git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Victoria Dye <vdye@github.com>
Cc: "Martin Ågren" <martin.agren@gmail.com>,
	git@vger.kernel.org, "Derrick Stolee" <stolee@gmail.com>
Subject: Re: [PATCH] cache.h: drop duplicate `ensure_full_index()` declaration
Date: Mon, 10 Jan 2022 11:30:51 -0800	[thread overview]
Message-ID: <xmqqfspvz8us.fsf@gitster.g> (raw)
In-Reply-To: <c0a0798d-96fb-936b-3234-88e500eb86d0@github.com> (Victoria Dye's message of "Mon, 10 Jan 2022 13:57:21 -0500")

Victoria Dye <vdye@github.com> writes:

> Martin Ågren wrote:
>> 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 */".
>> 
>> Signed-off-by: Martin Ågren <martin.agren@gmail.com>
>> ---
>>  cache.h | 2 --
>>  1 file changed, 2 deletions(-)
>> 
>> diff --git a/cache.h b/cache.h
>> index 5d7463e6fb..281f00ab1b 100644
>> --- a/cache.h
>> +++ b/cache.h
>> @@ -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!

Thanks, both.

  reply	other threads:[~2022-01-10 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 18:41 [PATCH] cache.h: drop duplicate `ensure_full_index()` declaration Martin Ågren
2022-01-10 18:57 ` Victoria Dye
2022-01-10 19:30   ` Junio C Hamano [this message]
2022-01-10 19:52     ` A couple more duplicate declarations Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqfspvz8us.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=martin.agren@gmail.com \
    --cc=stolee@gmail.com \
    --cc=vdye@github.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).