Subject: [PATCH 01/17] rev-list: do not do commit simplification if simplify_history = 0

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Sun, 5 Sep 2010 16:47:28 +1000

This is just a workaround to make my series work. Currently, commit
chain will be simplified if pathspecs are given. That would make
pack-objects generate commit chain with gaps.

Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 Equivalence of Elijah's evil commit, 14/15.

 builtin/pack-objects.c |    1 +
 revision.c             |    2 +-
 upload-pack.c          |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0e81673..789f6bf 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2072,6 +2072,7 @@ static void get_object_list(int ac, const char **av)
 
 	init_revisions(&revs, NULL);
 	save_commit_buffer = 0;
+	revs.simplify_history = 0;
 	setup_revisions(ac, av, &revs, NULL);
 
 	while (fgets(line, sizeof(line), stdin) != NULL) {
diff --git a/revision.c b/revision.c
index 55c4586..ea64970 100644
--- a/revision.c
+++ b/revision.c
@@ -372,7 +372,7 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)
 	/*
 	 * If we don't do pruning, everything is interesting
 	 */
-	if (!revs->prune)
+	if (!revs->prune || !revs->simplify_history)
 		return;
 
 	if (!commit->tree)
diff --git a/upload-pack.c b/upload-pack.c
index fc79dde..cc1983f 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -115,6 +115,7 @@ static int do_rev_list(int in, int out, void *user_data)
 	revs.tag_objects = 1;
 	revs.tree_objects = 1;
 	revs.blob_objects = 1;
+	revs.simplify_history = 0;
 	if (use_thin_pack)
 		revs.edge_hint = 1;
 
-- 
1.7.1.rc1.69.g24c2f7