Re: [PATCH v6 2/5] reflog-walk: expose read_complete_reflog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 24/05/2025 00:22, brian m. carlson wrote:
> On 2025-05-22 at 21:53:27, Ramsay Jones wrote:
>>
>>
>> On 22/05/2025 19:55, brian m. carlson wrote:
>>> diff --git a/reflog-walk.h b/reflog-walk.h
>>> index 989583dc55..8f0640f662 100644
>>> --- a/reflog-walk.h
>>> +++ b/reflog-walk.h
>>> @@ -1,9 +1,24 @@
>>>  #ifndef REFLOG_WALK_H
>>>  #define REFLOG_WALK_H
>>>  
>>> +#include "git-compat-util.h"
>>
>> Why? 'git-compat-util.h' must be #include-d in any compilation
>> unit before 'reflog-walk.h', so ...
> 
> One of the CI jobs fails if we don't include `hash.h` for `struct
> object_id`.  I don't remember which one.  The rule is that we always
> include that header before any other header, so that's what I did here.
> It is also needed for `timestamp_t`.

The rule refers to '*.c' files not '*.h' files. ie. we #include
'git-compat-util.h' at the beginning of all C files, so at the
start of all compilation units (well Documentation/CodingGuidelines
has some exceptions, but ...).

So, at this point, 'git-compat-util.h' will already have been seen
by the compiler (so it won't cause any problem, but equally it is
not needed). In order to determine if the header can stand alone
you should just need to:

    $ make reflog-walk.hco

[That is what the hdr-check target is for].

So, yes, include 'hash.h' to make the header file stand alone,
but 'git-compat-util.h' should not be needed.

Thanks.

ATB,
Ramsay Jones






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux