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

Re: [Bug report] includeIf config is not displayed in normal directories

From
Jeff King <peff@peff.net>
Date
Dec 18, 2020, 06:23 UTC
Message-ID
<X9xK+rn8vZGtBuuo@coredump.intra.peff.net>
In-Reply-To
<xmqq5z512v2r.fsf@gitster.c.googlers.com>
On Wed, Dec 16, 2020 at 03:24:28PM -0800, Junio C Hamano wrote:
Show 22 quoted lines
> Stuart MacDonald <stuartm.coding@gmail.com> writes:
> 
> > My old understanding of git clone:
> > - create sub-directory
> > - create subdir/.git and whatever initial states are needed
> > - clone the repo from origin into the directory
> > - all never having left $CWD
> >
> > It's actually:
> > - create sub-directory
> > - cd subdir
> > - create ./.git and initial states
> > - clone the repo _while inside_ a gitdir
> > - cd ..
> 
> I am not sure how the above two should make any difference with the
> [includeif "gitdir:<pattern>"] matching.  Regardless of where your
> $CWD is, the inclusion is decided on the location of the .git/
> directory we are dealing with, so as long as "subdir/.git" matches
> the pattern given to "gitdir:<pattern>" the inclusion should work
> the same way even if the internal implementation of "git clone"
> changes between the above two.

I think the question is just "are we in a repository as part of clone or not". Stuart's original world-view was that we were not, as we were creating a clone but not "entering" it. But that is not how it is implemented (nor the conceptual model I think we would want to give the user).

> IIRC "includeif" is a Peff's brainchild, so I'd ask him to correct
> any mistakes in the above paragraph,

The notion of conditional includes was my thing, but gitdir: was Duy's. That said...

> but I am a bit puzzled as to
> what the true misunderstanding is, where the misunderstanding came
> from, and which documentation if any we should look into improving.

I think it might just be a case of mistaken assumptions. But I am certainly open to hearing from Stuart if there are places in the documentation that misled him (or could have led him better).

-Peff
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 6 of 8 in “[Bug report] includeIf config is not displayed in normal directories”
  1. Stuart MacDonaldDec 15, 2020
  2. Junio C HamanoDec 15, 2020
  3. Jeff KingDec 16, 2020
  4. Stuart MacDonaldDec 16, 2020
  5. Junio C HamanoDec 16, 2020
  6. Jeff KingDec 18, 2020
  7. Ævar Arnfjörð BjarmasonDec 15, 2020
  8. Junio C HamanoDec 16, 2020

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.