]> git.ipfire.org Git - thirdparty/git.git/commit
t4205: correctly test %(describe:abbrev=...)
authorKousik Sanagavarapu <five231003@gmail.com>
Thu, 29 Jun 2023 13:18:08 +0000 (18:48 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Jun 2023 19:20:35 +0000 (12:20 -0700)
commit1876a5ae152018ca3b03540d319c5fc981fd3061
tree0ae1973c630f067e2e9b8f6c6c2f31062133178d
parent9bbde12feed306b9044060e4eab6b3b4c6628050
t4205: correctly test %(describe:abbrev=...)

The pretty format %(describe:abbrev=<number>) tells describe to use
at least <number> digits of the oid to generate the human-readable
format of the commit-ish.

There are three things to test here:
  - Check that we can describe a commit that is not tagged (that is,
    for example our HEAD is at least one commit ahead of some reachable
    commit which is tagged) with at least <number> digits of the oid
    being used for describing it.

  - Check that when using such a commit-ish, we always use at least
    <number> digits of the oid to describe it.

  - Check that we can describe a tag. This just gives the name of the
    tag irrespective of abbrev (abbrev doesn't make sense here).

Do this, instead of the current test which only tests the last case.

Helped-by: Junio C Hamano <gitster@pobox.com>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4205-log-pretty-formats.sh