Thread (5 messages) 5 messages, 4 authors, 2024-03-18

Re: [PATCH v2 1/1] config: learn the "hostname:" includeIf condition

From: Junio C Hamano <hidden>
Date: 2024-03-16 17:02:40

Jeff King [off-list ref] writes:
Do we need to define "hostname" in more detail here? Specifically, I'm
wondering whether the result will be a FQDN or not (i.e., the output of
"hostname" vs "hostname -f"). Looking at the code I think it will just
be the short name returned. That's probably OK, but it may be worth
documenting.
That was my first reaction but there are places where "hostname"
already gives a name that is not "short" at all, without being
invoked with "-f".

For example, the (virtual) workstation I am typing this message on
sits in a $WORK datacenter, where "hostname" gives the same string
as "hostname -f", which looks like "git.c.xxxxxx.tld" ("git" is the
only part I picked myself for it, "c" is shared by those employee
workstations hosted at datacenters, "xxxxxx.tld" is redacted to
conceal the real domain name to protect the culprits ;-).

I think the most honest answer we can give in the documentation is
that we use what gethostname() [*] gives.


[References]

* https://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help