aboutsummaryrefslogtreecommitdiffstats
path: root/rev-tree.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2005-04-12 12:35:11 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-12 12:35:11 -0700
commit727ff277878490f50a3acefdd1ce6a94b3c9f4c2 (patch)
tree7ab8bf31e1f8df4e485bbf198c2579fc6b2b5cb9 /rev-tree.c
parentc0fb976aa779c508314305f309f240fa6bfc3128 (diff)
downloadgit-727ff277878490f50a3acefdd1ce6a94b3c9f4c2.tar.gz
[PATCH] rev-tree support for "in X but not in Y".
To do the automated commit-mailing I need to be able to answer the question "which commits are here today but weren't yesterday"... i.e. given two commit-ids $HEAD and $YESTERDAY I want to be able to do: rev-tree $HEAD ^$YESTERDAY to list those commits which are in the tree now but weren't ancestors of yesterday's head. Yes, I could probably do this with rev-tree $HEAD $YESTERDAY | egrep -v ^[a-z0-9]*:3 but I prefer not to.
Diffstat (limited to 'rev-tree.c')
-rw-r--r--rev-tree.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/rev-tree.c b/rev-tree.c
index 7669c5ed18..21598d6170 100644
--- a/rev-tree.c
+++ b/rev-tree.c
@@ -14,6 +14,7 @@
#define SEEN 0x10000
static int show_edges = 0;
+static int basemask = 0;
struct parent {
struct revision *parent;
@@ -180,6 +181,9 @@ static int interesting(struct revision *rev)
}
return 0;
}
+ if (mask & basemask)
+ return 0;
+
return 1;
}
@@ -214,6 +218,10 @@ int main(int argc, char **argv)
continue;
}
+ if (arg[0] == '^') {
+ arg++;
+ basemask |= 1<<nr;
+ }
if (nr >= MAX_COMMITS || get_sha1_hex(arg, sha1[nr]))
usage("rev-tree [--edges] [--cache <cache-file>] <commit-id> [<commit-id>]");
parse_commit(sha1[nr]);