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

Re: [PATCH v2 0/3] nd/clear-gitenv-upon-use-of-alias

From
Duy Nguyen <pclouds@gmail.com>
Date
Dec 24, 2015, 09:35 UTC
Message-ID
<CACsJy8Aqu9wTigWKC1-74qLUimV8PvmbDG1XeqYcbW0ZSMLSTg@mail.gmail.com>
In-Reply-To
<20151223213140.GB21277@sigill.intra.peff.net>
On Thu, Dec 24, 2015 at 4:31 AM, Jeff King <peff@peff.net> wrote:
>   2. I doubt anybody is actually seeing this in practice anymore. But
>      maybe I am misunderstanding something in Duy's series that changes
>      this.

There are two parts in your patch, one (that you two seemed to focus on) about return code with "!" aliases. Another, suppressing SIGPIPE, affects more than "!" aliases. In my case it's execv_dashed_external(). Non-"!" aliases are now forced to use that function.

This is the output with 'pu'. Notice git-log is executed separately
> ~/w/git $ GIT_TRACE=2 PAGER=true ./git --exec-path=. l

16:28:19.167040 git.c:567 trace: exec: 'git-l' 16:28:19.167088 run-command.c:345 trace: run_command: 'git-l' 16:28:19.168599 git.c:286 trace: alias expansion: l => 'log' '--stat' 16:28:19.168633 git.c:567 trace: exec: 'git-log' '--stat' 16:28:19.168649 run-command.c:345 trace: run_command: 'git-log' '--stat' 16:28:19.170420 git.c:350 trace: built-in: git 'log' '--stat' 16:28:19.210074 run-command.c:345 trace: run_command: 'true' 16:28:19.210382 run-command.c:204 trace: exec: 'true' error: git-log died of signal 13

With your patch on top, "git-log died of.." goes away. And this is with 'master', where the builtin version of git-log is used

> ~/w/git $ GIT_TRACE=2 PAGER=true ./git --exec-path=. l

16:29:17.546382 git.c:561 trace: exec: 'git-l' 16:29:17.546428 run-command.c:343 trace: run_command: 'git-l' 16:29:17.547485 git.c:282 trace: alias expansion: l => 'log' '--stat' 16:29:17.548482 git.c:348 trace: built-in: git 'log' '--stat' 16:29:17.586457 run-command.c:343 trace: run_command: 'true' 16:29:17.586770 run-command.c:202 trace: exec: 'true'

So, in practice, people will see "died of signal 13" a lot more often if my series is merged and released (I assume that people often use aliases for paged commands like git-log, git-diff...)

-- 
Duy
Previous: Jeff KingNext: Jeff King
Message 32 of 39 in “Fwd: Git clone fails during pre-commit hook due to GIT_WORK_TREE=. (regression 2.5 -> 2.6)”
  1. Anthony SottileNov 24, 2015
  2. Stefan BellerNov 24, 2015
  3. Duy NguyenNov 25, 2015
  4. Duy NguyenNov 30, 2015
  5. Junio C HamanoNov 30, 2015
  6. Duy NguyenDec 1, 2015
  7. Junio C HamanoDec 2, 2015
  8. 1/2 git.c: make it clear save_env() is for alias handling onlyNguyễn Thái Ngọc Duy, Dec 3, 2015
  9. 2/2 setup.c: re-fix d95138e (setup: set env $GIT_WORK_TREE when ..Nguyễn Thái Ngọc Duy, Dec 3, 2015
  10. Junio C HamanoDec 4, 2015
  11. Duy NguyenDec 5, 2015
  12. 3/2 git.c: make sure we do not leak GIT_* to alias scriptsNguyễn Thái Ngọc Duy, Dec 5, 2015
  13. Junio C HamanoDec 7, 2015
  14. Duy NguyenDec 8, 2015
  15. Jeff KingDec 8, 2015
  16. Junio C HamanoDec 8, 2015
  17. Duy NguyenDec 5, 2015
  18. Junio C HamanoDec 7, 2015
  19. 0/3 nd/clear-gitenv-upon-use-of-aliasNguyễn Thái Ngọc Duy, Dec 20, 2015
  20. 1/3 git.c: make it clear save_env() is for alias handling onlyNguyễn Thái Ngọc Duy, Dec 20, 2015
  21. 2/3 setup.c: re-fix d95138e (setup: set env $GIT_WORK_TREE when ..Nguyễn Thái Ngọc Duy, Dec 20, 2015
  22. 3/3 git.c: make sure we do not leak GIT_* to alias scriptsNguyễn Thái Ngọc Duy, Dec 20, 2015
  23. Junio C HamanoDec 21, 2015
  24. Duy NguyenDec 22, 2015
  25. Duy NguyenDec 22, 2015
  26. Junio C HamanoDec 22, 2015
  27. Jeff KingDec 23, 2015
  28. Duy NguyenDec 23, 2015
  29. Eric SunshineDec 23, 2015
  30. Johannes SixtDec 23, 2015
  31. Jeff KingDec 23, 2015
  32. Duy NguyenDec 24, 2015
  33. Jeff KingDec 29, 2015
  34. Junio C HamanoDec 29, 2015
  35. Revert "setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR"Nguyễn Thái Ngọc Duy, Dec 21, 2015
  36. Junio C HamanoDec 21, 2015
  37. Junio C HamanoDec 21, 2015
  38. Duy NguyenDec 22, 2015
  39. Junio C HamanoDec 22, 2015

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.