From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] read-cache: hide refresh_cache_entry()
Date: Fri, 30 Oct 2026 10:43:44 +0100 [thread overview]
Message-ID: <auRm0Ohkg3OQIbWE@pks.im> (raw)
In-Reply-To: <xmqq4ie58syl.fsf@gitster.g>
On Wed, Oct 28, 2026 at 01:34:42PM -0700, Junio C Hamano wrote:
> Once upon a time, there was a merge strategy called "recursive",
> which was added in 6d297f8137 (Status update on merge-recursive in
> C, 2006-07-08). This implementation came with its own machinery
> that creates an in-core index entry, and then refreshed the index
> entry it created by calling the refresh_cache_entry() function
> borrowed from the read-cache.c API. refresh_cache_entry() used to
> be file-scope static, but was made public with this change.
>
> When ad45b327c0 (merge-recursive.[ch]: thoroughly debug these,
> 2025-04-08) finally removed the entire code for the "recursive"
> merge strategy, the last external caller of refresh_cache_entry()
> went with it.
>
> Hide the low-level implementation detail again by making it a
> file-scope static function. The external callers would indirectly
> call it when they call make_cache_entry() or rename_index_entry_at()
> external interface, which "ort" (the successor of "recursive") does.
Seeing all these patches dropping public declarations I wonder whether
they should have been part of the same patch series :)
> diff --git a/read-cache.c b/read-cache.c
> index c4cf08a3a3..94dff890a7 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -129,6 +129,8 @@ static struct mem_pool *find_mem_pool(struct index_state *istate)
> return *pool_ptr;
> }
>
> +static struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
> +
> static const char *alternate_index_output;
>
> static void set_index_entry(struct index_state *istate, int nr, struct cache_entry *ce)
Could we avoid this forward declaration by moving the function around?
Patrick
next prev parent reply other threads:[~2026-10-30 9:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 20:34 [PATCH] read-cache: hide refresh_cache_entry() Junio C Hamano
2026-10-30 9:43 ` Patrick Steinhardt [this message]
2026-10-30 15:46 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=auRm0Ohkg3OQIbWE@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox