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

Re: [PATCHv4 0/6] Add missing includes and forward declares

From
Jeff King <peff@peff.net>
Date
Aug 16, 2018, 17:48 UTC
Message-ID
<20180816174810.GD882@sigill.intra.peff.net>
In-Reply-To
<b8553a50-6b97-2b45-2f7b-cfe2576548cb@ramsayjones.plus.com>
On Thu, Aug 16, 2018 at 01:19:17AM +0100, Ramsay Jones wrote:
> As a quick ("just before bedtime") exercise, I tried adding
> a Makefile target to perform a similar check. The result is
> given below, but I haven't had time to look too closely at
> the results:

The resulting patch doesn't look too horrible, and I think it would be great to automate this, even if people don't always run it by default.

The flip side is the "do all files include git-compat-util.h first" test I mentioned elsewhere (and which resulted in the test-tool.h patch). That could be automated, too. I did it like:

  {
    echo '#undef int'
    cat git-compat-util.h
  } >tmp
  mv tmp git-compat-util.h
  make CFLAGS=-Dint=foo
That's obviously pretty nasty, but if we were willing to carry:
  #ifdef UNDO_TRICKY_LINT_HACK
  #undef int
  #endif

in git-compat-util.h, it could be driven from the Makefile. Maybe worth-while to couple with this.

-Peff
Previous: Junio C Hamano
Message 14 of 14 in “[PATCHv4 0/6] Add missing includes and forward declares”
  1. Elijah NewrenAug 15, 2018
  2. 6/6 Remove forward declaration of an enumElijah Newren, Aug 15, 2018
  3. Jonathan NiederAug 15, 2018
  4. 4/6 urlmatch.h: fix include guardElijah Newren, Aug 15, 2018
  5. 2/6 alloc: make allocate_alloc_state and clear_alloc_state more consistentElijah Newren, Aug 15, 2018
  6. Jonathan NiederAug 15, 2018
  7. 5/6 compat/precompose_utf8.h: use more common include guard styleElijah Newren, Aug 15, 2018
  8. 3/6 Move definition of enum branch_track from cache.h to branch.hElijah Newren, Aug 15, 2018
  9. 1/6 Add missing includes and forward declarationsElijah Newren, Aug 15, 2018
  10. Jonathan NiederAug 15, 2018
  11. Jonathan NiederAug 15, 2018
  12. Ramsay JonesAug 16, 2018
  13. Junio C HamanoAug 16, 2018
  14. Jeff KingAug 16, 2018

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.