summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-10-31 14:22:34 -0800
committerJunio C Hamano <junkio@cox.net>2006-10-31 14:22:34 -0800
commit62476c8e331a22e224d87c18830913129f5f303b (patch)
treef81057bf5002f016d26a82d055ff694f31ab2e43 /revision.c
parent0d981c67d8bcf4610e165744059c1e9e14609baa (diff)
downloadgit-62476c8e331a22e224d87c18830913129f5f303b.tar.gz
Introduce a new revision set operator <rev>^!
This is a shorthand for "<rev> --not <rev>^@", i.e. "include this commit but exclude any of its parents". When a new file $F is introduced by revision $R, this notation can be used to find a copy-and-paste from existing file in the parents of that revision without annotating the ancestry of the lines that were copied from: git pickaxe -f -C $R^! -- $F Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index f1e0caaae3..b021d3354e 100644
--- a/revision.c
+++ b/revision.c
@@ -660,6 +660,13 @@ int handle_revision_arg(const char *arg, struct rev_info *revs,
return 0;
*dotdot = '^';
}
+ dotdot = strstr(arg, "^!");
+ if (dotdot && !dotdot[2]) {
+ *dotdot = 0;
+ if (!add_parents_only(revs, arg, flags ^ UNINTERESTING))
+ *dotdot = '^';
+ }
+
local_flags = 0;
if (*arg == '^') {
local_flags = UNINTERESTING;