Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Sep 26, 2018, 00:56 UTC
- Message-ID
- <20180926005620.GH4364@syl>
- In-Reply-To
- <xmqqr2hmvcyz.fsf@gitster-ct.c.googlers.com>
On Fri, Sep 21, 2018 at 12:59:16PM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> Taylor Blau <me@ttaylorr.com> writes:
>
> > In fact, I think that we can go even further: since we don't need to
> > catch the beginning '^.*' (without -o), we can instead:
> >
> > extract_haves () {
> > depacketize - | grep '\.have' | sed -e 's/\\0.*$//g'
> > }
>
> Do not pipe grep into sed, unless you have an overly elaborate set
> of patterns to filter with, e.g. something along the lines of...
>
> sed -ne '/\.have/s/...//p'Thanks, I'm not sure why I thought that this was a good idea to send (even after discussing it to myself twice publicly on the list beforehand).
Anyway, in my local copy, I adopted Peff's suggestion below in the thread, which is:
extract_haves () {
depacketize - | perl -lne '/^(\S+) \.have/ and print $1'
}I think that that should be OK, but I sent it here to double check before sending you real patches.
Thanks, Taylor