From: Junio C Hamano Date: Thu, 20 Jun 2013 20:38:14 GMT Subject: Re: [PATCH v5 3/5] t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs Message-ID: <7vtxksr009.fsf@alter.siamese.dyndns.org> In-Reply-To: <8ca30465721ee9f98613397c1778640e3fcc0f83.1371720245.git.Alex.Crezoff@gmail.com> Alexey Shumkin writes: > The expected SHA-1 digests are always available in variables. Use > them instead of hardcoding. > > Signed-off-by: Alexey Shumkin > --- > t/t4205-log-pretty-formats.sh | 48 +++++++++++++++++++++++-------------------- > 1 file changed, 26 insertions(+), 22 deletions(-) > > diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh > index 26fbfde..6d8d457 100755 > --- a/t/t4205-log-pretty-formats.sh > +++ b/t/t4205-log-pretty-formats.sh > @@ -101,7 +101,11 @@ test_expect_failure 'NUL termination with --stat' ' > > test_expect_success 'setup more commits' ' > test_commit "message one" one one message-one && > - test_commit "message two" two two message-two > + test_commit "message two" two two message-two && > + head1=$(git rev-list --max-count=1 --abbrev-commit HEAD~0) && > + head2=$(git rev-list --max-count=1 --abbrev-commit HEAD~1) && > + head3=$(git rev-list --max-count=1 --abbrev-commit HEAD~2) && > + head4=$(git rev-list --max-count=1 --abbrev-commit HEAD~3) Hmmph. Why not rev-parse --short like in your 1/5?