summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-15 20:26:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-15 23:53:51 (GMT)
commita74352867e689d50ee9c368f24d4a64392e27a35 (patch)
tree1569e2356883fa1bdabf282a82addc035190298a /revision.c
parent2ac5e4470b7a17303b10ba539d8aa84e870bade9 (diff)
downloadgit-a74352867e689d50ee9c368f24d4a64392e27a35.zip
git-a74352867e689d50ee9c368f24d4a64392e27a35.tar.gz
git-a74352867e689d50ee9c368f24d4a64392e27a35.tar.bz2
revision: propagate flag bits from tags to pointees
With the previous fix 895c5ba3 (revision: do not peel tags used in range notation, 2013-09-19), handle_revision_arg() that processes command line arguments for the "git log" family of commands no longer directly places the object pointed by the tag in the pending object array when it sees a tag object. We used to place pointee there after copying the flag bits like UNINTERESTING and SYMMETRIC_LEFT. This change meant that any flag that is relevant to later history traversal must now be propagated to the pointed objects (most often these are commits) while starting the traversal, which is partly done by handle_commit() that is called from prepare_revision_walk(). We did propagate UNINTERESTING, but did not do so for others, most notably SYMMETRIC_LEFT. This caused "git log --left-right v1.0..." (where "v1.0" is a tag) to start losing the "leftness" from the commit the tag points at. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/revision.c b/revision.c
index 28449c5..aec0333 100644
--- a/revision.c
+++ b/revision.c
@@ -273,6 +273,7 @@ static struct commit *handle_commit(struct rev_info *revs, struct object *object
return NULL;
die("bad object %s", sha1_to_hex(tag->tagged->sha1));
}
+ object->flags |= flags;
}
/*
@@ -284,7 +285,6 @@ static struct commit *handle_commit(struct rev_info *revs, struct object *object
if (parse_commit(commit) < 0)
die("unable to parse commit %s", name);
if (flags & UNINTERESTING) {
- commit->object.flags |= UNINTERESTING;
mark_parents_uninteresting(commit);
revs->limited = 1;
}
@@ -302,7 +302,6 @@ static struct commit *handle_commit(struct rev_info *revs, struct object *object
if (!revs->tree_objects)
return NULL;
if (flags & UNINTERESTING) {
- tree->object.flags |= UNINTERESTING;
mark_tree_contents_uninteresting(tree);
return NULL;
}
@@ -314,13 +313,10 @@ static struct commit *handle_commit(struct rev_info *revs, struct object *object
* Blob object? You know the drill by now..
*/
if (object->type == OBJ_BLOB) {
- struct blob *blob = (struct blob *)object;
if (!revs->blob_objects)
return NULL;
- if (flags & UNINTERESTING) {
- blob->object.flags |= UNINTERESTING;
+ if (flags & UNINTERESTING)
return NULL;
- }
add_pending_object(revs, object, "");
return NULL;
}