git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] Organize mingw includes

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 10, 2025, 16:18 UTC
Message-ID
<xmqqfrbqafxj.fsf@gitster.g>
In-Reply-To
<c4a03e23-1c14-05b7-25ad-a3d6998df876@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 7 quoted lines
>> 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.

Previous: Johannes Schindelin
Message 9 of 9 in “Organize mingw includes”
  1. 0/2 Organize mingw includesJohannes Schindelin via GitGitGadget, Oct 9, 2025
  2. 1/2 mingw: avoid relative `#include`sJohannes Schindelin via GitGitGadget, Oct 9, 2025
  3. Matthias AßhauerOct 11, 2025
  4. Johannes SixtOct 12, 2025
  5. Junio C HamanoOct 13, 2025
  6. 2/2 mingw: order `#include`s alphabeticallyJohannes Schindelin via GitGitGadget, Oct 9, 2025
  7. Patrick SteinhardtOct 10, 2025
  8. Johannes SchindelinOct 10, 2025
  9. Junio C HamanoOct 10, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.