Subject: Re: [PATCH v12 3/4] sequencer: teach autostash apply to take optional conflict marker labels

From: Phillip Wood <[email-masked]>
Date: Tue, 14 Apr 2026 15:06:39 +0100

Hi Harald

On 14/04/2026 13:59, Harald Nordgren via GitGitGadget wrote:
> From: Harald Nordgren <[email-masked]>
> 
> Add label_ours, label_theirs, and label_base parameters to the autostash
> apply machinery so callers can pass custom conflict marker labels
> through to "git stash apply --label-ours/--label-theirs/--label-base".
> Introduce apply_autostash_ref_with_labels() for callers that want
> to pass labels.
> 
> Signed-off-by: Harald Nordgren <[email-masked]>
> [...]
> diff --git a/sequencer.c b/sequencer.c
> index 780628aab4..c2516000bd 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -4732,7 +4732,10 @@ void create_autostash_ref_with_msg_silent(struct repository *r, const char *refn
>   	create_autostash_internal(r, NULL, refname, message, true);
>   }
>   
> -static int apply_save_autostash_oid(const char *stash_oid, int attempt_apply)
> +static int apply_save_autostash_oid(const char *stash_oid, int attempt_apply,
> +				    const char *label_ours, const char *label_theirs,
> +				    const char *label_base,
> +				    const char *stash_msg)

I'm confused why to need to provide a message when we're storing an 
existing stash that already has the message that we want to use.
> diff --git a/sequencer.h b/sequencer.h
> index 5d3bc83314..b0c891d3b6 100644
> --- a/sequencer.h
> +++ b/sequencer.h
> @@ -237,6 +237,10 @@ int save_autostash_ref(struct repository *r, const char *refname);
>   int apply_autostash(const char *path);
>   int apply_autostash_oid(const char *stash_oid);
>   int apply_autostash_ref(struct repository *r, const char *refname);
> +int apply_autostash_ref_with_labels(struct repository *r, const char *refname,
> +				    const char *label_ours, const char *label_theirs,
> +				    const char *label_base,
> +				    const char *stash_msg);

Do we need a new function, or can we just update the existing callers to 
pass NULL? In the future I think we'll want to pass better conflict 
labels and updating them now to pass NULL makes that easier.

Thanks

Phillip