cache.h: drop duplicate `ensure_full_index()` declaration
PATCH 1/1 cache.h: drop duplicate `ensure_full_index()` declaration
There are two identical declarations of ensure_full_index() in cache.h.
Commit 3964fc2aae ("sparse-index: add guard to ensure full index", 2021-03-30) provided an empty implementation of ensure_full_index(), declaring it in a new file sparse-index.h. When commit 4300f8442a ("sparse-index: implement ensure_full_index()", 2021-03-30) fleshed out the implementation, it added an identical declaration to cache.h.
Then 118a2e8bde ("cache: move ensure_full_index() to cache.h", 2021-04-01) favored having the declaration in cache.h. Because of the double declaration, at that point we could have just dropped the one in sparse-index.h, but instead it got moved to cache.h.
As a result, cache.h contains the exact same function declaration twice. Drop the one under "/* Name hashing */", in favor of the one under "/* Initialize and use the cache information */".
--- cache.h | 2 -- 1 file changed, 2 deletions(-)
cache.h +0 -2
@@ -350,8 +350,6 @@ void add_name_hash(struct index_state *istate, struct cache_entry *ce);void remove_name_hash (struct index_state *istate,struct cache_entry *ce);void free_name_hash (struct index_state *istate); -void ensure_full_index (struct index_state *istate); -/* Cache entry creation and cleanup */ /*
Signature · 1 line
2.34.1.703.g22d0c6ccf7
Quoted 28 lines · Martin Ågren
There are two identical declarations of
ensure_full_index()incache.h.Commit
3964fc2aae("sparse-index: add guard to ensure full index", 2021-03-30) provided an empty implementation ofensure_full_index(), declaring it in a new filesparse-index.h. When commit4300f8442a("sparse-index: implementensure_full_index()", 2021-03-30) fleshed out the implementation, it added an identical declaration tocache.h.Then
118a2e8bde("cache: moveensure_full_index()tocache.h", 2021-04-01) favored having the declaration incache.h. Because of the double declaration, at that point we could have just dropped the one insparse-index.h, but instead it got moved tocache.h.As a result,
cache.hcontains the exact same function declaration twice. Drop the one under "/* Name hashing */", in favor of the one under "/* Initialize and use the cache information */".Signed-off-by Martin Ågren <[email protected]>--- cache.h | 2 -- 1 file changed, 2 deletions(-)cache.h +0
-0
cache.h void add_name_hash(struct index_state *istate, struct cache_entry *ce); · line 355
Quoted 8 lines
cache.h +0
-2@@ -350,8 +350,6 @@ void add_name_hash(struct index_state *istate, struct cache_entry *ce);void remove_name_hash (struct index_state *istate,struct cache_entry *ce);void free_name_hash (struct index_state *istate); -void ensure_full_index (struct index_state *istate); -/* Cache entry creation and cleanup */ /*
Thanks for cleaning up the duplicate, looks good to me!
Quoted 32 lines · Victoria Dye
Quoted 31 lines · Martin Ågren
There are two identical declarations of
ensure_full_index()incache.h.Commit
3964fc2aae("sparse-index: add guard to ensure full index", 2021-03-30) provided an empty implementation ofensure_full_index(), declaring it in a new filesparse-index.h. When commit4300f8442a("sparse-index: implementensure_full_index()", 2021-03-30) fleshed out the implementation, it added an identical declaration tocache.h.Then
118a2e8bde("cache: moveensure_full_index()tocache.h", 2021-04-01) favored having the declaration incache.h. Because of the double declaration, at that point we could have just dropped the one insparse-index.h, but instead it got moved tocache.h.As a result,
cache.hcontains the exact same function declaration twice. Drop the one under "/* Name hashing */", in favor of the one under "/* Initialize and use the cache information */".Signed-off-by Martin Ågren <[email protected]>--- cache.h | 2 -- 1 file changed, 2 deletions(-)cache.h +0
-0@@ -350,8 +350,6 @@ void add_name_hash(struct index_state *istate, struct cache_entry *ce);void remove_name_hash (struct index_state *istate,struct cache_entry *ce);void free_name_hash (struct index_state *istate);
Quoted 7 lines
cache.h void add_name_hash(struct index_state *istate, struct cache_entry *ce); · line 355
Quoted 5 lines
cache.h +0
-2-void ensure_full_index (struct index_state *istate); -/* Cache entry creation and cleanup */ /* Thanks for cleaning up the duplicate, looks good to me!
Thanks, both.
A couple more duplicate declarations
Quoted 3 lines · Junio C Hamano
Quoted 1 line
Thanks for cleaning up the duplicate, looks good to me!
Thanks, both.
This is not urgent at all, given that we are about to enter the pre-release stabilization period and patches that might result from this message would become lower priority, but there are a couple of duplicate declarations, which I'll mention in order to help people to come back to them later.
* trace2_cmd_exit_fl() was added to git-compat-util.h and to trace2.h by ee4512ed (trace2: create new combined trace facility, 2019-02-22). Logically it belongs to the latter. Moving inclusion of the latter from <cache.h> to <git-compat-util.h> might be the lowest-cost fix, but there may be ramifications.
* xdl_emit_diff() is declared in xdiff/xdiffi.h and xdiff/xemit.h; I wonder if there is a caller that only includes one but not the other header. As they came from the same upstream-import commit, I wouldn't worry too much about it.