From: Eric Sunshine Date: Fri, 05 Apr 2019 19:25:43 GMT Subject: Re: [PATCH 2/7] t: introduce tests for unexpected object types Message-ID: In-Reply-To: <20190405182412.GC2284@sigill.intra.peff.net> On Fri, Apr 5, 2019 at 2:24 PM Jeff King wrote: > On Fri, Apr 05, 2019 at 12:50:33PM +0200, SZEDER Gábor wrote: > > > + git cat-file commit $commit | > > > + perl -lpe "/^author/ && print q(parent $blob)" \ > > > + >broken-commit && > > > Wouldn't a 'sed' one-liner suffice, so we won't have yet another perl > > dependency? > > Heh, this was actually the subject of much discussion before the patches > hit the list. If you can write such a one-liner that is both readable > and portable, please share it. I got disgusted with sed and suggested > this perl. Trivial and portable 'sed' equivalent: git cat-file commit $commit | sed "/^author/ { h; s/.*/parent $blob/; G; }"