Re: [PATCH v2 13/22] hash-ll.h: split out of hash.h to remove dependency on repository.h
- From
Glen Choo <chooglen@google.com>
- Date
- Apr 24, 2023, 18:51 UTC
- Message-ID
- <kl6ly1mh865x.fsf@chooglen-macbookpro.roam.corp.google.com>
- In-Reply-To
- <d95f97f5e90da40b285aa8fd678efcff0ae11033.1682194651.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Move the parts of hash.h that do not > depend upon repository.h into a new file hash-ll.h (the "low level" > parts of hash.h), and adjust other files to use this new header where > the convenience inline functions aren't needed.
Suggestion: To maintain this property, it might be helpful to capture the rules of hash-ll.h vs hash.h in a top-level comment.
Show 9 quoted lines
> diff --git a/hash-ll.h b/hash-ll.h > new file mode 100644 > index 00000000000..80509251370 > --- /dev/null > +++ b/hash-ll.h > +const struct object_id *null_oid(void); > [...] > +const char *empty_tree_oid_hex(void); > +const char *empty_blob_oid_hex(void);
hash-ll.h doesn't depend on repository.h, but these functions' bodies use the_hash_algo. Does it matter?
Moving the functions to hash.h requires changing 8 files to #include "hash.h", all of which seem to be because they were getting hash-ll.h indirectly via object-name.h.