Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-25 Thread Taylor Blau
On Fri, Sep 21, 2018 at 12:59:16PM -0700, Junio C Hamano wrote: > Taylor Blau 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 '

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Junio C Hamano
Taylor Blau 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 elab

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Taylor Blau
On Fri, Sep 21, 2018 at 01:48:25PM -0400, Taylor Blau wrote: > On Fri, Sep 21, 2018 at 09:39:14AM -0700, Junio C Hamano wrote: > > Taylor Blau writes: > > > > > +extract_haves () { > > > + depacketize - | grep -o '^.* \.have' > > > > Not portable, isn't it? > > > > cf. http://pubs.opengroup.org/on

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Taylor Blau
On Fri, Sep 21, 2018 at 09:39:14AM -0700, Junio C Hamano wrote: > Taylor Blau writes: > > > +extract_haves () { > > + depacketize - | grep -o '^.* \.have' > > Not portable, isn't it? > > cf. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html Good catch. Definitely not portable,

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-21 Thread Junio C Hamano
Taylor Blau writes: > +extract_haves () { > + depacketize - | grep -o '^.* \.have' Not portable, isn't it? cf. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-20 Thread Jeff King
On Thu, Sep 20, 2018 at 04:00:34PM -0400, Taylor Blau wrote: > > My "rev-list --alternate-refs" patches _do_ use the refnames, since you > > could do something like "--source" that cares about them. But there's > > some awkwardness there, because the names are in a different namespace > > than the

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-20 Thread Taylor Blau
On Thu, Sep 20, 2018 at 03:37:51PM -0400, Jeff King wrote: > On Thu, Sep 20, 2018 at 02:04:11PM -0400, Taylor Blau wrote: > > > diff --git a/Documentation/config.txt b/Documentation/config.txt > > index 112041f407..b908bc5825 100644 > > --- a/Documentation/config.txt > > +++ b/Documentation/config.

Re: [PATCH 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-20 Thread Jeff King
On Thu, Sep 20, 2018 at 02:04:11PM -0400, Taylor Blau wrote: > diff --git a/Documentation/config.txt b/Documentation/config.txt > index 112041f407..b908bc5825 100644 > --- a/Documentation/config.txt > +++ b/Documentation/config.txt > @@ -616,6 +616,12 @@ core.preferSymlinkRefs:: > This is so