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

Re: Possible bug in includeIf / conditional includes on non git initialised directories

From
Jeff King <peff@peff.net>
Date
May 11, 2017, 23:43 UTC
Message-ID
<20170511234259.gnbr6aiu26oqysxo@sigill.intra.peff.net>
In-Reply-To
<5735fdc6-85de-491c-481d-9d0c18912ee6@gmail.com>
On Thu, May 11, 2017 at 10:31:14PM +0200, Sebastian Schuberth wrote:
Show 8 quoted lines
> On 2017-05-11 20:53, Raphael Stolt wrote:
> 
> > I might have stumbled this time over a real bug in includeIf / conditional includes or maybe it's just as intended.
> > 1) Given I have a correct configured includeIf and I’m issuing `git config --show-origin --get user.email` against an directory which hasn’t been `git init`ed I get the user.email configured globally.
> 
> I don't think that's a bug surprise: The condition in the conditional
> include is "gitdir:". Before running "git init", it simply *is* no
> gitdir.

Yeah, I think all is working as intended. A "cwd:" conditional seems like it would be useful, but I think it would have a lot of corner cases. It may change over the course of a program, and you have weirdness with things like "git --git-dir=/some/other/path", where your cwd and the git repository you're looking at are totally unrelated.

-Peff
Previous: Sebastian SchuberthNext: Ævar Arnfjörð Bjarmason
Message 3 of 4 in “Possible bug in includeIf / conditional includes on non git initialised directories”
  1. Raphael StoltMay 11, 2017
  2. Sebastian SchuberthMay 11, 2017
  3. Jeff KingMay 11, 2017
  4. Ævar Arnfjörð BjarmasonMay 12, 2017

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.