{"thread":{"id":"57218","subject":"[PATCH] cache.h: drop duplicate `ensure_full_index()` declaration","startedAt":"2022-01-10T18:42:27Z","lastAt":"2022-01-10T19:52:06Z","messageCount":4,"participants":["Martin Ågren","Victoria Dye","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"445856","messageId":"20220110184134.18675-1-martin.agren@gmail.com","threadId":"57218","inReplyTo":null,"subject":"[PATCH] cache.h: drop duplicate `ensure_full_index()` declaration","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2022-01-10T18:41:34Z","receivedAt":"2022-01-10T18:42:27Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"There are two identical declarations of `ensure_full_index()` in\ncache.h.\n\nCommit 3964fc2aae (\"sparse-index: add guard to ensure full index\",\n2021-03-30) provided an empty implementation of `ensure_full_index()`,\ndeclaring it in a new file sparse-index.h. When commit 4300f8442a\n(\"sparse-index: implement ensure_full_index()\", 2021-03-30) fleshed out\nthe implementation, it added an identical declaration to cache.h.\n\nThen 118a2e8bde (\"cache: move ensure_full_index() to cache.h\",\n2021-04-01) favored having the declaration in cache.h. Because of the\ndouble declaration, at that point we could have just dropped the one in\nsparse-index.h, but instead it got moved to cache.h.\n\nAs a result, cache.h contains the exact same function declaration twice.\nDrop the one under \"/* Name hashing */\", in favor of the one under\n\"/* Initialize and use the cache information */\".\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\n---\n cache.h | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 5d7463e6fb..281f00ab1b 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -350,8 +350,6 @@ void add_name_hash(struct index_state *istate, struct cache_entry *ce);\n void remove_name_hash(struct index_state *istate, struct cache_entry *ce);\n void free_name_hash(struct index_state *istate);\n \n-void ensure_full_index(struct index_state *istate);\n-\n /* Cache entry creation and cleanup */\n \n /*\n-- \n2.34.1.703.g22d0c6ccf7\n\n"},{"id":"445857","messageId":"c0a0798d-96fb-936b-3234-88e500eb86d0@github.com","threadId":"57218","inReplyTo":"20220110184134.18675-1-martin.agren@gmail.com","subject":"Re: [PATCH] cache.h: drop duplicate `ensure_full_index()` declaration","fromName":"Victoria Dye","fromEmail":"vdye@github.com","sentAt":"2022-01-10T18:57:21Z","receivedAt":"2022-01-10T18:57:24Z","isPatch":true,"sender":{"key":"vdye@github.com","avatar":"https://avatars.githubusercontent.com/u/3619353?v=4"},"body":"Martin Ågren wrote:\n> There are two identical declarations of `ensure_full_index()` in\n> cache.h.\n> \n> Commit 3964fc2aae (\"sparse-index: add guard to ensure full index\",\n> 2021-03-30) provided an empty implementation of `ensure_full_index()`,\n> declaring it in a new file sparse-index.h. When commit 4300f8442a\n> (\"sparse-index: implement ensure_full_index()\", 2021-03-30) fleshed out\n> the implementation, it added an identical declaration to cache.h.\n> \n> Then 118a2e8bde (\"cache: move ensure_full_index() to cache.h\",\n> 2021-04-01) favored having the declaration in cache.h. Because of the\n> double declaration, at that point we could have just dropped the one in\n> sparse-index.h, but instead it got moved to cache.h.\n> \n> As a result, cache.h contains the exact same function declaration twice.\n> Drop the one under \"/* Name hashing */\", in favor of the one under\n> \"/* Initialize and use the cache information */\".\n> \n> Signed-off-by: Martin Ågren <martin.agren@gmail.com>\n> ---\n>  cache.h | 2 --\n>  1 file changed, 2 deletions(-)\n> \n> diff --git a/cache.h b/cache.h\n> index 5d7463e6fb..281f00ab1b 100644\n> --- a/cache.h\n> +++ b/cache.h\n> @@ -350,8 +350,6 @@ void add_name_hash(struct index_state *istate, struct cache_entry *ce);\n>  void remove_name_hash(struct index_state *istate, struct cache_entry *ce);\n>  void free_name_hash(struct index_state *istate);\n>  \n> -void ensure_full_index(struct index_state *istate);\n> -\n>  /* Cache entry creation and cleanup */\n>  \n>  /*\n\nThanks for cleaning up the duplicate, looks good to me!\n"},{"id":"445869","messageId":"xmqqfspvz8us.fsf@gitster.g","threadId":"57218","inReplyTo":"c0a0798d-96fb-936b-3234-88e500eb86d0@github.com","subject":"Re: [PATCH] cache.h: drop duplicate `ensure_full_index()` declaration","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-01-10T19:30:51Z","receivedAt":"2022-01-10T19:30:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Victoria Dye <vdye@github.com> writes:\n\n> Martin Ågren wrote:\n>> There are two identical declarations of `ensure_full_index()` in\n>> cache.h.\n>> \n>> Commit 3964fc2aae (\"sparse-index: add guard to ensure full index\",\n>> 2021-03-30) provided an empty implementation of `ensure_full_index()`,\n>> declaring it in a new file sparse-index.h. When commit 4300f8442a\n>> (\"sparse-index: implement ensure_full_index()\", 2021-03-30) fleshed out\n>> the implementation, it added an identical declaration to cache.h.\n>> \n>> Then 118a2e8bde (\"cache: move ensure_full_index() to cache.h\",\n>> 2021-04-01) favored having the declaration in cache.h. Because of the\n>> double declaration, at that point we could have just dropped the one in\n>> sparse-index.h, but instead it got moved to cache.h.\n>> \n>> As a result, cache.h contains the exact same function declaration twice.\n>> Drop the one under \"/* Name hashing */\", in favor of the one under\n>> \"/* Initialize and use the cache information */\".\n>> \n>> Signed-off-by: Martin Ågren <martin.agren@gmail.com>\n>> ---\n>>  cache.h | 2 --\n>>  1 file changed, 2 deletions(-)\n>> \n>> diff --git a/cache.h b/cache.h\n>> index 5d7463e6fb..281f00ab1b 100644\n>> --- a/cache.h\n>> +++ b/cache.h\n>> @@ -350,8 +350,6 @@ void add_name_hash(struct index_state *istate, struct cache_entry *ce);\n>>  void remove_name_hash(struct index_state *istate, struct cache_entry *ce);\n>>  void free_name_hash(struct index_state *istate);\n>>  \n>> -void ensure_full_index(struct index_state *istate);\n>> -\n>>  /* Cache entry creation and cleanup */\n>>  \n>>  /*\n>\n> Thanks for cleaning up the duplicate, looks good to me!\n\nThanks, both.\n"},{"id":"445871","messageId":"xmqqwnj7xtb2.fsf_-_@gitster.g","threadId":"57218","inReplyTo":"xmqqfspvz8us.fsf@gitster.g","subject":"A couple more duplicate declarations","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-01-10T19:52:01Z","receivedAt":"2022-01-10T19:52:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> Thanks for cleaning up the duplicate, looks good to me!\n>\n> Thanks, both.\n\nThis is not urgent at all, given that we are about to enter the\npre-release stabilization period and patches that might result from\nthis message would become lower priority, but there are a couple of\nduplicate declarations, which I'll mention in order to help people\nto come back to them later.\n\n* trace2_cmd_exit_fl() was added to git-compat-util.h and to\n  trace2.h by ee4512ed (trace2: create new combined trace facility,\n  2019-02-22).  Logically it belongs to the latter.  Moving\n  inclusion of the latter from <cache.h> to <git-compat-util.h>\n  might be the lowest-cost fix, but there may be ramifications.\n\n* xdl_emit_diff() is declared in xdiff/xdiffi.h and xdiff/xemit.h; I\n  wonder if there is a caller that only includes one but not the\n  other header.  As they came from the same upstream-import commit,\n  I wouldn't worry too much about it.\n\n"}]}