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

Re: [RFC PATCH 2/2] headers: include dependent headers

From
René Scharfe <l.s.r@web.de>
Date
Sep 9, 2014, 19:44 UTC
Message-ID
<540F58A8.7000500@web.de>
In-Reply-To
<xmqqfvg2ngrn.fsf@gitster.dls.corp.google.com>
Am 08.09.2014 um 19:50 schrieb Junio C Hamano:
Show 26 quoted lines
> René Scharfe <l.s.r@web.de> writes:
>
>> Am 06.09.2014 um 21:20 schrieb David Aguilar:
>>> Add dependent headers so that including a header does not
>>> require including additional headers.
>>>
>>> This makes it so that "gcc -c $header" succeeds for each header.
>>>
>>> Signed-off-by: David Aguilar <davvid@gmail.com>
>>> ---
>>
>>> diff --git a/branch.h b/branch.h
>>> index 64173ab..a61fd1a 100644
>>> --- a/branch.h
>>> +++ b/branch.h
>>> @@ -3,6 +3,9 @@
>>>
>>>    /* Functions for acting on the information about branches. */
>>>
>>> +#include "cache.h"
>>> +#include "strbuf.h"
>>
>> cache.h includes strbuf.h, so the line above isn't necessary.
>
> True, but is "gcc -c $header" something we want to please in the
> first place (not an objection, but request for opinions)?

It *sounds* useful, but we did without that feature so far. Hmm. It would make it easier to use headers -- any dependency to other files are already taken care of. Since we have less .h files than .c files this seems to make sense.

Would it perhaps also make using precompiled headers easier (or possible in the first place)? Do we care?

René
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 10 in “Makefile: add check-headers target”
  1. 1/2 Makefile: add check-headers targetDavid Aguilar, Sep 6, 2014
  2. 2/2 headers: include dependent headersDavid Aguilar, Sep 6, 2014
  3. René ScharfeSep 6, 2014
  4. Junio C HamanoSep 8, 2014
  5. René ScharfeSep 9, 2014
  6. Junio C HamanoSep 8, 2014
  7. René ScharfeSep 6, 2014
  8. David AguilarSep 6, 2014
  9. Jeff KingSep 6, 2014
  10. David AguilarSep 7, 2014

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.