Re: [PATCH 2/2] t4200: convert sed expression which operates on non-text file to perl
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- May 6, 2009, 23:24 UTC
- Message-ID
- <fcaeb9bf0905061624s515d9b13i188b27f4c5472eba@mail.gmail.com>
- In-Reply-To
- <Lle9L7vlL2vfnqjU75q2MW9kwH-igiKVkmBrtmLzQmOXU0OyvCI2tl4UD8Kdhyg0x_gCHDJIHDM@cipher.nrlssc.navy.mil>
On Thu, May 7, 2009 at 8:56 AM, Brandon Casey <casey@nrlssc.navy.mil> wrote:
Show 10 quoted lines
> diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh > index 504802c..5a1721d 100755 > --- a/t/t4200-rerere.sh > +++ b/t/t4200-rerere.sh > @@ -57,7 +57,7 @@ test_expect_success 'conflicting merge' ' > test_must_fail git merge first > ' > > -sha1=$(sed -e 's/ .*//' .git/MERGE_RR) > +sha1=$(perl -pe 's/ .*//' .git/MERGE_RR)
Can we have a wrapper for this please? This is correction solution. But my work to make git work on windows without msys/cygwin also means that I don't have perl. Maybe something like this? I know perl regex and sed one is not completely compatible, but it should work for simple regex used here and elsewhere.
sed_wrapper() {
if test_have_prereq PERL; then
perl -pe "$@"
else
sed -e "$@"
fi
}-- Duy