Re: [PATCH v12 3/4] sequencer: teach autostash apply to take optional conflict marker labels
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Apr 14, 2026, 14:06 UTC
- Message-ID
- <ebb65b1d-879f-4d9f-b25e-fe1c58a47ff7@gmail.com>
- In-Reply-To
- <4593745e90d7c897463fcb4835ecfac70a088b8e.1776171585.git.gitgitgadget@gmail.com>
Hi Harald
On 14/04/2026 13:59, Harald Nordgren via GitGitGadget wrote:
Show 23 quoted lines
> From: Harald Nordgren <haraldnordgren@gmail.com> > > 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 <haraldnordgren@gmail.com> > [...] > 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.
Show 12 quoted lines
> 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