git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <rsbecker@nexbridge.com>
To: "'Dirk Gouders'" <dirk@gouders.net>
Cc: "'Junio C Hamano'" <gitster@pobox.com>,
	"'Eric Sunshine'" <sunshine@sunshineco.com>,
	"'Ignacio Encinas'" <ignacio@iencinas.com>, <git@vger.kernel.org>,
	"'Jeff King'" <peff@peff.net>, "'Taylor Blau'" <me@ttaylorr.com>
Subject: RE: [PATCH v3 0/2] Add hostname condition to includeIf
Date: Tue, 19 Mar 2024 18:31:47 -0400	[thread overview]
Message-ID: <02d701da7a4d$3e60e960$bb22bc20$@nexbridge.com> (raw)
In-Reply-To: <ghr0g5j1sc.fsf@gouders.net>

On Tuesday, March 19, 2024 6:27 PM, Dirk Gouders wrote:
><rsbecker@nexbridge.com> writes:
>
>> On Tuesday, March 19, 2024 5:37 PM, Dirk Gouders wrote:
>>>Junio C Hamano <gitster@pobox.com> writes:
>>>
>>>> Eric Sunshine <sunshine@sunshineco.com> writes:
>>>>
>>>>> Peff felt that adding `git config --show-hostname-for-includes` was
>>>>> probably overkill, but I'd argue that it is necessary to enable
>>>>> users to deterministically figure out the value to use in their
>>>>> configuration rather than having to grope around in the dark via
>>>>> guesswork and trial-and-error to figure out exactly what works.
>>>>>
>>>>> And the option name doesn't necessarily have to be so verbose; a
>>>>> shorter name, such as `git config --show-hostname` may be good enough.
>>>>> Implementing this option would also obviate the need to implement
>>>>> `test-tool xgethostname` (though, I agree with Junio that
>>>>> `test-tool gethostname` would have been a better, less
>>>>> implementation-revealing name).
>>>>
>>>> Yeah, I like that show-hostname thing (which I do not know if "config"
>>>> is a good home for, though).
>>>
>>>A thought when I was reading this: wouldn't it be enough to document
>>>that
>> `uname -n` can be used to get the hostname that should
>>>be used?
>>>
>>>As far as I know this should be POSIX-compliant and uses gethostname(2).
>>
>> As previously pointed out, uname -n and gethostname(2) are not
equivalent.
>> uname -n does not (depending on implementation) go to DNS while
>> gethostname(2) goes to DNS first (although apparently glibc may not).
>> This is particularly important in a multi-home situation where more
>> than one IP adapter has a different IP address on the same host, and
>> where DNS does not consider the different addresses to be equivalent
>> (which otherwise could cause problems for reverse lookups).
>
>Thanks for the explanation, I did not notice this has already been
discussed.
>
>Interestingly, I strace(1)'ed uname -n here on Linux and noticed it uses
>uname(2) (what else?) and not gethostname(2), so it seems I was completely
>wrong.
>
>Sorry for disturbing the discussion.

No worries. I only know this point because I was rather deeply in a related
code base back in 1994. I did not know that glibc varied from an old UNIX (I
think that's where the code was from) code base prior to this thread.
Learning is good and never a problem.

Regards,
Randall


  reply	other threads:[~2024-03-19 22:32 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
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 [this message]
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='02d701da7a4d$3e60e960$bb22bc20$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=dirk@gouders.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ignacio@iencinas.com \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.com \
    /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).