Re: [BUG] t7004 (master) busted on Leopard
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 15, 2007, 14:37 UTC
- Message-ID
- <Pine.LNX.4.64.0711151434060.30886@racer.site>
- In-Reply-To
- <17E3F66C-4644-4B64-817C-88062727A2D9@wincent.com>
Hi,
On Thu, 15 Nov 2007, Wincent Colaiuta wrote:
Show 6 quoted lines
> Commit 4d8b1dc850 added a couple of tests to t7004, and my testing reveals > that this one has been broken on Leopard since then: > > * FAIL 83: 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
I think this is our good old friend, MacOSX' sed. (Wasn't there a question today what's wrong with using sed? I think this issue qualifies.)
I imagine that it is that MacOSX' sed is adding a trailing newline (not the regexp like you suggested). Which means that "wc -l" would print "1". (You can see for yourself if you run the script with "sh -x ...".)
IMHO a good solution would be
test -z "$(grep -e '^#' -e '^$' actual)"
Could you test, please?
Thanks, Dscho