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

Re: [PATCH] commit: match explicit-ident semantics for summary and template

From
Jeff King <peff@peff.net>
Date
Jan 17, 2010, 21:00 UTC
Message-ID
<20100117210038.GA3935@coredump.intra.peff.net>
In-Reply-To
<201001172153.44413.j6t@kdbg.org>
On Sun, Jan 17, 2010 at 09:53:44PM +0100, Johannes Sixt wrote:
Show 11 quoted lines
> On Sonntag, 17. Januar 2010, Jeff King wrote:
> > -	if (!user_ident_explicitly_given) {
> > +	if (user_ident_explicitly_given != IDENT_ALL_GIVEN) {
> >  		strbuf_addstr(&format, "\n Committer: ");
> 
> Sorry for chiming in so late, but this new condition worries me a bit. On all 
> of my machines I have the GECOS field filled in with "Johannes Sixt", i.e., I 
> do not need user.name. But of course the automatically derived email address 
> is nonsense, so I've set up only user.email. Now I would always this hint, 
> wouldn't I? Do most others fill in GECOS in ways that are inappropriate for 
> git?

Yes, you are correctly analyzing the situation. I don't personally have a preference (even though my GECOS field is correct, it always seemed sensible to me to just explicitly set user.name along with user.email. But presumably a user who has set one is clueful enough to know whether they need to set the other one, too).

I do, however, think the summary behavior should match the behavior for the commit message template, which was actually changed in 91c38a21. Either this patch should be applied, or the other behavior should be tweaked as below:

diff --git a/builtin-commit.c b/builtin-commit.c
index d4eef6d..ec1415e 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -656,7 +656,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 				author_ident);
 		free(author_ident);
 
-		if (user_ident_explicitly_given != IDENT_ALL_GIVEN)
+		if (!user_ident_explicitly_given)
 			fprintf(fp,
 				"%s"
 				"# Committer: %s\n",
Previous: Johannes SixtNext: Junio C Hamano
Message 3 of 6 in “commit: match explicit-ident semantics for summary and template”
  1. commit: match explicit-ident semantics for summary and templateJeff King, Jan 17, 2010
  2. Johannes SixtJan 17, 2010
  3. Jeff KingJan 17, 2010
  4. Junio C HamanoJan 17, 2010
  5. Jeff KingJan 18, 2010
  6. Junio C HamanoJan 18, 2010

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.