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

From: René Scharfe <[email-masked]>
Date: Tue, 09 Sep 2014 21:44:40 +0200

Am 08.09.2014 um 19:50 schrieb Junio C Hamano:
> René Scharfe <[email-masked]> 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 <[email-masked]>
>>> ---
>>
>>> 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é