(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ (Token id:Id.Lit_Chars val:'auto squash' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(.)} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) (/lib-rebase.sh)}) (C {(test_expect_success)} {(setup)} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:28) (Token id:Id.Lit_Chars val:'\techo 0 >file0 &&\n' span_id:29) (Token id:Id.Lit_Chars val:'\tgit add . &&\n' span_id:30) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:31) (Token id:Id.Lit_Chars val:'\tgit commit -m "initial commit" &&\n' span_id:32) (Token id:Id.Lit_Chars val:'\techo 0 >file1 &&\n' span_id:33) (Token id:Id.Lit_Chars val:'\techo 2 >file2 &&\n' span_id:34) (Token id:Id.Lit_Chars val:'\tgit add . &&\n' span_id:35) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:36) (Token id:Id.Lit_Chars val:'\tgit commit -m "first commit" &&\n' span_id:37) (Token id:Id.Lit_Chars val:'\tgit tag first-commit &&\n' span_id:38) (Token id:Id.Lit_Chars val:'\techo 3 >file3 &&\n' span_id:39) (Token id:Id.Lit_Chars val:'\tgit add . &&\n' span_id:40) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:41) (Token id:Id.Lit_Chars val:'\tgit commit -m "second commit" &&\n' span_id:42) (Token id:Id.Lit_Chars val:'\tgit tag base\n' span_id:43) ) } ) (command.ShFunction name: test_auto_fixup body: (command.BraceGroup children: [ (command.AndOr ops: [ Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp ] children: [ (C {(git)} {(reset)} {(--hard)} {(base)}) (command.Simple words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:70) fd: -1 arg_word: {(file1)} ) ] ) (C {(git)} {(add)} {(-u)}) (C {(test_tick)}) (C {(git)} {(commit)} {(-m)} {(DQ ('fixup! first'))}) (C {(git)} {(tag)} {($ Id.VSub_Number '$1')}) (C {(test_tick)}) (C {(git)} {(rebase)} {($ Id.VSub_Number '$2')} {(-i)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other '^') (Id.Lit_Other '^')} ) (command.Simple words: [{(git)} {(log)} {(--oneline)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:140) fd: -1 arg_word: {(actual)} ) ] ) (C {(test_line_count)} {(Id.Lit_Equals '=')} {(3)} {(actual)}) (C {(git)} {(diff)} {(--exit-code)} {($ Id.VSub_Number '$1')}) (C {(test)} {(1)} {(Id.Lit_Equals '=')} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:175) command_list: (command.CommandList children: [ (C {(git)} {(cat-file)} {(blob)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other ':') (file1)} ) ] ) ) ) } ) (C {(test)} {(1)} {(Id.Lit_Equals '=')} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:198) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(cat-file)} {(commit)} {(HEAD) (Id.Lit_Other '^')}) (C {(grep)} {(first)}) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } ) ] ) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'auto fixup (option)' span_id:227))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:231) (Token id: Id.Lit_Chars val: '\ttest_auto_fixup final-fixup-option --autosquash\n' span_id: 232 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'auto fixup (config)' span_id:239))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:243) (Token id: Id.Lit_Chars val: '\tgit config rebase.autosquash true &&\n' span_id: 244 ) (Token id:Id.Lit_Chars val:'\ttest_auto_fixup final-fixup-config-true &&\n' span_id:245) (Token id: Id.Lit_Chars val: '\ttest_must_fail test_auto_fixup fixup-config-true-no --no-autosquash &&\n' span_id: 246 ) (Token id:Id.Lit_Chars val:'\tgit config rebase.autosquash false &&\n' span_id:247) (Token id: Id.Lit_Chars val: '\ttest_must_fail test_auto_fixup final-fixup-config-false\n' span_id: 248 ) ) } ) (command.ShFunction name: test_auto_squash body: (command.BraceGroup children: [ (command.AndOr ops: [ Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp ] children: [ (C {(git)} {(reset)} {(--hard)} {(base)}) (command.Simple words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:275) fd: -1 arg_word: {(file1)} ) ] ) (C {(git)} {(add)} {(-u)}) (C {(test_tick)}) (C {(git)} {(commit)} {(-m)} {(DQ ('squash! first'))}) (C {(git)} {(tag)} {($ Id.VSub_Number '$1')}) (C {(test_tick)}) (C {(git)} {(rebase)} {($ Id.VSub_Number '$2')} {(-i)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other '^') (Id.Lit_Other '^')} ) (command.Simple words: [{(git)} {(log)} {(--oneline)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:345) fd: -1 arg_word: {(actual)} ) ] ) (C {(test_line_count)} {(Id.Lit_Equals '=')} {(3)} {(actual)}) (C {(git)} {(diff)} {(--exit-code)} {($ Id.VSub_Number '$1')}) (C {(test)} {(1)} {(Id.Lit_Equals '=')} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:380) command_list: (command.CommandList children: [ (C {(git)} {(cat-file)} {(blob)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other ':') (file1)} ) ] ) ) ) } ) (C {(test)} {(2)} {(Id.Lit_Equals '=')} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:403) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(cat-file)} {(commit)} {(HEAD) (Id.Lit_Other '^')}) (C {(grep)} {(first)}) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } ) ] ) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'auto squash (option)' span_id:432))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:436) (Token id: Id.Lit_Chars val: '\ttest_auto_squash final-squash --autosquash\n' span_id: 437 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'auto squash (config)' span_id:444))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:448) (Token id: Id.Lit_Chars val: '\tgit config rebase.autosquash true &&\n' span_id: 449 ) (Token id:Id.Lit_Chars val:'\ttest_auto_squash final-squash-config-true &&\n' span_id:450) (Token id: Id.Lit_Chars val: '\ttest_must_fail test_auto_squash squash-config-true-no --no-autosquash &&\n' span_id: 451 ) (Token id:Id.Lit_Chars val:'\tgit config rebase.autosquash false &&\n' span_id:452) (Token id: Id.Lit_Chars val: '\ttest_must_fail test_auto_squash final-squash-config-false\n' span_id: 453 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'misspelled auto squash' span_id:460))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:464) (Token id:Id.Lit_Chars val:'\tgit reset --hard base &&\n' span_id:465) (Token id:Id.Lit_Chars val:'\techo 1 >file1 &&\n' span_id:466) (Token id:Id.Lit_Chars val:'\tgit add -u &&\n' span_id:467) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:468) (Token id:Id.Lit_Chars val:'\tgit commit -m "squash! forst" &&\n' span_id:469) (Token id:Id.Lit_Chars val:'\tgit tag final-missquash &&\n' span_id:470) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:471) (Token id:Id.Lit_Chars val:'\tgit rebase --autosquash -i HEAD^^^ &&\n' span_id:472) (Token id:Id.Lit_Chars val:'\tgit log --oneline >actual &&\n' span_id:473) (Token id:Id.Lit_Chars val:'\ttest_line_count = 4 actual &&\n' span_id:474) (Token id: Id.Lit_Chars val: '\tgit diff --exit-code final-missquash &&\n' span_id: 475 ) (Token id:Id.Lit_Chars val:'\ttest 0 = $(git rev-list final-missquash...HEAD | wc -l)\n' span_id:476) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'auto squash that matches 2 commits' span_id:483))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:487) (Token id:Id.Lit_Chars val:'\tgit reset --hard base &&\n' span_id:488) (Token id:Id.Lit_Chars val:'\techo 4 >file4 &&\n' span_id:489) (Token id:Id.Lit_Chars val:'\tgit add file4 &&\n' span_id:490) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:491) (Token id:Id.Lit_Chars val:'\tgit commit -m "first new commit" &&\n' span_id:492) (Token id:Id.Lit_Chars val:'\techo 1 >file1 &&\n' span_id:493) (Token id:Id.Lit_Chars val:'\tgit add -u &&\n' span_id:494) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:495) (Token id:Id.Lit_Chars val:'\tgit commit -m "squash! first" &&\n' span_id:496) (Token id:Id.Lit_Chars val:'\tgit tag final-multisquash &&\n' span_id:497) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:498) (Token id:Id.Lit_Chars val:'\tgit rebase --autosquash -i HEAD~4 &&\n' span_id:499) (Token id:Id.Lit_Chars val:'\tgit log --oneline >actual &&\n' span_id:500) (Token id:Id.Lit_Chars val:'\ttest_line_count = 4 actual &&\n' span_id:501) (Token id: Id.Lit_Chars val: '\tgit diff --exit-code final-multisquash &&\n' span_id: 502 ) (Token id:Id.Lit_Chars val:'\ttest 1 = "$(git cat-file blob HEAD^^:file1)" &&\n' span_id:503) (Token id: Id.Lit_Chars val: '\ttest 2 = $(git cat-file commit HEAD^^ | grep first | wc -l) &&\n' span_id: 504 ) (Token id: Id.Lit_Chars val: '\ttest 1 = $(git cat-file commit HEAD | grep first | wc -l)\n' span_id: 505 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'auto squash that matches a commit after the squash' span_id: 512 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:516) (Token id:Id.Lit_Chars val:'\tgit reset --hard base &&\n' span_id:517) (Token id:Id.Lit_Chars val:'\techo 1 >file1 &&\n' span_id:518) (Token id:Id.Lit_Chars val:'\tgit add -u &&\n' span_id:519) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:520) (Token id:Id.Lit_Chars val:'\tgit commit -m "squash! third" &&\n' span_id:521) (Token id:Id.Lit_Chars val:'\techo 4 >file4 &&\n' span_id:522) (Token id:Id.Lit_Chars val:'\tgit add file4 &&\n' span_id:523) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:524) (Token id:Id.Lit_Chars val:'\tgit commit -m "third commit" &&\n' span_id:525) (Token id:Id.Lit_Chars val:'\tgit tag final-presquash &&\n' span_id:526) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:527) (Token id:Id.Lit_Chars val:'\tgit rebase --autosquash -i HEAD~4 &&\n' span_id:528) (Token id:Id.Lit_Chars val:'\tgit log --oneline >actual &&\n' span_id:529) (Token id:Id.Lit_Chars val:'\ttest_line_count = 5 actual &&\n' span_id:530) (Token id: Id.Lit_Chars val: '\tgit diff --exit-code final-presquash &&\n' span_id: 531 ) (Token id:Id.Lit_Chars val:'\ttest 0 = "$(git cat-file blob HEAD^^:file1)" &&\n' span_id:532) (Token id: Id.Lit_Chars val: '\ttest 1 = "$(git cat-file blob HEAD^:file1)" &&\n' span_id: 533 ) (Token id: Id.Lit_Chars val: '\ttest 1 = $(git cat-file commit HEAD | grep third | wc -l) &&\n' span_id: 534 ) (Token id: Id.Lit_Chars val: '\ttest 1 = $(git cat-file commit HEAD^ | grep third | wc -l)\n' span_id: 535 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'auto squash that matches a sha1' span_id:541))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:545) (Token id:Id.Lit_Chars val:'\tgit reset --hard base &&\n' span_id:546) (Token id:Id.Lit_Chars val:'\techo 1 >file1 &&\n' span_id:547) (Token id:Id.Lit_Chars val:'\tgit add -u &&\n' span_id:548) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:549) (Token id: Id.Lit_Chars val: '\tgit commit -m "squash! $(git rev-parse --short HEAD^)" &&\n' span_id: 550 ) (Token id:Id.Lit_Chars val:'\tgit tag final-shasquash &&\n' span_id:551) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:552) (Token id:Id.Lit_Chars val:'\tgit rebase --autosquash -i HEAD^^^ &&\n' span_id:553) (Token id:Id.Lit_Chars val:'\tgit log --oneline >actual &&\n' span_id:554) (Token id:Id.Lit_Chars val:'\ttest_line_count = 3 actual &&\n' span_id:555) (Token id: Id.Lit_Chars val: '\tgit diff --exit-code final-shasquash &&\n' span_id: 556 ) (Token id:Id.Lit_Chars val:'\ttest 1 = "$(git cat-file blob HEAD^:file1)" &&\n' span_id:557) (Token id: Id.Lit_Chars val: '\ttest 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)\n' span_id: 558 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'auto squash that matches longer sha1' span_id:565))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:569) (Token id:Id.Lit_Chars val:'\tgit reset --hard base &&\n' span_id:570) (Token id:Id.Lit_Chars val:'\techo 1 >file1 &&\n' span_id:571) (Token id:Id.Lit_Chars val:'\tgit add -u &&\n' span_id:572) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:573) (Token id: Id.Lit_Chars val: '\tgit commit -m "squash! $(git rev-parse --short=11 HEAD^)" &&\n' span_id: 574 ) (Token id:Id.Lit_Chars val:'\tgit tag final-longshasquash &&\n' span_id:575) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:576) (Token id:Id.Lit_Chars val:'\tgit rebase --autosquash -i HEAD^^^ &&\n' span_id:577) (Token id:Id.Lit_Chars val:'\tgit log --oneline >actual &&\n' span_id:578) (Token id:Id.Lit_Chars val:'\ttest_line_count = 3 actual &&\n' span_id:579) (Token id: Id.Lit_Chars val: '\tgit diff --exit-code final-longshasquash &&\n' span_id: 580 ) (Token id:Id.Lit_Chars val:'\ttest 1 = "$(git cat-file blob HEAD^:file1)" &&\n' span_id:581) (Token id: Id.Lit_Chars val: '\ttest 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)\n' span_id: 582 ) ) } ) (command.ShFunction name: test_auto_commit_flags body: (command.BraceGroup children: [ (command.AndOr ops: [ Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp ] children: [ (C {(git)} {(reset)} {(--hard)} {(base)}) (command.Simple words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:609) fd: -1 arg_word: {(file1)} ) ] ) (C {(git)} {(add)} {(-u)}) (C {(test_tick)}) (C {(git)} {(commit)} {(--) ($ Id.VSub_Number '$1')} {(first-commit)}) (C {(git)} {(tag)} {(final-commit-) ($ Id.VSub_Number '$1')}) (C {(test_tick)}) (C {(git)} {(rebase)} {(--autosquash)} {(-i)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other '^') (Id.Lit_Other '^')} ) (command.Simple words: [{(git)} {(log)} {(--oneline)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:678) fd: -1 arg_word: {(actual)} ) ] ) (C {(test_line_count)} {(Id.Lit_Equals '=')} {(3)} {(actual)}) (C {(git)} {(diff)} {(--exit-code)} {(final-commit-) ($ Id.VSub_Number '$1')}) (C {(test)} {(1)} {(Id.Lit_Equals '=')} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:714) command_list: (command.CommandList children: [ (C {(git)} {(cat-file)} {(blob)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other ':') (file1)} ) ] ) ) ) } ) (C {(test)} {($ Id.VSub_Number '$2')} {(Id.Lit_Equals '=')} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:737) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(cat-file)} {(commit)} {(HEAD) (Id.Lit_Other '^')}) (C {(grep)} {(first)}) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } ) ] ) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'use commit --fixup' span_id:766))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:770) (Token id:Id.Lit_Chars val:'\ttest_auto_commit_flags fixup 1\n' span_id:771) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'use commit --squash' span_id:778))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:782) (Token id:Id.Lit_Chars val:'\ttest_auto_commit_flags squash 2\n' span_id:783) ) } ) (command.ShFunction name: test_auto_fixup_fixup body: (command.BraceGroup children: [ (command.AndOr ops: [ Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp ] children: [ (C {(git)} {(reset)} {(--hard)} {(base)}) (command.Simple words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:810) fd: -1 arg_word: {(file1)} ) ] ) (C {(git)} {(add)} {(-u)}) (C {(test_tick)}) (C {(git)} {(commit)} {(-m)} {(DQ ($ Id.VSub_Number '$1') ('! first'))}) (command.Simple words: [{(echo)} {(2)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:848) fd: -1 arg_word: {(file1)} ) ] ) (C {(git)} {(add)} {(-u)}) (C {(test_tick)}) (C {(git)} {(commit)} {(-m)} {(DQ ($ Id.VSub_Number '$1') ('! ') ($ Id.VSub_Number '$2') ('! first'))} ) (C {(git)} {(tag)} {(DQ (final-) ($ Id.VSub_Number '$1') (-) ($ Id.VSub_Number '$2'))}) (C {(test_tick)}) (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (C {(set_cat_todo_editor)}) (command.Simple words: [ {(test_must_fail)} {(git)} {(rebase)} {(--autosquash)} {(-i)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other '^') (Id.Lit_Other '^') (Id.Lit_Other '^') } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:927) fd: -1 arg_word: {(actual)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:935) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:938) fd: -1 here_begin: {(EOF)} here_end_span_id: 1002 stdin_parts: [ ('pick ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:944) command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(--short)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other '^') (Id.Lit_Other '^') } ) ] ) ) (' first commit\n') ($ Id.VSub_Number '$1') (' ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:959) command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(--short)} {(HEAD) (Id.Lit_Other '^')} ) ] ) ) (' ') ($ Id.VSub_Number '$1') ('! first\n') ($ Id.VSub_Number '$1') (' ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:974) command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--short)} {(HEAD)})] ) ) (' ') ($ Id.VSub_Number '$1') ('! ') ($ Id.VSub_Number '$2') ('! first\n') ('pick ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:989) command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(--short)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other '^')} ) ] ) ) (' second commit\n') ] ) ] ) (C {(test_cmp)} {(expected)} {(actual)}) ] ) ] ) ) (C {(git)} {(rebase)} {(--autosquash)} {(-i)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other '^') (Id.Lit_Other '^') (Id.Lit_Other '^')} ) (command.Simple words: [{(git)} {(log)} {(--oneline)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1039) fd: -1 arg_word: {(actual)} ) ] ) (C {(test_line_count)} {(Id.Lit_Equals '=')} {(3)} {(actual)}) ] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {(git)} {(diff)} {(--exit-code)} {(DQ (final-) ($ Id.VSub_Number '$1') (-) ($ Id.VSub_Number '$2'))} ) (C {(test)} {(2)} {(Id.Lit_Equals '=')} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1077) command_list: (command.CommandList children: [ (C {(git)} {(cat-file)} {(blob)} {(HEAD) (Id.Lit_Other '^') (Id.Lit_Other ':') (file1)} ) ] ) ) ) } ) (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_Equals '=')} {(DQ (fixup))}) ] action: [ (C {(test)} {(1)} {(Id.Lit_Equals '=')} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1118) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(cat-file)} {(commit)} {(HEAD) (Id.Lit_Other '^')}) (C {(grep)} {(first)}) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } ) ] spids: [1094 1109] ) (if_arm cond: [ (C {(test)} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_Equals '=')} {(DQ (squash))}) ] action: [ (C {(test)} {(3)} {(Id.Lit_Equals '=')} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1166) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(cat-file)} {(commit)} {(HEAD) (Id.Lit_Other '^')}) (C {(grep)} {(first)}) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } ) ] spids: [1142 1157] ) ] else_action: [(C {(false)})] ) ] ) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fixup! fixup!' span_id:1204))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1208) (Token id:Id.Lit_Chars val:'\ttest_auto_fixup_fixup fixup fixup\n' span_id:1209) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'fixup! squash!' span_id:1216))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1220) (Token id:Id.Lit_Chars val:'\ttest_auto_fixup_fixup fixup squash\n' span_id:1221) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'squash! squash!' span_id:1228))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1232) (Token id: Id.Lit_Chars val: '\ttest_auto_fixup_fixup squash squash\n' span_id: 1233 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'squash! fixup!' span_id:1240))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1244) (Token id:Id.Lit_Chars val:'\ttest_auto_fixup_fixup squash fixup\n' span_id:1245) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'autosquash with custom inst format' span_id:1252))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1256) (Token id:Id.Lit_Chars val:'\tgit reset --hard base &&\n' span_id:1257) (Token id: Id.Lit_Chars val: '\tgit config --add rebase.instructionFormat "[%an @ %ar] %s" &&\n' span_id: 1258 ) (Token id:Id.Lit_Chars val:'\techo 2 >file1 &&\n' span_id:1259) (Token id:Id.Lit_Chars val:'\tgit add -u &&\n' span_id:1260) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1261) (Token id: Id.Lit_Chars val: '\tgit commit -m "squash! $(git rev-parse --short HEAD^)" &&\n' span_id: 1262 ) (Token id:Id.Lit_Chars val:'\techo 1 >file1 &&\n' span_id:1263) (Token id:Id.Lit_Chars val:'\tgit add -u &&\n' span_id:1264) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1265) (Token id: Id.Lit_Chars val: '\tgit commit -m "squash! $(git log -n 1 --format=%s HEAD~2)" &&\n' span_id: 1266 ) (Token id:Id.Lit_Chars val:'\tgit tag final-squash-instFmt &&\n' span_id:1267) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1268) (Token id:Id.Lit_Chars val:'\tgit rebase --autosquash -i HEAD~4 &&\n' span_id:1269) (Token id:Id.Lit_Chars val:'\tgit log --oneline >actual &&\n' span_id:1270) (Token id:Id.Lit_Chars val:'\ttest_line_count = 3 actual &&\n' span_id:1271) (Token id: Id.Lit_Chars val: '\tgit diff --exit-code final-squash-instFmt &&\n' span_id: 1272 ) (Token id:Id.Lit_Chars val:'\ttest 1 = "$(git cat-file blob HEAD^:file1)" &&\n' span_id:1273) (Token id: Id.Lit_Chars val: '\ttest 2 = $(git cat-file commit HEAD^ | grep squash | wc -l)\n' span_id: 1274 ) ) } ) (command.ShFunction name: set_backup_editor body: (command.BraceGroup children: [ (command.Simple words: [{(write_script)} {(backup-editor.sh)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:1290) fd: -1 here_begin: { (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\E' span_id:1291) ) (OF) } here_end_span_id: 1295 stdin_parts: [('cp "$1" .git/backup-"$(basename "$1")"\n')] ) ] ) (C {(test_set_editor)} {(DQ ($ Id.VSub_DollarName '$PWD') (/backup-editor.sh))}) ] ) ) (C {(test_expect_failure)} {(SQ (Token id:Id.Lit_Chars val:'autosquash with multiple empty patches' span_id:1310))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1314) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1315) (Token id:Id.Lit_Chars val:'\tgit commit --allow-empty -m "empty" &&\n' span_id:1316) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1317) (Token id:Id.Lit_Chars val:'\tgit commit --allow-empty -m "empty2" &&\n' span_id:1318) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1319) (Token id:Id.Lit_Chars val:'\t>fixup &&\n' span_id:1320) (Token id:Id.Lit_Chars val:'\tgit add fixup &&\n' span_id:1321) (Token id:Id.Lit_Chars val:'\tgit commit --fixup HEAD^^ &&\n' span_id:1322) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1323) (Token id:Id.Lit_Chars val:'\t\tset_backup_editor &&\n' span_id:1324) (Token id:Id.Lit_Chars val:'\t\tGIT_USE_REBASE_HELPER=false \\\n' span_id:1325) (Token id:Id.Lit_Chars val:'\t\tgit rebase -i --force-rebase --autosquash HEAD~4 &&\n' span_id:1326) (Token id: Id.Lit_Chars val: '\t\tgrep empty2 .git/backup-git-rebase-todo\n' span_id: 1327 ) (Token id:Id.Lit_Chars val:'\t)\n' span_id:1328) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'extra spaces after fixup!' span_id:1335))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1339) (Token id:Id.Lit_Chars val:'\tbase=$(git rev-parse HEAD) &&\n' span_id:1340) (Token id:Id.Lit_Chars val:'\ttest_commit to-fixup &&\n' span_id:1341) (Token id: Id.Lit_Chars val: '\tgit commit --allow-empty -m "fixup! to-fixup" &&\n' span_id: 1342 ) (Token id:Id.Lit_Chars val:'\tgit rebase -i --autosquash --keep-empty HEAD~2 &&\n' span_id:1343) (Token id:Id.Lit_Chars val:'\tparent=$(git rev-parse HEAD^) &&\n' span_id:1344) (Token id:Id.Lit_Chars val:'\ttest $base = $parent\n' span_id:1345) ) } ) (C {(test_done)}) ] )