Git development
 help / color / mirror / Atom feed
* [PATCH] [checkout-index] Give names to stages
@ 2006-12-03  9:49 Luben Tuikov
  2006-12-04  2:00 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Luben Tuikov @ 2006-12-03  9:49 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

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.


[-- Attachment #2: 1207600725-p1.txt --]
[-- Type: text/plain, Size: 808 bytes --]

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-12-04 11:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-03  9:49 [PATCH] [checkout-index] Give names to stages Luben Tuikov
2006-12-04  2:00 ` Junio C Hamano
2006-12-04  5:18   ` Luben Tuikov
2006-12-04  6:32     ` Junio C Hamano
2006-12-04  6:59       ` Luben Tuikov
2006-12-04 10:52     ` Johannes Schindelin
2006-12-04 11:36       ` Jakub Narebski
2006-12-04 11:39         ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox