git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] [checkout-index] Give names to stages

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Dec 3, 2006, 09:49 UTC
Message-ID
<651451.91694.qm@web31813.mail.mud.yahoo.com>

One can now say "git-checkout-index --stage=ours ..." or "git-checkout-index --stage=theirs ...", instead of having to remember the corresponding number assigned to each stage.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 builtin-checkout-index.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
I find this quite helpful when resolving.
diff --git a/builtin-checkout-index.c b/builtin-checkout-index.c
index b097c88..d54a290 100644
--- a/builtin-checkout-index.c
+++ b/builtin-checkout-index.c
@@ -236,8 +236,17 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
 				int ch = arg[8];
 				if ('1' <= ch && ch <= '3')
 					checkout_stage = arg[8] - '0';
+				else if (!strncmp(arg+8, "ancestor", 8))
+					checkout_stage = 1;
+				else if (!strncmp(arg+8, "ours", 4))
+					checkout_stage = 2;
+				else if (!strncmp(arg+8, "HEAD", 4))
+					checkout_stage = 2;
+				else if (!strncmp(arg+8, "theirs", 6))
+					checkout_stage = 3;
 				else
-					die("stage should be between 1 and 3 or all");
+					die("stage should be "
+					    "(1|ancestor)|(2|ours|HEAD)|(3|theirs)");
 			}
 			continue;
 		}
-- 
1.4.4.1.gc87e
Message 1 of 1 in “[checkout-index] Give names to stages”
  1. [checkout-index] Give names to stagesLuben Tuikov, Dec 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.