From: "Shawn O. Pearce" <spearce@spearce.org>
To: Andy Parkins <andyparkins@gmail.com>
Cc: git@vger.kernel.org, Francis Moreau <francis.moro@gmail.com>
Subject: Re: [PATCH] update-hook: remove all functionality that should be in hooks/post-receive
Date: Sun, 25 Mar 2007 05:25:31 -0400 [thread overview]
Message-ID: <20070325092530.GI25863@spearce.org> (raw)
In-Reply-To: <200703251011.53712.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> wrote:
> On Saturday 2007, March 24, Francis Moreau wrote:
>
> > yes that almost would do the thing. But instead of hacking the hook,
> > it would be great to have a trivial setup at the begining of the
> > script to choose this config.
>
> I'd like Junio's permission before actually doing that; I know he is
> worried about out-of-control growth of hook scripts and it's already
> overly large just to do the one job it's got.
One thought I had today:
The old hooks (update, post-update) were easy to chain if you wanted
to run more than one "standard" hook in a repository. Just pass
"$@" to each hook excutable, using a small shell-script wrapper
that is installed as the actual hook.
The new hooks (pre-receive, post-receive) are not so easy to chain,
as their input comes by way of stdin. You'd have to copy the
data off to a temporary file, and redirect that into each hook in
turn. Annoying.
So I'm kicking around the idea of teaching receive-pack to run
hooks in filename order if the hook is actually a subdirectory.
Then you can do:
mkdir .git/hooks/post-receive
ln -s \
~/git/contrib/email/post-receive-head \
.git/hooks/post-receive/01-head
ln -s \
~/git/contrib/email/post-receive-tag \
.git/hooks/post-receive/02-tag
ln -s \
~/git/contrib/continuous/post-receive-cinotify \
.git/hooks/post-receive/10-cinotify
Where this applies to Andy's message that I quoted is the email
hooks could be split up to handle different types of refs in each
hook, e.g. one for heads and one for tags, and just skip refs that
don't apply to that particular hook.
--
Shawn.
next prev parent reply other threads:[~2007-03-25 9:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 10:21 [PATCH] update-hook: remove all functionality that should be in hooks/post-receive Andy Parkins
2007-03-24 1:09 ` Junio C Hamano
2007-03-24 3:23 ` Linus Torvalds
2007-03-24 3:28 ` Shawn O. Pearce
2007-03-24 8:14 ` Andy Parkins
2007-03-24 10:26 ` Theodore Tso
2007-03-24 10:41 ` Junio C Hamano
2007-03-24 12:44 ` Andy Parkins
2007-03-24 14:21 ` Theodore Tso
2007-03-24 14:43 ` Francis Moreau
2007-03-24 15:48 ` Andy Parkins
2007-03-24 18:15 ` Francis Moreau
2007-03-25 9:11 ` Andy Parkins
2007-03-25 9:25 ` Shawn O. Pearce [this message]
2007-03-25 14:04 ` Francis Moreau
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=20070325092530.GI25863@spearce.org \
--to=spearce@spearce.org \
--cc=andyparkins@gmail.com \
--cc=francis.moro@gmail.com \
--cc=git@vger.kernel.org \
/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).