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

[PATCH 0/3] git-clone fails when current user is not in /etc/passwd

From
Jeff King <peff@peff.net>
Date
Dec 10, 2015, 21:32 UTC
Message-ID
<20151210213228.GB29055@sigill.intra.peff.net>
In-Reply-To
<20151210204034.GA29055@sigill.intra.peff.net>
On Thu, Dec 10, 2015 at 03:40:35PM -0500, Jeff King wrote:
Show 9 quoted lines
> > All true.  The adding of "(none)" in add_domainname() I used as an
> > excuse to make the function stop barfing is a symptom coming from
> > the above.  That one should die when asked to do a strict thing
> > (there is a corresponding kludge to do strstr "(none)" to cover it
> > up, which is even uglier X-<).
> 
> Yes, I have always hated that. It seems like we should just be able to
> carry a "strict" flag (both from xgetpwuid() and from the "(none)" hack)
> along with ident_default_*, and barf at the right time if it is not set.

I don't think we want to pass down a "be strict" flag to the low-level code filling in default_{name,email}. We might be strict in one call, and non-strict in another within the same program. Worse, we actually call ident_default_name() even when we don't actually want the name (we could fix that, too, but it just adds more cases to the code).

So here's my solution, which instead carries the "is it bogus" flag along with the default strings.

  [1/3]: ident: make xgetpwuid_self() a static local helper
  [2/3]: ident: keep a flag for bogus default_email
  [3/3]: ident: loosen getpwuid error in non-strict mode
-Peff
Previous: Jeff KingNext: Jeff King
Message 10 of 20 in “git-clone fails when current user is not in /etc/passwd”
  1. Taylor Braun-JonesDec 2, 2015
  2. Taylor Braun-JonesDec 9, 2015
  3. Duy NguyenDec 9, 2015
  4. Duy NguyenDec 9, 2015
  5. Taylor Braun-JonesDec 9, 2015
  6. Taylor Braun-JonesDec 10, 2015
  7. Jeff KingDec 10, 2015
  8. Junio C HamanoDec 10, 2015
  9. Jeff KingDec 10, 2015
  10. 0/3 git-clone fails when current user is not in /etc/passwdJeff King, Dec 10, 2015
  11. 1/3 ident: make xgetpwuid_self() a static local helperJeff King, Dec 10, 2015
  12. Junio C HamanoDec 10, 2015
  13. 2/3 ident: keep a flag for bogus default_emailJeff King, Dec 10, 2015
  14. Jeff KingDec 10, 2015
  15. 3/3 ident: loosen getpwuid error in non-strict modeJeff King, Dec 10, 2015
  16. Jeff KingDec 14, 2015
  17. Junio C HamanoDec 10, 2015
  18. Taylor Braun-JonesDec 11, 2015
  19. Junio C HamanoDec 10, 2015
  20. Taylor Braun-JonesDec 10, 2015

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.