{"thread":{"id":"66697","subject":"[PATCH] unpack-trees: hide verify_uptodate()","startedAt":"2026-10-28T21:03:08Z","lastAt":"2026-10-30T09:31:26Z","messageCount":2,"participants":["Junio C Hamano","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"556709","messageId":"xmqqqzh97d2r.fsf@gitster.g","threadId":"66697","inReplyTo":null,"subject":"[PATCH] unpack-trees: hide verify_uptodate()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-28T21:03:08Z","receivedAt":"2026-10-28T21:03:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"64b1abe962 (merge-recursive: fix overwriting dirty files involved in\nrenames, 2018-04-19) made this function available to external callers.\n\nWith the removal of the \"recursive\" strategy in ad45b327c0\n(merge-recursive.[ch]: thoroughly debug these, 2025-04-08), the last\nexternal caller of this function want away.\n\nMake it file-scope static again.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n unpack-trees.c | 4 ++--\n unpack-trees.h | 3 ---\n 2 files changed, 2 insertions(+), 5 deletions(-)\n\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex 1802809ad3..3298773490 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -2269,8 +2269,8 @@ static int verify_uptodate_1(const struct cache_entry *ce,\n \treturn add_rejected_path(o, error_type, ce->name);\n }\n \n-int verify_uptodate(const struct cache_entry *ce,\n-\t\t    struct unpack_trees_options *o)\n+static int verify_uptodate(const struct cache_entry *ce,\n+\t\t\t   struct unpack_trees_options *o)\n {\n \tif (!o->skip_sparse_checkout &&\n \t    (ce->ce_flags & CE_SKIP_WORKTREE) &&\ndiff --git a/unpack-trees.h b/unpack-trees.h\nindex 5867e26e17..638a6b076d 100644\n--- a/unpack-trees.h\n+++ b/unpack-trees.h\n@@ -123,9 +123,6 @@ enum update_sparsity_result {\n enum update_sparsity_result update_sparsity(struct unpack_trees_options *options,\n \t\t\t\t\t    struct pattern_list *pl);\n \n-int verify_uptodate(const struct cache_entry *ce,\n-\t\t    struct unpack_trees_options *o);\n-\n int threeway_merge(const struct cache_entry * const *stages,\n \t\t   struct unpack_trees_options *o);\n int twoway_merge(const struct cache_entry * const *src,\n-- \n2.56.0-433-ga9209adf11\n\n\n"},{"id":"556865","messageId":"auRj7rRyg15WYiFc@pks.im","threadId":"66697","inReplyTo":"xmqqqzh97d2r.fsf@gitster.g","subject":"Re: [PATCH] unpack-trees: hide verify_uptodate()","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-10-30T09:31:26Z","receivedAt":"2026-10-30T09:31:26Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Oct 28, 2026 at 02:03:08PM -0700, Junio C Hamano wrote:\n> 64b1abe962 (merge-recursive: fix overwriting dirty files involved in\n> renames, 2018-04-19) made this function available to external callers.\n> \n> With the removal of the \"recursive\" strategy in ad45b327c0\n> (merge-recursive.[ch]: thoroughly debug these, 2025-04-08), the last\n\nHeh, this commit message confused me for a second, until I remembered\nthe discussion that we had around it back then.\n\n> external caller of this function want away.\n\nBut history checks out...\n\n> diff --git a/unpack-trees.c b/unpack-trees.c\n> index 1802809ad3..3298773490 100644\n> --- a/unpack-trees.c\n> +++ b/unpack-trees.c\n> @@ -2269,8 +2269,8 @@ static int verify_uptodate_1(const struct cache_entry *ce,\n>  \treturn add_rejected_path(o, error_type, ce->name);\n>  }\n>  \n> -int verify_uptodate(const struct cache_entry *ce,\n> -\t\t    struct unpack_trees_options *o)\n> +static int verify_uptodate(const struct cache_entry *ce,\n> +\t\t\t   struct unpack_trees_options *o)\n>  {\n>  \tif (!o->skip_sparse_checkout &&\n>  \t    (ce->ce_flags & CE_SKIP_WORKTREE) &&\n> diff --git a/unpack-trees.h b/unpack-trees.h\n> index 5867e26e17..638a6b076d 100644\n> --- a/unpack-trees.h\n> +++ b/unpack-trees.h\n> @@ -123,9 +123,6 @@ enum update_sparsity_result {\n>  enum update_sparsity_result update_sparsity(struct unpack_trees_options *options,\n>  \t\t\t\t\t    struct pattern_list *pl);\n>  \n> -int verify_uptodate(const struct cache_entry *ce,\n> -\t\t    struct unpack_trees_options *o);\n> -\n\n... and the diff looks good. So assuming this compiles and links the\nchange is obviously correct.\n\nThanks!\n\nPatrick\n\n"}]}