Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Jeff King
On Fri, Sep 02, 2016 at 07:03:30PM -0700, Shawn Pearce wrote: > > Is it useful for upload-pack? If we have no refs, there's traditionally > > been nothing to fetch. Perhaps that's something that could change, > > though. For example, there could be a capability to allow fetching > > arbitrary sha1

Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Shawn Pearce
On Fri, Sep 2, 2016 at 1:13 PM, Jeff King wrote: > > Hmm. So since this is backwards-compatible, I'm not overly concerned > with changing the client. But I wonder if you considered that the > documentation is wrong, and that JGit should stop sending the extra > capabilities line? No, JGit needs t

Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Jeff King
On Fri, Sep 02, 2016 at 03:11:16PM -0700, Jonathan Tan wrote: > On 09/02/2016 01:13 PM, Jeff King wrote: > > On Fri, Sep 02, 2016 at 10:15:39AM -0700, Jonathan Tan wrote: > > > (git-daemon should probably also be changed to serve zero IDs, but such > > > a change can be considered independently fr

Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Jonathan Tan
On 09/02/2016 01:13 PM, Jeff King wrote: On Fri, Sep 02, 2016 at 10:15:39AM -0700, Jonathan Tan wrote: (git-daemon should probably also be changed to serve zero IDs, but such a change can be considered independently from this change; even if both the client and server changes were made in one co

Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Jeff King
On Fri, Sep 02, 2016 at 10:15:39AM -0700, Jonathan Tan wrote: > connect.c, when processing packfiles, treats a zero ID (with > `capabilities^{}` in place of the refname) as an actual ref instead of a > placeholder for a capability declaration, contrary to the specification > in Reference Discovery

Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Shawn Pearce
On Fri, Sep 2, 2016 at 12:56 PM, Stefan Beller wrote: > On Fri, Sep 2, 2016 at 12:39 PM, Shawn Pearce wrote: >> On Fri, Sep 2, 2016 at 10:15 AM, Jonathan Tan >> wrote: >>> >>> + if (is_null_oid(&old_oid)) { >>> + if (strcmp(name, "capabilities^{}")) >> >> Its

Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Stefan Beller
On Fri, Sep 2, 2016 at 12:39 PM, Shawn Pearce wrote: > On Fri, Sep 2, 2016 at 10:15 AM, Jonathan Tan > wrote: >> >> + if (is_null_oid(&old_oid)) { >> + if (strcmp(name, "capabilities^{}")) > > Its not the zero ID that is special, its the "capabilities^{}" name

Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Shawn Pearce
On Fri, Sep 2, 2016 at 10:15 AM, Jonathan Tan wrote: > > + if (is_null_oid(&old_oid)) { > + if (strcmp(name, "capabilities^{}")) Its not the zero ID that is special, its the "capabilities^{}" name that is special when its the first entry in the stream. In the w

Re: [PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Jonathan Nieder
Hi, Jonathan Tan wrote: > connect.c, when processing packfiles, treats a zero ID (with > `capabilities^{}` in place of the refname) as an actual ref instead of a > placeholder for a capability declaration, contrary to the specification > in Reference Discovery in Documentation/technical/pack-prot

[PATCH 2/2] connect: know that zero-ID is not a ref

2016-09-02 Thread Jonathan Tan
connect.c, when processing packfiles, treats a zero ID (with `capabilities^{}` in place of the refname) as an actual ref instead of a placeholder for a capability declaration, contrary to the specification in Reference Discovery in Documentation/technical/pack-protocol.txt. This is an issue when in