From 62476c8e331a22e224d87c18830913129f5f303b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 31 Oct 2006 14:22:34 -0800 Subject: Introduce a new revision set operator ^! This is a shorthand for " --not ^@", 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 --- revision.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'revision.c') diff --git a/revision.c b/revision.c index f1e0caaae..b021d3354 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; -- cgit v1.2.1