Re: [PATCH v4] blame: print unblamable and ignored commits in porcelain mode
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 31, 2025, 07:05 UTC
- Message-ID
- <Z-o-suJAfu5yc2AW@pks.im>
- In-Reply-To
- <20250330204339.191382-1-karthik.188@gmail.com>
On Sun, Mar 30, 2025 at 10:43:39PM +0200, Karthik Nayak wrote:
Show 17 quoted lines
> 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