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

Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 11, 2008, 23:36 UTC
Message-ID
<7v3at42avd.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<9b3e2dc20801111210n7bd7a71cw437819aa6253ae85@mail.gmail.com>
"Stephen Sinclair" <radarsat1@gmail.com> writes:
Show 16 quoted lines
> @@ -423,8 +423,18 @@ static int prepare_log_message(const char
> *index_file, const char *prefix)
>  			"#\n",
>  			git_path("MERGE_HEAD"));
>
> +    fprintf(fp, "\n");
> +
> +    fprintf(fp,
> +            "# Committer: %s\n"
> +            "# Author:    %s\n"
> +            "#\n",
> +            fmt_name(getenv("GIT_AUTHOR_NAME"),
> +                     getenv("GIT_AUTHOR_EMAIL")),
> +            fmt_name(getenv("GIT_COMMITTER_NAME"),
> +                     getenv("GIT_COMMITTER_EMAIL")));
> +

I'd almost agree with this patch if if added AUTHOR but not COMMITTER, and only when AUTHOR is different from me. That would help reassure anybody while amending other's changes. COMMITTER is always me and I should not reminded with extra lines that waste precious screen real estate.

And no, I did not check if your change correctly supports the use case of amending other's changes. But if I recall the code correctly, I suspect that your change doesn't. The recorded author is determined after the log message is prepared, way later.

I strongly agree with Dscho that this change needs to be defended with a good description on the reason why this is good. If the reason is "newbie protection", I do not think this is a good change at all. Newbie protection is never a good reason to make people who graduated that state to pay extra price unconditionally.

Previous: Johannes SchindelinNext: Stephen Sinclair
Message 3 of 17 in “Add committer and author names to top of COMMIT_EDITMSG.”
  1. Add committer and author names to top of COMMIT_EDITMSG.Stephen Sinclair, Jan 11, 2008
  2. Johannes SchindelinJan 11, 2008
  3. Junio C HamanoJan 11, 2008
  4. Stephen SinclairJan 12, 2008
  5. Junio C HamanoJan 12, 2008
  6. Stephen SinclairJan 12, 2008
  7. Junio C HamanoJan 12, 2008
  8. Stephen SinclairJan 12, 2008
  9. Junio C HamanoJan 12, 2008
  10. Stephen SinclairJan 12, 2008
  11. Junio C HamanoJan 12, 2008
  12. Jeff KingJan 12, 2008
  13. Junio C HamanoJan 12, 2008
  14. Junio C HamanoJan 12, 2008
  15. Jeff KingJan 12, 2008
  16. Junio C HamanoJan 12, 2008
  17. Jeff KingJan 12, 2008

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.