(List (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('test_description', {[SQ <LIT_CHARS "auto squash">]})]) (Com {[LIT_CHARS .]} {[LIT_CHARS ./test-lib.sh]} ) (Com {[LIT_CHARS test_expect_success]} {[LIT_CHARS setup]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\techo 0 >file0 &&\n"> <LIT_CHARS "\tgit add . &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"initial commit\" &&\n"> <LIT_CHARS "\techo 0 >file1 &&\n"> <LIT_CHARS "\techo 2 >file2 &&\n"> <LIT_CHARS "\tgit add . &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"first commit\" &&\n"> <LIT_CHARS "\tgit tag first-commit &&\n"> <LIT_CHARS "\techo 3 >file3 &&\n"> <LIT_CHARS "\tgit add . &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"second commit\" &&\n"> <LIT_CHARS "\tgit tag base\n">]} ) (FunctionDef test_auto_fixup [] (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS reset]} {[LIT_CHARS --hard]} {[LIT_CHARS base]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS echo]} {[LIT_CHARS 1]} < (FilenameRedirectNode filename={[LIT_CHARS file1]} <REDIR_GREAT ">"> 1), > ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS add]} {[LIT_CHARS -u]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_tick]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS commit]} {[LIT_CHARS -m]} {[DQ [LIT_CHARS "fixup! first"]]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS tag]} {[VarSub 1]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_tick]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS rebase]} {[VarSub 2]} {[LIT_CHARS -i]} {[LIT_CHARS HEAD] [LIT_OTHER "^"] [LIT_OTHER "^"] [LIT_OTHER "^"]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS log]} {[LIT_CHARS --oneline]} < (FilenameRedirectNode filename={[LIT_CHARS actual]} <REDIR_GREAT ">"> 1), > ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_line_count]} {[LIT_DBRACKET_LIKE "="]} {[LIT_CHARS 3]} {[LIT_CHARS actual]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS diff]} {[LIT_CHARS --exit-code]} {[VarSub 1]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[LIT_CHARS 1]} {[LIT_DBRACKET_LIKE "="]} {[DQ [ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS blob]} {[LIT_CHARS HEAD] [LIT_OTHER "^"] [LIT_OTHER ":"] [LIT_CHARS file1]})]]} ) (Com {[LIT_CHARS test]} {[LIT_CHARS 1]} {[LIT_DBRACKET_LIKE "="]} {[ComSub (Pipeline (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS commit]} {[LIT_CHARS HEAD] [LIT_OTHER "^"]}) (Com {[LIT_CHARS grep]} {[LIT_CHARS first]}) (Com {[LIT_CHARS wc]} {[LIT_CHARS -l]}) )]} ) ) ) ) ) ) ) ) ) ) ) ) ) ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto fixup (option)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\ttest_auto_fixup final-fixup-option --autosquash\n">]} ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto fixup (config)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit config rebase.autosquash true &&\n"> <LIT_CHARS "\ttest_auto_fixup final-fixup-config-true &&\n"> <LIT_CHARS "\ttest_must_fail test_auto_fixup fixup-config-true-no --no-autosquash &&\n"> <LIT_CHARS "\tgit config rebase.autosquash false &&\n"> <LIT_CHARS "\ttest_must_fail test_auto_fixup final-fixup-config-false\n">]} ) (FunctionDef test_auto_squash [] (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS reset]} {[LIT_CHARS --hard]} {[LIT_CHARS base]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS echo]} {[LIT_CHARS 1]} < (FilenameRedirectNode filename={[LIT_CHARS file1]} <REDIR_GREAT ">"> 1), > ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS add]} {[LIT_CHARS -u]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_tick]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS commit]} {[LIT_CHARS -m]} {[DQ [LIT_CHARS "squash! first"]]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS tag]} {[VarSub 1]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_tick]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS rebase]} {[VarSub 2]} {[LIT_CHARS -i]} {[LIT_CHARS HEAD] [LIT_OTHER "^"] [LIT_OTHER "^"] [LIT_OTHER "^"]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS log]} {[LIT_CHARS --oneline]} < (FilenameRedirectNode filename={[LIT_CHARS actual]} <REDIR_GREAT ">"> 1), > ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_line_count]} {[LIT_DBRACKET_LIKE "="]} {[LIT_CHARS 3]} {[LIT_CHARS actual]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS diff]} {[LIT_CHARS --exit-code]} {[VarSub 1]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[LIT_CHARS 1]} {[LIT_DBRACKET_LIKE "="]} {[DQ [ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS blob]} {[LIT_CHARS HEAD] [LIT_OTHER "^"] [LIT_OTHER ":"] [LIT_CHARS file1]})]]} ) (Com {[LIT_CHARS test]} {[LIT_CHARS 2]} {[LIT_DBRACKET_LIKE "="]} {[ComSub (Pipeline (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS commit]} {[LIT_CHARS HEAD] [LIT_OTHER "^"]}) (Com {[LIT_CHARS grep]} {[LIT_CHARS first]}) (Com {[LIT_CHARS wc]} {[LIT_CHARS -l]}) )]} ) ) ) ) ) ) ) ) ) ) ) ) ) ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto squash (option)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\ttest_auto_squash final-squash --autosquash\n">]} ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto squash (config)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit config rebase.autosquash true &&\n"> <LIT_CHARS "\ttest_auto_squash final-squash-config-true &&\n"> <LIT_CHARS "\ttest_must_fail test_auto_squash squash-config-true-no --no-autosquash &&\n"> <LIT_CHARS "\tgit config rebase.autosquash false &&\n"> <LIT_CHARS "\ttest_must_fail test_auto_squash final-squash-config-false\n">]} ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "misspelled auto squash">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit reset --hard base &&\n"> <LIT_CHARS "\techo 1 >file1 &&\n"> <LIT_CHARS "\tgit add -u &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"squash! forst\" &&\n"> <LIT_CHARS "\tgit tag final-missquash &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit rebase --autosquash -i HEAD^^^ &&\n"> <LIT_CHARS "\tgit log --oneline >actual &&\n"> <LIT_CHARS "\ttest_line_count = 4 actual &&\n"> <LIT_CHARS "\tgit diff --exit-code final-missquash &&\n"> <LIT_CHARS "\ttest 0 = $(git rev-list final-missquash...HEAD | wc -l)\n">]} ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto squash that matches 2 commits">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit reset --hard base &&\n"> <LIT_CHARS "\techo 4 >file4 &&\n"> <LIT_CHARS "\tgit add file4 &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"first new commit\" &&\n"> <LIT_CHARS "\techo 1 >file1 &&\n"> <LIT_CHARS "\tgit add -u &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"squash! first\" &&\n"> <LIT_CHARS "\tgit tag final-multisquash &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit rebase --autosquash -i HEAD~4 &&\n"> <LIT_CHARS "\tgit log --oneline >actual &&\n"> <LIT_CHARS "\ttest_line_count = 4 actual &&\n"> <LIT_CHARS "\tgit diff --exit-code final-multisquash &&\n"> <LIT_CHARS "\ttest 1 = \"$(git cat-file blob HEAD^^:file1)\" &&\n"> <LIT_CHARS "\ttest 2 = $(git cat-file commit HEAD^^ | grep first | wc -l) &&\n"> <LIT_CHARS "\ttest 1 = $(git cat-file commit HEAD | grep first | wc -l)\n">]} ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto squash that matches a commit after the squash">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit reset --hard base &&\n"> <LIT_CHARS "\techo 1 >file1 &&\n"> <LIT_CHARS "\tgit add -u &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"squash! third\" &&\n"> <LIT_CHARS "\techo 4 >file4 &&\n"> <LIT_CHARS "\tgit add file4 &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"third commit\" &&\n"> <LIT_CHARS "\tgit tag final-presquash &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit rebase --autosquash -i HEAD~4 &&\n"> <LIT_CHARS "\tgit log --oneline >actual &&\n"> <LIT_CHARS "\ttest_line_count = 5 actual &&\n"> <LIT_CHARS "\tgit diff --exit-code final-presquash &&\n"> <LIT_CHARS "\ttest 0 = \"$(git cat-file blob HEAD^^:file1)\" &&\n"> <LIT_CHARS "\ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n"> <LIT_CHARS "\ttest 1 = $(git cat-file commit HEAD | grep third | wc -l) &&\n"> <LIT_CHARS "\ttest 1 = $(git cat-file commit HEAD^ | grep third | wc -l)\n">]} ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto squash that matches a sha1">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit reset --hard base &&\n"> <LIT_CHARS "\techo 1 >file1 &&\n"> <LIT_CHARS "\tgit add -u &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"squash! $(git rev-parse --short HEAD^)\" &&\n"> <LIT_CHARS "\tgit tag final-shasquash &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit rebase --autosquash -i HEAD^^^ &&\n"> <LIT_CHARS "\tgit log --oneline >actual &&\n"> <LIT_CHARS "\ttest_line_count = 3 actual &&\n"> <LIT_CHARS "\tgit diff --exit-code final-shasquash &&\n"> <LIT_CHARS "\ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n"> <LIT_CHARS "\ttest 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)\n">]} ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "auto squash that matches longer sha1">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit reset --hard base &&\n"> <LIT_CHARS "\techo 1 >file1 &&\n"> <LIT_CHARS "\tgit add -u &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit commit -m \"squash! $(git rev-parse --short=11 HEAD^)\" &&\n"> <LIT_CHARS "\tgit tag final-longshasquash &&\n"> <LIT_CHARS "\ttest_tick &&\n"> <LIT_CHARS "\tgit rebase --autosquash -i HEAD^^^ &&\n"> <LIT_CHARS "\tgit log --oneline >actual &&\n"> <LIT_CHARS "\ttest_line_count = 3 actual &&\n"> <LIT_CHARS "\tgit diff --exit-code final-longshasquash &&\n"> <LIT_CHARS "\ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n"> <LIT_CHARS "\ttest 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)\n">]} ) (FunctionDef test_auto_commit_flags [] (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS reset]} {[LIT_CHARS --hard]} {[LIT_CHARS base]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS echo]} {[LIT_CHARS 1]} < (FilenameRedirectNode filename={[LIT_CHARS file1]} <REDIR_GREAT ">"> 1), > ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS add]} {[LIT_CHARS -u]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_tick]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS commit]} {[LIT_CHARS --] [VarSub 1]} {[LIT_CHARS first-commit]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS tag]} {[LIT_CHARS final-commit-] [VarSub 1]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_tick]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS rebase]} {[LIT_CHARS --autosquash]} {[LIT_CHARS -i]} {[LIT_CHARS HEAD] [LIT_OTHER "^"] [LIT_OTHER "^"] [LIT_OTHER "^"]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS log]} {[LIT_CHARS --oneline]} < (FilenameRedirectNode filename={[LIT_CHARS actual]} <REDIR_GREAT ">"> 1), > ) (AndOr OP_AND_IF (Com {[LIT_CHARS test_line_count]} {[LIT_DBRACKET_LIKE "="]} {[LIT_CHARS 3]} {[LIT_CHARS actual]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS diff]} {[LIT_CHARS --exit-code]} {[LIT_CHARS final-commit-] [VarSub 1]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[LIT_CHARS 1]} {[LIT_DBRACKET_LIKE "="]} {[DQ [ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS blob]} {[LIT_CHARS HEAD] [LIT_OTHER "^"] [LIT_OTHER ":"] [LIT_CHARS file1]})]]} ) (Com {[LIT_CHARS test]} {[VarSub 2]} {[LIT_DBRACKET_LIKE "="]} {[ComSub (Pipeline (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS commit]} {[LIT_CHARS HEAD] [LIT_OTHER "^"]}) (Com {[LIT_CHARS grep]} {[LIT_CHARS first]}) (Com {[LIT_CHARS wc]} {[LIT_CHARS -l]}) )]} ) ) ) ) ) ) ) ) ) ) ) ) ) ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "use commit --fixup">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\ttest_auto_commit_flags fixup 1\n">]} ) (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "use commit --squash">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\ttest_auto_commit_flags squash 2\n">]} ) (Com {[LIT_CHARS test_done]} ) )