3 test_description='test describe
6 .--------------o----o----o----x
8 o----o----o----o----o----. /
10 .------------o---o---o
18 R=$(git describe "$@") &&
19 test_expect_success "describe $*" '
21 $expect) echo happy ;;
22 *) echo "Oops - $R is not $expect";
28 test_expect_success setup '
31 echo one >file && git add file && git-commit -m initial &&
32 one=$(git rev-parse HEAD) &&
35 echo two >file && git add file && git-commit -m second &&
36 two=$(git rev-parse HEAD) &&
39 echo three >file && git add file && git-commit -m third &&
42 echo A >file && git add file && git-commit -m A &&
47 echo c >file && git add file && git-commit -m c &&
51 git reset --hard $two &&
53 echo B >side && git add side && git-commit -m B &&
58 git-merge -m Merged c &&
59 merged=$(git rev-parse HEAD) &&
61 git reset --hard $two &&
63 echo D >another && git add another && git-commit -m D &&
68 echo DD >another && git commit -a -m another &&
74 echo DDD >another && git commit -a -m "yet another" &&
77 git-merge -m Merged $merged &&
80 echo X >file && echo X >side && git add file side &&
85 check_describe A-* HEAD
86 check_describe A-* HEAD^
87 check_describe D-* HEAD^^
88 check_describe A-* HEAD^^2
89 check_describe B HEAD^^2^
91 check_describe A-* --tags HEAD
92 check_describe A-* --tags HEAD^
93 check_describe D-* --tags HEAD^^
94 check_describe A-* --tags HEAD^^2
95 check_describe B --tags HEAD^^2^