git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: run_hook: why special check for uncaught signal?

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jul 1, 2009, 09:57 UTC
Message-ID
<20090701095751.GE10895@genesis.frugalware.org>
In-Reply-To
<200906302231.45157.j6t@kdbg.org>
On Tue, Jun 30, 2009 at 10:31:45PM +0200, Johannes Sixt <j6t@kdbg.org> wrote:
Show 13 quoted lines
> 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.
Previous: Johannes Sixt
Message 2 of 2 in “run_hook: why special check for uncaught signal?”
  1. Johannes SixtJun 30, 2009
  2. Miklos VajnaJul 1, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.