Re: [PATCH v2 3/9] reset: modernize flags passed to `reset_head()`
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 5, 2026, 15:08 UTC
- Message-ID
- <9e2cb34b-97f6-44f4-be44-60f44760e601@gmail.com>
- In-Reply-To
- <20260603-b4-pks-history-drop-v2-3-742cb5b5176d@pks.im>
Hi Patrick
On 03/06/2026 17:14, Patrick Steinhardt wrote:
> -/* Update ORIG_HEAD as well as HEAD */ > -#define RESET_ORIG_HEAD (1<<4)
> [...]> + /* Update ORIG_HEAD as well as HEAD */
> + RESET_HEAD_ORIG_HEAD = (1 << 4),
I'm having a hard time parsing this new name, if we must have a "RESET_HEAD_" prefix can we call it something like RESET_HEAD_UPDATE_ORIG_HEAD?
Thanks
Phillip
Show 36 quoted lines
> +};
>
> struct reset_head_opts {
> /*
> @@ -33,7 +39,7 @@ struct reset_head_opts {
> /*
> * Flags defined above.
> */
> - unsigned flags;
> + enum reset_head_flags flags;
> /*
> * Optional reflog message for branch, defaults to head_msg.
> */
> @@ -45,7 +51,7 @@ struct reset_head_opts {
> const char *head_msg;
> /*
> * Optional reflog message for ORIG_HEAD, if this omitted and flags
> - * contains RESET_ORIG_HEAD then default_reflog_action must be given.
> + * contains RESET_HEAD_ORIG_HEAD then default_reflog_action must be given.
> */
> const char *orig_head_msg;
> /*
> diff --git a/sequencer.c b/sequencer.c
> index 1ee4b2875b..0b89a977b0 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -4870,7 +4870,7 @@ static int checkout_onto(struct repository *r, struct replay_opts *opts,
> struct reset_head_opts ropts = {
> .oid = onto,
> .orig_head = orig_head,
> - .flags = RESET_HEAD_DETACH | RESET_ORIG_HEAD |
> + .flags = RESET_HEAD_DETACH | RESET_HEAD_ORIG_HEAD |
> RESET_HEAD_RUN_POST_CHECKOUT_HOOK,
> .head_msg = reflog_message(opts, "start", "checkout %s",
> onto_name),
>