(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'git svn honors i18n.commitEncoding in config'>)}
        )
      ]
    )
    (C {(.)} {(./lib-git-svn.sh)})
    (command.FuncDef
      name: compare_git_head_with
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:nr)
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.SimpleCommand
                                words: [{(wc)} {(-l)}]
                                redirects: [
                                  (redir.Redir
                                    op: <Redir_Less '<'>
                                    fd: 16777215
                                    arg_word: {(DQ ($ VSub_Number '$1'))}
                                  )
                                ]
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                      )
                    }
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:a) op:Equal rhs:{(7)})]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:b)
                  op: Equal
                  rhs: 
                    {
                      (word_part.ArithSubPart
                        anode: 
                          (arith_expr.ArithBinary
                            op_id: Arith_Minus
                            left: 
                              (arith_expr.ArithBinary
                                op_id: Arith_Plus
                                left: (arith_expr.ArithWord w:{($ VSub_DollarName '$a')})
                                right: (arith_expr.ArithWord w:{($ VSub_DollarName '$nr')})
                              )
                            right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                          )
                      )
                    }
                )
              ]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.Pipeline
                  children: [
                    (C {(git)} {(cat-file)} {(commit)} {(HEAD)})
                    (command.SimpleCommand
                      words: [{(sed)} {(-ne)} {(DQ ($ VSub_DollarName '$a') (',') (${ VSub_Name b) (p))}]
                      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(current)})]
                    )
                  ]
                  negated: F
                )
                (C {(test_cmp)} {(current)} {(DQ ($ VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (C {(prepare_a_utf8_locale)})
    (command.FuncDef
      name: compare_svn_head_with
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.Pipeline
                  children: [
                    (command.SimpleCommand
                      words: [
                        {(svn)}
                        {(log)}
                        {
                          (word_part.CommandSubPart
                            command_list: 
                              (command.CommandList
                                children: [(C {(git)} {(svn)} {(info)} {(--url)})]
                              )
                            left_token: <Left_CommandSub '$('>
                          )
                        }
                      ]
                      more_env: [(env_pair name:LC_ALL val:{(DQ ($ VSub_DollarName '$a_utf8_locale'))})]
                    )
                    (command.SimpleCommand
                      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.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(current)})]
                    )
                  ]
                  negated: F
                )
                (C {(test_cmp)} {(current)} {(DQ ($ 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 ($ 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 ($ 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 ($ 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 ($ 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)})
  ]
)