Merge branch 'jc/revision-range-unpeel'
"git log --left-right A...B" lost the "leftness" of commits reachable from A when A is a tag as a side effect of a recent bugfix. This is a regression in 1.8.4.x series. * jc/revision-range-unpeel: revision: propagate flag bits from tags to pointees revision: mark contents of an uninteresting tree uninteresting
This commit is contained in:
commit
63763273de
28
revision.c
28
revision.c
@ -104,17 +104,12 @@ static void mark_blob_uninteresting(struct blob *blob)
|
|||||||
blob->object.flags |= UNINTERESTING;
|
blob->object.flags |= UNINTERESTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mark_tree_uninteresting(struct tree *tree)
|
static void mark_tree_contents_uninteresting(struct tree *tree)
|
||||||
{
|
{
|
||||||
struct tree_desc desc;
|
struct tree_desc desc;
|
||||||
struct name_entry entry;
|
struct name_entry entry;
|
||||||
struct object *obj = &tree->object;
|
struct object *obj = &tree->object;
|
||||||
|
|
||||||
if (!tree)
|
|
||||||
return;
|
|
||||||
if (obj->flags & UNINTERESTING)
|
|
||||||
return;
|
|
||||||
obj->flags |= UNINTERESTING;
|
|
||||||
if (!has_sha1_file(obj->sha1))
|
if (!has_sha1_file(obj->sha1))
|
||||||
return;
|
return;
|
||||||
if (parse_tree(tree) < 0)
|
if (parse_tree(tree) < 0)
|
||||||
@ -142,6 +137,18 @@ void mark_tree_uninteresting(struct tree *tree)
|
|||||||
free_tree_buffer(tree);
|
free_tree_buffer(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mark_tree_uninteresting(struct tree *tree)
|
||||||
|
{
|
||||||
|
struct object *obj = &tree->object;
|
||||||
|
|
||||||
|
if (!tree)
|
||||||
|
return;
|
||||||
|
if (obj->flags & UNINTERESTING)
|
||||||
|
return;
|
||||||
|
obj->flags |= UNINTERESTING;
|
||||||
|
mark_tree_contents_uninteresting(tree);
|
||||||
|
}
|
||||||
|
|
||||||
void mark_parents_uninteresting(struct commit *commit)
|
void mark_parents_uninteresting(struct commit *commit)
|
||||||
{
|
{
|
||||||
struct commit_list *parents = NULL, *l;
|
struct commit_list *parents = NULL, *l;
|
||||||
@ -276,6 +283,7 @@ static struct commit *handle_commit(struct rev_info *revs,
|
|||||||
return NULL;
|
return NULL;
|
||||||
die("bad object %s", sha1_to_hex(tag->tagged->sha1));
|
die("bad object %s", sha1_to_hex(tag->tagged->sha1));
|
||||||
}
|
}
|
||||||
|
object->flags |= flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -287,7 +295,6 @@ static struct commit *handle_commit(struct rev_info *revs,
|
|||||||
if (parse_commit(commit) < 0)
|
if (parse_commit(commit) < 0)
|
||||||
die("unable to parse commit %s", name);
|
die("unable to parse commit %s", name);
|
||||||
if (flags & UNINTERESTING) {
|
if (flags & UNINTERESTING) {
|
||||||
commit->object.flags |= UNINTERESTING;
|
|
||||||
mark_parents_uninteresting(commit);
|
mark_parents_uninteresting(commit);
|
||||||
revs->limited = 1;
|
revs->limited = 1;
|
||||||
}
|
}
|
||||||
@ -305,7 +312,7 @@ static struct commit *handle_commit(struct rev_info *revs,
|
|||||||
if (!revs->tree_objects)
|
if (!revs->tree_objects)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (flags & UNINTERESTING) {
|
if (flags & UNINTERESTING) {
|
||||||
mark_tree_uninteresting(tree);
|
mark_tree_contents_uninteresting(tree);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
add_pending_object(revs, object, "");
|
add_pending_object(revs, object, "");
|
||||||
@ -316,13 +323,10 @@ static struct commit *handle_commit(struct rev_info *revs,
|
|||||||
* Blob object? You know the drill by now..
|
* Blob object? You know the drill by now..
|
||||||
*/
|
*/
|
||||||
if (object->type == OBJ_BLOB) {
|
if (object->type == OBJ_BLOB) {
|
||||||
struct blob *blob = (struct blob *)object;
|
|
||||||
if (!revs->blob_objects)
|
if (!revs->blob_objects)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (flags & UNINTERESTING) {
|
if (flags & UNINTERESTING)
|
||||||
mark_blob_uninteresting(blob);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
add_pending_object(revs, object, "");
|
add_pending_object(revs, object, "");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -56,4 +56,21 @@ test_expect_success 'rev-list A..B and rev-list ^A B are the same' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'propagate uninteresting flag down correctly' '
|
||||||
|
git rev-list --objects ^HEAD^{tree} HEAD^{tree} >actual &&
|
||||||
|
>expect &&
|
||||||
|
test_cmp expect actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'symleft flag bit is propagated down from tag' '
|
||||||
|
git log --format="%m %s" --left-right v1.0...master >actual &&
|
||||||
|
cat >expect <<-\EOF &&
|
||||||
|
> two
|
||||||
|
> one
|
||||||
|
< another
|
||||||
|
< that
|
||||||
|
EOF
|
||||||
|
test_cmp expect actual
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user