Patrick Steinhardt <ps@xxxxxx> writes: > On Sun, Mar 30, 2025 at 10:43:39PM +0200, Karthik Nayak wrote: >> diff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh >> index 370b768149..50a0a7ca4a 100755 >> --- a/t/t8013-blame-ignore-revs.sh >> +++ b/t/t8013-blame-ignore-revs.sh >> @@ -158,6 +158,21 @@ test_expect_success mark_unblamable_lines ' >> test_cmp expect actual >> ' >> >> +for opt in --porcelain --line-porcelain >> +do >> + test_expect_success "mark_unblamable_lines with $opt" ' >> + sha=$(git rev-parse Y) && >> + >> + git -c blame.markUnblamableLines=false blame $opt --ignore-rev Y file >raw && >> + sed -e "s/^\ty3/unblamable\n&/" raw >expect && >> + cp expect raw && >> + sed -e "s/^\ty4/unblamable\n&/" raw >expect && > > The intent here is to do two replacements in "raw", right? You can do > this with a single call to sed(1) by chaining "-e": > > git -c blame.markUnblamableLines=false blame $opt --ignore-rev Y file >raw && > sed -e "s/^\ty3/unblamable\n&/" \ > -e "s/^\ty4/unblamable\n&/" raw >expect && > > Patrick Nice, I first tried to use `-i`, but seems like that doesn't work with the 'sed' shipped in OSX. Didn't know I could chain it. This makes it cleaner.
Attachment:
signature.asc
Description: PGP signature