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

Re: RFC: [PATCH] ignore SIGINT&QUIT while waiting for external command

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Oct 19, 2010, 16:31 UTC
Message-ID
<20101019163124.GB8065@dpotapov.dyndns.org>
In-Reply-To
<20101019133236.GA804@sigill.intra.peff.net>
On Tue, Oct 19, 2010 at 09:32:36AM -0400, Jeff King wrote:
Show 6 quoted lines
> 
>   2. Why do we want to do it only for the proxy-command case? If I have
>      a long-running external diff or merge helper, for example, what
>      should happen on SIGINT? Should we exit with the child still
>      potentially running, or should we actually be reaping the child
>      properly?

Probably, it should be done in other cases too. However, I am not sure if it should be done unconditionally. For instance, when we run a pager, I don't think we should ignore the signals just because we started a pager.

I agree that silent_exec_failure is not the best flag for that -- I was just trying to make minimal changes to the existing behavior, and if this flag is set, you seem always want to ignore these signals, but there are some other cases too as you pointed above.

Now, I think we should always ignore these signals when run_command() is used (similar to system()), but do not mask signals if start_command() is used (or make it optional by adding a new flag).

Show 7 quoted lines
> 
> we will overwrite the function pushed in the sigchain_push with a stale
> handler. I think you could just replace your signal() calls with:
> 
>   sigchain_push(SIGINT, SIG_IGN);
>   ...
>   sigchain_pop(SIGINT);
Yes, it is certainly better. I was not aware about these functions.
Dmitry
Previous: Jonathan Nieder
Message 10 of 10 in “git subcommand sigint gotcha”
  1. Joey HessOct 19, 2010
  2. Dmitry PotapovOct 19, 2010
  3. RFC: [PATCH] ignore SIGINT&QUIT while waiting for external commandDmitry Potapov, Oct 19, 2010
  4. Jeff KingOct 19, 2010
  5. Jeff KingOct 19, 2010
  6. Jonathan NiederOct 19, 2010
  7. Jeff KingOct 19, 2010
  8. Jakub NarebskiOct 19, 2010
  9. Jonathan NiederOct 19, 2010
  10. Dmitry PotapovOct 19, 2010

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.