Re: [PATCH 09/10] t3404 (rebase -i): introduce helper to check position of HEAD
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 17, 2010, 17:55 UTC
- Message-ID
- <7vd3q3g7h9.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20101031074030.GJ11483@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
> The same code to check the position of HEAD is used by several > tests in this script. Factor it out as a function and simplify it.
That rationale makes sense, but why use describe for it, especially if the helper is called "cmp-rev"? The tests here are not about catching breakages in describe.
When we later want to move this helper to test-lib.sh, some potential callers may find it inconvenient that use of describe robs the ability to tell annotated tags from bare commits.
Show 5 quoted lines
> +test_cmp_rev () {
> + git describe --always --tags "$1" >expect.rev &&
> + git describe --always --tags "$2" >actual.rev &&
> + test_cmp expect.rev actual.rev
> +}