From: Taylor Blau <me@ttaylorr.com>
To: Ignacio Encinas Rubio <ignacio@iencinas.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH v2 1/1] config: learn the "hostname:" includeIf condition
Date: Sat, 16 Mar 2024 12:00:36 -0400 [thread overview]
Message-ID: <ZfXCJAsACzKLndNm@nand.local> (raw)
In-Reply-To: <857e512c-d6d8-4bad-9eb5-5ca233a1c884@iencinas.com>
On Sat, Mar 16, 2024 at 12:19:44PM +0100, Ignacio Encinas Rubio wrote:
>
>
> On 16/3/24 7:57, Jeff King wrote:
> > On Sat, Mar 09, 2024 at 07:18:28PM +0100, Ignacio Encinas wrote:
> >
> >> diff --git a/Documentation/config.txt b/Documentation/config.txt
> >> index e3a74dd1c19d..9a22fd260935 100644
> >> --- a/Documentation/config.txt
> >> +++ b/Documentation/config.txt
> >> @@ -186,6 +186,11 @@ As for the naming of this keyword, it is for forwards compatibility with
> >> a naming scheme that supports more variable-based include conditions,
> >> but currently Git only supports the exact keyword described above.
> >>
> >> +`hostname`::
> >> + The data that follows the keyword `hostname:` is taken to be a
> >> + pattern with standard globbing wildcards. If the current
> >> + hostname matches the pattern, the include condition is met.
> >
> > 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.
>
> Thanks for pointing it out. I agree that it should be further clarified.
>
> Indeed, I was referring to the short name reported by gethostname(2),
> which should agree with "hostname". What do you think about
>
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 9a22fd260935..268a9fab7be0 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -189,7 +189,8 @@ but currently Git only supports the exact keyword described above.
> `hostname`::
> The data that follows the keyword `hostname:` is taken to be a
> pattern with standard globbing wildcards. If the current
> - hostname matches the pattern, the include condition is met.
> + hostname (output of gethostname(2)) matches the
Hmm. gethostname(2)'s manual page isn't overly specific on the details
here, either.
I admittedly don't love the idea of documenting this implementation
detail (that is, that we are calling gethostname() and using its output
to compare against). I think it's fine to say instead, "the short
hostname", and leave it at that.
Alternatively, you could say "If the machine's short hostname (as
opposed to a fully-qualified hostname, as returned by `hostname -f`)
matches the pattern [...]".
I think I have a vague preference towards the latter.
Thanks,
Taylor
next prev parent reply other threads:[~2024-03-16 16:00 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-07 20:50 [RFC PATCH 0/1] Add hostname condition to includeIf Ignacio Encinas
2024-03-07 20:50 ` [RFC PATCH 1/1] config: learn the "hostname:" includeIf condition Ignacio Encinas
2024-03-07 21:40 ` Junio C Hamano
2024-03-09 10:47 ` Ignacio Encinas Rubio
2024-03-09 17:38 ` Junio C Hamano
2024-03-09 18:18 ` [PATCH v2 0/1] Add hostname condition to includeIf Ignacio Encinas
2024-03-09 18:18 ` [PATCH v2 1/1] config: learn the "hostname:" includeIf condition Ignacio Encinas
2024-03-10 16:59 ` Junio C Hamano
2024-03-10 18:46 ` Ignacio Encinas Rubio
2024-03-11 17:39 ` Junio C Hamano
2024-03-13 21:53 ` Ignacio Encinas Rubio
2024-03-16 6:57 ` Jeff King
2024-03-16 11:19 ` Ignacio Encinas Rubio
2024-03-16 16:00 ` Taylor Blau [this message]
2024-03-16 16:46 ` Ignacio Encinas Rubio
2024-03-16 17:02 ` Junio C Hamano
2024-03-16 17:41 ` rsbecker
2024-03-16 18:05 ` Ignacio Encinas Rubio
2024-03-16 18:49 ` rsbecker
2024-03-18 8:17 ` Jeff King
2024-03-16 16:01 ` Taylor Blau
2024-03-16 16:50 ` Ignacio Encinas Rubio
2024-03-19 18:37 ` [PATCH v3 0/2] Add hostname condition to includeIf Ignacio Encinas
2024-03-19 18:37 ` [PATCH v3 1/2] t: add a test helper for getting hostname Ignacio Encinas
2024-03-19 20:31 ` Junio C Hamano
2024-03-19 20:57 ` Jeff King
2024-03-19 21:00 ` Junio C Hamano
2024-03-19 21:11 ` Jeff King
2024-03-19 21:44 ` Junio C Hamano
2024-03-21 0:11 ` Chris Torek
2024-03-19 20:56 ` Jeff King
2024-03-19 18:37 ` [PATCH v3 2/2] config: learn the "hostname:" includeIf condition Ignacio Encinas
2024-03-19 20:53 ` Junio C Hamano
2024-03-19 21:04 ` Jeff King
2024-03-19 21:32 ` Ignacio Encinas Rubio
2024-03-19 20:55 ` [PATCH v3 0/2] Add hostname condition to includeIf Eric Sunshine
2024-03-19 21:12 ` Junio C Hamano
2024-03-19 21:13 ` Eric Sunshine
2024-03-20 0:19 ` Jeff King
2024-03-20 2:49 ` Eric Sunshine
2024-03-20 3:07 ` Eric Sunshine
2024-03-20 14:34 ` Chris Torek
2024-03-20 16:37 ` Eric Sunshine
2024-03-20 20:51 ` Jeff King
2024-03-20 16:49 ` Junio C Hamano
2024-03-19 21:36 ` Dirk Gouders
2024-03-19 22:03 ` rsbecker
2024-03-19 22:26 ` Dirk Gouders
2024-03-19 22:31 ` rsbecker
2024-03-19 22:59 ` Junio C Hamano
2024-03-19 21:22 ` Ignacio Encinas Rubio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZfXCJAsACzKLndNm@nand.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=ignacio@iencinas.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).