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

Re: [PATCH 1/1] Makefile: use `git ls-files` to list header files, if possible

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 6, 2019, 05:28 UTC
Message-ID
<xmqqd0n4r2qm.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190306044006.GA6664@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 17 quoted lines
> On Wed, Mar 06, 2019 at 12:23:20AM +0000, Ramsay Jones wrote:
>
>> > Yeah, that's what I was hinting at earlier in the thread. Here it is
>> > sketched out to an actual working patch. The sub-make bits could
>> > actually be a shell script instead of a Makefile; the only point in
>> > using make is to use the parent "-j" for parallelism.
>> 
>> sigh. :(
>> 
>> I wish my patch removing this target had been picked up now!
>> 
>> Earlier this evening I spent an hour or so writing an email which
>> tried to discourage spending any time on this, because of the
>> potential for this to be a huge time-suck. An unrewarding one at
>> that! :-D
>
> Heh. I am OK with removing it, too.
FWIW, I am fine with that plan as well.
Show 10 quoted lines
> My thinking earlier in the thread was that it should go in our bag of
> linting tools that people should generally run. But actually, it is kind
> of expensive to run, and it does not actually help anything immediately
> in practice. I.e., what we really care about is that the C source files
> compile, and running "make" does that (and especially running it on
> various platforms). This is just checking for a _potential_ problem if
> somebody were to include a particular header file at the start of
> another C file.
>
> So it's really about 2 steps removed from stopping an actual problem.
Yeah, exactly.
Show 17 quoted lines
> diff --git a/compat/bswap.h b/compat/bswap.h
> index 5078ce5ecc..e4e25735ce 100644
> --- a/compat/bswap.h
> +++ b/compat/bswap.h
> @@ -1,3 +1,6 @@
> +#ifndef COMPAT_BSWAP_H
> +#define COMPAT_BSWAP_H
> +
>  /*
>   * Let's make sure we always have a sane definition for ntohl()/htonl().
>   * Some libraries define those as a function call, just to perform byte
> @@ -210,3 +213,5 @@ static inline void put_be64(void *ptr, uint64_t value)
>  }
>  
>  #endif
> +
> +#endif /* COMPAT_BSWAP_H */
This probably is worth having as an independent clean-up.
Previous: Jeff KingNext: Jeff King
Message 24 of 31 in “Avoid calling find in the Makefile, if possible”
  1. 0/1 Avoid calling find in the Makefile, if possibleJohannes Schindelin via GitGitGadget, Mar 1, 2019
  2. 1/1 Makefile: use `git ls-files` to list header files, if possibleJohannes Schindelin via GitGitGadget, Mar 1, 2019
  3. Jeff KingMar 1, 2019
  4. Jeff KingMar 1, 2019
  5. Jeff KingMar 1, 2019
  6. Johannes SchindelinMar 2, 2019
  7. Jeff KingMar 3, 2019
  8. Johannes SchindelinMar 2, 2019
  9. Jeff KingMar 3, 2019
  10. Johannes SchindelinMar 2, 2019
  11. Jeff KingMar 3, 2019
  12. Ramsay JonesMar 3, 2019
  13. Johannes SchindelinMar 4, 2019
  14. Ramsay JonesMar 4, 2019
  15. Jeff KingMar 4, 2019
  16. Johannes SchindelinMar 4, 2019
  17. Jeff KingMar 4, 2019
  18. Junio C HamanoMar 5, 2019
  19. Johannes SchindelinMar 5, 2019
  20. Junio C HamanoMar 5, 2019
  21. Jeff KingMar 5, 2019
  22. Ramsay JonesMar 6, 2019
  23. Jeff KingMar 6, 2019
  24. Junio C HamanoMar 6, 2019
  25. compat/bswap: add include header guardsJeff King, Mar 6, 2019
  26. Junio C HamanoMar 6, 2019
  27. 0/1 Avoid calling find in the Makefile, if possibleJohannes Schindelin via GitGitGadget, Mar 4, 2019
  28. 1/1 Makefile: use `git ls-files` to list header files, if possibleJohannes Schindelin via GitGitGadget, Mar 4, 2019
  29. Ramsay JonesMar 4, 2019
  30. Ramsay JonesMar 4, 2019
  31. Jeff KingMar 4, 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.