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

Re: [PATCH 2/2] Wait for child on signal death for aliases to externals

From
Jeff King <peff@peff.net>
Date
Jul 7, 2020, 22:06 UTC
Message-ID
<20200707220626.GC2300296@coredump.intra.peff.net>
In-Reply-To
<20200707101959.qsuumtuelepnxore@aaberge.net>
On Tue, Jul 07, 2020 at 12:19:59PM +0200, Trygve Aaberge wrote:
Show 21 quoted lines
> On Mon, Jul 06, 2020 at 17:14:03 -0400, Jeff King wrote:
> >     I guess to recreate that you'd need to trigger the pager inside the
> >     alias itself, like:
> > 
> >       $ git -c alias.foo='!{ echo foo; sleep 10; echo bar; } | less' foo
> >       ^C
> > 
> >     which does exhibit the annoying behavior (we exit, and pgrp loses
> >     the tty session leader bit, and the pager gets EIO).
> 
> Yes, that's correct. So it's a rather niche use case. The main thing for me
> was the first commit, but I figured I should fix this too while I was at it. I
> don't think I have any current use cases where I would need this fix, but I
> could imagine some existing. For instance, before stash list got the -p
> option, I had this alias:
> 
>   stash-p = !git show $(git stash list | cut -d: -f1)
> 
> And this is one use case where the pager is invoked inside the alias, so the
> first patch doesn't help, but the second one fixes it. While this alias isn't
> necessary anymore, there could be similar use cases.

Thanks for this real-world example. I agree that particular one isn't necessary anymore, but to me it provides a compelling argument. It's not all that far-fetched that somebody runs a git command that triggers a pager inside a shell alias.

-Peff
Previous: Trygve AabergeNext: Johannes Schindelin
Message 6 of 13 in “Wait for child on signal death for aliases to builtins”
  1. 1/2 Wait for child on signal death for aliases to builtinstrygveaa@gmail.com, Jul 4, 2020
  2. 2/2 Wait for child on signal death for aliases to externalstrygveaa@gmail.com, Jul 4, 2020
  3. Jeff KingJul 6, 2020
  4. Junio C HamanoJul 7, 2020
  5. Trygve AabergeJul 7, 2020
  6. Jeff KingJul 7, 2020
  7. Johannes SchindelinJul 5, 2020
  8. Junio C HamanoJul 7, 2020
  9. Jeff KingJul 6, 2020
  10. Junio C HamanoJul 7, 2020
  11. Trygve AabergeJul 7, 2020
  12. 1/2 Wait for child on signal death for aliases to builtinstrygveaa@gmail.com, Jul 7, 2020
  13. 2/2 Wait for child on signal death for aliases to externalstrygveaa@gmail.com, Jul 7, 2020

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.