From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>,
git@vger.kernel.org
Subject: Re: [PATCH 1/2] mingw: avoid relative `#include`s
Date: Mon, 13 Oct 2025 09:29:27 -0700 [thread overview]
Message-ID: <xmqqa51u3guw.fsf@gitster.g> (raw)
In-Reply-To: <e593886e-eeb4-440f-a317-a2959577e1e3@kdbg.org> (Johannes Sixt's message of "Sun, 12 Oct 2025 13:45:50 +0200")
Johannes Sixt <j6t@kdbg.org> writes:
> Why is this needed?
;-)
As pointed out by Matthias, the changes in the posted patch are not
complete/comprehensive.
> With #include "foo" it is quite clear that the file is first looked up
> from the directory of the file being processed. The changed code
> requires that the top-level directory is among the -I directives of the
> command lines. Then it would be much more logical to use #include <foo>
> instead.
I actually prefer that, but that is a taste thing I do not want to
impose on this project.
> So, IMO, the status quo is perfect and does not need this change.
I tend to agree, but it would be a waste of time to further discuss
on this. As long as it does not break compilation, I'll just let
the patch graduate.
My preference is to
* always name custom headers using the path from the top-level (we
use -I in BASIC_CFLAGS exactly for this purpose),
e.g.
#include "compat/win32.h" (good)
#include "win32.h" (not good)
* compat header that aims to replace system supplied headers like
<regex.h> should use -I appropriately and appear as if they are
from the system, e.g.
#include <regex.h> (good)
#include "compat/regex/regex.h" (not good)
If somebody truly wants to improve things once the dust settles from
these patches, I would appreciate they keep the above in mind.
THanks.
next prev parent reply other threads:[~2025-10-13 16:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 7:45 [PATCH 0/2] Organize mingw includes Johannes Schindelin via GitGitGadget
2025-10-09 7:46 ` [PATCH 1/2] mingw: avoid relative `#include`s Johannes Schindelin via GitGitGadget
2025-10-11 9:03 ` Matthias Aßhauer
2025-10-12 11:45 ` Johannes Sixt
2025-10-13 16:29 ` Junio C Hamano [this message]
2025-10-09 7:46 ` [PATCH 2/2] mingw: order `#include`s alphabetically Johannes Schindelin via GitGitGadget
2025-10-10 9:53 ` [PATCH 0/2] Organize mingw includes Patrick Steinhardt
2025-10-10 13:55 ` Johannes Schindelin
2025-10-10 16:18 ` Junio C Hamano
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=xmqqa51u3guw.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=j6t@kdbg.org \
--cc=johannes.schindelin@gmx.de \
/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).