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

Re: log and diff family: honor config even from subdirectories

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 29, 2006, 01:17 UTC
Message-ID
<Pine.LNX.4.64.0607281811580.4168@g5.osdl.org>
Junio,
 I think your patch is fine as a band-aid, but I wonder if we shouldn't 
just move the "setup_git_directory()" call out of init_revisions(), and 
pass it as an argument to init_revision(). Some of the callers have 
already done setup_git_directory() earlier for their own reasons anyway.

And from a quick look it looks like you missed the same bug happening in cmd_format_patch(), which calls git_config(git_format_config) before having done the setup.

I'd actually _like_ to do the setup unconditionally inside the git wrapper (early - to make sure that we don't have this bug), but some things (at least "init-db", "clone" and "ls-remote") are obviously not supposed to do it, since they work outside of a git directory. So either we need to do it in each builtin command separately, or we'd need to add a flag in the command descriptor array.

Any clever ideas?
		Linus
Next: Junio C Hamano
Message 1 of 8 in “Re: log and diff family: honor config even from subdirectories”
  1. Linus TorvaldsJul 29, 2006
  2. Junio C HamanoJul 29, 2006
  3. Call setup_git_directory() earlyLinus Torvalds, Jul 29, 2006
  4. An alternative: call setup_git_directory() earlyJunio C Hamano, Jul 29, 2006
  5. Junio C HamanoJul 29, 2006
  6. Linus TorvaldsJul 29, 2006
  7. Junio C HamanoJul 29, 2006
  8. Linus TorvaldsJul 29, 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.