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

Re: Why is ident_is_sufficient different on Windows?

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2013, 20:41 UTC
Message-ID
<7vmwvhb2fm.fsf@alter.siamese.dyndns.org>
In-Reply-To
<991CBC1C-912C-4DD6-B911-93F6B41D895E@quendi.de>
Max Horn <max@quendi.de> writes:
Show 25 quoted lines
> static int ident_is_sufficient(int user_ident_explicitly_given)
> {
> #ifndef WINDOWS
> 	return (user_ident_explicitly_given & IDENT_MAIL_GIVEN);
> #else
> 	return (user_ident_explicitly_given == IDENT_ALL_GIVEN);
> #endif
> }
>
>
> According to git blame, this was introduced here:
>
> commit 5aeb3a3a838b2cb03d250f3376cf9c41f4d4608e
> Author: Junio C Hamano <gitster@pobox.com>
> Date:   Sun Jan 17 13:54:28 2010 -0800
>
>     user_ident_sufficiently_given(): refactor the logic to be usable from elsewhere
>
>
> The commit message sounds as if this was only a refactoring, but
> the patch to me look as if it changes behaviour, too. Of course
> this could very well be false, say due to code elsewhere that
> already caused Windows to behave differently; I wouldn't know.
>
> Still, I wonder: Why does this difference exist?

Sorry but I do not recall why these ifdefs are there. The commit did this to builtin-commit.c:

-               if (user_ident_explicitly_given != IDENT_ALL_GIVEN)
+               if (!user_ident_sufficiently_given())

I would have written the function to always check with ALL_GIVEN myself, and it is very likely that I was *not* the person who noticed that the function needs to behave differently on Windows, as I do not do Windows.

I suspect somebody from the Windows camp saw a patch I posted without the ifdef, noticed that there is a problem to expect IDENT_NAME_GIVEN to be set on Windows for some reason, and resulted in a reroll of the function in that shape.

I didn't find anything in the list archive, though. So I am stumped.

Previous: Max HornNext: Junio C Hamano
Message 2 of 4 in “Why is ident_is_sufficient different on Windows?”
  1. Max HornFeb 6, 2013
  2. Junio C HamanoFeb 6, 2013
  3. Junio C HamanoFeb 6, 2013
  4. Junio C HamanoFeb 6, 2013

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.