Re: [PATCH 2/5] shallow: extract a header file for shallow-related functions
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 30, 2020, 03:19 UTC
- Message-ID
- <20200430031949.GE115238@google.com>
- In-Reply-To
- <0b93abe072aa35ab96ba3b97118caa8ffe8e439d.1588199705.git.me@ttaylorr.com>
Taylor Blau wrote:
Show 7 quoted lines
> There are many functions in commit.h that are more related to shallow > repositories than they are to any sort of generic commit machinery. > Likely this began when there were only a few shallow-related functions, > and commit.h seemed a reasonable enough place to put them. > > But, now there are a good number of shallow-related functions, and > placing them all in 'commit.h' doesn't make sense.
Sure. For me, there are a few additional sources of motivation:
- shallow clone is a bit of a thorny feature, so I like having the indication of which source files are interacting with it
- this will give us a good place to put any overview documentation on the shallow API
Show 7 quoted lines
> This patch extracts a 'shallow.h', which takes all of the headers from > 'commit.h' for functions which already exist in 'shallow.c'. We will > bring the remaining shallow-related functions defined in 'commit.c' in a > subsequent patch. > > For now, move only the ones that already are implemented in 'shallow.c', > and update the necessary includes.
It's probably worth a mention of the builtin.h part here.
(By the way, I wouldn't be against propagating that to the callers, to better match what https://include-what-you-use.org/ would enforce.)
Thanks, Jonathan