git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* --git-dir= leads to "The empty string is not a valid path" only some times
@ 2022-07-07 15:56 Yaroslav Halchenko
  0 siblings, 0 replies; only message in thread
From: Yaroslav Halchenko @ 2022-07-07 15:56 UTC (permalink / raw)
  To: git@vger.kernel.org

Dear Git Gurus,

The original reported issue possibly with more details:
https://github.com/datalad/datalad/issues/6815

Background: in DataLad we specify empty value for --git-dir in

    git --git-dir= config -z -l --show-origin

call to ensure that we are not picking up any local repository
configurations if called while being under some repo.  It had been
working just fine for years until today user reported that such call
errors out with

	$> git --git-dir= config -z -l --show-origin > /dev/null
	fatal: The empty string is not a valid path

because of having 

	[includeIf "gitdir:**/devbgc/**"]
		path = ~/.gitconfig_bgc

in user's ~/.gitconfig (I have reproduced with git  2.35.1).

Note: specifying some non-empty path pointing to some non-existing path (e.g.
--git-dir=/non-existing) does not cause error.

- should not git behavior on --git-dir  be consistent regardless of the content
of ~/.gitconfig ?

- is use --git-dir= generally legit (seems not documented)?  If not -- why it
is not whenever pointing to non-existing directory is?

- what is a more "legit" way to achieve "do not load local repository
config if under a git repository path"?

Thank you in advance for the clarifications,
-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
WWW:   http://www.linkedin.com/in/yarik        


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-07 16:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-07 15:56 --git-dir= leads to "The empty string is not a valid path" only some times Yaroslav Halchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).