Re: git config not following include paths by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 18, 2020 at 01:40:11PM -0700, Paul S. Strauss wrote:

> The problem is related to my having GIT_CONFIG set to a file other than
> ~/.gitconfig - when I unset GIT_CONFIG and copied my config file to
> ~/.gitconfig, the include worked as expected.

That's working as designed. From git-config(1):

   --[no-]includes
       Respect include.* directives in config files when looking up
       values. Defaults to off when a specific file is given (e.g.,
       using --file, --global, etc) and on when searching all config
       files.

The reasons for that are historical. Includes were added much later, and
you would probably not want "git config --file=.gitmodules" against an
untrusted input to be able to include from anywhere on your filesystem.

$GIT_CONFIG works the same way (as it's equivalent to using --file).  We
generally discourage the use of the environment variable (and its
existence is yet another historical compatibility thing). If you tell us
more about what you're trying to accomplish with it, we might be able to
suggest a better solution.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux