Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH] merge-recursive: do not report the resulting tree object name

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:49
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

It is not available in the outermost merge, and it is only
useful for debugging merge-recursive in the inner merges.

Sergey Vlasov noticed that the old code accesses an
uninitialized location.

Signed-off-by: Junio C Hamano <redacted>
---

 Junio C Hamano [off-list ref] writes:

 > 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.

 So I'd commit this -- I tested it this time, with

 	if (result) *result = NULL

 at the beginning of that function.

 merge-recursive.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 5237021..b4acbb7 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1066,13 +1066,10 @@ static int merge_trees(struct tree *head,
 		path_list_clear(re_head, 0);
 		path_list_clear(entries, 1);
 
-	} else {
-		clean = 1;
-		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));
 	}
+	else
+		clean = 1;
+
 	if (index_only)
 		*result = git_write_tree();
 
-- 
1.5.0.rc1.g397d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help