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

Re: [PATCH v4 1/2] hooks: allow input from stdin for commit-related hooks

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2020, 18:13 UTC
Message-ID
<xmqqr1onuc9w.fsf@gitster.c.googlers.com>
In-Reply-To
<CAPig+cS5BUCaFN=MN+7gSTbvskffRdTJOgck6TrRRacxCc_CwA@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 10 quoted lines
> At the very least, this change deserves a documentation update, both
> to explain that the prepare-commit-msg hook has a valid stdin, and
> (importantly) that it won't be able to rely upon stdin in conjunction
> with `-F -`. (This also makes me wonder if it would be possible to
> signal to the hook whether or not stdin is available. Perhaps this
> could be done by passing an additional argument to the hook.)
>
> Finally, I realize that you followed Junio's suggestion for organizing
> the series, however, it feels undesirable for patch [1/2] to leave the
> command in a somewhat broken state, ...

True. The split you suggest sounds saner, if we were to still move forward with this change. I originally threw "commit -F -" in the "don't do it if it hurts" category, but I agree with you that it is quite plausible that IDE would want to use the feature to feed the log message to the command (that way they do not need to worry about a temporary file at all), so it can become a real issue.

Thanks.
Previous: Orgad ShanehNext: Ævar Arnfjörð Bjarmason
Message 16 of 22 in “hooks: allow input from stdin”
  1. hooks: allow input from stdinOrgad Shaneh via GitGitGadget, Nov 17, 2020
  2. Junio C HamanoNov 17, 2020
  3. hooks: allow input from stdinOrgad Shaneh via GitGitGadget, Nov 19, 2020
  4. hooks: allow input from stdin for commit-related hooksOrgad Shaneh via GitGitGadget, Nov 19, 2020
  5. Junio C HamanoNov 19, 2020
  6. Orgad ShanehNov 19, 2020
  7. 0/2 hooks: allow input from stdin for commit-related hooksOrgad Shaneh via GitGitGadget, Nov 19, 2020
  8. 2/2 commit: fix stdin conflict between message and hookOrgad Shaneh via GitGitGadget, Nov 19, 2020
  9. 1/2 hooks: allow input from stdin for commit-related hooksOrgad Shaneh via GitGitGadget, Nov 19, 2020
  10. Eric SunshineNov 19, 2020
  11. Junio C HamanoNov 19, 2020
  12. Orgad ShanehNov 20, 2020
  13. Eric SunshineNov 20, 2020
  14. Eric SunshineNov 20, 2020
  15. Orgad ShanehNov 20, 2020
  16. Junio C HamanoNov 20, 2020
  17. Ævar Arnfjörð BjarmasonNov 20, 2020
  18. Orgad ShanehNov 20, 2020
  19. 0/2 hooks: allow input from stdin for commit-related hooksOrgad Shaneh via GitGitGadget, Dec 9, 2020
  20. 1/2 hooks: lay foundations for passing stdin to hooksOrgad Shaneh via GitGitGadget, Dec 9, 2020
  21. 2/2 hooks: allow input from stdin for commit-related hooksOrgad Shaneh via GitGitGadget, Dec 9, 2020
  22. Junio C HamanoDec 9, 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.