From: Junio C Hamano Date: Wed, 17 Nov 2010 17:55:46 GMT Subject: Re: [PATCH 09/10] t3404 (rebase -i): introduce helper to check position of HEAD Message-ID: <7vd3q3g7h9.fsf@alter.siamese.dyndns.org> In-Reply-To: <20101031074030.GJ11483@burratino> Jonathan Nieder 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. > +test_cmp_rev () { > + git describe --always --tags "$1" >expect.rev && > + git describe --always --tags "$2" >actual.rev && > + test_cmp expect.rev actual.rev > +}