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

Re: git-commit: allow From: line to be entered in commit message

From
Junio C Hamano <junkio@cox.net>
Date
Jan 13, 2006, 04:35 UTC
Message-ID
<7vzmm0eod1.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<BAYC1-PASMTP067B249A8110916F036FB3AE260@CEZ.ICE>
sean <seanlkml@sympatico.ca> writes:
> I think you're over estimating the downsides of allowing this to be
> set the same was as it is in the git-am case and underestimating the
> number of people who would find it useful, but I personally don't 
> really care if you'd rather have it as a command line option.

You are obviously not talking about the use of "git commit" as a building block of some script (if you were, it would not make an iota of difference whether it is a command line option, an extra "echo From: $name" prepending that to the body of the message, or setting GIT_AUTHOR_* variables).

So you must be talking about some manual process, at the end of which the user invokes "git commit" from the command line.

But I would imagine that "git commit" is preceded by a bigger process of preparing the tree to the committable state out of what is stored in the foreign SCM, after the user figures out which commit to pick from (in the original example; the committable state may come from something other than SCM --- e.g. set of tarballs or patch application or random monkey typing). And the whole process of "preparing the tree" and "committing" would be done number of times (otherwise we would not be having this discussion --- just use GIT_AUTHOR_* which is already available), so having to set them as separate steps between 'preparing the tree' and 'committing using "git commit"' is cumbersome.

But you would write 'preparing the tree' (which may include "figuring out who the author is and what the log has to say" if the committable state is coming from a foreign SCM) script anyway, and I simply do not understand why inserting a couple of setting and exporting of GIT_AUTHOR_* variables at the very end of that script before calling "git commit" from it, to make it not just a 'preparing the tree' script but 'prepare the tree and commit' script is such a big deal for you.

If the committable state does not come from foreign SCM, then 'preparing tree' stage may only be able to prepare a committable tree, and log and authorship information might need to be typed/pasted by the user. But then your script would just do "read author" or "${VISUAL-vi} .msgfile" before eventually calling 'GIT_AUTHOR_NAME="$author" git commit -F .msgfile' from there, so I do not think it is such a big deal either.

I guess the disagreement is primarily coming from that you think "git commit" is always the uppermost UI layer, while I feel "git commit" is _one_ possible building block of bigger scripts, but the true building block is "git commit-tree".

Previous: seanNext: sean
Message 10 of 16 in “git-commit: allow From: line to be entered in commit message”
  1. seanJan 12, 2006
  2. seanJan 12, 2006
  3. Junio C HamanoJan 12, 2006
  4. Andreas EricssonJan 12, 2006
  5. Junio C HamanoJan 12, 2006
  6. seanJan 13, 2006
  7. seanJan 13, 2006
  8. Junio C HamanoJan 13, 2006
  9. seanJan 13, 2006
  10. Junio C HamanoJan 13, 2006
  11. seanJan 13, 2006
  12. Artem KhodushJan 13, 2006
  13. Junio C HamanoJan 13, 2006
  14. seanJan 13, 2006
  15. Junio C HamanoJan 13, 2006
  16. Johannes SchindelinJan 13, 2006

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.