{"thread":{"id":"58119","subject":"--git-dir= leads to \"The empty string is not a valid path\" only some times","startedAt":"2022-07-07T16:34:53Z","lastAt":"2022-07-07T16:34:53Z","messageCount":1,"participants":["Yaroslav Halchenko"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"458575","messageId":"YscCKuoDPBbs4iPX@lena.dartmouth.edu","threadId":"58119","inReplyTo":null,"subject":"--git-dir= leads to \"The empty string is not a valid path\" only some times","fromName":"Yaroslav Halchenko","fromEmail":"yoh@onerussian.com","sentAt":"2022-07-07T15:56:26Z","receivedAt":"2022-07-07T16:34:53Z","isPatch":false,"sender":{"key":"yoh@onerussian.com","avatar":"https://gravatar.com/avatar/8901b82415ae451a83aea49409708912726e53620e3ac92320bf1f86548d97e9?d=mp&s=160"},"body":"Dear Git Gurus,\n\nThe original reported issue possibly with more details:\nhttps://github.com/datalad/datalad/issues/6815\n\nBackground: in DataLad we specify empty value for --git-dir in\n\n    git --git-dir= config -z -l --show-origin\n\ncall to ensure that we are not picking up any local repository\nconfigurations if called while being under some repo.  It had been\nworking just fine for years until today user reported that such call\nerrors out with\n\n\t$> git --git-dir= config -z -l --show-origin > /dev/null\n\tfatal: The empty string is not a valid path\n\nbecause of having \n\n\t[includeIf \"gitdir:**/devbgc/**\"]\n\t\tpath = ~/.gitconfig_bgc\n\nin user's ~/.gitconfig (I have reproduced with git  2.35.1).\n\nNote: specifying some non-empty path pointing to some non-existing path (e.g.\n--git-dir=/non-existing) does not cause error.\n\n- should not git behavior on --git-dir  be consistent regardless of the content\nof ~/.gitconfig ?\n\n- is use --git-dir= generally legit (seems not documented)?  If not -- why it\nis not whenever pointing to non-existing directory is?\n\n- what is a more \"legit\" way to achieve \"do not load local repository\nconfig if under a git repository path\"?\n\nThank you in advance for the clarifications,\n-- \nYaroslav O. Halchenko\nCenter for Open Neuroscience     http://centerforopenneuroscience.org\nDartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755\nWWW:   http://www.linkedin.com/in/yarik        \n\n"}]}