Merge branch 'ar/t6016-modernise' into maint
Test update. * ar/t6016-modernise: t6016: move to lib-log-graph.sh framework
This commit is contained in:
commit
f0e3c7f831
@ -8,6 +8,12 @@
|
|||||||
test_description='--graph and simplified history'
|
test_description='--graph and simplified history'
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
. "$TEST_DIRECTORY"/lib-log-graph.sh
|
||||||
|
|
||||||
|
check_graph () {
|
||||||
|
cat >expect &&
|
||||||
|
lib_test_cmp_graph --format=%s "$@"
|
||||||
|
}
|
||||||
|
|
||||||
test_expect_success 'set up rev-list --graph test' '
|
test_expect_success 'set up rev-list --graph test' '
|
||||||
# 3 commits on branch A
|
# 3 commits on branch A
|
||||||
@ -28,7 +34,7 @@ test_expect_success 'set up rev-list --graph test' '
|
|||||||
|
|
||||||
# Octopus merge B and C into branch A
|
# Octopus merge B and C into branch A
|
||||||
git checkout A &&
|
git checkout A &&
|
||||||
git merge B C &&
|
git merge B C -m A4 &&
|
||||||
git tag A4 &&
|
git tag A4 &&
|
||||||
|
|
||||||
test_commit A5 bar.txt &&
|
test_commit A5 bar.txt &&
|
||||||
@ -38,80 +44,63 @@ test_expect_success 'set up rev-list --graph test' '
|
|||||||
test_commit C3 foo.txt &&
|
test_commit C3 foo.txt &&
|
||||||
test_commit C4 bar.txt &&
|
test_commit C4 bar.txt &&
|
||||||
git checkout A &&
|
git checkout A &&
|
||||||
git merge -s ours C &&
|
git merge -s ours C -m A6 &&
|
||||||
git tag A6 &&
|
git tag A6 &&
|
||||||
|
|
||||||
test_commit A7 bar.txt &&
|
test_commit A7 bar.txt
|
||||||
|
|
||||||
# Store commit names in variables for later use
|
|
||||||
A1=$(git rev-parse --verify A1) &&
|
|
||||||
A2=$(git rev-parse --verify A2) &&
|
|
||||||
A3=$(git rev-parse --verify A3) &&
|
|
||||||
A4=$(git rev-parse --verify A4) &&
|
|
||||||
A5=$(git rev-parse --verify A5) &&
|
|
||||||
A6=$(git rev-parse --verify A6) &&
|
|
||||||
A7=$(git rev-parse --verify A7) &&
|
|
||||||
B1=$(git rev-parse --verify B1) &&
|
|
||||||
B2=$(git rev-parse --verify B2) &&
|
|
||||||
C1=$(git rev-parse --verify C1) &&
|
|
||||||
C2=$(git rev-parse --verify C2) &&
|
|
||||||
C3=$(git rev-parse --verify C3) &&
|
|
||||||
C4=$(git rev-parse --verify C4)
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '--graph --all' '
|
test_expect_success '--graph --all' '
|
||||||
rm -f expected &&
|
check_graph --all <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A6" >> expected &&
|
* A6
|
||||||
echo "|\\ " >> expected &&
|
|\
|
||||||
echo "| * $C4" >> expected &&
|
| * C4
|
||||||
echo "| * $C3" >> expected &&
|
| * C3
|
||||||
echo "* | $A5" >> expected &&
|
* | A5
|
||||||
echo "| | " >> expected &&
|
| |
|
||||||
echo "| \\ " >> expected &&
|
| \
|
||||||
echo "*-. | $A4" >> expected &&
|
*-. | A4
|
||||||
echo "|\\ \\| " >> expected &&
|
|\ \|
|
||||||
echo "| | * $C2" >> expected &&
|
| | * C2
|
||||||
echo "| | * $C1" >> expected &&
|
| | * C1
|
||||||
echo "| * | $B2" >> expected &&
|
| * | B2
|
||||||
echo "| * | $B1" >> expected &&
|
| * | B1
|
||||||
echo "* | | $A3" >> expected &&
|
* | | A3
|
||||||
echo "| |/ " >> expected &&
|
| |/
|
||||||
echo "|/| " >> expected &&
|
|/|
|
||||||
echo "* | $A2" >> expected &&
|
* | A2
|
||||||
echo "|/ " >> expected &&
|
|/
|
||||||
echo "* $A1" >> expected &&
|
* A1
|
||||||
git rev-list --graph --all > actual &&
|
EOF
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
# Make sure the graph_is_interesting() code still realizes
|
# Make sure the graph_is_interesting() code still realizes
|
||||||
# that undecorated merges are interesting, even with --simplify-by-decoration
|
# that undecorated merges are interesting, even with --simplify-by-decoration
|
||||||
test_expect_success '--graph --simplify-by-decoration' '
|
test_expect_success '--graph --simplify-by-decoration' '
|
||||||
rm -f expected &&
|
|
||||||
git tag -d A4 &&
|
git tag -d A4 &&
|
||||||
echo "* $A7" >> expected &&
|
check_graph --all --simplify-by-decoration <<-\EOF
|
||||||
echo "* $A6" >> expected &&
|
* A7
|
||||||
echo "|\\ " >> expected &&
|
* A6
|
||||||
echo "| * $C4" >> expected &&
|
|\
|
||||||
echo "| * $C3" >> expected &&
|
| * C4
|
||||||
echo "* | $A5" >> expected &&
|
| * C3
|
||||||
echo "| | " >> expected &&
|
* | A5
|
||||||
echo "| \\ " >> expected &&
|
| |
|
||||||
echo "*-. | $A4" >> expected &&
|
| \
|
||||||
echo "|\\ \\| " >> expected &&
|
*-. | A4
|
||||||
echo "| | * $C2" >> expected &&
|
|\ \|
|
||||||
echo "| | * $C1" >> expected &&
|
| | * C2
|
||||||
echo "| * | $B2" >> expected &&
|
| | * C1
|
||||||
echo "| * | $B1" >> expected &&
|
| * | B2
|
||||||
echo "* | | $A3" >> expected &&
|
| * | B1
|
||||||
echo "| |/ " >> expected &&
|
* | | A3
|
||||||
echo "|/| " >> expected &&
|
| |/
|
||||||
echo "* | $A2" >> expected &&
|
|/|
|
||||||
echo "|/ " >> expected &&
|
* | A2
|
||||||
echo "* $A1" >> expected &&
|
|/
|
||||||
git rev-list --graph --all --simplify-by-decoration > actual &&
|
* A1
|
||||||
test_cmp expected actual
|
EOF
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'setup: get rid of decorations on B' '
|
test_expect_success 'setup: get rid of decorations on B' '
|
||||||
@ -122,142 +111,133 @@ test_expect_success 'setup: get rid of decorations on B' '
|
|||||||
|
|
||||||
# Graph with branch B simplified away
|
# Graph with branch B simplified away
|
||||||
test_expect_success '--graph --simplify-by-decoration prune branch B' '
|
test_expect_success '--graph --simplify-by-decoration prune branch B' '
|
||||||
rm -f expected &&
|
check_graph --simplify-by-decoration --all <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A6" >> expected &&
|
* A6
|
||||||
echo "|\\ " >> expected &&
|
|\
|
||||||
echo "| * $C4" >> expected &&
|
| * C4
|
||||||
echo "| * $C3" >> expected &&
|
| * C3
|
||||||
echo "* | $A5" >> expected &&
|
* | A5
|
||||||
echo "* | $A4" >> expected &&
|
* | A4
|
||||||
echo "|\\| " >> expected &&
|
|\|
|
||||||
echo "| * $C2" >> expected &&
|
| * C2
|
||||||
echo "| * $C1" >> expected &&
|
| * C1
|
||||||
echo "* | $A3" >> expected &&
|
* | A3
|
||||||
echo "|/ " >> expected &&
|
|/
|
||||||
echo "* $A2" >> expected &&
|
* A2
|
||||||
echo "* $A1" >> expected &&
|
* A1
|
||||||
git rev-list --graph --simplify-by-decoration --all > actual &&
|
EOF
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '--graph --full-history -- bar.txt' '
|
test_expect_success '--graph --full-history -- bar.txt' '
|
||||||
rm -f expected &&
|
check_graph --full-history --all -- bar.txt <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A6" >> expected &&
|
* A6
|
||||||
echo "|\\ " >> expected &&
|
|\
|
||||||
echo "| * $C4" >> expected &&
|
| * C4
|
||||||
echo "* | $A5" >> expected &&
|
* | A5
|
||||||
echo "* | $A4" >> expected &&
|
* | A4
|
||||||
echo "|\\| " >> expected &&
|
|\|
|
||||||
echo "* | $A3" >> expected &&
|
* | A3
|
||||||
echo "|/ " >> expected &&
|
|/
|
||||||
echo "* $A2" >> expected &&
|
* A2
|
||||||
git rev-list --graph --full-history --all -- bar.txt > actual &&
|
EOF
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '--graph --full-history --simplify-merges -- bar.txt' '
|
test_expect_success '--graph --full-history --simplify-merges -- bar.txt' '
|
||||||
rm -f expected &&
|
check_graph --full-history --simplify-merges --all -- bar.txt <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A6" >> expected &&
|
* A6
|
||||||
echo "|\\ " >> expected &&
|
|\
|
||||||
echo "| * $C4" >> expected &&
|
| * C4
|
||||||
echo "* | $A5" >> expected &&
|
* | A5
|
||||||
echo "* | $A3" >> expected &&
|
* | A3
|
||||||
echo "|/ " >> expected &&
|
|/
|
||||||
echo "* $A2" >> expected &&
|
* A2
|
||||||
git rev-list --graph --full-history --simplify-merges --all \
|
EOF
|
||||||
-- bar.txt > actual &&
|
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '--graph -- bar.txt' '
|
test_expect_success '--graph -- bar.txt' '
|
||||||
rm -f expected &&
|
check_graph --all -- bar.txt <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A5" >> expected &&
|
* A5
|
||||||
echo "* $A3" >> expected &&
|
* A3
|
||||||
echo "| * $C4" >> expected &&
|
| * C4
|
||||||
echo "|/ " >> expected &&
|
|/
|
||||||
echo "* $A2" >> expected &&
|
* A2
|
||||||
git rev-list --graph --all -- bar.txt > actual &&
|
EOF
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '--graph --sparse -- bar.txt' '
|
test_expect_success '--graph --sparse -- bar.txt' '
|
||||||
rm -f expected &&
|
check_graph --sparse --all -- bar.txt <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A6" >> expected &&
|
* A6
|
||||||
echo "* $A5" >> expected &&
|
* A5
|
||||||
echo "* $A4" >> expected &&
|
* A4
|
||||||
echo "* $A3" >> expected &&
|
* A3
|
||||||
echo "| * $C4" >> expected &&
|
| * C4
|
||||||
echo "| * $C3" >> expected &&
|
| * C3
|
||||||
echo "| * $C2" >> expected &&
|
| * C2
|
||||||
echo "| * $C1" >> expected &&
|
| * C1
|
||||||
echo "|/ " >> expected &&
|
|/
|
||||||
echo "* $A2" >> expected &&
|
* A2
|
||||||
echo "* $A1" >> expected &&
|
* A1
|
||||||
git rev-list --graph --sparse --all -- bar.txt > actual &&
|
EOF
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '--graph ^C4' '
|
test_expect_success '--graph ^C4' '
|
||||||
rm -f expected &&
|
check_graph --all ^C4 <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A6" >> expected &&
|
* A6
|
||||||
echo "* $A5" >> expected &&
|
* A5
|
||||||
echo "* $A4" >> expected &&
|
* A4
|
||||||
echo "|\\ " >> expected &&
|
|\
|
||||||
echo "| * $B2" >> expected &&
|
| * B2
|
||||||
echo "| * $B1" >> expected &&
|
| * B1
|
||||||
echo "* $A3" >> expected &&
|
* A3
|
||||||
git rev-list --graph --all ^C4 > actual &&
|
EOF
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '--graph ^C3' '
|
test_expect_success '--graph ^C3' '
|
||||||
rm -f expected &&
|
check_graph --all ^C3 <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A6" >> expected &&
|
* A6
|
||||||
echo "|\\ " >> expected &&
|
|\
|
||||||
echo "| * $C4" >> expected &&
|
| * C4
|
||||||
echo "* $A5" >> expected &&
|
* A5
|
||||||
echo "* $A4" >> expected &&
|
* A4
|
||||||
echo "|\\ " >> expected &&
|
|\
|
||||||
echo "| * $B2" >> expected &&
|
| * B2
|
||||||
echo "| * $B1" >> expected &&
|
| * B1
|
||||||
echo "* $A3" >> expected &&
|
* A3
|
||||||
git rev-list --graph --all ^C3 > actual &&
|
EOF
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
# I don't think the ordering of the boundary commits is really
|
# I don't think the ordering of the boundary commits is really
|
||||||
# that important, but this test depends on it. If the ordering ever changes
|
# that important, but this test depends on it. If the ordering ever changes
|
||||||
# in the code, we'll need to update this test.
|
# in the code, we'll need to update this test.
|
||||||
test_expect_success '--graph --boundary ^C3' '
|
test_expect_success '--graph --boundary ^C3' '
|
||||||
rm -f expected &&
|
check_graph --boundary --all ^C3 <<-\EOF
|
||||||
echo "* $A7" >> expected &&
|
* A7
|
||||||
echo "* $A6" >> expected &&
|
* A6
|
||||||
echo "|\\ " >> expected &&
|
|\
|
||||||
echo "| * $C4" >> expected &&
|
| * C4
|
||||||
echo "* | $A5" >> expected &&
|
* | A5
|
||||||
echo "| | " >> expected &&
|
| |
|
||||||
echo "| \\ " >> expected &&
|
| \
|
||||||
echo "*-. \\ $A4" >> expected &&
|
*-. \ A4
|
||||||
echo "|\\ \\ \\ " >> expected &&
|
|\ \ \
|
||||||
echo "| * | | $B2" >> expected &&
|
| * | | B2
|
||||||
echo "| * | | $B1" >> expected &&
|
| * | | B1
|
||||||
echo "* | | | $A3" >> expected &&
|
* | | | A3
|
||||||
echo "o | | | $A2" >> expected &&
|
o | | | A2
|
||||||
echo "|/ / / " >> expected &&
|
|/ / /
|
||||||
echo "o / / $A1" >> expected &&
|
o / / A1
|
||||||
echo " / / " >> expected &&
|
/ /
|
||||||
echo "| o $C3" >> expected &&
|
| o C3
|
||||||
echo "|/ " >> expected &&
|
|/
|
||||||
echo "o $C2" >> expected &&
|
o C2
|
||||||
git rev-list --graph --boundary --all ^C3 > actual &&
|
EOF
|
||||||
test_cmp expected actual
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user