From: Jan Hudec <bulb@ucw.cz>
To: Ping Yin <pkufranky@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: How to bypass the post-commit hook?
Date: Mon, 31 Dec 2007 10:31:52 +0100 [thread overview]
Message-ID: <20071231093152.GC20098@efreet.light.src> (raw)
In-Reply-To: <46dff0320712302108i61f3b868obb93f89c1c24062c@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]
On Mon, Dec 31, 2007 at 13:08:05 +0800, Ping Yin wrote:
> On Dec 31, 2007 5:50 AM, Jan Hudec <bulb@ucw.cz> wrote:
> >
> > On Sun, Dec 30, 2007 at 23:12:12 +0800, Ping Yin wrote:
> > > --no-verify can bypass pre-commit hook? Then how to bypass post-commit hook?
> > >
> > > Usually I want post-commit take effect. However, in the middle of
> > > git-rebase, i want to bypass post-commit when 'git-commit --amend'
> > > since my post-commit hooks will modify the working directory and so
> > > make following rebase troubesome.
> >
> > There does not seem to be an option to do it, but you can always temporarily
> > disable it (unset the executable permission on it).
> >
> > By the way, what is your post-commit hook doing anyway? Modifying the work
> > tree *after* a commit does not sound like a common thing to do.
> >
> I have already considered disabling hook temporarily, but it is a
> little annoying.
Well, I guess noone thought it would be useful to disable it.
> I use post-commit because i don't find a better way to update imported
> css version automatically
>
> $ cat foo.css
> @import url(bar.css?57e708)
> ...
>
> When i modify bar.css and then commit it ( with blob sha1 bf7059),I
> use post-commit to modify foo.css
> $ cat foo.css
> @import url(bar.css?bf7059)
> ...
But that file is not versioned, is it?
Because if it is, you want to commit it in the very same commit as bar.css
and therefore want to do it in the *pre*-commit hook. Since obviously the
foo.css wants to include the current version of bar.css, not the previous
one.
Note, that while you don't know the commit sha1 before the commit, you do
know the *blob* sha1s. So you can do this change in pre-commit hook.
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-12-31 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-30 15:12 How to bypass the post-commit hook? Ping Yin
2007-12-30 21:50 ` Jan Hudec
[not found] ` <46dff0320712302108i61f3b868obb93f89c1c24062c@mail.gmail.com>
2007-12-31 9:31 ` Jan Hudec [this message]
[not found] ` <46dff0320712310222m64d86e95l1499a7ffb1fff65c@mail.gmail.com>
2007-12-31 10:55 ` Jan Hudec
2007-12-31 13:26 ` Ping Yin
2007-12-31 17:05 ` Jan Hudec
2007-12-31 17:53 ` Ping Yin
2007-12-31 9:50 ` Pascal Obry
2008-01-14 17:59 ` Jan Hudec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071231093152.GC20098@efreet.light.src \
--to=bulb@ucw.cz \
--cc=git@vger.kernel.org \
--cc=pkufranky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).