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

Re: [PATCH] config doc: remove confusion about relative GIT_DIR from FILES section

From
Jeff King <peff@peff.net>
Date
May 25, 2012, 20:06 UTC
Message-ID
<20120525200631.GA4364@sigill.intra.peff.net>
In-Reply-To
<20120525181204.GA4491@burratino>
On Fri, May 25, 2012 at 01:12:04PM -0500, Jonathan Nieder wrote:
Show 24 quoted lines
> From the FILES section of the git-config(1) manual:
> 
> 	$GIT_DIR/config::
> 		Repository specific configuration file. (The filename is
> 		of course relative to the repository root, not the working
> 		directory.)
> 
> That's confusing because $GIT_DIR really is relative to the working
> directory.
> 
> 	$ GIT_DIR=.git GIT_EDITOR='pwd; echo editing'
> 	$ export GIT_DIR GIT_EDITOR
> 	$ git config --edit --local
> 	/home/jrn/src/git/Documentation
> 	editing .git/config
> 
> It turns out that the comment is a remnant from older days when the
> heading said ".git/config" (which is indeed relative to the top of the
> worktree).
> 
> It was only when the heading was changed to refer more precisely to
> <git dir>/config (see v1.5.3.2~18, AsciiDoc tweak to avoid leading
> dot, 2007-09-14) that the parenthesis stopped making sense.  Remove
> it.
Thanks for digging in the history for the answer.
Show 15 quoted lines
> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
> index 3f5d216a..d9463cb3 100644
> --- a/Documentation/git-config.txt
> +++ b/Documentation/git-config.txt
> @@ -198,9 +198,7 @@ If not set explicitly with '--file', there are three files where
>  'git config' will search for configuration options:
>  
>  $GIT_DIR/config::
> -	Repository specific configuration file. (The filename is
> -	of course relative to the repository root, not the working
> -	directory.)
> +	Repository specific configuration file.
>  
>  ~/.gitconfig::
>  	User-specific configuration file. Also called "global"
This makes a lot more sense to me.
Acked-by: Jeff King <peff@peff.net>
-Peff
Previous: Jonathan NiederNext: Junio C Hamano
Message 9 of 26 in “[RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig”
  1. nguyenhu@minatec.inpg.frMay 25, 2012
  2. Jonathan NiederMay 25, 2012
  3. Matthieu MoyMay 25, 2012
  4. Jonathan NiederMay 25, 2012
  5. Hilco WijbengaMay 25, 2012
  6. Jonathan NiederMay 25, 2012
  7. Hilco WijbengaMay 25, 2012
  8. config doc: remove confusion about relative GIT_DIR from FILES sectionJonathan Nieder, May 25, 2012
  9. Jeff KingMay 25, 2012
  10. Junio C HamanoMay 25, 2012
  11. Matthieu MoyMay 25, 2012
  12. Jeff KingMay 25, 2012
  13. Junio C HamanoMay 25, 2012
  14. Jonathan NiederMay 25, 2012
  15. Junio C HamanoMay 25, 2012
  16. Jonathan NiederMay 25, 2012
  17. Junio C HamanoMay 25, 2012
  18. Matthieu MoyMay 25, 2012
  19. Jonathan NiederMay 25, 2012
  20. Matthieu MoyMay 25, 2012
  21. Jonathan NiederMay 25, 2012
  22. Jonathan NiederMay 25, 2012
  23. Matthieu MoyMay 25, 2012
  24. Matthieu MoyMay 25, 2012
  25. Felipe ContrerasMay 26, 2012
  26. Heiko VoigtMay 26, 2012

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.