(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'--graph and simplified history'>)} spids: [17] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {(SQ <'set up rev-list --graph test'>)} { (SQ <'\n'> <'\t# 3 commits on branch A\n'> <'\ttest_commit A1 foo.txt &&\n'> <'\ttest_commit A2 bar.txt &&\n'> <'\ttest_commit A3 bar.txt &&\n'> <'\tgit branch -m master A &&\n'> <'\n'> <'\t# 2 commits on branch B, started from A1\n'> <'\tgit checkout -b B A1 &&\n'> <'\ttest_commit B1 foo.txt &&\n'> <'\ttest_commit B2 abc.txt &&\n'> <'\n'> <'\t# 2 commits on branch C, started from A2\n'> <'\tgit checkout -b C A2 &&\n'> <'\ttest_commit C1 xyz.txt &&\n'> <'\ttest_commit C2 xyz.txt &&\n'> <'\n'> <'\t# Octopus merge B and C into branch A\n'> <'\tgit checkout A &&\n'> <'\tgit merge B C &&\n'> <'\tgit tag A4 &&\n'> <'\n'> <'\ttest_commit A5 bar.txt &&\n'> <'\n'> <'\t# More commits on C, then merge C into A\n'> <'\tgit checkout C &&\n'> <'\ttest_commit C3 foo.txt &&\n'> <'\ttest_commit C4 bar.txt &&\n'> <'\tgit checkout A &&\n'> <'\tgit merge -s ours C &&\n'> <'\tgit tag A6 &&\n'> <'\n'> <'\ttest_commit A7 bar.txt &&\n'> <'\n'> <'\t# Store commit names in variables for later use\n'> <'\tA1=$(git rev-parse --verify A1) &&\n'> <'\tA2=$(git rev-parse --verify A2) &&\n'> <'\tA3=$(git rev-parse --verify A3) &&\n'> <'\tA4=$(git rev-parse --verify A4) &&\n'> <'\tA5=$(git rev-parse --verify A5) &&\n'> <'\tA6=$(git rev-parse --verify A6) &&\n'> <'\tA7=$(git rev-parse --verify A7) &&\n'> <'\tB1=$(git rev-parse --verify B1) &&\n'> <'\tB2=$(git rev-parse --verify B2) &&\n'> <'\tC1=$(git rev-parse --verify C1) &&\n'> <'\tC2=$(git rev-parse --verify C2) &&\n'> <'\tC3=$(git rev-parse --verify C3) &&\n'> <'\tC4=$(git rev-parse --verify C4)\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph --all'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "| * $C3" >> expected &&\n'> <'\techo "* | $A5" >> expected &&\n'> <'\techo "| | " >> expected &&\n'> <'\techo "| \\\\ " >> expected &&\n'> <'\techo "*-. \\\\ $A4" >> expected &&\n'> <'\techo "|\\\\ \\\\ \\\\ " >> expected &&\n'> <'\techo "| | |/ " >> expected &&\n'> <'\techo "| | * $C2" >> expected &&\n'> <'\techo "| | * $C1" >> expected &&\n'> <'\techo "| * | $B2" >> expected &&\n'> <'\techo "| * | $B1" >> expected &&\n'> <'\techo "* | | $A3" >> expected &&\n'> <'\techo "| |/ " >> expected &&\n'> <'\techo "|/| " >> expected &&\n'> <'\techo "* | $A2" >> expected &&\n'> <'\techo "|/ " >> expected &&\n'> <'\techo "* $A1" >> expected &&\n'> <'\tgit rev-list --graph --all > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph --simplify-by-decoration'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\tgit tag -d A4 &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "| * $C3" >> expected &&\n'> <'\techo "* | $A5" >> expected &&\n'> <'\techo "| | " >> expected &&\n'> <'\techo "| \\\\ " >> expected &&\n'> <'\techo "*-. \\\\ $A4" >> expected &&\n'> <'\techo "|\\\\ \\\\ \\\\ " >> expected &&\n'> <'\techo "| | |/ " >> expected &&\n'> <'\techo "| | * $C2" >> expected &&\n'> <'\techo "| | * $C1" >> expected &&\n'> <'\techo "| * | $B2" >> expected &&\n'> <'\techo "| * | $B1" >> expected &&\n'> <'\techo "* | | $A3" >> expected &&\n'> <'\techo "| |/ " >> expected &&\n'> <'\techo "|/| " >> expected &&\n'> <'\techo "* | $A2" >> expected &&\n'> <'\techo "|/ " >> expected &&\n'> <'\techo "* $A1" >> expected &&\n'> <'\tgit rev-list --graph --all --simplify-by-decoration > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'setup: get rid of decorations on B'>)} {(SQ <'\n'> <'\tgit tag -d B2 &&\n'> <'\tgit tag -d B1 &&\n'> <'\tgit branch -d B\n'>)} ) (C {<test_expect_success>} {(SQ <'--graph --simplify-by-decoration prune branch B'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "| * $C3" >> expected &&\n'> <'\techo "* | $A5" >> expected &&\n'> <'\techo "* | $A4" >> expected &&\n'> <'\techo "|\\\\ \\\\ " >> expected &&\n'> <'\techo "| |/ " >> expected &&\n'> <'\techo "| * $C2" >> expected &&\n'> <'\techo "| * $C1" >> expected &&\n'> <'\techo "* | $A3" >> expected &&\n'> <'\techo "|/ " >> expected &&\n'> <'\techo "* $A2" >> expected &&\n'> <'\techo "* $A1" >> expected &&\n'> <'\tgit rev-list --graph --simplify-by-decoration --all > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph --full-history -- bar.txt'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "* | $A5" >> expected &&\n'> <'\techo "* | $A4" >> expected &&\n'> <'\techo "|\\\\ \\\\ " >> expected &&\n'> <'\techo "| |/ " >> expected &&\n'> <'\techo "* | $A3" >> expected &&\n'> <'\techo "|/ " >> expected &&\n'> <'\techo "* $A2" >> expected &&\n'> <'\tgit rev-list --graph --full-history --all -- bar.txt > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph --full-history --simplify-merges -- bar.txt'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "* | $A5" >> expected &&\n'> <'\techo "* | $A3" >> expected &&\n'> <'\techo "|/ " >> expected &&\n'> <'\techo "* $A2" >> expected &&\n'> <'\tgit rev-list --graph --full-history --simplify-merges --all \\\n'> <'\t\t-- bar.txt > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph -- bar.txt'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A5" >> expected &&\n'> <'\techo "* $A3" >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "|/ " >> expected &&\n'> <'\techo "* $A2" >> expected &&\n'> <'\tgit rev-list --graph --all -- bar.txt > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph --sparse -- bar.txt'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "* $A5" >> expected &&\n'> <'\techo "* $A4" >> expected &&\n'> <'\techo "* $A3" >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "| * $C3" >> expected &&\n'> <'\techo "| * $C2" >> expected &&\n'> <'\techo "| * $C1" >> expected &&\n'> <'\techo "|/ " >> expected &&\n'> <'\techo "* $A2" >> expected &&\n'> <'\techo "* $A1" >> expected &&\n'> <'\tgit rev-list --graph --sparse --all -- bar.txt > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph ^C4'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "* $A5" >> expected &&\n'> <'\techo "* $A4" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $B2" >> expected &&\n'> <'\techo "| * $B1" >> expected &&\n'> <'\techo "* $A3" >> expected &&\n'> <'\tgit rev-list --graph --all ^C4 > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph ^C3'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "* $A5" >> expected &&\n'> <'\techo "* $A4" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $B2" >> expected &&\n'> <'\techo "| * $B1" >> expected &&\n'> <'\techo "* $A3" >> expected &&\n'> <'\tgit rev-list --graph --all ^C3 > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(SQ <'--graph --boundary ^C3'>)} { (SQ <'\n'> <'\trm -f expected &&\n'> <'\techo "* $A7" >> expected &&\n'> <'\techo "* $A6" >> expected &&\n'> <'\techo "|\\\\ " >> expected &&\n'> <'\techo "| * $C4" >> expected &&\n'> <'\techo "* | $A5" >> expected &&\n'> <'\techo "| | " >> expected &&\n'> <'\techo "| \\\\ " >> expected &&\n'> <'\techo "*-. \\\\ $A4" >> expected &&\n'> <'\techo "|\\\\ \\\\ \\\\ " >> expected &&\n'> <'\techo "| * | | $B2" >> expected &&\n'> <'\techo "| * | | $B1" >> expected &&\n'> <'\techo "* | | | $A3" >> expected &&\n'> <'\techo "o | | | $A2" >> expected &&\n'> <'\techo "|/ / / " >> expected &&\n'> <'\techo "o | | $A1" >> expected &&\n'> <'\techo " / / " >> expected &&\n'> <'\techo "| o $C3" >> expected &&\n'> <'\techo "|/ " >> expected &&\n'> <'\techo "o $C2" >> expected &&\n'> <'\tgit rev-list --graph --boundary --all ^C3 > actual &&\n'> <'\ttest_cmp expected actual\n'> <'\t'> ) } ) (C {<test_done>}) ] )