summaryrefslogtreecommitdiff
path: root/t/t6019-rev-list-ancestry-path.sh
diff options
context:
space:
mode:
authorKevin Bracey <kevin@bracey.fi>2013-05-16 18:32:39 +0300
committerJunio C Hamano <gitster@pobox.com>2013-05-16 11:51:10 -0700
commit4d826608e9610851d29440ca290e54b701921608 (patch)
treedcae3f11bb893adf66bec4a3bd2cb6a098012a6c /t/t6019-rev-list-ancestry-path.sh
parent7f34a46ff57121910c9ad697c2809a2d01ed1673 (diff)
downloadgit-4d826608e9610851d29440ca290e54b701921608.tar.gz
revision.c: discount side branches when computing TREESAME
Use the BOTTOM flag to define relevance for pruning. Relevant commits are those that are !UNINTERESTING or BOTTOM, and this allows us to identify irrelevant side branches (UNINTERESTING && !BOTTOM). If a merge has relevant parents, and it is TREESAME to them, then do not let irrelevant parents cause the merge to be treated as !TREESAME. When considering simplification, don't always include all merges - merges with exactly one relevant parent can be simplified, if TREESAME according to the above rule. These two changes greatly increase simplification in limited, pruned revision lists. Signed-off-by: Kevin Bracey <kevin@bracey.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6019-rev-list-ancestry-path.sh')
-rwxr-xr-xt/t6019-rev-list-ancestry-path.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh
index 5ad96e3320..dabebaee0b 100755
--- a/t/t6019-rev-list-ancestry-path.sh
+++ b/t/t6019-rev-list-ancestry-path.sh
@@ -18,7 +18,8 @@ test_description='--ancestry-path'
# --ancestry-path F...I == F H I
#
# G..M -- G.t == [nothing - was dropped in "-s ours" merge L]
-# --ancestry-path G..M -- G.t == H J L
+# --ancestry-path G..M -- G.t == L
+# --ancestry-path --simplify-merges G^..M -- G.t == G L
. ./test-lib.sh
@@ -101,8 +102,15 @@ test_expect_success 'rev-list G..M -- G.t' '
'
test_expect_success 'rev-list --ancestry-path G..M -- G.t' '
- for c in H J L; do echo $c; done >expect &&
+ echo L >expect &&
git rev-list --ancestry-path --format=%s G..M -- G.t |
+ sed -e "/^commit /d" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rev-list --ancestry-path --simplify-merges G^..M -- G.t' '
+ for c in G L; do echo $c; done >expect &&
+ git rev-list --ancestry-path --simplify-merges --format=%s G^..M -- G.t |
sed -e "/^commit /d" |
sort >actual &&
test_cmp expect actual