(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:'git rebase interactive\n' span_id:15) 
                (Token id:Id.Lit_Chars val:'\n' span_id:16) 
                (Token
                  id: Id.Lit_Chars
                  val: 
'This test runs git rebase "interactively", by faking an edit, and verifies\n'
                  span_id: 17
                ) (Token id:Id.Lit_Chars val:'that the result still makes sense.\n' span_id:18) 
                (Token id:Id.Lit_Chars val:'\n' span_id:19) (Token id:Id.Lit_Chars val:'Initial setup:\n' span_id:20) (Token id:Id.Lit_Chars val:'\n' span_id:21) 
                (Token
                  id: Id.Lit_Chars
                  val: '     one - two - three - four (conflict-branch)\n'
                  span_id: 22
                ) (Token id:Id.Lit_Chars val:'   /\n' span_id:23) 
                (Token
                  id: Id.Lit_Chars
                  val: ' A - B - C - D - E            (master)\n'
                  span_id: 24
                ) (Token id:Id.Lit_Chars val:' | \\\n' span_id:25) 
                (Token
                  id: Id.Lit_Chars
                  val: ' |   F - G - H                (branch1)\n'
                  span_id: 26
                ) (Token id:Id.Lit_Chars val:' |     \\\n' span_id:27) 
                (Token
                  id: Id.Lit_Chars
                  val: ' |\\      I                    (branch2)\n'
                  span_id: 28
                ) (Token id:Id.Lit_Chars val:' | \\\n' span_id:29) 
                (Token
                  id: Id.Lit_Chars
                  val: ' |   J - K - L - M            (no-conflict-branch)\n'
                  span_id: 30
                ) (Token id:Id.Lit_Chars val:'  \\\n' span_id:31) 
                (Token
                  id: Id.Lit_Chars
                  val: '    N - O - P                 (no-ff-branch)\n'
                  span_id: 32
                ) (Token id:Id.Lit_Chars val:'\n' span_id:33) 
                (Token
                  id: Id.Lit_Chars
                  val: ' where A, B, D and G all touch file1, and one, two, three, four all\n'
                  span_id: 34
                ) (Token id:Id.Lit_Chars val:' touch file "conflict".\n' span_id:35)
              )
            }
          spids: [13]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(.)} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) (/lib-rebase.sh)})
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:61))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:65) 
          (Token id:Id.Lit_Chars val:'\ttest_commit A file1 &&\n' span_id:66) (Token id:Id.Lit_Chars val:'\ttest_commit B file1 &&\n' span_id:67) 
          (Token id:Id.Lit_Chars val:'\ttest_commit C file2 &&\n' span_id:68) (Token id:Id.Lit_Chars val:'\ttest_commit D file1 &&\n' span_id:69) 
          (Token id:Id.Lit_Chars val:'\ttest_commit E file3 &&\n' span_id:70) (Token id:Id.Lit_Chars val:'\tgit checkout -b branch1 A &&\n' span_id:71) 
          (Token id:Id.Lit_Chars val:'\ttest_commit F file4 &&\n' span_id:72) (Token id:Id.Lit_Chars val:'\ttest_commit G file1 &&\n' span_id:73) 
          (Token id:Id.Lit_Chars val:'\ttest_commit H file5 &&\n' span_id:74) (Token id:Id.Lit_Chars val:'\tgit checkout -b branch2 F &&\n' span_id:75) 
          (Token id:Id.Lit_Chars val:'\ttest_commit I file6 &&\n' span_id:76) (Token id:Id.Lit_Chars val:'\tgit checkout -b conflict-branch A &&\n' span_id:77) 
          (Token id:Id.Lit_Chars val:'\ttest_commit one conflict &&\n' span_id:78) (Token id:Id.Lit_Chars val:'\ttest_commit two conflict &&\n' span_id:79) 
          (Token id:Id.Lit_Chars val:'\ttest_commit three conflict &&\n' span_id:80) (Token id:Id.Lit_Chars val:'\ttest_commit four conflict &&\n' span_id:81) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b no-conflict-branch A &&\n'
            span_id: 82
          ) (Token id:Id.Lit_Chars val:'\ttest_commit J fileJ &&\n' span_id:83) 
          (Token id:Id.Lit_Chars val:'\ttest_commit K fileK &&\n' span_id:84) (Token id:Id.Lit_Chars val:'\ttest_commit L fileL &&\n' span_id:85) 
          (Token id:Id.Lit_Chars val:'\ttest_commit M fileM &&\n' span_id:86) (Token id:Id.Lit_Chars val:'\tgit checkout -b no-ff-branch A &&\n' span_id:87) 
          (Token id:Id.Lit_Chars val:'\ttest_commit N fileN &&\n' span_id:88) (Token id:Id.Lit_Chars val:'\ttest_commit O fileO &&\n' span_id:89) 
          (Token id:Id.Lit_Chars val:'\ttest_commit P fileP\n' span_id:90)
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SHELL)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [106]
        )
      ]
    )
    (C {(export)} {(SHELL)})
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'rebase --keep-empty' span_id:116))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:120) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b emptybranch master &&\n'
            span_id: 121
          ) (Token id:Id.Lit_Chars val:'\tgit commit --allow-empty -m "empty" &&\n' span_id:122) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit rebase --keep-empty -i HEAD~2 &&\n'
            span_id: 123
          ) (Token id:Id.Lit_Chars val:'\tgit log --oneline >actual &&\n' span_id:124) 
          (Token id:Id.Lit_Chars val:'\ttest_line_count = 6 actual\n' span_id:125)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i with the exec command' span_id:132))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:136) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:137) (Token id:Id.Lit_Chars val:'\t(\n' span_id:138) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:139) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 exec_>touch-one\n' span_id:140) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t2 exec_>touch-two exec_false exec_>touch-three\n'
            span_id: 141
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t3 4 exec_>\\"touch-file__name_with_spaces\\";_>touch-after-semicolon 5" &&\n'
            span_id: 142
          ) (Token id:Id.Lit_Chars val:'\texport FAKE_LINES &&\n' span_id:143) 
          (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase -i A\n' span_id:144) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:145) 
          (Token id:Id.Lit_Chars val:'\ttest_path_is_file touch-one &&\n' span_id:146) (Token id:Id.Lit_Chars val:'\ttest_path_is_file touch-two &&\n' span_id:147) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_path_is_missing touch-three " (should have stopped before)" &&\n'
            span_id: 148
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp_rev C HEAD &&\n' span_id:149) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:150) (Token id:Id.Lit_Chars val:'\ttest_path_is_file touch-three &&\n' span_id:151) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_path_is_file "touch-file  name with spaces" &&\n'
            span_id: 152
          ) (Token id:Id.Lit_Chars val:'\ttest_path_is_file touch-after-semicolon &&\n' span_id:153) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp_rev master HEAD &&\n' span_id:154) (Token id:Id.Lit_Chars val:'\trm -f touch-*\n' span_id:155)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i with the exec command runs from tree root'
            span_id: 162
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:166) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:167) (Token id:Id.Lit_Chars val:'\tmkdir subdir && (cd subdir &&\n' span_id:168) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:169) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 exec_>touch-subdir" \\\n' span_id:170) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD^\n' span_id:171) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:172) 
          (Token id:Id.Lit_Chars val:'\ttest_path_is_file touch-subdir &&\n' span_id:173) (Token id:Id.Lit_Chars val:'\trm -fr subdir\n' span_id:174)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i with the exec command checks tree cleanness'
            span_id: 181
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:185) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:186) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:187) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="exec_echo_foo_>file1 1" git rebase -i HEAD^ &&\n'
            span_id: 188
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp_rev master^ HEAD &&\n' span_id:189) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:190) (Token id:Id.Lit_Chars val:'\tgit rebase --continue\n' span_id:191)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i with exec of inexistent command' span_id:198))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:202) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:203) (Token id:Id.Lit_Chars val:'\ttest_when_finished "git rebase --abort" &&\n' span_id:204) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:205) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="exec_this-command-does-not-exist 1" \\\n'
            span_id: 206
          ) (Token id:Id.Lit_Chars val:'\tgit rebase -i HEAD^ >actual 2>&1 &&\n' span_id:207) 
          (Token
            id: Id.Lit_Chars
            val: '\t! grep "Maybe git-rebase is broken" actual\n'
            span_id: 208
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'no changes are a nop' span_id:215))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:219) 
          (Token id:Id.Lit_Chars val:'\tgit checkout branch2 &&\n' span_id:220) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:221) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i F &&\n' span_id:222) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest "$(git symbolic-ref -q HEAD)" = "refs/heads/branch2" &&\n'
            span_id: 223
          ) (Token id:Id.Lit_Chars val:'\ttest $(git rev-parse I) = $(git rev-parse HEAD)\n' span_id:224)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'test the [branch] option' span_id:231))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:235) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b dead-end &&\n' span_id:236) (Token id:Id.Lit_Chars val:'\tgit rm file6 &&\n' span_id:237) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m "stop here" &&\n' span_id:238) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:239) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i F branch2 &&\n' span_id:240) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest "$(git symbolic-ref -q HEAD)" = "refs/heads/branch2" &&\n'
            span_id: 241
          ) (Token id:Id.Lit_Chars val:'\ttest $(git rev-parse I) = $(git rev-parse branch2) &&\n' span_id:242) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse I) = $(git rev-parse HEAD)\n'
            span_id: 243
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'test --onto <branch>' span_id:250))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:254) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b test-onto branch2 &&\n'
            span_id: 255
          ) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:256) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i --onto branch1 F &&\n' span_id:257) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest "$(git symbolic-ref -q HEAD)" = "refs/heads/test-onto" &&\n'
            span_id: 258
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse HEAD^) = $(git rev-parse branch1) &&\n'
            span_id: 259
          ) (Token id:Id.Lit_Chars val:'\ttest $(git rev-parse I) = $(git rev-parse branch2)\n' span_id:260)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase on top of a non-conflicting commit' span_id:267))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:271) 
          (Token id:Id.Lit_Chars val:'\tgit checkout branch1 &&\n' span_id:272) (Token id:Id.Lit_Chars val:'\tgit tag original-branch1 &&\n' span_id:273) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:274) (Token id:Id.Lit_Chars val:'\tgit rebase -i branch2 &&\n' span_id:275) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest file6 = $(git diff --name-only original-branch1) &&\n'
            span_id: 276
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest "$(git symbolic-ref -q HEAD)" = "refs/heads/branch1" &&\n'
            span_id: 277
          ) (Token id:Id.Lit_Chars val:'\ttest $(git rev-parse I) = $(git rev-parse branch2) &&\n' span_id:278) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse I) = $(git rev-parse HEAD~2)\n'
            span_id: 279
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'reflog for the branch shows state before rebase' span_id:286))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:290) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse branch1@{1}) = $(git rev-parse original-branch1)\n'
            span_id: 291
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'exchange two commits' span_id:298))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:302) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:303) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="2 1" git rebase -i HEAD~2 &&\n' span_id:304) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest H = $(git cat-file commit HEAD^ | sed -ne \\$p) &&\n'
            span_id: 305
          ) (Token id:Id.Lit_Chars val:'\ttest G = $(git cat-file commit HEAD | sed -ne \\$p)\n' span_id:306)
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:312)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:316)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 328
          stdin_parts: [
            ('diff --git a/file1 b/file1\n')
            ('index f70f10e..fd79235 100644\n')
            ('--- a/file1\n')
            ('+++ b/file1\n')
            ('@@ -1 +1 @@\n')
            ('-A\n')
            ('+G\n')
          ]
        )
      ]
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:332)
          fd: -1
          arg_word: {(expect2)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:336)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 346
          stdin_parts: [('<<<<<<< HEAD\n') ('D\n') ('=======\n') ('G\n') ('>>>>>>> 5d18e54... G\n')]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'stop on conflicting pick' span_id:351))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:355) 
          (Token id:Id.Lit_Chars val:'\tgit tag new-branch1 &&\n' span_id:356) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:357) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase -i master &&\n'
            span_id: 358
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest "$(git rev-parse HEAD~3)" = "$(git rev-parse master)" &&\n'
            span_id: 359
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect .git/rebase-merge/patch &&\n' span_id:360) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp expect2 file1 &&\n' span_id:361) (Token id:Id.Lit_Chars val:'\ttest "$(git diff --name-status |\n' span_id:362) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tsed -n -e "/^U/s/^U[^a-z]*//p")" = file1 &&\n'
            span_id: 363
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 4 = $(grep -v "^#" < .git/rebase-merge/done | wc -l) &&\n'
            span_id: 364
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 0 = $(grep -c "^[^#]" < .git/rebase-merge/git-rebase-todo)\n'
            span_id: 365
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:abort span_id:372))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:376) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --abort &&\n' span_id:377) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&\n'
            span_id: 378
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest "$(git symbolic-ref -q HEAD)" = "refs/heads/branch1" &&\n'
            span_id: 379
          ) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing .git/rebase-merge\n' span_id:380)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'abort with error when new base cannot be checked out'
            span_id: 387
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:391) 
          (Token id:Id.Lit_Chars val:'\tgit rm --cached file1 &&\n' span_id:392) (Token id:Id.Lit_Chars val:'\tgit commit -m "remove file in base" &&\n' span_id:393) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:394) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase -i master > output 2>&1 &&\n' span_id:395) 
          (Token
            id: Id.Lit_Chars
            val: 
'\ttest_i18ngrep "The following untracked working tree files would be overwritten by checkout:" \\\n'
            span_id: 396
          ) (Token id:Id.Lit_Chars val:'\t\toutput &&\n' span_id:397) 
          (Token id:Id.Lit_Chars val:'\ttest_i18ngrep "file1" output &&\n' span_id:398) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing .git/rebase-merge &&\n' span_id:399) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD^\n' span_id:400)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'retain authorship' span_id:407))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:411) 
          (Token id:Id.Lit_Chars val:'\techo A > file7 &&\n' span_id:412) (Token id:Id.Lit_Chars val:'\tgit add file7 &&\n' span_id:413) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:414) 
          (Token
            id: Id.Lit_Chars
            val: '\tGIT_AUTHOR_NAME="Twerp Snog" git commit -m "different author" &&\n'
            span_id: 415
          ) (Token id:Id.Lit_Chars val:'\tgit tag twerp &&\n' span_id:416) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:417) (Token id:Id.Lit_Chars val:'\tgit rebase -i --onto master HEAD^ &&\n' span_id:418) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit show HEAD | grep "^Author: Twerp Snog"\n'
            span_id: 419
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:squash span_id:426))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:430) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard twerp &&\n' span_id:431) (Token id:Id.Lit_Chars val:'\techo B > file7 &&\n' span_id:432) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:433) 
          (Token
            id: Id.Lit_Chars
            val: '\tGIT_AUTHOR_NAME="Nitfol" git commit -m "nitfol" file7 &&\n'
            span_id: 434
          ) (Token id:Id.Lit_Chars val:'\techo "******************************" &&\n' span_id:435) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:436) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 squash 2" EXPECT_HEADER_COUNT=2 \\\n' span_id:437) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit rebase -i --onto master HEAD~2 &&\n'
            span_id: 438
          ) (Token id:Id.Lit_Chars val:'\ttest B = $(cat file7) &&\n' span_id:439) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse HEAD^) = $(git rev-parse master)\n'
            span_id: 440
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'retain authorship when squashing' span_id:447))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:451) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit show HEAD | grep "^Author: Twerp Snog"\n'
            span_id: 452
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'-p handles "no changes" gracefully' span_id:459))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:463) 
          (Token id:Id.Lit_Chars val:'\tHEAD=$(git rev-parse HEAD) &&\n' span_id:464) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:465) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i -p HEAD^ &&\n' span_id:466) (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:467) 
          (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet &&\n' span_id:468) (Token id:Id.Lit_Chars val:'\tgit diff-index --quiet --cached HEAD -- &&\n' span_id:469) 
          (Token id:Id.Lit_Chars val:'\ttest $HEAD = $(git rev-parse HEAD)\n' span_id:470)
        )
      }
    )
    (C {(test_expect_failure)} 
      {(SQ (Token id:Id.Lit_Chars val:'exchange two commits with -p' span_id:477))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:481) 
          (Token id:Id.Lit_Chars val:'\tgit checkout H &&\n' span_id:482) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:483) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="2 1" git rebase -i -p HEAD~2 &&\n'
            span_id: 484
          ) (Token id:Id.Lit_Chars val:'\ttest H = $(git cat-file commit HEAD^ | sed -ne \\$p) &&\n' span_id:485) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest G = $(git cat-file commit HEAD | sed -ne \\$p)\n'
            span_id: 486
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'preserve merges with -p' span_id:493))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:497) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b to-be-preserved master^ &&\n'
            span_id: 498
          ) (Token id:Id.Lit_Chars val:'\t: > unrelated-file &&\n' span_id:499) 
          (Token id:Id.Lit_Chars val:'\tgit add unrelated-file &&\n' span_id:500) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:501) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m "unrelated" &&\n' span_id:502) (Token id:Id.Lit_Chars val:'\tgit checkout -b another-branch master &&\n' span_id:503) 
          (Token id:Id.Lit_Chars val:'\techo B > file1 &&\n' span_id:504) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:505) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m J file1 &&\n' span_id:506) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:507) 
          (Token id:Id.Lit_Chars val:'\tgit merge to-be-preserved &&\n' span_id:508) (Token id:Id.Lit_Chars val:'\techo C > file1 &&\n' span_id:509) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:510) (Token id:Id.Lit_Chars val:'\tgit commit -m K file1 &&\n' span_id:511) 
          (Token id:Id.Lit_Chars val:'\techo D > file1 &&\n' span_id:512) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:513) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m L1 file1 &&\n' span_id:514) (Token id:Id.Lit_Chars val:'\tgit checkout HEAD^ &&\n' span_id:515) 
          (Token id:Id.Lit_Chars val:'\techo 1 > unrelated-file &&\n' span_id:516) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:517) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m L2 unrelated-file &&\n' span_id:518) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:519) 
          (Token id:Id.Lit_Chars val:'\tgit merge another-branch &&\n' span_id:520) (Token id:Id.Lit_Chars val:'\techo E > file1 &&\n' span_id:521) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:522) (Token id:Id.Lit_Chars val:'\tgit commit -m M file1 &&\n' span_id:523) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b to-be-rebased &&\n' span_id:524) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:525) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:526) (Token id:Id.Lit_Chars val:'\tgit rebase -i -p --onto branch1 master &&\n' span_id:527) 
          (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:528) (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet &&\n' span_id:529) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit diff-index --quiet --cached HEAD -- &&\n'
            span_id: 530
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse HEAD~6) = $(git rev-parse branch1) &&\n'
            span_id: 531
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse HEAD~4^2) = $(git rev-parse to-be-preserved) &&\n'
            span_id: 532
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse HEAD^^2^) = $(git rev-parse HEAD^^^) &&\n'
            span_id: 533
          ) (Token id:Id.Lit_Chars val:'\ttest $(git show HEAD~5:file1) = B &&\n' span_id:534) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git show HEAD~3:file1) = C &&\n'
            span_id: 535
          ) (Token id:Id.Lit_Chars val:'\ttest $(git show HEAD:file1) = E &&\n' span_id:536) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git show HEAD:unrelated-file) = 1\n'
            span_id: 537
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'edit ancestor with -p' span_id:544))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:548) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:549) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 2 edit 3 4" git rebase -i -p HEAD~3 &&\n' span_id:550) 
          (Token id:Id.Lit_Chars val:'\techo 2 > unrelated-file &&\n' span_id:551) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:552) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit commit -m L2-modified --amend unrelated-file &&\n'
            span_id: 553
          ) (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:554) 
          (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:555) (Token id:Id.Lit_Chars val:'\tgit diff-files --quiet &&\n' span_id:556) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit diff-index --quiet --cached HEAD -- &&\n'
            span_id: 557
          ) (Token id:Id.Lit_Chars val:'\ttest $(git show HEAD:unrelated-file) = 2\n' span_id:558)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'--continue tries to commit' span_id:565))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:569) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:570) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:571) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase -i --onto new-branch1 HEAD^ &&\n'
            span_id: 572
          ) (Token id:Id.Lit_Chars val:'\techo resolved > file1 &&\n' span_id:573) 
          (Token id:Id.Lit_Chars val:'\tgit add file1 &&\n' span_id:574) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_COMMIT_MESSAGE="chouette!" git rebase --continue &&\n'
            span_id: 575
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse HEAD^) = $(git rev-parse new-branch1) &&\n'
            span_id: 576
          ) (Token id:Id.Lit_Chars val:'\tgit show HEAD | grep chouette\n' span_id:577)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'verbose flag is heeded, even after --continue' span_id:584))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:588) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard master@{1} &&\n' span_id:589) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:590) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:591) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase -v -i --onto new-branch1 HEAD^ &&\n'
            span_id: 592
          ) (Token id:Id.Lit_Chars val:'\techo resolved > file1 &&\n' span_id:593) 
          (Token id:Id.Lit_Chars val:'\tgit add file1 &&\n' span_id:594) (Token id:Id.Lit_Chars val:'\tgit rebase --continue > output &&\n' span_id:595) 
          (Token id:Id.Lit_Chars val:'\tgrep "^ file1 | 2 +-$" output\n' span_id:596)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'multi-squash only fires up editor once' span_id:603))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:607) 
          (Token id:Id.Lit_Chars val:'\tbase=$(git rev-parse HEAD~4) &&\n' span_id:608) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:609) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 squash 2 squash 3 squash 4" \\\n'
            span_id: 610
          ) (Token id:Id.Lit_Chars val:'\t\tEXPECT_HEADER_COUNT=4 \\\n' span_id:611) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i $base &&\n' span_id:612) (Token id:Id.Lit_Chars val:'\ttest $base = $(git rev-parse HEAD^) &&\n' span_id:613) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 1 = $(git show | grep ONCE | wc -l)\n'
            span_id: 614
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'multi-fixup does not fire up editor' span_id:621))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:625) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b multi-fixup E &&\n' span_id:626) (Token id:Id.Lit_Chars val:'\tbase=$(git rev-parse HEAD~4) &&\n' span_id:627) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:628) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_COMMIT_AMEND="NEVER" FAKE_LINES="1 fixup 2 fixup 3 fixup 4" \\\n'
            span_id: 629
          ) (Token id:Id.Lit_Chars val:'\t\tgit rebase -i $base &&\n' span_id:630) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $base = $(git rev-parse HEAD^) &&\n'
            span_id: 631
          ) (Token id:Id.Lit_Chars val:'\ttest 0 = $(git show | grep NEVER | wc -l) &&\n' span_id:632) 
          (Token id:Id.Lit_Chars val:'\tgit checkout to-be-rebased &&\n' span_id:633) (Token id:Id.Lit_Chars val:'\tgit branch -D multi-fixup\n' span_id:634)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'commit message used after conflict' span_id:641))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:645) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b conflict-fixup conflict-branch &&\n'
            span_id: 646
          ) (Token id:Id.Lit_Chars val:'\tbase=$(git rev-parse HEAD~4) &&\n' span_id:647) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:648) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="1 fixup 3 fixup 4" git rebase -i $base &&\n'
            span_id: 649
          ) (Token id:Id.Lit_Chars val:'\techo three > conflict &&\n' span_id:650) 
          (Token id:Id.Lit_Chars val:'\tgit add conflict &&\n' span_id:651) (Token id:Id.Lit_Chars val:'\tFAKE_COMMIT_AMEND="ONCE" EXPECT_HEADER_COUNT=2 \\\n' span_id:652) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase --continue &&\n' span_id:653) (Token id:Id.Lit_Chars val:'\ttest $base = $(git rev-parse HEAD^) &&\n' span_id:654) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 1 = $(git show | grep ONCE | wc -l) &&\n'
            span_id: 655
          ) (Token id:Id.Lit_Chars val:'\tgit checkout to-be-rebased &&\n' span_id:656) 
          (Token id:Id.Lit_Chars val:'\tgit branch -D conflict-fixup\n' span_id:657)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'commit message retained after conflict' span_id:664))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:668) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b conflict-squash conflict-branch &&\n'
            span_id: 669
          ) (Token id:Id.Lit_Chars val:'\tbase=$(git rev-parse HEAD~4) &&\n' span_id:670) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:671) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="1 fixup 3 squash 4" git rebase -i $base &&\n'
            span_id: 672
          ) (Token id:Id.Lit_Chars val:'\techo three > conflict &&\n' span_id:673) 
          (Token id:Id.Lit_Chars val:'\tgit add conflict &&\n' span_id:674) (Token id:Id.Lit_Chars val:'\tFAKE_COMMIT_AMEND="TWICE" EXPECT_HEADER_COUNT=2 \\\n' span_id:675) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase --continue &&\n' span_id:676) (Token id:Id.Lit_Chars val:'\ttest $base = $(git rev-parse HEAD^) &&\n' span_id:677) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 2 = $(git show | grep TWICE | wc -l) &&\n'
            span_id: 678
          ) (Token id:Id.Lit_Chars val:'\tgit checkout to-be-rebased &&\n' span_id:679) 
          (Token id:Id.Lit_Chars val:'\tgit branch -D conflict-squash\n' span_id:680)
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:686)
          fd: -1
          arg_word: {(expect-squash-fixup)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:690)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 700
          stdin_parts: [('B\n') ('\n') ('D\n') ('\n') ('ONCE\n')]
        )
      ]
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'squash and fixup generate correct log messages' span_id:705))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:709) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b squash-fixup E &&\n' span_id:710) (Token id:Id.Lit_Chars val:'\tbase=$(git rev-parse HEAD~4) &&\n' span_id:711) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:712) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 fixup 2 squash 3 fixup 4" \\\n'
            span_id: 713
          ) (Token id:Id.Lit_Chars val:'\t\tEXPECT_HEADER_COUNT=4 \\\n' span_id:714) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i $base &&\n' span_id:715) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit cat-file commit HEAD | sed -e 1,/^\\$/d > actual-squash-fixup &&\n'
            span_id: 716
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-squash-fixup actual-squash-fixup &&\n' span_id:717) 
          (Token id:Id.Lit_Chars val:'\tgit checkout to-be-rebased &&\n' span_id:718) (Token id:Id.Lit_Chars val:'\tgit branch -D squash-fixup\n' span_id:719)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'squash ignores comments' span_id:726))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:730) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b skip-comments E &&\n' span_id:731) (Token id:Id.Lit_Chars val:'\tbase=$(git rev-parse HEAD~4) &&\n' span_id:732) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:733) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tFAKE_COMMIT_AMEND="ONCE" FAKE_LINES="# 1 # squash 2 # squash 3 # squash 4 #" \\\n'
            span_id: 734
          ) (Token id:Id.Lit_Chars val:'\t\tEXPECT_HEADER_COUNT=4 \\\n' span_id:735) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i $base &&\n' span_id:736) (Token id:Id.Lit_Chars val:'\ttest $base = $(git rev-parse HEAD^) &&\n' span_id:737) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 1 = $(git show | grep ONCE | wc -l) &&\n'
            span_id: 738
          ) (Token id:Id.Lit_Chars val:'\tgit checkout to-be-rebased &&\n' span_id:739) 
          (Token id:Id.Lit_Chars val:'\tgit branch -D skip-comments\n' span_id:740)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'squash ignores blank lines' span_id:747))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:751) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b skip-blank-lines E &&\n'
            span_id: 752
          ) (Token id:Id.Lit_Chars val:'\tbase=$(git rev-parse HEAD~4) &&\n' span_id:753) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:754) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tFAKE_COMMIT_AMEND="ONCE" FAKE_LINES="> 1 > squash 2 > squash 3 > squash 4 >" \\\n'
            span_id: 755
          ) (Token id:Id.Lit_Chars val:'\t\tEXPECT_HEADER_COUNT=4 \\\n' span_id:756) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i $base &&\n' span_id:757) (Token id:Id.Lit_Chars val:'\ttest $base = $(git rev-parse HEAD^) &&\n' span_id:758) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 1 = $(git show | grep ONCE | wc -l) &&\n'
            span_id: 759
          ) (Token id:Id.Lit_Chars val:'\tgit checkout to-be-rebased &&\n' span_id:760) 
          (Token id:Id.Lit_Chars val:'\tgit branch -D skip-blank-lines\n' span_id:761)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'squash works as expected' span_id:768))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:772) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b squash-works no-conflict-branch &&\n'
            span_id: 773
          ) (Token id:Id.Lit_Chars val:'\tone=$(git rev-parse HEAD~3) &&\n' span_id:774) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:775) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 squash 3 2" EXPECT_HEADER_COUNT=2 \\\n' span_id:776) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD~3 &&\n' span_id:777) (Token id:Id.Lit_Chars val:'\ttest $one = $(git rev-parse HEAD~2)\n' span_id:778)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'interrupted squash works as expected' span_id:785))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:789) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b interrupted-squash conflict-branch &&\n'
            span_id: 790
          ) (Token id:Id.Lit_Chars val:'\tone=$(git rev-parse HEAD~3) &&\n' span_id:791) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:792) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="1 squash 3 2" git rebase -i HEAD~3 &&\n'
            span_id: 793
          ) (Token id:Id.Lit_Chars val:'\t(echo one; echo two; echo four) > conflict &&\n' span_id:794) 
          (Token id:Id.Lit_Chars val:'\tgit add conflict &&\n' span_id:795) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase --continue &&\n' span_id:796) 
          (Token id:Id.Lit_Chars val:'\techo resolved > conflict &&\n' span_id:797) (Token id:Id.Lit_Chars val:'\tgit add conflict &&\n' span_id:798) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:799) (Token id:Id.Lit_Chars val:'\ttest $one = $(git rev-parse HEAD~2)\n' span_id:800)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'interrupted squash works as expected (case 2)' span_id:807))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:811) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b interrupted-squash2 conflict-branch &&\n'
            span_id: 812
          ) (Token id:Id.Lit_Chars val:'\tone=$(git rev-parse HEAD~3) &&\n' span_id:813) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:814) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="3 squash 1 2" git rebase -i HEAD~3 &&\n'
            span_id: 815
          ) (Token id:Id.Lit_Chars val:'\t(echo one; echo four) > conflict &&\n' span_id:816) 
          (Token id:Id.Lit_Chars val:'\tgit add conflict &&\n' span_id:817) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase --continue &&\n' span_id:818) 
          (Token
            id: Id.Lit_Chars
            val: '\t(echo one; echo two; echo four) > conflict &&\n'
            span_id: 819
          ) (Token id:Id.Lit_Chars val:'\tgit add conflict &&\n' span_id:820) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase --continue &&\n'
            span_id: 821
          ) (Token id:Id.Lit_Chars val:'\techo resolved > conflict &&\n' span_id:822) 
          (Token id:Id.Lit_Chars val:'\tgit add conflict &&\n' span_id:823) (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:824) 
          (Token id:Id.Lit_Chars val:'\ttest $one = $(git rev-parse HEAD~2)\n' span_id:825)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'--continue tries to commit, even for "edit"' span_id:832))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:836) 
          (Token id:Id.Lit_Chars val:'\techo unrelated > file7 &&\n' span_id:837) (Token id:Id.Lit_Chars val:'\tgit add file7 &&\n' span_id:838) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:839) (Token id:Id.Lit_Chars val:'\tgit commit -m "unrelated change" &&\n' span_id:840) 
          (Token id:Id.Lit_Chars val:'\tparent=$(git rev-parse HEAD^) &&\n' span_id:841) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:842) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:843) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="edit 1" git rebase -i HEAD^ &&\n' span_id:844) 
          (Token id:Id.Lit_Chars val:'\techo edited > file7 &&\n' span_id:845) (Token id:Id.Lit_Chars val:'\tgit add file7 &&\n' span_id:846) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_COMMIT_MESSAGE="chouette!" git rebase --continue &&\n'
            span_id: 847
          ) (Token id:Id.Lit_Chars val:'\ttest edited = $(git show HEAD:file7) &&\n' span_id:848) 
          (Token id:Id.Lit_Chars val:'\tgit show HEAD | grep chouette &&\n' span_id:849) (Token id:Id.Lit_Chars val:'\ttest $parent = $(git rev-parse HEAD^)\n' span_id:850)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'aborted --continue does not squash commits after "edit"'
            span_id: 857
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:861) 
          (Token id:Id.Lit_Chars val:'\told=$(git rev-parse HEAD) &&\n' span_id:862) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:863) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:864) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="edit 1" git rebase -i HEAD^ &&\n' span_id:865) 
          (Token id:Id.Lit_Chars val:'\techo "edited again" > file7 &&\n' span_id:866) (Token id:Id.Lit_Chars val:'\tgit add file7 &&\n' span_id:867) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_COMMIT_MESSAGE=" " git rebase --continue &&\n'
            span_id: 868
          ) (Token id:Id.Lit_Chars val:'\ttest $old = $(git rev-parse HEAD) &&\n' span_id:869) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --abort\n' span_id:870)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'auto-amend only edited commits after "edit"' span_id:877))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:881) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:882) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:883) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="edit 1" git rebase -i HEAD^ &&\n'
            span_id: 884
          ) (Token id:Id.Lit_Chars val:'\techo "edited again" > file7 &&\n' span_id:885) 
          (Token id:Id.Lit_Chars val:'\tgit add file7 &&\n' span_id:886) (Token id:Id.Lit_Chars val:'\tFAKE_COMMIT_MESSAGE="edited file7 again" git commit &&\n' span_id:887) 
          (Token id:Id.Lit_Chars val:'\techo "and again" > file7 &&\n' span_id:888) (Token id:Id.Lit_Chars val:'\tgit add file7 &&\n' span_id:889) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:890) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_COMMIT_MESSAGE="and again" git rebase --continue &&\n'
            span_id: 891
          ) (Token id:Id.Lit_Chars val:'\tgit rebase --abort\n' span_id:892)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'clean error after failed "exec"' span_id:899))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:903) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:904) (Token id:Id.Lit_Chars val:'\ttest_when_finished "git rebase --abort || :" &&\n' span_id:905) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:906) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="1 exec_false" git rebase -i HEAD^ &&\n'
            span_id: 907
          ) (Token id:Id.Lit_Chars val:'\techo "edited again" > file7 &&\n' span_id:908) 
          (Token id:Id.Lit_Chars val:'\tgit add file7 &&\n' span_id:909) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase --continue 2>error &&\n' span_id:910) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_i18ngrep "You have staged changes in your working tree." error\n'
            span_id: 911
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'rebase a detached HEAD' span_id:918))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:922) 
          (Token
            id: Id.Lit_Chars
            val: '\tgrandparent=$(git rev-parse HEAD~2) &&\n'
            span_id: 923
          ) (Token id:Id.Lit_Chars val:'\tgit checkout $(git rev-parse HEAD) &&\n' span_id:924) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:925) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:926) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="2 1" git rebase -i HEAD~2 &&\n'
            span_id: 927
          ) (Token id:Id.Lit_Chars val:'\ttest $grandparent = $(git rev-parse HEAD~2)\n' span_id:928)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase a commit violating pre-commit' span_id:935))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:939) (Token id:Id.Lit_Chars val:'\n' span_id:940) 
          (Token id:Id.Lit_Chars val:'\tmkdir -p .git/hooks &&\n' span_id:941) (Token id:Id.Lit_Chars val:'\twrite_script .git/hooks/pre-commit <<-\\EOF &&\n' span_id:942) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest -z "$(git diff --cached --check)"\n'
            span_id: 943
          ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:944) 
          (Token id:Id.Lit_Chars val:'\techo "monde! " >> file1 &&\n' span_id:945) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:946) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git commit -m doesnt-verify file1 &&\n'
            span_id: 947
          ) (Token id:Id.Lit_Chars val:'\tgit commit -m doesnt-verify --no-verify file1 &&\n' span_id:948) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:949) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:950) 
          (Token id:Id.Lit_Chars val:'\tFAKE_LINES=2 git rebase -i HEAD~2\n' span_id:951) (Token id:Id.Lit_Chars val:'\n' span_id:952)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase with a file named HEAD in worktree' span_id:959))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:963) (Token id:Id.Lit_Chars val:'\n' span_id:964) 
          (Token id:Id.Lit_Chars val:'\trm -fr .git/hooks &&\n' span_id:965) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:966) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b branch3 A &&\n' span_id:967) (Token id:Id.Lit_Chars val:'\n' span_id:968) (Token id:Id.Lit_Chars val:'\t(\n' span_id:969) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tGIT_AUTHOR_NAME="Squashed Away" &&\n'
            span_id: 970
          ) (Token id:Id.Lit_Chars val:'\t\texport GIT_AUTHOR_NAME &&\n' span_id:971) 
          (Token id:Id.Lit_Chars val:'\t\t>HEAD &&\n' span_id:972) (Token id:Id.Lit_Chars val:'\t\tgit add HEAD &&\n' span_id:973) 
          (Token id:Id.Lit_Chars val:'\t\tgit commit -m "Add head" &&\n' span_id:974) (Token id:Id.Lit_Chars val:'\t\t>BODY &&\n' span_id:975) 
          (Token id:Id.Lit_Chars val:'\t\tgit add BODY &&\n' span_id:976) (Token id:Id.Lit_Chars val:'\t\tgit commit -m "Add body"\n' span_id:977) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:978) (Token id:Id.Lit_Chars val:'\n' span_id:979) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:980) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 squash 2" git rebase -i to-be-rebased &&\n' span_id:981) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest "$(git show -s --pretty=format:%an)" = "Squashed Away"\n'
            span_id: 982
          ) (Token id:Id.Lit_Chars val:'\n' span_id:983)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'do "noop" when there is nothing to cherry-pick' span_id:990))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:994) (Token id:Id.Lit_Chars val:'\n' span_id:995) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b branch4 HEAD &&\n' span_id:996) (Token id:Id.Lit_Chars val:'\tGIT_EDITOR=: git commit --amend \\\n' span_id:997) 
          (Token
            id: Id.Lit_Chars
            val: '\t\t--author="Somebody else <somebody@else.com>" &&\n'
            span_id: 998
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse branch3) != $(git rev-parse branch4) &&\n'
            span_id: 999
          ) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1000) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i branch3 &&\n' span_id:1001) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse branch3) = $(git rev-parse branch4)\n'
            span_id: 1002
          ) (Token id:Id.Lit_Chars val:'\n' span_id:1003)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'submodule rebase setup' span_id:1010))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1014) 
          (Token id:Id.Lit_Chars val:'\tgit checkout A &&\n' span_id:1015) (Token id:Id.Lit_Chars val:'\tmkdir sub &&\n' span_id:1016) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1017) (Token id:Id.Lit_Chars val:'\t\tcd sub && git init && >elif &&\n' span_id:1018) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit add elif && git commit -m "submodule initial"\n'
            span_id: 1019
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1020) 
          (Token id:Id.Lit_Chars val:'\techo 1 >file1 &&\n' span_id:1021) (Token id:Id.Lit_Chars val:'\tgit add file1 sub &&\n' span_id:1022) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1023) (Token id:Id.Lit_Chars val:'\tgit commit -m "One" &&\n' span_id:1024) 
          (Token id:Id.Lit_Chars val:'\techo 2 >file1 &&\n' span_id:1025) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1026) 
          (Token id:Id.Lit_Chars val:'\tgit commit -a -m "Two" &&\n' span_id:1027) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1028) 
          (Token id:Id.Lit_Chars val:'\t\tcd sub && echo 3 >elif &&\n' span_id:1029) (Token id:Id.Lit_Chars val:'\t\tgit commit -a -m "submodule second"\n' span_id:1030) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1031) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1032) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1033) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "Three changes submodule"\n' span_id:1034)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'submodule rebase -i' span_id:1041))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1045) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1046) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 squash 2 3" git rebase -i A\n' span_id:1047)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'submodule conflict setup' span_id:1054))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1058) 
          (Token id:Id.Lit_Chars val:'\tgit tag submodule-base &&\n' span_id:1059) (Token id:Id.Lit_Chars val:'\tgit checkout HEAD^ &&\n' span_id:1060) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1061) (Token id:Id.Lit_Chars val:'\t\tcd sub && git checkout HEAD^ && echo 4 >elif &&\n' span_id:1062) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit add elif && git commit -m "submodule conflict"\n'
            span_id: 1063
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1064) 
          (Token id:Id.Lit_Chars val:'\tgit add sub &&\n' span_id:1065) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1066) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit commit -m "Conflict in submodule" &&\n'
            span_id: 1067
          ) (Token id:Id.Lit_Chars val:'\tgit tag submodule-topic\n' span_id:1068)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i continue with only submodule staged' span_id:1075))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1079) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1080) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase -i submodule-base &&\n' span_id:1081) 
          (Token id:Id.Lit_Chars val:'\tgit add sub &&\n' span_id:1082) (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:1083) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse submodule-base) != $(git rev-parse HEAD)\n'
            span_id: 1084
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i continue with unstaged submodule' span_id:1091))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1095) 
          (Token id:Id.Lit_Chars val:'\tgit checkout submodule-topic &&\n' span_id:1096) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1097) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1098) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase -i submodule-base &&\n' span_id:1099) 
          (Token id:Id.Lit_Chars val:'\tgit reset &&\n' span_id:1100) (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:1101) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse submodule-base) = $(git rev-parse HEAD)\n'
            span_id: 1102
          )
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'avoid unnecessary reset' span_id:1109))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1113) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:1114) (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1115) 
          (Token id:Id.Lit_Chars val:'\ttest-chmtime =123456789 file3 &&\n' span_id:1116) (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:1117) 
          (Token id:Id.Lit_Chars val:'\tHEAD=$(git rev-parse HEAD) &&\n' span_id:1118) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1119) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i HEAD~4 &&\n' span_id:1120) (Token id:Id.Lit_Chars val:'\ttest $HEAD = $(git rev-parse HEAD) &&\n' span_id:1121) 
          (Token
            id: Id.Lit_Chars
            val: '\tMTIME=$(test-chmtime -v +0 file3 | sed '
            span_id: 1122
          )
        ) (s/) (Id.Lit_LBracket '[') (Id.Lit_Other '^') (0-9) (Id.Lit_RBracket ']') (.) (Id.Lit_Star '*') 
        (Id.Lit_Other '$') (//) 
        (SQ (Token id:Id.Lit_Chars val:') &&\n' span_id:1134) 
          (Token id:Id.Lit_Chars val:'\ttest 123456789 = $MTIME\n' span_id:1135)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:reword span_id:1142))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1146) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b reword-branch master &&\n'
            span_id: 1147
          ) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1148) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tFAKE_LINES="1 2 3 reword 4" FAKE_COMMIT_MESSAGE="E changed" git rebase -i A &&\n'
            span_id: 1149
          ) (Token id:Id.Lit_Chars val:'\tgit show HEAD | grep "E changed" &&\n' span_id:1150) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse master) != $(git rev-parse HEAD) &&\n'
            span_id: 1151
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse master^) = $(git rev-parse HEAD^) &&\n'
            span_id: 1152
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tFAKE_LINES="1 2 reword 3 4" FAKE_COMMIT_MESSAGE="D changed" git rebase -i A &&\n'
            span_id: 1153
          ) (Token id:Id.Lit_Chars val:'\tgit show HEAD^ | grep "D changed" &&\n' span_id:1154) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tFAKE_LINES="reword 1 2 3 4" FAKE_COMMIT_MESSAGE="B changed" git rebase -i A &&\n'
            span_id: 1155
          ) (Token id:Id.Lit_Chars val:'\tgit show HEAD~3 | grep "B changed" &&\n' span_id:1156) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tFAKE_LINES="1 reword 2 3 4" FAKE_COMMIT_MESSAGE="C changed" git rebase -i A &&\n'
            span_id: 1157
          ) (Token id:Id.Lit_Chars val:'\tgit show HEAD~2 | grep "C changed"\n' span_id:1158)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i can copy notes' span_id:1165))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1169) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit config notes.rewrite.rebase true &&\n'
            span_id: 1170
          ) (Token id:Id.Lit_Chars val:'\tgit config notes.rewriteRef "refs/notes/*" &&\n' span_id:1171) 
          (Token id:Id.Lit_Chars val:'\ttest_commit n1 &&\n' span_id:1172) (Token id:Id.Lit_Chars val:'\ttest_commit n2 &&\n' span_id:1173) 
          (Token id:Id.Lit_Chars val:'\ttest_commit n3 &&\n' span_id:1174) (Token id:Id.Lit_Chars val:'\tgit notes add -m"a note" n3 &&\n' span_id:1175) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1176) (Token id:Id.Lit_Chars val:'\tgit rebase -i --onto n1 n2 &&\n' span_id:1177) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest "a note" = "$(git notes show HEAD)"\n'
            span_id: 1178
          )
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:1184)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:1187)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 1194
          stdin_parts: [('an earlier note\n') ('\n') ('a note\n')]
        )
      ]
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i can copy notes over a fixup' span_id:1199))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1203) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard n3 &&\n' span_id:1204) (Token id:Id.Lit_Chars val:'\tgit notes add -m"an earlier note" n2 &&\n' span_id:1205) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1206) 
          (Token
            id: Id.Lit_Chars
            val: '\tGIT_NOTES_REWRITE_MODE=concatenate FAKE_LINES="1 fixup 2" git rebase -i n1 &&\n'
            span_id: 1207
          ) (Token id:Id.Lit_Chars val:'\tgit notes show > output &&\n' span_id:1208) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp expect output\n' span_id:1209)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase while detaching HEAD' span_id:1216))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1220) 
          (Token id:Id.Lit_Chars val:'\tgit symbolic-ref HEAD &&\n' span_id:1221) (Token id:Id.Lit_Chars val:'\tgrandparent=$(git rev-parse HEAD~2) &&\n' span_id:1222) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1223) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1224) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="2 1" git rebase -i HEAD~2 HEAD^0 &&\n'
            span_id: 1225
          ) (Token id:Id.Lit_Chars val:'\ttest $grandparent = $(git rev-parse HEAD~2) &&\n' span_id:1226) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git symbolic-ref HEAD\n'
            span_id: 1227
          )
        )
      }
    )
    (C {(test_tick)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'always cherry-pick with --no-ff' span_id:1239))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1243) 
          (Token id:Id.Lit_Chars val:'\tgit checkout no-ff-branch &&\n' span_id:1244) (Token id:Id.Lit_Chars val:'\tgit tag original-no-ff-branch &&\n' span_id:1245) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1246) (Token id:Id.Lit_Chars val:'\tgit rebase -i --no-ff A &&\n' span_id:1247) 
          (Token id:Id.Lit_Chars val:'\ttouch empty &&\n' span_id:1248) (Token id:Id.Lit_Chars val:'\tfor p in 0 1 2\n' span_id:1249) 
          (Token id:Id.Lit_Chars val:'\tdo\n' span_id:1250) 
          (Token
            id: Id.Lit_Chars
            val: 
'\t\ttest ! $(git rev-parse HEAD~$p) = $(git rev-parse original-no-ff-branch~$p) &&\n'
            span_id: 1251
          ) (Token id:Id.Lit_Chars val:'\t\tgit diff HEAD~$p original-no-ff-branch~$p > out &&\n' span_id:1252) 
          (Token id:Id.Lit_Chars val:'\t\ttest_cmp empty out\n' span_id:1253) (Token id:Id.Lit_Chars val:'\tdone &&\n' span_id:1254) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git rev-parse HEAD~3) = $(git rev-parse original-no-ff-branch~3) &&\n'
            span_id: 1255
          ) (Token id:Id.Lit_Chars val:'\tgit diff HEAD~3 original-no-ff-branch~3 > out &&\n' span_id:1256) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp empty out\n' span_id:1257)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'set up commits with funny messages' span_id:1264))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1268) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b funny A &&\n' span_id:1269) (Token id:Id.Lit_Chars val:'\techo >>file1 &&\n' span_id:1270) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1271) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "end with slash\\\\" &&\n' span_id:1272) 
          (Token id:Id.Lit_Chars val:'\techo >>file1 &&\n' span_id:1273) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1274) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit commit -a -m "something (\\000) that looks like octal" &&\n'
            span_id: 1275
          ) (Token id:Id.Lit_Chars val:'\techo >>file1 &&\n' span_id:1276) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1277) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit commit -a -m "something (\\n) that looks like a newline" &&\n'
            span_id: 1278
          ) (Token id:Id.Lit_Chars val:'\techo >>file1 &&\n' span_id:1279) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1280) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "another commit"\n' span_id:1281)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase-i history with funny messages' span_id:1288))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1292) 
          (Token id:Id.Lit_Chars val:'\tgit rev-list A..funny >expect &&\n' span_id:1293) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1294) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1295) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 2 3 4" git rebase -i A &&\n' span_id:1296) 
          (Token id:Id.Lit_Chars val:'\tgit rev-list A.. >actual &&\n' span_id:1297) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1298)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'prepare for rebase -i --exec' span_id:1305))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1309) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:1310) (Token id:Id.Lit_Chars val:'\tgit checkout -b execute &&\n' span_id:1311) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_commit one_exec main.txt one_exec &&\n'
            span_id: 1312
          ) (Token id:Id.Lit_Chars val:'\ttest_commit two_exec main.txt two_exec &&\n' span_id:1313) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_commit three_exec main.txt three_exec\n'
            span_id: 1314
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'running "git rebase -i --exec git show HEAD"' span_id:1321))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1325) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1326) (Token id:Id.Lit_Chars val:'\tgit rebase -i --exec "git show HEAD" HEAD~2 >actual &&\n' span_id:1327) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1328) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tFAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&\n'
            span_id: 1329
          ) (Token id:Id.Lit_Chars val:'\t\texport FAKE_LINES &&\n' span_id:1330) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD~2 >expect\n' span_id:1331) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1332) 
          (Token id:Id.Lit_Chars val:'\tsed -e "1,9d" expect >expected &&\n' span_id:1333) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:1334)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'running "git rebase --exec git show HEAD -i"' span_id:1341))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1345) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard execute &&\n' span_id:1346) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1347) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit rebase --exec "git show HEAD" -i HEAD~2 >actual &&\n'
            span_id: 1348
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1349) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tFAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&\n'
            span_id: 1350
          ) (Token id:Id.Lit_Chars val:'\t\texport FAKE_LINES &&\n' span_id:1351) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD~2 >expect\n' span_id:1352) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1353) 
          (Token id:Id.Lit_Chars val:'\tsed -e "1,9d" expect >expected &&\n' span_id:1354) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:1355)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'running "git rebase -ix git show HEAD"' span_id:1362))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1366) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard execute &&\n' span_id:1367) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1368) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit rebase -ix "git show HEAD" HEAD~2 >actual &&\n'
            span_id: 1369
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1370) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tFAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&\n'
            span_id: 1371
          ) (Token id:Id.Lit_Chars val:'\t\texport FAKE_LINES &&\n' span_id:1372) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD~2 >expect\n' span_id:1373) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1374) 
          (Token id:Id.Lit_Chars val:'\tsed -e "1,9d" expect >expected &&\n' span_id:1375) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:1376)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -ix with several <CMD>' span_id:1384))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1388) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard execute &&\n' span_id:1389) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1390) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit rebase -ix "git show HEAD; pwd" HEAD~2 >actual &&\n'
            span_id: 1391
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1392) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tFAKE_LINES="1 exec_git_show_HEAD;_pwd 2 exec_git_show_HEAD;_pwd" &&\n'
            span_id: 1393
          ) (Token id:Id.Lit_Chars val:'\t\texport FAKE_LINES &&\n' span_id:1394) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD~2 >expect\n' span_id:1395) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1396) 
          (Token id:Id.Lit_Chars val:'\tsed -e "1,9d" expect >expected &&\n' span_id:1397) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:1398)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -ix with several instances of --exec' span_id:1405))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1409) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard execute &&\n' span_id:1410) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1411) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit rebase -i --exec "git show HEAD" --exec "pwd" HEAD~2 >actual &&\n'
            span_id: 1412
          ) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1413) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tFAKE_LINES="1 exec_git_show_HEAD exec_pwd 2\n'
            span_id: 1414
          ) (Token id:Id.Lit_Chars val:'\t\t\t\texec_git_show_HEAD exec_pwd" &&\n' span_id:1415) 
          (Token id:Id.Lit_Chars val:'\t\texport FAKE_LINES &&\n' span_id:1416) (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD~2 >expect\n' span_id:1417) 
          (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1418) (Token id:Id.Lit_Chars val:'\tsed -e "1,11d" expect >expected &&\n' span_id:1419) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:1420)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -ix with --autosquash' span_id:1427))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1431) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard execute &&\n' span_id:1432) (Token id:Id.Lit_Chars val:'\tgit checkout -b autosquash &&\n' span_id:1433) 
          (Token id:Id.Lit_Chars val:'\techo second >second.txt &&\n' span_id:1434) (Token id:Id.Lit_Chars val:'\tgit add second.txt &&\n' span_id:1435) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m "fixup! two_exec" &&\n' span_id:1436) (Token id:Id.Lit_Chars val:'\techo bis >bis.txt &&\n' span_id:1437) 
          (Token id:Id.Lit_Chars val:'\tgit add bis.txt &&\n' span_id:1438) (Token id:Id.Lit_Chars val:'\tgit commit -m "fixup! two_exec" &&\n' span_id:1439) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1440) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1441) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit checkout -b autosquash_actual &&\n'
            span_id: 1442
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit rebase -i --exec "git show HEAD" --autosquash HEAD~4 >actual\n'
            span_id: 1443
          ) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1444) 
          (Token id:Id.Lit_Chars val:'\tgit checkout autosquash &&\n' span_id:1445) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1446) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tgit checkout -b autosquash_expected &&\n'
            span_id: 1447
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tFAKE_LINES="1 fixup 3 fixup 4 exec_git_show_HEAD 2 exec_git_show_HEAD" &&\n'
            span_id: 1448
          ) (Token id:Id.Lit_Chars val:'\t\texport FAKE_LINES &&\n' span_id:1449) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD~4 >expect\n' span_id:1450) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:1451) 
          (Token id:Id.Lit_Chars val:'\tsed -e "1,13d" expect >expected &&\n' span_id:1452) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:1453)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase --exec works without -i ' span_id:1460))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1464) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard execute &&\n' span_id:1465) (Token id:Id.Lit_Chars val:'\trm -rf exec_output &&\n' span_id:1466) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tEDITOR="echo >invoked_editor" git rebase --exec "echo a line >>exec_output"  HEAD~2 2>actual &&\n'
            span_id: 1467
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_i18ngrep  "Successfully rebased and updated" actual &&\n'
            span_id: 1468
          ) (Token id:Id.Lit_Chars val:'\ttest_line_count = 2 exec_output &&\n' span_id:1469) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_path_is_missing invoked_editor\n'
            span_id: 1470
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i --exec without <CMD>' span_id:1477))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1481) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard execute &&\n' span_id:1482) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1483) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase -i --exec 2>tmp &&\n'
            span_id: 1484
          ) (Token id:Id.Lit_Chars val:'\tsed -e "1d" tmp >actual &&\n' span_id:1485) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase -h >expected &&\n'
            span_id: 1486
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual &&\n' span_id:1487) 
          (Token id:Id.Lit_Chars val:'\tgit checkout master\n' span_id:1488)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i --root re-order and drop commits' span_id:1495))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1499) 
          (Token id:Id.Lit_Chars val:'\tgit checkout E &&\n' span_id:1500) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1501) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="3 1 2 5" git rebase -i --root &&\n'
            span_id: 1502
          ) (Token id:Id.Lit_Chars val:'\ttest E = $(git cat-file commit HEAD | sed -ne \\$p) &&\n' span_id:1503) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest B = $(git cat-file commit HEAD^ | sed -ne \\$p) &&\n'
            span_id: 1504
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest A = $(git cat-file commit HEAD^^ | sed -ne \\$p) &&\n'
            span_id: 1505
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest C = $(git cat-file commit HEAD^^^ | sed -ne \\$p) &&\n'
            span_id: 1506
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 0 = $(git cat-file commit HEAD^^^ | grep -c ^parent\\ )\n'
            span_id: 1507
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i --root retain root commit author and message'
            span_id: 1514
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1518) 
          (Token id:Id.Lit_Chars val:'\tgit checkout A &&\n' span_id:1519) (Token id:Id.Lit_Chars val:'\techo B >file7 &&\n' span_id:1520) 
          (Token id:Id.Lit_Chars val:'\tgit add file7 &&\n' span_id:1521) 
          (Token
            id: Id.Lit_Chars
            val: '\tGIT_AUTHOR_NAME="Twerp Snog" git commit -m "different author" &&\n'
            span_id: 1522
          ) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1523) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="2" git rebase -i --root &&\n'
            span_id: 1524
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit cat-file commit HEAD | grep -q "^author Twerp Snog" &&\n'
            span_id: 1525
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit cat-file commit HEAD | grep -q "^different author$"\n'
            span_id: 1526
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i --root temporary sentinel commit' span_id:1533))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1537) 
          (Token id:Id.Lit_Chars val:'\tgit checkout B &&\n' span_id:1538) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1539) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="2" git rebase -i --root &&\n'
            span_id: 1540
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit cat-file commit HEAD | grep "^tree 4b825dc642cb" &&\n'
            span_id: 1541
          ) (Token id:Id.Lit_Chars val:'\tgit rebase --abort\n' span_id:1542)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i --root fixup root commit' span_id:1549))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1553) 
          (Token id:Id.Lit_Chars val:'\tgit checkout B &&\n' span_id:1554) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1555) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="1 fixup 2" git rebase -i --root &&\n'
            span_id: 1556
          ) (Token id:Id.Lit_Chars val:'\ttest A = $(git cat-file commit HEAD | sed -ne \\$p) &&\n' span_id:1557) 
          (Token id:Id.Lit_Chars val:'\ttest B = $(git show HEAD:file1) &&\n' span_id:1558) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest 0 = $(git cat-file commit HEAD | grep -c ^parent\\ )\n'
            span_id: 1559
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase --edit-todo does not works on non-interactive rebase'
            span_id: 1566
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1570) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1571) (Token id:Id.Lit_Chars val:'\tgit checkout conflict-branch &&\n' span_id:1572) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1573) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase --onto HEAD~2 HEAD~ &&\n' span_id:1574) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase --edit-todo &&\n'
            span_id: 1575
          ) (Token id:Id.Lit_Chars val:'\tgit rebase --abort\n' span_id:1576)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase --edit-todo can be used to modify todo' span_id:1583))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1587) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1588) (Token id:Id.Lit_Chars val:'\tgit checkout no-conflict-branch^0 &&\n' span_id:1589) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1590) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="edit 1 2 3" git rebase -i HEAD~3 &&\n' span_id:1591) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="2 1" git rebase --edit-todo &&\n'
            span_id: 1592
          ) (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:1593) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest M = $(git cat-file commit HEAD^ | sed -ne \\$p) &&\n'
            span_id: 1594
          ) (Token id:Id.Lit_Chars val:'\ttest L = $(git cat-file commit HEAD | sed -ne \\$p)\n' span_id:1595)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i produces readable reflog' span_id:1602))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1606) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1607) (Token id:Id.Lit_Chars val:'\tgit branch -f branch-reflog-test H &&\n' span_id:1608) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1609) (Token id:Id.Lit_Chars val:'\tgit rebase -i --onto I F branch-reflog-test &&\n' span_id:1610) 
          (Token id:Id.Lit_Chars val:'\tcat >expect <<-\\EOF &&\n' span_id:1611) 
          (Token
            id: Id.Lit_Chars
            val: '\trebase -i (finish): returning to refs/heads/branch-reflog-test\n'
            span_id: 1612
          ) (Token id:Id.Lit_Chars val:'\trebase -i (pick): H\n' span_id:1613) 
          (Token id:Id.Lit_Chars val:'\trebase -i (pick): G\n' span_id:1614) (Token id:Id.Lit_Chars val:'\trebase -i (start): checkout I\n' span_id:1615) 
          (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1616) (Token id:Id.Lit_Chars val:'\tgit reflog -n4 HEAD |\n' span_id:1617) 
          (Token id:Id.Lit_Chars val:'\tsed "s/[^:]*: //" >actual &&\n' span_id:1618) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1619)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i respects core.commentchar' span_id:1626))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1630) 
          (Token id:Id.Lit_Chars val:'\tgit reset --hard &&\n' span_id:1631) (Token id:Id.Lit_Chars val:'\tgit checkout E^0 &&\n' span_id:1632) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config core.commentchar "\\\\" &&\n'
            span_id: 1633
          ) (Token id:Id.Lit_Chars val:'\twrite_script remove-all-but-first.sh <<-\\EOF &&\n' span_id:1634) 
          (Token
            id: Id.Lit_Chars
            val: '\tsed -e "2,\\$s/^/\\\\\\\\/" "$1" >"$1.tmp" &&\n'
            span_id: 1635
          ) (Token id:Id.Lit_Chars val:'\tmv "$1.tmp" "$1"\n' span_id:1636) 
          (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1637) (Token id:Id.Lit_Chars val:'\ttest_set_editor "$(pwd)/remove-all-but-first.sh" &&\n' span_id:1638) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i B &&\n' span_id:1639) (Token id:Id.Lit_Chars val:'\ttest B = $(git cat-file commit HEAD^ | sed -ne \\$p)\n' span_id:1640)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i, with <onto> and <upstream> specified as :/quuxery'
            span_id: 1647
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1651) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_when_finished "git branch -D torebase" &&\n'
            span_id: 1652
          ) (Token id:Id.Lit_Chars val:'\tgit checkout -b torebase branch1 &&\n' span_id:1653) 
          (Token id:Id.Lit_Chars val:'\tupstream=$(git rev-parse ":/J") &&\n' span_id:1654) (Token id:Id.Lit_Chars val:'\tonto=$(git rev-parse ":/A") &&\n' span_id:1655) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit rebase --onto $onto $upstream &&\n'
            span_id: 1656
          ) (Token id:Id.Lit_Chars val:'\tgit reset --hard branch1 &&\n' span_id:1657) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --onto ":/A" ":/J" &&\n' span_id:1658) (Token id:Id.Lit_Chars val:'\tgit checkout branch1\n' span_id:1659)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i with --strategy and -X' span_id:1666))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1670) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b conflict-merge-use-theirs conflict-branch &&\n'
            span_id: 1671
          ) (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD^ &&\n' span_id:1672) 
          (Token id:Id.Lit_Chars val:'\techo five >conflict &&\n' span_id:1673) (Token id:Id.Lit_Chars val:'\techo Z >file1 &&\n' span_id:1674) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit commit -a -m "one file conflict" &&\n'
            span_id: 1675
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\tEDITOR=true git rebase -i --strategy=recursive -Xours conflict-branch &&\n'
            span_id: 1676
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git show conflict-branch:conflict) = $(cat conflict) &&\n'
            span_id: 1677
          ) (Token id:Id.Lit_Chars val:'\ttest $(cat file1) = Z\n' span_id:1678)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'interrupted rebase -i with --strategy and -X' span_id:1685))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1689) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit checkout -b conflict-merge-use-theirs-interrupted conflict-branch &&\n'
            span_id: 1690
          ) (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD^ &&\n' span_id:1691) 
          (Token id:Id.Lit_Chars val:'\t>breakpoint &&\n' span_id:1692) (Token id:Id.Lit_Chars val:'\tgit add breakpoint &&\n' span_id:1693) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit commit -m "breakpoint for interactive mode" &&\n'
            span_id: 1694
          ) (Token id:Id.Lit_Chars val:'\techo five >conflict &&\n' span_id:1695) 
          (Token id:Id.Lit_Chars val:'\techo Z >file1 &&\n' span_id:1696) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "one file conflict" &&\n' span_id:1697) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1698) 
          (Token
            id: Id.Lit_Chars
            val: 
'\tFAKE_LINES="edit 1 2" git rebase -i --strategy=recursive -Xours conflict-branch &&\n'
            span_id: 1699
          ) (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:1700) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git show conflict-branch:conflict) = $(cat conflict) &&\n'
            span_id: 1701
          ) (Token id:Id.Lit_Chars val:'\ttest $(cat file1) = Z\n' span_id:1702)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i error on commits with \\ in message' span_id:1709))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1713) 
          (Token
            id: Id.Lit_Chars
            val: '\tcurrent_head=$(git rev-parse HEAD) &&\n'
            span_id: 1714
          ) 
          (Token
            id: Id.Lit_Chars
            val: 
'\ttest_when_finished "git rebase --abort; git reset --hard $current_head; rm -f error" &&\n'
            span_id: 1715
          ) (Token id:Id.Lit_Chars val:'\ttest_commit TO-REMOVE will-conflict old-content &&\n' span_id:1716) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_commit "\\temp" will-conflict new-content dummy &&\n'
            span_id: 1717
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env EDITOR=true git rebase -i HEAD^ --onto HEAD^^ 2>error &&\n'
            span_id: 1718
          ) (Token id:Id.Lit_Chars val:'\ttest_expect_code 1 grep  "\temp" error\n' span_id:1719)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'short SHA-1 setup' span_id:1726))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1730) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_when_finished "git checkout master" &&\n'
            span_id: 1731
          ) (Token id:Id.Lit_Chars val:'\tgit checkout --orphan collide &&\n' span_id:1732) 
          (Token id:Id.Lit_Chars val:'\tgit rm -rf . &&\n' span_id:1733) (Token id:Id.Lit_Chars val:'\t(\n' span_id:1734) 
          (Token id:Id.Lit_Chars val:'\tunset test_tick &&\n' span_id:1735) (Token id:Id.Lit_Chars val:'\ttest_commit collide1 collide &&\n' span_id:1736) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_commit --notick collide2 collide &&\n'
            span_id: 1737
          ) (Token id:Id.Lit_Chars val:'\ttest_commit --notick collide3 collide\n' span_id:1738) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1739)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'short SHA-1 collide' span_id:1746))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1750) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_when_finished "reset_rebase && git checkout master" &&\n'
            span_id: 1751
          ) (Token id:Id.Lit_Chars val:'\tgit checkout collide &&\n' span_id:1752) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:1753) (Token id:Id.Lit_Chars val:'\tunset test_tick &&\n' span_id:1754) 
          (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:1755) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1756) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_COMMIT_MESSAGE="collide2 ac4f2ee" \\\n'
            span_id: 1757
          ) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="reword 1 2" git rebase -i HEAD~2\n' span_id:1758) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:1759)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'respect core.abbrev' span_id:1766))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1770) 
          (Token id:Id.Lit_Chars val:'\tgit config core.abbrev 12 &&\n' span_id:1771) (Token id:Id.Lit_Chars val:'\tset_cat_todo_editor &&\n' span_id:1772) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase -i HEAD~4 >todo-list &&\n'
            span_id: 1773
          ) (Token id:Id.Lit_Chars val:'\ttest 4 = $(grep -c "pick [0-9a-f]\\{12,\\}" todo-list)\n' span_id:1774)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'todo count' span_id:1781))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1785) 
          (Token
            id: Id.Lit_Chars
            val: '\twrite_script dump-raw.sh <<-\\EOF &&\n'
            span_id: 1786
          ) (Token id:Id.Lit_Chars val:'\t\tcat "$1"\n' span_id:1787) 
          (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1788) (Token id:Id.Lit_Chars val:'\ttest_set_editor "$(pwd)/dump-raw.sh" &&\n' span_id:1789) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i HEAD~4 >actual &&\n' span_id:1790) (Token id:Id.Lit_Chars val:'\ttest_i18ngrep "^# Rebase ..* onto ..* ([0-9]" actual\n' span_id:1791)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i commits that overwrite untracked files (pick)'
            span_id: 1798
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1802) 
          (Token id:Id.Lit_Chars val:'\tgit checkout --force branch2 &&\n' span_id:1803) (Token id:Id.Lit_Chars val:'\tgit clean -f &&\n' span_id:1804) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1805) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="edit 1 2" git rebase -i A &&\n' span_id:1806) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp_rev HEAD F &&\n' span_id:1807) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing file6 &&\n' span_id:1808) 
          (Token id:Id.Lit_Chars val:'\t>file6 &&\n' span_id:1809) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase --continue &&\n' span_id:1810) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp_rev HEAD F &&\n' span_id:1811) (Token id:Id.Lit_Chars val:'\trm file6 &&\n' span_id:1812) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:1813) (Token id:Id.Lit_Chars val:'\ttest_cmp_rev HEAD I\n' span_id:1814)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i commits that overwrite untracked files (squash)'
            span_id: 1821
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1825) 
          (Token id:Id.Lit_Chars val:'\tgit checkout --force branch2 &&\n' span_id:1826) (Token id:Id.Lit_Chars val:'\tgit clean -f &&\n' span_id:1827) 
          (Token id:Id.Lit_Chars val:'\tgit tag original-branch2 &&\n' span_id:1828) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1829) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="edit 1 squash 2" git rebase -i A &&\n'
            span_id: 1830
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp_rev HEAD F &&\n' span_id:1831) 
          (Token id:Id.Lit_Chars val:'\ttest_path_is_missing file6 &&\n' span_id:1832) (Token id:Id.Lit_Chars val:'\t>file6 &&\n' span_id:1833) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git rebase --continue &&\n'
            span_id: 1834
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp_rev HEAD F &&\n' span_id:1835) 
          (Token id:Id.Lit_Chars val:'\trm file6 &&\n' span_id:1836) (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:1837) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git cat-file commit HEAD | sed -ne \\$p) = I &&\n'
            span_id: 1838
          ) (Token id:Id.Lit_Chars val:'\tgit reset --hard original-branch2\n' span_id:1839)
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i commits that overwrite untracked files (no ff)'
            span_id: 1846
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1850) 
          (Token id:Id.Lit_Chars val:'\tgit checkout --force branch2 &&\n' span_id:1851) (Token id:Id.Lit_Chars val:'\tgit clean -f &&\n' span_id:1852) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1853) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="edit 1 2" git rebase -i --no-ff A &&\n' span_id:1854) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git cat-file commit HEAD | sed -ne \\$p) = F &&\n'
            span_id: 1855
          ) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing file6 &&\n' span_id:1856) 
          (Token id:Id.Lit_Chars val:'\t>file6 &&\n' span_id:1857) (Token id:Id.Lit_Chars val:'\ttest_must_fail git rebase --continue &&\n' span_id:1858) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest $(git cat-file commit HEAD | sed -ne \\$p) = F &&\n'
            span_id: 1859
          ) (Token id:Id.Lit_Chars val:'\trm file6 &&\n' span_id:1860) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:1861) (Token id:Id.Lit_Chars val:'\ttest $(git cat-file commit HEAD | sed -ne \\$p) = I\n' span_id:1862)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase --continue removes CHERRY_PICK_HEAD' span_id:1869))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1873) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b commit-to-skip &&\n' span_id:1874) (Token id:Id.Lit_Chars val:'\tfor double in X 3 1\n' span_id:1875) 
          (Token id:Id.Lit_Chars val:'\tdo\n' span_id:1876) (Token id:Id.Lit_Chars val:'\t\ttest_seq 5 | sed "s/$double/&&/" >seq &&\n' span_id:1877) 
          (Token id:Id.Lit_Chars val:'\t\tgit add seq &&\n' span_id:1878) (Token id:Id.Lit_Chars val:'\t\ttest_tick &&\n' span_id:1879) 
          (Token id:Id.Lit_Chars val:'\t\tgit commit -m seq-$double\n' span_id:1880) (Token id:Id.Lit_Chars val:'\tdone &&\n' span_id:1881) 
          (Token id:Id.Lit_Chars val:'\tgit tag seq-onto &&\n' span_id:1882) (Token id:Id.Lit_Chars val:'\tgit reset --hard HEAD~2 &&\n' span_id:1883) 
          (Token id:Id.Lit_Chars val:'\tgit cherry-pick seq-onto &&\n' span_id:1884) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1885) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES= git rebase -i seq-onto &&\n'
            span_id: 1886
          ) (Token id:Id.Lit_Chars val:'\ttest -d .git/rebase-merge &&\n' span_id:1887) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:1888) (Token id:Id.Lit_Chars val:'\tgit diff --exit-code seq-onto &&\n' span_id:1889) 
          (Token id:Id.Lit_Chars val:'\ttest ! -d .git/rebase-merge &&\n' span_id:1890) (Token id:Id.Lit_Chars val:'\ttest ! -f .git/CHERRY_PICK_HEAD\n' span_id:1891)
        )
      }
    )
    (command.ShFunction
      name: rebase_setup_and_clean
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(test_when_finished)} 
                  {
                    (DQ ('\n') ('\t\tgit checkout master &&\n') ('\t\ttest_might_fail git branch -D ') 
                      ($ Id.VSub_Number '$1') (' &&\n') ('\t\ttest_might_fail git rebase --abort\n') ('\t')
                    )
                  }
                )
                (C {(git)} {(checkout)} {(-b)} {($ Id.VSub_Number '$1')} {(master)})
              ]
            )
          ]
        )
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:drop span_id:1934))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1938) 
          (Token
            id: Id.Lit_Chars
            val: '\trebase_setup_and_clean drop-test &&\n'
            span_id: 1939
          ) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1940) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="1 drop 2 3 drop 4 5" git rebase -i --root &&\n'
            span_id: 1941
          ) (Token id:Id.Lit_Chars val:'\ttest E = $(git cat-file commit HEAD | sed -ne \\$p) &&\n' span_id:1942) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest C = $(git cat-file commit HEAD^ | sed -ne \\$p) &&\n'
            span_id: 1943
          ) (Token id:Id.Lit_Chars val:'\ttest A = $(git cat-file commit HEAD^^ | sed -ne \\$p)\n' span_id:1944)
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:1950)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:1953)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 1958
          stdin_parts: [('Successfully rebased and updated refs/heads/missing-commit.\n')]
        )
      ]
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i respects rebase.missingCommitsCheck = ignore'
            span_id: 1963
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1967) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config rebase.missingCommitsCheck ignore &&\n'
            span_id: 1968
          ) (Token id:Id.Lit_Chars val:'\trebase_setup_and_clean missing-commit &&\n' span_id:1969) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:1970) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 2 3 4" \\\n' span_id:1971) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i --root 2>actual &&\n' span_id:1972) (Token id:Id.Lit_Chars val:'\ttest D = $(git cat-file commit HEAD | sed -ne \\$p) &&\n' span_id:1973) 
          (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual\n' span_id:1974)
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:1980)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:1983)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 2016
          stdin_parts: [
            ('Warning: some commits may have been dropped accidentally.\n')
            ('Dropped commits (newer to older):\n')
            (' - ')
            (command_sub
              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1989)
              command_list: 
                (command.CommandList
                  children: [
                    (C {(git)} {(rev-list)} {(--pretty) (Id.Lit_Equals '=') (oneline)} 
                      {(--abbrev-commit)} {(-1)} {(master)}
                    )
                  ]
                )
            )
            ('\n')
            ('To avoid this message, use ')
            (Id.Right_DoubleQuote '"')
            (drop)
            (Id.Right_DoubleQuote '"')
            (' to explicitly remove a commit.\n')
            ('\n')
            ("Use 'git config rebase.missingCommitsCheck' to change the level of warnings.\n")
            ('The possible behaviours are: ignore, warn, error.\n')
            ('\n')
            ('Successfully rebased and updated refs/heads/missing-commit.\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i respects rebase.missingCommitsCheck = warn'
            span_id: 2021
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2025) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config rebase.missingCommitsCheck warn &&\n'
            span_id: 2026
          ) (Token id:Id.Lit_Chars val:'\trebase_setup_and_clean missing-commit &&\n' span_id:2027) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:2028) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 2 3 4" \\\n' span_id:2029) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i --root 2>actual &&\n' span_id:2030) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual &&\n' span_id:2031) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest D = $(git cat-file commit HEAD | sed -ne \\$p)\n'
            span_id: 2032
          )
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:2038)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:2041)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 2093
          stdin_parts: [
            ('Warning: some commits may have been dropped accidentally.\n')
            ('Dropped commits (newer to older):\n')
            (' - ')
            (command_sub
              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2047)
              command_list: 
                (command.CommandList
                  children: [
                    (C {(git)} {(rev-list)} {(--pretty) (Id.Lit_Equals '=') (oneline)} 
                      {(--abbrev-commit)} {(-1)} {(master)}
                    )
                  ]
                )
            )
            ('\n')
            (' - ')
            (command_sub
              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2064)
              command_list: 
                (command.CommandList
                  children: [
                    (C {(git)} {(rev-list)} {(--pretty) (Id.Lit_Equals '=') (oneline)} 
                      {(--abbrev-commit)} {(-1)} {(master) (Id.Lit_TildeLike '~2')}
                    )
                  ]
                )
            )
            ('\n')
            ('To avoid this message, use ')
            (Id.Right_DoubleQuote '"')
            (drop)
            (Id.Right_DoubleQuote '"')
            (' to explicitly remove a commit.\n')
            ('\n')
            ("Use 'git config rebase.missingCommitsCheck' to change the level of warnings.\n")
            ('The possible behaviours are: ignore, warn, error.\n')
            ('\n')
            (
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.\n"
            )
            ("Or you can abort the rebase with 'git rebase --abort'.\n")
          ]
        )
      ]
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'rebase -i respects rebase.missingCommitsCheck = error'
            span_id: 2098
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2102) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_config rebase.missingCommitsCheck error &&\n'
            span_id: 2103
          ) (Token id:Id.Lit_Chars val:'\trebase_setup_and_clean missing-commit &&\n' span_id:2104) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:2105) (Token id:Id.Lit_Chars val:'\ttest_must_fail env FAKE_LINES="1 2 4" \\\n' span_id:2106) 
          (Token id:Id.Lit_Chars val:'\t\tgit rebase -i --root 2>actual &&\n' span_id:2107) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual &&\n' span_id:2108) 
          (Token
            id: Id.Lit_Chars
            val: '\tcp .git/rebase-merge/git-rebase-todo.backup \\\n'
            span_id: 2109
          ) (Token id:Id.Lit_Chars val:'\t\t.git/rebase-merge/git-rebase-todo &&\n' span_id:2110) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="1 2 drop 3 4 drop 5" \\\n'
            span_id: 2111
          ) (Token id:Id.Lit_Chars val:'\t\tgit rebase --edit-todo &&\n' span_id:2112) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:2113) (Token id:Id.Lit_Chars val:'\ttest D = $(git cat-file commit HEAD | sed -ne \\$p) &&\n' span_id:2114) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest B = $(git cat-file commit HEAD^ | sed -ne \\$p)\n'
            span_id: 2115
          )
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:2121)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:2124)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 2146
          stdin_parts: [
            ("Warning: the command isn't recognized in the following line:\n")
            (' - badcmd ')
            (command_sub
              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2129)
              command_list: 
                (command.CommandList
                  children: [
                    (C {(git)} {(rev-list)} {(--oneline)} {(-1)} {(master) (Id.Lit_TildeLike '~1')})
                  ]
                )
            )
            ('\n')
            ('\n')
            (
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.\n"
            )
            ("Or you can abort the rebase with 'git rebase --abort'.\n")
          ]
        )
      ]
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'static check of bad command' span_id:2151))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2155) 
          (Token id:Id.Lit_Chars val:'\trebase_setup_and_clean bad-cmd &&\n' span_id:2156) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:2157) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="1 2 3 bad 4 5" \\\n'
            span_id: 2158
          ) (Token id:Id.Lit_Chars val:'\t\tgit rebase -i --root 2>actual &&\n' span_id:2159) 
          (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual &&\n' span_id:2160) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo &&\n' span_id:2161) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:2162) (Token id:Id.Lit_Chars val:'\ttest E = $(git cat-file commit HEAD | sed -ne \\$p) &&\n' span_id:2163) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest C = $(git cat-file commit HEAD^ | sed -ne \\$p)\n'
            span_id: 2164
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'tabs and spaces are accepted in the todolist' span_id:2171))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2175) 
          (Token
            id: Id.Lit_Chars
            val: '\trebase_setup_and_clean indented-comment &&\n'
            span_id: 2176
          ) (Token id:Id.Lit_Chars val:'\twrite_script add-indent.sh <<-\\EOF &&\n' span_id:2177) 
          (Token id:Id.Lit_Chars val:'\t(\n' span_id:2178) (Token id:Id.Lit_Chars val:'\t\t# Turn single spaces into space/tab mix\n' span_id:2179) 
          (Token
            id: Id.Lit_Chars
            val: '\t\tsed "1s/ /\t/g; 2s/ /  /g; 3s/ / \t/g" "$1"\n'
            span_id: 2180
          ) (Token id:Id.Lit_Chars val:'\t\tprintf "\\n\\t# comment\\n #more\\n\\t # comment\\n"\n' span_id:2181) 
          (Token id:Id.Lit_Chars val:'\t) >"$1.new"\n' span_id:2182) (Token id:Id.Lit_Chars val:'\tmv "$1.new" "$1"\n' span_id:2183) 
          (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:2184) (Token id:Id.Lit_Chars val:'\ttest_set_editor "$(pwd)/add-indent.sh" &&\n' span_id:2185) 
          (Token id:Id.Lit_Chars val:'\tgit rebase -i HEAD^^^ &&\n' span_id:2186) (Token id:Id.Lit_Chars val:'\ttest E = $(git cat-file commit HEAD | sed -ne \\$p)\n' span_id:2187)
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:2193)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:2196)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 2205
          stdin_parts: [
            ("Warning: the SHA-1 is missing or isn't a commit in the following line:\n")
            (' - edit XXXXXXX False commit\n')
            ('\n')
            (
"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.\n"
            )
            ("Or you can abort the rebase with 'git rebase --abort'.\n")
          ]
        )
      ]
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'static check of bad SHA-1' span_id:2210))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2214) 
          (Token id:Id.Lit_Chars val:'\trebase_setup_and_clean bad-sha &&\n' span_id:2215) (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:2216) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \\\n'
            span_id: 2217
          ) (Token id:Id.Lit_Chars val:'\t\tgit rebase -i --root 2>actual &&\n' span_id:2218) 
          (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expect actual &&\n' span_id:2219) (Token id:Id.Lit_Chars val:'\tFAKE_LINES="1 2 4 5 6" git rebase --edit-todo &&\n' span_id:2220) 
          (Token id:Id.Lit_Chars val:'\tgit rebase --continue &&\n' span_id:2221) (Token id:Id.Lit_Chars val:'\ttest E = $(git cat-file commit HEAD | sed -ne \\$p)\n' span_id:2222)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'editor saves as CR/LF' span_id:2229))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2233) 
          (Token id:Id.Lit_Chars val:'\tgit checkout -b with-crlf &&\n' span_id:2234) (Token id:Id.Lit_Chars val:'\twrite_script add-crs.sh <<-\\EOF &&\n' span_id:2235) 
          (Token
            id: Id.Lit_Chars
            val: '\tsed -e "s/\\$/Q/" <"$1" | tr Q "\\\\015" >"$1".new &&\n'
            span_id: 2236
          ) (Token id:Id.Lit_Chars val:'\tmv -f "$1".new "$1"\n' span_id:2237) 
          (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:2238) (Token id:Id.Lit_Chars val:'\t(\n' span_id:2239) 
          (Token
            id: Id.Lit_Chars
            val: '\t\ttest_set_editor "$(pwd)/add-crs.sh" &&\n'
            span_id: 2240
          ) (Token id:Id.Lit_Chars val:'\t\tgit rebase -i HEAD^\n' span_id:2241) 
          (Token id:Id.Lit_Chars val:'\t)\n' span_id:2242)
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SQ)
          op: assign_op.Equal
          rhs: {(DQ ("'"))}
          spids: [2246]
        )
      ]
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'rebase -i --gpg-sign=<key-id>' span_id:2254))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2258) 
          (Token id:Id.Lit_Chars val:'\tset_fake_editor &&\n' span_id:2259) 
          (Token
            id: Id.Lit_Chars
            val: '\tFAKE_LINES="edit 1" git rebase -i --gpg-sign="\\"S I Gner\\"" HEAD^ \\\n'
            span_id: 2260
          ) (Token id:Id.Lit_Chars val:'\t\t>out 2>err &&\n' span_id:2261) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_i18ngrep "$SQ-S\\"S I Gner\\"$SQ" err\n'
            span_id: 2262
          )
        )
      }
    )
    (C {(test_done)})
  ]
)