(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'git svn honors i18n.commitEncoding in config'>)}
          spids: [10]
        )
      ]
    )
    (C {<.>} {<'./lib-git-svn.sh'>})
    (command.ShFunction
      name: compare_git_head_with
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:nr)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Simple
                            words: [{<wc>} {<-l>}]
                            redirects: [
                              (redir
                                op: <Id.Redir_Less '<'>
                                loc: (redir_loc.Fd fd:0)
                                arg: {(DQ ($ Id.VSub_Number '$1'))}
                              )
                            ]
                            do_fork: T
                          )
                      )
                    }
                  spids: [29]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:a)
                  op: assign_op.Equal
                  rhs: {<7>}
                  spids: [43]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:b)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Minus
                            left: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Plus
                                left: {($ Id.VSub_DollarName '$a')}
                                right: {($ Id.VSub_DollarName '$nr')}
                              )
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [47]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.Pipeline
                  children: [
                    (C {<git>} {<cat-file>} {<commit>} {<HEAD>})
                    (command.Simple
                      words: [
                        {<sed>}
                        {<-ne>}
                        {(DQ ($ Id.VSub_DollarName '$a') <','> (${ Id.VSub_Name b) <p>)}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<current>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  negated: F
                )
                (C {<test_cmp>} {<current>} {(DQ ($ Id.VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (C {<prepare_a_utf8_locale>})
    (command.ShFunction
      name: compare_svn_head_with
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.Pipeline
                  children: [
                    (command.Simple
                      words: [
                        {<svn>}
                        {<log>}
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: (C {<git>} {<svn>} {<info>} {<--url>})
                          )
                        }
                      ]
                      more_env: [
                        (env_pair
                          name: LC_ALL
                          val: {(DQ ($ Id.VSub_DollarName '$a_utf8_locale'))}
                          spids: [121]
                        )
                      ]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<perl>}
                        {<-w>}
                        {<-e>}
                        {
                          (SQ <'\n'> <'\t\tuse bytes;\n'> <'\t\t$/ = ("-"x72) . "\\n";\n'> 
                            <'\t\tmy @x = <STDIN>;\n'> <'\t\t@x = split(/\\n/, $x[1]);\n'> <'\t\tsplice(@x, 0, 2);\n'> <'\t\t$x[-1] = "";\n'> 
                            <'\t\tprint join("\\n", @x);\n'> <'\t'>
                          )
                        }
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<current>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  negated: F
                )
                (C {<test_cmp>} {<current>} {(DQ ($ Id.VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (command.ForEach
      iter_name: H
      iter_words: [{<ISO8859-1>} {<eucJP>} {<ISO-2022-JP>}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$H') <' setup'>)} 
              {
                (SQ <'\n'> <'\t\tmkdir $H &&\n'> 
                  <'\t\tsvn_cmd import -m "$H test" $H "$svnrepo"/$H &&\n'> <'\t\tgit svn clone "$svnrepo"/$H $H\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (command.ForEach
      iter_name: H
      iter_words: [{<ISO8859-1>} {<eucJP>} {<ISO-2022-JP>}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$H') <' commit on git side'>)} 
              {
                (SQ <'\n'> <'\t(\n'> <'\t\tcd $H &&\n'> <'\t\tgit config i18n.commitencoding $H &&\n'> 
                  <'\t\tgit checkout -b t refs/remotes/git-svn &&\n'> <'\t\techo $H >F &&\n'> <'\t\tgit add F &&\n'> 
                  <'\t\tgit commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&\n'> <'\t\tE=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&\n'> <'\t\ttest "z$E" = "z$H"\n'> 
                  <'\t\tcompare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt\n'> <'\t)\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (command.ForEach
      iter_name: H
      iter_words: [{<ISO8859-1>} {<eucJP>} {<ISO-2022-JP>}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$H') <' dcommit to svn'>)} 
              {
                (SQ <'\n'> <'\t(\n'> <'\t\tcd $H &&\n'> <'\t\tgit svn dcommit &&\n'> 
                  <'\t\tgit cat-file commit HEAD | grep git-svn-id: &&\n'> <'\t\tE=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&\n'> <'\t\ttest "z$E" = "z$H" &&\n'> 
                  <'\t\tcompare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt\n'> <'\t)\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (C {<test_expect_success>} {<UTF8>} {(SQ <'ISO-8859-1 should match UTF-8 in svn'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd ISO8859-1 &&\n'> 
          <'\t\tcompare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt\n'> <'\t)\n'>
        )
      }
    )
    (command.ForEach
      iter_name: H
      iter_words: [{<eucJP>} {<ISO-2022-JP>}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} {<UTF8>} 
              {(DQ ($ Id.VSub_DollarName '$H') <' should match UTF-8 in svn'>)} 
              {
                (SQ <'\n'> <'\t\t(\n'> <'\t\t\tcd $H &&\n'> 
                  <'\t\t\tcompare_svn_head_with "$TEST_DIRECTORY"/t3900/2-UTF-8.txt\n'> <'\t\t)\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (C {<test_done>})
  ]
)