From: "Shawn O. Pearce" <spearce@spearce.org>
To: Bill Lear <rael@zopyra.com>
Cc: git@vger.kernel.org
Subject: Re: Git push failure with update hook success
Date: Wed, 7 Mar 2007 12:09:04 -0500 [thread overview]
Message-ID: <20070307170904.GB27922@spearce.org> (raw)
In-Reply-To: <17902.60536.5890.608883@lisa.zopyra.com>
Bill Lear <rael@zopyra.com> wrote:
> On Wednesday, March 7, 2007 at 10:29:29 (-0600) Bill Lear writes:
> >...
> >whether it might be better to call the update hook after everything
> >had actually been written, including the log file.
>
> I dug into the code: in receive-pack.c, the command 'update(struct
> command *cmd)', calls write_ref_sha1() after run_update_hook()
> and does not check the return code of write_ref_sha1().
Please see the patch I just posted (and CC'd you on). We should
have caught the return error of write_ref_sha1, the patch now
does that. :)
You probably want to use the post-update hook to send email.
This hook will always run if it exists and is executable, but it
won't be given a ref that failed to be updated.
Of course an unfortunate downside to the post-update hook is it
does not receive the old SHA-1 of the ref; it just gets the ref name.
--
Shawn.
next prev parent reply other threads:[~2007-03-07 17:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-07 16:29 Git push failure with update hook success Bill Lear
2007-03-07 16:46 ` Bill Lear
2007-03-07 17:09 ` Shawn O. Pearce [this message]
2007-03-07 17:25 ` Bill Lear
2007-03-07 17:38 ` Shawn O. Pearce
2007-03-07 23:09 ` Shawn O. Pearce
2007-03-07 23:15 ` Bill Lear
2007-03-08 9:22 ` Andy Parkins
2007-03-08 9:28 ` Shawn O. Pearce
2007-03-08 9:54 ` Junio C Hamano
2007-03-08 10:04 ` Andy Parkins
2007-03-08 10:06 ` Shawn O. Pearce
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=20070307170904.GB27922@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=rael@zopyra.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).