From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Patrick Steinhardt <ps@pks.im>,
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH 0/2] Organize mingw includes
Date: Fri, 10 Oct 2025 09:18:32 -0700 [thread overview]
Message-ID: <xmqqfrbqafxj.fsf@gitster.g> (raw)
In-Reply-To: <c4a03e23-1c14-05b7-25ad-a3d6998df876@gmx.de> (Johannes Schindelin's message of "Fri, 10 Oct 2025 15:55:55 +0200 (CEST)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> Sorting them also makes sense. It's another thing where I wish that we
>> had a tool to enforce this. clang-format supports this in theory, but
>> it's disabled right now. And I'm not even sure whether it can be told to
>> include e.g. "git-compat-util.h" first.
>
> In theory, I am totally with you: Sorting `#include`s is a job best left
> to tools. But then, I say the same about formatting,
I am afraid that it is apples-to-oranges comparison. Nobody has to
read the #include directives; they may have to see if a header they
care about (because they are planning to add a call to a function
that hasn't been used in the particular C source file, perhaps) is
already included, and sorted list of includes is a good tool to help
them. IOW, they do not read them, they scan in them. But the code,
the result of formatting, must be readable by people.
prev parent reply other threads:[~2025-10-10 16:18 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
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 [this message]
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=xmqqfrbqafxj.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=ps@pks.im \
/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).