path: root/revision.c
diff options
authorLinus Torvalds <>2006-04-15 19:09:56 (GMT)
committerJunio C Hamano <>2006-04-16 07:13:38 (GMT)
commitba1d45051e050cbcf68ccccacea86a4b6ecde731 (patch)
tree1c2d22f50d2dd5a78f8626d5ec5f19f5e8cc651f /revision.c
parent5b84f4d87a1bd58c7540e9ea82ee3673ecddbad5 (diff)
Tentative built-in "git show"
This uses the "--no-walk" flag that I never actually implemented (but I'm sure I mentioned it) to make "git show" be essentially the same thing as "git whatchanged --no-walk". It just refuses to add more interesting parents to the revision walking history, so you don't actually get any history, you just get the commit you asked for. I was going to add "--no-walk" as a real argument flag to git-rev-list too, but I'm not sure anybody actually needs it. Although it might be useful for porcelain, so I left the door open. [jc: ported to the unified option structure by Linus] Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'revision.c')
1 files changed, 5 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index 9693b6e..f8fb028 100644
--- a/revision.c
+++ b/revision.c
@@ -380,6 +380,9 @@ static void add_parents_to_list(struct rev_info *revs, struct commit *commit, st
if (revs->prune_fn)
revs->prune_fn(revs, commit);
+ if (revs->no_walk)
+ return;
parent = commit->parents;
while (parent) {
struct commit *p = parent->item;
@@ -816,6 +819,8 @@ void prepare_revision_walk(struct rev_info *revs)
list = list->next;
+ if (revs->no_walk)
+ return;
if (revs->limited)
if (revs->topo_order)