Re: [PATCH v3 2/4] t/t7030-verify-tag.sh: Adds validation for multiple tags
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 4, 2016, 01:38 UTC
- Message-ID
- <CAPig+cTccb8nr7sV1PKkEf30nRz123TTgeZXkac01RaRwqvTZw@mail.gmail.com>
- In-Reply-To
- <20160403215847.GD28933@LykOS>
On Sun, Apr 3, 2016 at 5:58 PM, Santiago Torres <santiago@nyu.edu> wrote:
Show 26 quoted lines
> On Sun, Apr 03, 2016 at 09:07:25AM -0400, Jeff King wrote: >> On Sun, Apr 03, 2016 at 03:59:46AM -0400, Eric Sunshine wrote: >> > On Sun, Apr 3, 2016 at 12:40 AM, Jeff King <peff@peff.net> wrote: >> > > In fact, I suspect you could replace the "GOODSIG" check as well by >> > > doing something like: >> > > >> > > tags="fourth-signed sixth-signed seventh-signed" >> > > for i in $tags; do >> > > git verify-tag -v --raw $i || return 1 >> > > done >expect.stdout 2>expect.stderr && >> > > git verify-tag -v --raw $tags >actual.stdout 2>actual.stderr && >> > > test_cmp expect.stdout actual.stdout && >> > > test_cmp expect.stderr actual.stderr >> > >> > Hmm, does [1] suggest that using test_cmp on stderr here would be >> > contraindicated? >> > >> > [1]: http://article.gmane.org/gmane.comp.version-control.git/289077 >> >> It does, but I am not sure I agree with the advice in that email in the >> general case (I like making "-x" work, too, but not at the cost of >> making the tests harder to read and write). In this case, I suppose you >> could grep for gpg raw-output on stderr, though, and compare only that. > > I just read [1], I'll take the later advice and use test_i18ngrep > instead.
I think Peff meant that a simple grep would suffice; no need for test_i18ngrep. In other words (reproducing Peff's example), something like this:
tags="fourth-signed sixth-signed seventh-signed" &&
for i in $tags; do
git verify-tag -v --raw $i || return 1
done >expect.stdout 2>expect.stderr.1 &&
grep GOODSIG <expect.stderr.1 >expect.stderr &&
git verify-tag -v --raw $tags >actual.stdout 2>actual.stderr.1 &&
grep GOODSIG <actual.stderr.1 >actual.stderr &&
test_cmp expect.stdout actual.stdout &&
test_cmp expect.stderr actual.stderr