Re: [PATCH v2] Fix git-tag test breakage caused by broken sed on Leopard
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Nov 16, 2007, 13:45 UTC
- Message-ID
- <7A6820DE-C6EE-4E3E-A97F-97766F682B85@wincent.com>
- In-Reply-To
- <7v4pfm3h6f.fsf@gitster.siamese.dyndns.org>
El 16/11/2007, a las 6:14, Junio C Hamano escribió:
Show 16 quoted lines
> Wincent Colaiuta <win@wincent.com> writes: > >> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh >> index 096fe33..b54c2e0 100755 >> --- a/t/t7004-tag.sh >> +++ b/t/t7004-tag.sh >> @@ -1007,7 +1007,7 @@ test_expect_failure \ >> test_expect_success \ >> 'message in editor has initial comment' ' >> GIT_EDITOR=cat git tag -a initial-comment > actual || true && >> - test $(sed -n "/^\(#\|\$\)/p" actual | wc -l) -gt 0 >> + test $(grep -e "^#" -e "^\$" actual | wc -l ) -gt 0 >> ' > > Heh, doesn't grep exit with zero only when it found some lines > that match the pattern already? What's that "wc -l" for?
I was just trying to make the minimal change (swapping grep for sed), but if you want a shorter version then we don't even need the "test"; it could just be:
- test $(sed -n "/^\(#\|\$\)/p" actual | wc -l) -gt 0 + grep -e "^#" -e "^\$" actual
Cheers, Wincent