threads / discuss / 60957

Re: Why does the includeif woks how it does?

Subject: Re: Why does the includeif woks how it does?

## tl;dr

One message between Feb 20, 2024 and Feb 20, 2024.

replies: 0people: 1as markdown or json

Dominik von Haller· Feb 20, 2024, 06:54 UTC · lore
Thanks, you all for your insights. <3
So to summarize, it was implemented through a gitdir because of possible confusions with the working directory. And there is no other implementation because the use case is not there.
For the new implementation I would always use the working directory. If set with git -C than use that. Should also not be a Problem because the working directory it is set internally anyway.
As far as the possible implementation of this goes, I would prefer an includeif with an extra option dir instead of gitdir. This would prevent confusion between includewhere and includeif.

The mentioned Problems seem to be easily figured out. Every includeif == true will get included. Every more specific path will overwrite properties if set before. Gitdir is more specific than just dir. Somewhat like that I would say is very intuitive.

Another possible approach which I would also say is logical is a top-down approach. Every Includeif would be executed from top to bottom. Every true includeif will be included and as before would overwrite properties if necessary. 

Best regards Dominik von Haller 

← back to recent threads