Volume XXII, number 279Tuesday, October 6, 2026Latest message 35 minutes ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

hostname: includeIf condition — anyone already working on this?

6 messages between Sep 28, 2026 and Oct 2, 2026, from Isabella Caselli, Jeff King, Ignacio Encinas, Junio C Hamano.

Plain Markdown or JSON for tools and agents.

Isabella CaselliSep 28, 2026, 23:43 UTC on lore
Hi all,

I'm looking for a small, relatively simple first contribution to Git as part of an undergraduate thesis on community/contribution barriers, and I'd like to work on the "hostname:" includeIf condition requested in gitgitgadget/git#1665 [1]: matching includeIf on the machine's hostname, mainly for sharing dotfiles across machines, e.g.:

    [includeIf "hostname:laptop"]
        path = ~/.gitconfig-laptop

I found a related proposal from 2022 for an includeIf condition based on the operating system [2], which stalled over disagreements about naming and case sensitivity. My understanding is that "hostname:" is a narrower, separate condition (machine identity, not platform), so I don't think it needs to revisit that discussion, but I wanted to check before starting:

- Is it still relevant for the project?
   - If yes, is anyone already working on this issue?
- Any objection to the approach itself? The same machine can report
its hostname differently depending on how it's set up — sometimes just
the short name, sometimes with the full network address attached to it
— so it isn't obvious whether the condition should compare that value
exactly as the system reports it, or normalize it somehow before
comparing.

If nobody is on it, I'll put together a small patch modeled on the existing onbranch: condition (dispatch in config.c, tests in t1305-config-include.sh, docs in config.adoc).

Thanks, Isabella Caselli [1] https://github.com/gitgitgadget/git/issues/1665 [2] https://patchwork.kernel.org/project/git/patch/pull.1429.v2.git.1669058388327.gitgitgadget@gmail.com/

Jeff KingSep 29, 2026, 01:44 UTC in reply to Isabella Caselli on lore

Re: hostname: includeIf condition — anyone already working on this?

On Mon, Sep 28, 2026 at 08:43:49PM -0300, Isabella Caselli wrote:
Show 9 quoted lines
> I found a related proposal from 2022 for an includeIf condition based
> on the operating system [2], which stalled over disagreements about
> naming and case sensitivity. My understanding is that "hostname:" is a
> narrower, separate condition (machine identity, not platform), so I
> don't think it needs to revisit that discussion, but I wanted to check
> before starting:
> 
> - Is it still relevant for the project?
>    - If yes, is anyone already working on this issue?

I think it's a reasonable feature to have. I don't recall seeing anybody else work on it recently (and a quick search of the list archive confirms).

But see below.
Show 6 quoted lines
> - Any objection to the approach itself? The same machine can report
> its hostname differently depending on how it's set up — sometimes just
> the short name, sometimes with the full network address attached to it
> — so it isn't obvious whether the condition should compare that value
> exactly as the system reports it, or normalize it somehow before
> comparing.
Yes, that is the tricky part. :) There were some patches in 2024:
  https://lore.kernel.org/git/20240307205006.467443-1-ignacio@iencinas.com/

where the issue came up. Based on my recollection and a quick skim of the thread, I think the consensus was that it's OK to document that it is system-dependent whether we'll match against a short of fully qualified hostname. But exposing our view of the hostname via git-var (e.g., "git var GIT_HOSTNAME") might be a helpful debugging aid.

It looks like after review on v3 of the series we never saw more. I'd guess the author (cc'd) just never got around to pushing it forward.

-Peff
Ignacio EncinasSep 29, 2026, 12:14 UTC in reply to Jeff King on lore

Re: hostname: includeIf condition — anyone already working on this?

Hello,
On Tue Sep 29, 2026 at 2:44 AM IST, Jeff King wrote:
Show 21 quoted lines
> On Mon, Sep 28, 2026 at 08:43:49PM -0300, Isabella Caselli wrote:
>
>> - Any objection to the approach itself? The same machine can report
>> its hostname differently depending on how it's set up — sometimes just
>> the short name, sometimes with the full network address attached to it
>> — so it isn't obvious whether the condition should compare that value
>> exactly as the system reports it, or normalize it somehow before
>> comparing.
>
> Yes, that is the tricky part. :) There were some patches in 2024:
>
>   https://lore.kernel.org/git/20240307205006.467443-1-ignacio@iencinas.com/
>
> where the issue came up. Based on my recollection and a quick skim of
> the thread, I think the consensus was that it's OK to document that it
> is system-dependent whether we'll match against a short of fully
> qualified hostname. But exposing our view of the hostname via git-var
> (e.g., "git var GIT_HOSTNAME") might be a helpful debugging aid.
>
> It looks like after review on v3 of the series we never saw more. I'd
> guess the author (cc'd) just never got around to pushing it forward.

That's what happened. Similar to Isabella, I was looking for a small contribution but it ended up being more complicated than expected. I got a bit overwhelmed and decided to drop it.

I kept wondering if I should have communicated that, so apologies if that was the case.

I hope the discussion from 2024 is at least helpful now if this ends up being implemented by Isabella.

Best regards, Ignacio

Jeff KingSep 29, 2026, 18:28 UTC in reply to Ignacio Encinas on lore

Re: hostname: includeIf condition — anyone already working on this?

On Tue, Sep 29, 2026 at 01:14:34PM +0100, Ignacio Encinas wrote:
Show 19 quoted lines
> > Yes, that is the tricky part. :) There were some patches in 2024:
> >
> >   https://lore.kernel.org/git/20240307205006.467443-1-ignacio@iencinas.com/
> >
> > where the issue came up. Based on my recollection and a quick skim of
> > the thread, I think the consensus was that it's OK to document that it
> > is system-dependent whether we'll match against a short of fully
> > qualified hostname. But exposing our view of the hostname via git-var
> > (e.g., "git var GIT_HOSTNAME") might be a helpful debugging aid.
> >
> > It looks like after review on v3 of the series we never saw more. I'd
> > guess the author (cc'd) just never got around to pushing it forward.
> 
> That's what happened. Similar to Isabella, I was looking for a small
> contribution but it ended up being more complicated than expected. I got
> a bit overwhelmed and decided to drop it.
> 
> I kept wondering if I should have communicated that, so apologies if
> that was the case.

Nah, it's not a big deal. This is open source, so everybody is here voluntarily, and it's normal for people to come in and out as time and interest permits. Plus the very reason that people end up dropping a series (getting overwhelmed) often makes it hard to decide whether and when to write the "I'm dropping this" email. :)

> I hope the discussion from 2024 is at least helpful now if this ends up
> being implemented by Isabella.

Yeah, I think there's a lot of good discussion there, and the patches themselves can probably give a boost to another attempt. Even if we did not finish it back then, thank you for the work so far.

-Peff
Junio C HamanoSep 29, 2026, 19:55 UTC in reply to Ignacio Encinas on lore

Re: hostname: includeIf condition — anyone already working on this?

"Ignacio Encinas" <ignacio@iencinas.com> writes:
Show 11 quoted lines
> On Tue Sep 29, 2026 at 2:44 AM IST, Jeff King wrote:
> ...
>> It looks like after review on v3 of the series we never saw more. I'd
>> guess the author (cc'd) just never got around to pushing it forward.
>
> That's what happened. Similar to Isabella, I was looking for a small
> contribution but it ended up being more complicated than expected. I got
> a bit overwhelmed and decided to drop it.
> ...
> I hope the discussion from 2024 is at least helpful now if this ends up
> being implemented by Isabella.

I was re-reading the thread yesterday. It looked like we were _so_ close to the finish line before the discussion stopped, which is a shame. All the good bits were already designed and the only thing left was to assemble and package them up.

Isabella CaselliOct 2, 2026, 01:52 UTC in reply to Junio C Hamano on lore

Re: hostname: includeIf condition — anyone already working on this?

Interesting, I didn't know there had already been a discussion about this issue. Thank you, Jeff, for pointing me to the 2024 series.

Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> "Ignacio Encinas" <ignacio@iencinas.com> writes:
>
>> That's what happened. Similar to Isabella, I was looking for a small
>> contribution but it ended up being more complicated than expected. I got
>> a bit overwhelmed and decided to drop it.
>> ...
>> I hope the discussion from 2024 is at least helpful now if this ends up
>> being implemented by Isabella.

Ignacio, if you don't mind, I'd like to continue the work based on yours and credit you when submitting the series.

> I was re-reading the thread yesterday.  It looked like we were _so_
> close to the finish line before the discussion stopped, which is a
> shame.  All the good bits were already designed and the only thing
> left was to assemble and package them up.

That's encouraging to hear! Sounds like a plan to go through the 2024 thread, including Jeff's suggestion of exposing the hostname via "git var", and send an updated version of the series addressing the comments on v3.

Thanks, Isabella

Back to recent threads