(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description)
          op: Equal
          rhs: 
            {
              (SQ <'test describe\n'> <'\n'> <'                       B\n'> 
                <'        .--------------o----o----o----x\n'> <'       /                   /    /\n'> <' o----o----o----o----o----.    /\n'> 
                <'       \\        A    c        /\n'> <'        .------------o---o---o\n'> <'                   D,R   e\n'>
              )
            }
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.FuncDef
      name: check_describe
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:expect)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                )
              ]
            )
            (C {(shift)})
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:R)
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.SimpleCommand
                                words: [{(git)} {(describe)} {(DQ ($ VSub_At '$@'))}]
                                redirects: [
                                  (redir.Redir
                                    op: <Redir_Great '2>'>
                                    fd: 2
                                    arg_word: {(err.actual)}
                                  )
                                ]
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                      )
                    }
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:S) op:Equal rhs:{($ VSub_QMark '$?')})]
            )
            (command.SimpleCommand
              words: [{(cat)} {(err.actual)}]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})]
            )
            (C {(test_expect_success)} {(DQ ('describe ') ($ VSub_Star '$*'))} 
              {
                (SQ <'\n'> <'\ttest $S = 0 &&\n'> <'\tcase "$R" in\n'> <'\t$expect)\techo happy ;;\n'> 
                  <'\t*)\techo "Oops - $R is not $expect";\n'> <'\t\tfalse ;;\n'> <'\tesac\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ <'\n'> <'\n'> <'\ttest_tick &&\n'> 
          <'\techo one >file && git add file && git commit -m initial &&\n'> <'\tone=$(git rev-parse HEAD) &&\n'> <'\n'> <'\tgit describe --always HEAD &&\n'> <'\n'> 
          <'\ttest_tick &&\n'> <'\techo two >file && git add file && git commit -m second &&\n'> <'\ttwo=$(git rev-parse HEAD) &&\n'> 
          <'\n'> <'\ttest_tick &&\n'> <'\techo three >file && git add file && git commit -m third &&\n'> <'\n'> 
          <'\ttest_tick &&\n'> <'\techo A >file && git add file && git commit -m A &&\n'> <'\ttest_tick &&\n'> 
          <'\tgit tag -a -m A A &&\n'> <'\n'> <'\ttest_tick &&\n'> <'\techo c >file && git add file && git commit -m c &&\n'> 
          <'\ttest_tick &&\n'> <'\tgit tag c &&\n'> <'\n'> <'\tgit reset --hard $two &&\n'> <'\ttest_tick &&\n'> 
          <'\techo B >side && git add side && git commit -m B &&\n'> <'\ttest_tick &&\n'> <'\tgit tag -a -m B B &&\n'> <'\n'> <'\ttest_tick &&\n'> 
          <'\tgit merge -m Merged c &&\n'> <'\tmerged=$(git rev-parse HEAD) &&\n'> <'\n'> <'\tgit reset --hard $two &&\n'> <'\ttest_tick &&\n'> 
          <'\techo D >another && git add another && git commit -m D &&\n'> <'\ttest_tick &&\n'> <'\tgit tag -a -m D D &&\n'> <'\ttest_tick &&\n'> <'\tgit tag -a -m R R &&\n'> 
          <'\n'> <'\ttest_tick &&\n'> <'\techo DD >another && git commit -a -m another &&\n'> <'\n'> <'\ttest_tick &&\n'> 
          <'\tgit tag e &&\n'> <'\n'> <'\ttest_tick &&\n'> <'\techo DDD >another && git commit -a -m "yet another" &&\n'> <'\n'> 
          <'\ttest_tick &&\n'> <'\tgit merge -m Merged $merged &&\n'> <'\n'> <'\ttest_tick &&\n'> 
          <'\techo X >file && echo X >side && git add file side &&\n'> <'\tgit commit -m x\n'> <'\n'>
        )
      }
    )
    (C {(check_describe)} {(A-) (Lit_Other '*')} {(HEAD)})
    (C {(check_describe)} {(A-) (Lit_Other '*')} {(HEAD) (Lit_Other '^')})
    (C {(check_describe)} {(R-) (Lit_Other '*')} {(HEAD) (Lit_Other '^') (Lit_Other '^')})
    (C {(check_describe)} {(A-) (Lit_Other '*')} {(HEAD) (Lit_Other '^') (Lit_Other '^') (2)})
    (C {(check_describe)} {(B)} {(HEAD) (Lit_Other '^') (Lit_Other '^') (2) (Lit_Other '^')})
    (C {(check_describe)} {(R-) (Lit_Other '*')} 
      {(HEAD) (Lit_Other '^') (Lit_Other '^') (Lit_Other '^')}
    )
    (C {(check_describe)} {(c-) (Lit_Other '*')} {(--tags)} {(HEAD)})
    (C {(check_describe)} {(c-) (Lit_Other '*')} {(--tags)} {(HEAD) (Lit_Other '^')})
    (C {(check_describe)} {(e-) (Lit_Other '*')} {(--tags)} {(HEAD) (Lit_Other '^') (Lit_Other '^')})
    (C {(check_describe)} {(c-) (Lit_Other '*')} {(--tags)} {(HEAD) (Lit_Other '^') (Lit_Other '^') (2)})
    (C {(check_describe)} {(B)} {(--tags)} {(HEAD) (Lit_Other '^') (Lit_Other '^') (2) (Lit_Other '^')})
    (C {(check_describe)} {(e)} {(--tags)} {(HEAD) (Lit_Other '^') (Lit_Other '^') (Lit_Other '^')})
    (C {(check_describe)} {(heads/master)} {(--all)} {(HEAD)})
    (C {(check_describe)} {(tags/c-) (Lit_Other '*')} {(--all)} {(HEAD) (Lit_Other '^')})
    (C {(check_describe)} {(tags/e)} {(--all)} {(HEAD) (Lit_Other '^') (Lit_Other '^') (Lit_Other '^')})
    (C {(check_describe)} {(B-0-) (Lit_Other '*')} {(--long)} 
      {(HEAD) (Lit_Other '^') (Lit_Other '^') (2) (Lit_Other '^')}
    )
    (C {(check_describe)} {(A-3-) (Lit_Other '*')} {(--long)} 
      {(HEAD) (Lit_Other '^') (Lit_Other '^') (2)}
    )
    (C {(check_describe)} {(c-7-) (Lit_Other '*')} {(--tags)})
    (C {(check_describe)} {(e-3-) (Lit_Other '*')} {(--first-parent)} {(--tags)})
    (C {(test_expect_success)} {(SQ <'describe --contains defaults to HEAD without commit-ish'>)} 
      {
        (SQ <'\n'> <'\techo "A^0" >expect &&\n'> <'\tgit checkout A &&\n'> 
          <'\ttest_when_finished "git checkout -" &&\n'> <'\tgit describe --contains >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (command.SimpleCommand
      words: [{(Lit_Other ':')}]
      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(err.expect)})]
    )
    (C {(check_describe)} {(A)} {(--all)} {(A) (Lit_Other '^') (0)})
    (C {(test_expect_success)} {(SQ <'no warning was displayed for A'>)} 
      {(SQ <'\n'> <'\ttest_cmp err.expect err.actual\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'rename tag A to Q locally'>)} 
      {(SQ <'\n'> <'\tmv .git/refs/tags/A .git/refs/tags/Q\n'>)}
    )
    (command.SimpleCommand
      words: [{(cat)} {(-)}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(err.expect)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 414
          stdin_parts: [("warning: tag 'A' is really 'Q' here\n")]
        )
      ]
    )
    (C {(check_describe)} {(A-) (Lit_Other '*')} {(HEAD)})
    (C {(test_expect_success)} {(SQ <'warning was displayed for Q'>)} 
      {(SQ <'\n'> <'\ttest_i18ncmp err.expect err.actual\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'rename tag Q back to A'>)} 
      {(SQ <'\n'> <'\tmv .git/refs/tags/Q .git/refs/tags/A\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'pack tag refs'>)} {(SQ <'git pack-refs'>)})
    (C {(check_describe)} {(A-) (Lit_Other '*')} {(HEAD)})
    (C {(check_describe)} {(DQ ('A-*[0-9a-f]'))} {(--dirty)})
    (C {(test_expect_success)} {(SQ <'set-up dirty work tree'>)} {(SQ <'\n'> <'\techo >>file\n'>)})
    (C {(check_describe)} {(DQ ('A-*[0-9a-f]-dirty'))} {(--dirty)})
    (C {(check_describe)} {(DQ ('A-*[0-9a-f].mod'))} {(--dirty) (Lit_Other '=') (.mod)})
    (C {(test_expect_success)} {(SQ <'describe --dirty HEAD'>)} 
      {(SQ <'\n'> <'\ttest_must_fail git describe --dirty HEAD\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'set-up matching pattern tests'>)} 
      {
        (SQ <'\n'> <'\tgit tag -a -m test-annotated test-annotated &&\n'> <'\techo >>file &&\n'> 
          <'\ttest_tick &&\n'> <'\tgit commit -a -m "one more" &&\n'> <'\tgit tag test1-lightweight &&\n'> <'\techo >>file &&\n'> 
          <'\ttest_tick &&\n'> <'\tgit commit -a -m "yet another" &&\n'> <'\tgit tag test2-lightweight &&\n'> <'\techo >>file &&\n'> 
          <'\ttest_tick &&\n'> <'\tgit commit -a -m "even more"\n'> <'\n'>
        )
      }
    )
    (C {(check_describe)} {(DQ ('test-annotated-*'))} {(--match) (Lit_Other '=') (DQ ('test-*'))})
    (C {(check_describe)} {(DQ ('test1-lightweight-*'))} {(--tags)} 
      {(--match) (Lit_Other '=') (DQ ('test1-*'))}
    )
    (C {(check_describe)} {(DQ ('test2-lightweight-*'))} {(--tags)} 
      {(--match) (Lit_Other '=') (DQ ('test2-*'))}
    )
    (C {(check_describe)} {(DQ ('test2-lightweight-*'))} {(--long)} {(--tags)} 
      {(--match) (Lit_Other '=') (DQ ('test2-*'))} {(HEAD) (Lit_Other '^')}
    )
    (C {(test_expect_success)} {(SQ <'name-rev with exact tags'>)} 
      {
        (SQ <'\n'> <'\techo A >expect &&\n'> <'\ttag_object=$(git rev-parse refs/tags/A) &&\n'> 
          <'\tgit name-rev --tags --name-only $tag_object >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\n'> <'\techo "A^0" >expect &&\n'> 
          <'\ttagged_commit=$(git rev-parse "refs/tags/A^0") &&\n'> <'\tgit name-rev --tags --name-only $tagged_commit >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'describe --contains with the exact tags'>)} 
      {
        (SQ <'\n'> <'\techo "A^0" >expect &&\n'> <'\ttag_object=$(git rev-parse refs/tags/A) &&\n'> 
          <'\tgit describe --contains $tag_object >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\n'> <'\techo "A^0" >expect &&\n'> 
          <'\ttagged_commit=$(git rev-parse "refs/tags/A^0") &&\n'> <'\tgit describe --contains $tagged_commit >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)