From: Jeff King Date: Sun, 08 Mar 2009 15:09:44 GMT Subject: Re: [PATCH/RFD] builtin-revert.c: release index lock when cherry-picking an empty commit Message-ID: <20090308150944.GA32294@coredump.intra.peff.net> In-Reply-To: <20090308144240.GA30794@coredump.intra.peff.net> On Sun, Mar 08, 2009 at 10:42:40AM -0400, Jeff King wrote: > 2. Have test_run_ canonicalize the snippet by removing trailing > newlines. > [...] > I think (2) is the most reasonable option of those choices. And here's what that would look like: diff --git a/t/test-lib.sh b/t/test-lib.sh index 7a847ec..276a14d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -273,7 +273,7 @@ test_debug () { } test_run_ () { - eval >&3 2>&4 "$1" + eval >&3 2>&4 "`echo "$1" | sed -e :a -e '/^ *\n*$/{$d;N;ba' -e '}'`" eval_ret="$?" return 0 } That is a truly hideous sed expression, and I would be happy to hear more readable suggestions (it is based on one from the "sed one-liners" compilation). With this applied, t3505 passes for me. However, some other random tests are broken as a result. It looks like it might be related to an extra round of '\' expansion. -Peff