Re: [PATCH] Speedup recursive by flushing index only once for all entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sergey Vlasov <vsu@xxxxxxxxxxx> writes:

> On Wed, 10 Jan 2007 11:28:14 -0800 Junio C Hamano wrote:
>
>> This revamps the merge-recursive implementation following the
>> outline in:
>> ...
> This commit broke t3401-rebase-partial.sh:
> ...
> ...and it is still used here - however, after the patch *result is
> uninitialized at this point.

Very true.  This untested patch should fix it.

Note that this stops (relative to the older
version of merge-recursive that always wrote a tree even when it
was not needed) reporting the tree object name for outermost
merge, but I think that reporting was primarily meant for people
who are debugging merge-recursive and did not have a real
value.  We could even remove the whole printf(), which I tend to
prefer.

--
diff --git a/merge-recursive.c b/merge-recursive.c
index 5237021..40c12aa 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1066,15 +1066,17 @@ static int merge_trees(struct tree *head,
 		path_list_clear(re_head, 0);
 		path_list_clear(entries, 1);
 
-	} else {
+	}
+	else
 		clean = 1;
+
+	if (index_only) {
+		*result = git_write_tree();
 		printf("merging of trees %s and %s resulted in %s\n",
 		       sha1_to_hex(head->object.sha1),
 		       sha1_to_hex(merge->object.sha1),
 		       sha1_to_hex((*result)->object.sha1));
 	}
-	if (index_only)
-		*result = git_write_tree();
 
 	return clean;
 }

-
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]