From 9c129eab99f16d7bb174b35573e68ae6a5d02efe Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Thu, 16 May 2013 18:32:36 +0300 Subject: simplify-merges: never remove all TREESAME parents When simplifying an odd merge, such as one that used "-s ours", we may find ourselves TREESAME to apparently redundant parents. Prevent simplify_merges() from removing every TREESAME parent; if this would happen reinstate the first TREESAME parent - the one that the default log would have followed. This avoids producing a totally disjoint history from the default log when the default log is a better explanation of the end result, and aids visualisation of odd merges. Signed-off-by: Kevin Bracey Signed-off-by: Junio C Hamano --- t/t6111-rev-list-treesame.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/t6111-rev-list-treesame.sh') diff --git a/t/t6111-rev-list-treesame.sh b/t/t6111-rev-list-treesame.sh index 0047b541fd..484b69bb2d 100755 --- a/t/t6111-rev-list-treesame.sh +++ b/t/t6111-rev-list-treesame.sh @@ -116,7 +116,7 @@ check_result 'M L H B A' -- file check_result '(LH)M (B)L (B)H (A)B A' --parents -- file check_result 'M L J I H G F D B A' --full-history -- file check_result '(LH)M (K)L (GJ)K (I)J (G)I (G)H (FB)G (D)F (BA)D (A)B A' --full-history --parents -- file -check_outcome failure '(LH)M (G)H (J)L (I)J (G)I (FB)G (B)F (A)B A' --simplify-merges -- file # drops parent B from G +check_result '(LH)M (G)H (J)L (I)J (G)I (FB)G (B)F (A)B A' --simplify-merges -- file check_result 'M L K G F D B A' --first-parent check_result 'M L G F B A' --first-parent -- file @@ -127,7 +127,7 @@ check_result 'M L H' F..M -- file check_result '(LH)M (B)L (B)H' --parents F..M -- file check_result 'M L J I H G' F..M --full-history -- file check_result '(LH)M (K)L (GJ)K (I)J (G)I (G)H (FB)G' F..M --full-history --parents -- file -check_outcome failure '(LH)M (G)H (J)L (I)J (G)I (FB)G' F..M --simplify-merges -- file # drops parent B from G +check_result '(LH)M (G)H (J)L (I)J (G)I (FB)G' F..M --simplify-merges -- file check_result 'M L K J I H G' F..M --ancestry-path check_result 'M L J I H G' F..M --ancestry-path -- file check_result '(LH)M (K)L (GJ)K (I)J (G)I (G)H (FE)G' F..M --ancestry-path --parents -- file -- cgit v1.2.1