Hi, These few patches are based on a suggestion in [1] from Jonathan Nieder and in [2] Junio. The gist of this series is to do the following three things: 1. Extract a new 'shallow.h' header to collect all of the functions that are related to shallow-ness, but defined in 'commit.h'. 2. Add some documentation from the previous series where it could have benefited from it. 3. Finally, introduce a thin wrapper type 'struct shallow_lock' which makes it a type-level error to unlock a non-shallow lock with '{commit,rollback}_shallow_file'. The remainder of suggestions in [1] about the structure of t5537 I decided to not address in this series, since I anticipate there is more work there than I want to take on in this series alone. Thanks in advance for your review! [1]: https://lore.kernel.org/git/20200423011444.GG140314@xxxxxxxxxx/ [2]: https://lore.kernel.org/git/xmqqy2qnidyy.fsf@xxxxxxxxxxxxxxxxxxxxxx/ Taylor Blau (5): commit: make 'commit_graft_pos' non-static shallow: extract a header file for shallow-related functions commit: move 'unregister_shallow' to 'shallow.h' shallow.h: document '{commit,rollback}_shallow_file' shallow: use struct 'shallow_lock' for additional safety builtin.h | 1 + builtin/receive-pack.c | 2 +- commit.c | 16 ++------- commit.h | 49 +------------------------- fetch-pack.c | 3 +- send-pack.c | 1 + shallow.c | 36 +++++++++++++------ shallow.h | 78 ++++++++++++++++++++++++++++++++++++++++++ upload-pack.c | 1 + 9 files changed, 112 insertions(+), 75 deletions(-) create mode 100644 shallow.h -- 2.26.0.113.ge9739cdccc