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

Re: [PATCH] Makefile: drop GEN_HDRS

From
Jeff King <peff@peff.net>
Date
Dec 17, 2019, 05:28 UTC
Message-ID
<20191217052812.GB2762303@coredump.intra.peff.net>
In-Reply-To
<20191217014321.GF10734@google.com>
On Mon, Dec 16, 2019 at 05:43:21PM -0800, Jonathan Nieder wrote:
Show 9 quoted lines
> Jeff King wrote:
> 
> > I actually wonder if the whole thing would be simpler if command-list.h
> > was a static tracked file with the declarations, and we generated
> > command-list.c with "extern const char *command_list[]", etc.
> 
> Right, or a "command-list.inc" file.
> 
> extern-ing it seems like the simplest way to go.

If only. I took a brief look at this. Besides the Makefile chaos (did you know that the vcxproj rule manually builds and git-adds command-list.h? No idea what is going on there), it looks like we dynamically generate the category bitfield, which is then used directly in help.c. We _could_ declare those bitfields as externs themselves, but part of the point is that the full list of categories is generated dynamically from command-list.txt.

So we'd either split the list into two (one list of categories special enough to be manually declared, and the rest that get generated automatically) or we'd end up just duplicating the whole list.

Certainly this could all be untangled, but given that the system is working just fine as it is, it doesn't seem worth anybody's time (and the risk of weird follow-on problems) to adjust it.

-Peff
Previous: Jonathan NiederNext: Johannes Schindelin
Message 10 of 12 in “Makefile: drop GEN_HDRS”
  1. Makefile: drop GEN_HDRSJunio C Hamano, Dec 13, 2019
  2. Jeff KingDec 14, 2019
  3. Jeff KingDec 14, 2019
  4. Junio C HamanoDec 16, 2019
  5. Jeff KingDec 16, 2019
  6. Emily ShafferDec 17, 2019
  7. Jonathan NiederDec 17, 2019
  8. Jeff KingDec 17, 2019
  9. Jonathan NiederDec 17, 2019
  10. Jeff KingDec 17, 2019
  11. vcxproj target, was Re: [PATCH] Makefile: drop GEN_HDRSJohannes Schindelin, Dec 17, 2019
  12. Jeff KingDec 19, 2019

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.