From: Miklos Vajna <vmiklos@frugalware.org>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git@vger.kernel.org
Subject: Re: run_hook: why special check for uncaught signal?
Date: Wed, 1 Jul 2009 11:57:51 +0200 [thread overview]
Message-ID: <20090701095751.GE10895@genesis.frugalware.org> (raw)
In-Reply-To: <200906302231.45157.j6t@kdbg.org>
[-- Attachment #1: Type: text/plain, Size: 1307 bytes --]
On Tue, Jun 30, 2009 at 10:31:45PM +0200, Johannes Sixt <j6t@kdbg.org> wrote:
> Function run_hook (in run-command.c) has this check:
>
> ret = finish_command(&hook);
> if (ret == -ERR_RUN_COMMAND_WAITPID_SIGNAL)
> warning("%s exited due to uncaught signal", argv[0]);
> return ret;
>
> The lines were moved to this location by ae98a008 (Move run_hook() from
> builtin-commit.c into run-command.c (libgit), 2009-01-16). Before this
> commit, the check existed in builtin-gc.c. It was introduced by bde30540
> (git-gc --auto: add pre-auto-gc hook, 2008-04-09).
>
> Why is this check necessary?
I do not really remember, but I think I wanted to give some error
messages for each return code, and somehow left out
ERR_RUN_COMMAND_WAITPID, ERR_RUN_COMMAND_WAITPID_WRONG_PID and
ERR_RUN_COMMAND_WAITPID_NOEXIT.
> I'm asking because I'm working on a modification that would remove
> ERR_RUN_COMMAND_WAITPID_SIGNAL.
That's fine, I think ideally run_hook() should call warning() for each
case which may be returned. Such functionality is already available in
builtin-receive-pack.c::hook_status() and unpack(), probably it would
make sense to introduce some run_command_strerror() to avoid code
duplication.
Sadly I don't have time to implement this in the near future.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
prev parent reply other threads:[~2009-07-01 9:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 20:31 run_hook: why special check for uncaught signal? Johannes Sixt
2009-07-01 9:57 ` Miklos Vajna [this message]
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=20090701095751.GE10895@genesis.frugalware.org \
--to=vmiklos@frugalware.org \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.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).