Thread (119 messages) 119 messages, 6 authors, 4d ago

Re: [PATCH v2 3/9] reset: modernize flags passed to `reset_head()`

From: Phillip Wood <hidden>
Date: 2026-06-05 15:09:14

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
quoted hunk ↗ jump to hunk
+};
  
  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),
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help