The correct fix is to include the *relevant pieces* of all commits. But this is a quick stopgap that lets me test some stuff. Signed-off-by: Elijah Newren <newren@xxxxxxxxx> --- revision.c | 5 +++-- revision.h | 3 ++- upload-pack.c | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/revision.c b/revision.c index 67b1a1d..c411bda 100644 --- a/revision.c +++ b/revision.c @@ -335,7 +335,7 @@ static int rev_compare_tree(struct rev_info *revs, struct commit *parent, struct tree_difference = REV_TREE_SAME; DIFF_OPT_CLR(&revs->pruning, HAS_CHANGES); if (diff_tree_sha1(t1->object.sha1, t2->object.sha1, "", - &revs->pruning) < 0) + &revs->pruning) < 0 || revs->sparse_traversal) return REV_TREE_DIFFERENT; return tree_difference; } @@ -380,7 +380,8 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit) return; if (!commit->parents) { - if (rev_same_tree_as_empty(revs, commit)) + if (rev_same_tree_as_empty(revs, commit) && + !revs->sparse_traversal) commit->object.flags |= TREESAME; return; } diff --git a/revision.h b/revision.h index ba879c9..17865e8 100644 --- a/revision.h +++ b/revision.h @@ -85,7 +85,8 @@ struct rev_info { ignore_merges:1, combine_merges:1, dense_combined_merges:1, - always_show_header:1; + always_show_header:1, + sparse_traversal:1; /* Format info */ unsigned int shown_one:1, diff --git a/upload-pack.c b/upload-pack.c index 721197b..a58b350 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -120,6 +120,7 @@ static int do_rev_list(int in, int out, void *user_data) revs.blob_objects = 1; if (use_thin_pack) revs.edge_hint = 1; + revs.sparse_traversal = 1; for (i = 0; i < want_obj.nr; i++) { struct object *o = want_obj.objects[i].item; -- 1.7.2.2.140.gd06af -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html