Re: [PATCH/RFD] fix connection via git protocol
On Tue, Apr 18, 2023 at 2:25 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 37 quoted lines
>
> On Tue, Apr 18, 2023 at 5:06 PM Junio C Hamano <gitster@pobox.com> wrote:
> > From: Elijah Newren <newren@gmail.com>
> > Subject: [PATCH] protocol.h: move definition of DEFAULT_GIT_PORT from cache.h
> >
> > Michael J Gruber noticed that connection via the git:// protocol no
> > longer worked after a recent header clean-up.
>
> A link to Michael's email might be useful for future readers of this
> commit message.
>
> Michale J Gruber noticed[1] that connection...
>
> [1]: https://lore.kernel.org/git/5d4e0ce10f537b4bb795a70dd51db12ecaf0206d.1681556597.git.git@grubix.eu/
>
> > This was caused by
> > funny interaction of few gotchas. First, a necessary definition
> >
> > #define DEFAULT_GIT_PORT 9418
> >
> > was made invisible to a place where
> >
> > const char *port = STR(DEFAULT_GIT_PORT);
> >
> > was expecting to turn the integer into "9418" with a clever STR()
> > macro, and ended up stringifying it to
> >
> > const char *port = "DEFAULT_GIT_PORT";
> >
> > without giving any chance to compilers to notice such a mistake.
> >
> > Signed-off-by: Elijah Newren <newren@gmail.com>
> > Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> Perhaps an additional tailer would be appropriate?
>
> Reported-by: Michael J Gruber <git@grubix.eu>
These both look like good additions too.