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

[PATCH v2 0/4] various: use iwyu (include-what-you-use) to analyze includes

From
Garrit Franke <garrit@slashdev.space>
Date
Apr 5, 2022, 11:45 UTC
Message-ID
<20220405114505.24389-1-garrit@slashdev.space>
In-Reply-To
<20220331194436.58005-1-garrit@slashdev.space>

I'm sorry about the half-baked patch of mine. I initially noticed that the "hash-lookup.h" wasn't needed (which was a correct assumption), and then went overboard when trying to clean up the other includes.

This is truly a rookie mistake that only wastes the time of everyone involved. This won't happen again!

On 01.04.22 10:07, ��������� var Arnfj��������r�������� Bjarmason wrote:
Show 6 quoted lines
> ... For anyone interested in pursuing this, I think using the excellent
> include-what-you-use tool would be a nice start.
>
> We could even eventually add it to our CI if the false positive rate
> isn't bad (I haven't checked much):
> https://github.com/include-what-you-use/include-what-you-use

This seems to be a really nice tool indeed. I wouldn't be comfortable adding it to the CI just yet, but it did make it considerably easier to spot includes that could safely be removed.

I think we could try battle-testing this tool in the codebase to get a sense of how it behaves. To start, I added your reference-command to a script under "contrib/iwyu" and ran it against the files you noted. Before breaking a bulk of the files, I wanted to make sure that this undertaking is headed in the right direction.

Feedback is of course welcomed!
Garrit Franke (4):
  contrib: add iwyu script
  bisect.c: remove unnecessary include
  serve.c: remove unnecessary include
  apply.c: remove unnecessary include
 bisect.c             |  1 -
 builtin/apply.c      |  1 -
 contrib/iwyu/README  | 33 +++++++++++++++++++++++++++++++++
 contrib/iwyu/iwyu.sh |  2 ++
 serve.c              |  1 -
 5 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 contrib/iwyu/README
 create mode 100755 contrib/iwyu/iwyu.sh
-- 
2.35.1
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 4 of 12 in “bisect.c: remove unused includes”
  1. bisect.c: remove unused includesGarrit Franke, Mar 31, 2022
  2. Junio C HamanoMar 31, 2022
  3. using iwyu (include-what-you-use) to analyze includes (was: [PATCH] bisect.c: remove unused includes)Ævar Arnfjörð Bjarmason, Apr 1, 2022
  4. 0/4 various: use iwyu (include-what-you-use) to analyze includesGarrit Franke, Apr 5, 2022
  5. Ævar Arnfjörð BjarmasonApr 6, 2022
  6. 4/4 apply.c: remove unnecessary includeGarrit Franke, Apr 5, 2022
  7. 3/4 serve.c: remove unnecessary includeGarrit Franke, Apr 5, 2022
  8. 1/4 contrib: add iwyu scriptGarrit Franke, Apr 5, 2022
  9. Ævar Arnfjörð BjarmasonApr 6, 2022
  10. 2/4 bisect.c: remove unnecessary includeGarrit Franke, Apr 5, 2022
  11. Ævar Arnfjörð BjarmasonApr 6, 2022
  12. Junio C HamanoApr 6, 2022

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.