# New series adds a hostname: condition to includeIf and GIT_HOSTNAME to git var

_People who share a home directory or dotfiles repository across machines could vary their Git config by host._

Section: Patches. Edition of 2026-10-12. Written by an AI editor from the thread "hostname: includeIf condition — anyone already working on this?" (20 messages): https://gitlist.dev/t/66414

Isabella Caselli, who said she is looking for a first contribution as part of an undergraduate thesis on contribution barriers, first asked on the list whether anyone was already working on a "hostname:" includeIf condition requested in gitgitgadget/git#1665. She pointed to a stalled 2022 proposal for an operating-system condition, which ran into disagreements over naming and case sensitivity, and treated hostname as a narrower, separate matter.

Her series is based on Ignacio Encinas's v3 from March 2024. He dropped it and agreed to let her try again, and the "hostname:" patch credits him with Based-on-patch-by.

The new condition takes a glob pattern and is met when the machine's hostname matches it. If the hostname cannot be determined, the condition is not met. The commit message notes that depending on system configuration the hostname may be a short name or a fully qualified domain name.

The series also adds a GIT_HOSTNAME variable to git var, so users can see which name Git uses for matching. This follows a suggestion from Eric, who pointed out that exposing the hostname to users makes the test-tool xgethostname helper from the earlier version unnecessary, so that helper is dropped.

A further patch changes the gc test "background auto gc respects lock for all operations" to get its hostname from git var GIT_HOSTNAME instead of the hostname command, so it matches what git gc uses. The excerpts do not show review comments on the new series.
