From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: git@vger.kernel.org, 重田一聖 <kazumasa.shigeta@kanamei.com>
Subject: Re: [PATCH v4 7/7] stash: simplify reset_tree() function signature
Date: Thu, 05 Nov 2026 17:59:12 -0800 [thread overview]
Message-ID: <xmqqo6c2oh3j.fsf@gitster.g> (raw)
In-Reply-To: <f61ebbf9a3e1196dea36e5fbcf4294c6addad222.1792767795.git.phillip.wood@dunelm.org.uk> (Phillip Wood's message of "Fri, 23 Oct 2026 16:03:35 +0100")
Phillip Wood <phillip.wood123@gmail.com> writes:
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> There is only one caller and it does not want to update the worktree or
> reset the index so remove those unused parameters.
>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---
> builtin/stash.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
Ah, an obvious simplification. Very nice.
>
> diff --git a/builtin/stash.c b/builtin/stash.c
> index f97cd4771a5..f0e3053ab49 100644
> --- a/builtin/stash.c
> +++ b/builtin/stash.c
> @@ -332,7 +332,7 @@ static int clear_stash(int argc, const char **argv, const char *prefix,
> return do_clear_stash();
> }
>
> -static int reset_tree(struct object_id *i_tree, int update, int reset)
> +static int reset_tree(struct object_id *i_tree)
> {
> int nr_trees = 1;
> struct unpack_trees_options opts;
> @@ -358,10 +358,6 @@ static int reset_tree(struct object_id *i_tree, int update, int reset)
> opts.src_index = the_repository->index;
> opts.dst_index = the_repository->index;
> opts.merge = 1;
> - opts.reset = reset ? UNPACK_RESET_PROTECT_UNTRACKED : 0;
> - opts.update = update;
> - if (update)
> - opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
> opts.fn = oneway_merge;
>
> if (unpack_trees(nr_trees, t, &opts))
> @@ -738,7 +734,7 @@ static enum stash_apply_result do_apply_stash(const char *prefix,
> }
>
> if (has_index) {
> - if (reset_tree(&index_tree, 0, 0))
> + if (reset_tree(&index_tree))
> ret = -1;
> } else {
> unstage_changes_unless_new(&c_tree);
next prev parent reply other threads:[~2026-11-06 1:59 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 16:35 [PATCH 0/2] stash: stop checking for changes twice Phillip Wood
2026-10-05 16:35 ` [PATCH 1/2] stash create: remove duplicate changes detection Phillip Wood
2026-10-06 12:44 ` Junio C Hamano
2026-10-07 13:49 ` Phillip Wood
2026-10-05 16:35 ` [PATCH 2/2] stash push: " Phillip Wood
2026-10-06 14:27 ` Junio C Hamano
2026-10-07 13:46 ` Phillip Wood
2026-10-07 17:15 ` Junio C Hamano
2026-10-08 13:35 ` Phillip Wood
2026-10-14 15:40 ` [PATCH v2 0/7] stash creation: avoid unecessary index loads and refreshes Phillip Wood
2026-10-14 15:40 ` [PATCH v2 1/7] stash: use an enum for create status Phillip Wood
2026-10-14 15:40 ` [PATCH v2 2/7] stash create: remove duplicate changes detection Phillip Wood
2026-10-14 15:40 ` [PATCH v2 3/7] stash push: " Phillip Wood
2026-10-14 15:40 ` [PATCH v2 4/7] stash push: avoid duplicate calls to preload_index() Phillip Wood
2026-10-14 18:09 ` Junio C Hamano
2026-10-14 15:40 ` [PATCH v2 5/7] stash create: rework temporary index creation Phillip Wood
2026-10-14 18:16 ` Junio C Hamano
2026-10-20 14:54 ` Phillip Wood
2026-10-14 15:40 ` [PATCH v2 6/7] stash create: remove unnecessary index load and refresh Phillip Wood
2026-10-14 18:21 ` Junio C Hamano
2026-10-14 15:40 ` [PATCH v2 7/7] stash: simplify reset_tree() function signature Phillip Wood
2026-10-20 15:20 ` [PATCH v3 0/7] stash creation: avoid unecessary index loads and refreshes Phillip Wood
2026-10-20 15:20 ` [PATCH v3 1/7] stash: use an enum for create status Phillip Wood
2026-10-21 6:07 ` Junio C Hamano
2026-10-22 15:57 ` Phillip Wood
2026-10-22 17:01 ` Junio C Hamano
2026-10-22 18:33 ` Phillip Wood
2026-10-20 15:20 ` [PATCH v3 2/7] stash create: remove duplicate changes detection Phillip Wood
2026-10-20 15:20 ` [PATCH v3 3/7] stash push: " Phillip Wood
2026-10-20 15:20 ` [PATCH v3 4/7] stash push: avoid duplicate calls to preload_index() Phillip Wood
2026-10-20 15:20 ` [PATCH v3 5/7] stash create: rework temporary index creation Phillip Wood
2026-10-20 22:07 ` Junio C Hamano
2026-10-20 15:20 ` [PATCH v3 6/7] stash create: remove unnecessary index load and refresh Phillip Wood
2026-10-20 15:20 ` [PATCH v3 7/7] stash: simplify reset_tree() function signature Phillip Wood
2026-10-21 0:07 ` [PATCH v3 0/7] stash creation: avoid unecessary index loads and refreshes Junio C Hamano
2026-10-23 15:03 ` [PATCH v4 " Phillip Wood
2026-10-23 15:03 ` [PATCH v4 1/7] stash: use an enum for create status Phillip Wood
2026-10-23 15:03 ` [PATCH v4 2/7] stash create: remove duplicate changes detection Phillip Wood
2026-10-23 15:03 ` [PATCH v4 3/7] stash push: " Phillip Wood
2026-10-23 15:03 ` [PATCH v4 4/7] stash push: avoid duplicate calls to preload_index() Phillip Wood
2026-10-23 15:03 ` [PATCH v4 5/7] stash create: rework temporary index creation Phillip Wood
2026-11-05 21:55 ` Junio C Hamano
2026-10-23 15:03 ` [PATCH v4 6/7] stash create: remove unnecessary index load and refresh Phillip Wood
2026-11-06 1:59 ` Junio C Hamano
2026-10-23 15:03 ` [PATCH v4 7/7] stash: simplify reset_tree() function signature Phillip Wood
2026-11-06 1:59 ` Junio C Hamano [this message]
2026-11-05 21:52 ` [PATCH v4 0/7] stash creation: avoid unecessary index loads and refreshes 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=xmqqo6c2oh3j.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kazumasa.shigeta@kanamei.com \
--cc=phillip.wood123@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.