Re: [PATCH 3/5] protocol-capabilities.txt: clarify "allow-x-sha1-in-want" re SHA-256
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Aug 14, 2020, 12:31 UTC
- Message-ID
- <73e1ce78-a461-1204-99d5-a588f8e65fc9@gmail.com>
- In-Reply-To
- <13798dfb121c9631e9d811f5f74f9a78c1fcfdf9.1597406877.git.martin.agren@gmail.com>
On 8/14/2020 8:21 AM, Martin Ågren wrote:
Show 35 quoted lines
> Two of our extensions contain "sha1" in their names, but that's > historical. The "want"s will take object names that are not necessarily > SHA-1s. Make this clear, but also make it clear how there's still just > one correct hash algo: These extensions don't somehow make the "want"s > take object names derived using *any* hash algorithm. > > Signed-off-by: Martin Ågren <martin.agren@gmail.com> > --- > Documentation/technical/protocol-capabilities.txt | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/Documentation/technical/protocol-capabilities.txt b/Documentation/technical/protocol-capabilities.txt > index 36ccd14f97..47f1b30090 100644 > --- a/Documentation/technical/protocol-capabilities.txt > +++ b/Documentation/technical/protocol-capabilities.txt > @@ -324,15 +324,18 @@ allow-tip-sha1-in-want > ---------------------- > > If the upload-pack server advertises this capability, fetch-pack may > -send "want" lines with SHA-1s that exist at the server but are not > -advertised by upload-pack. > +send "want" lines with object names that exist at the server but are not > +advertised by upload-pack. (Note that the name of the capability > +contains "sha1", but that it's more general than that: in SHA-1 > +repositories, the "want" lines provide SHA-1 values, but in SHA-256 > +repositories, they provide SHA-256 values.) > > allow-reachable-sha1-in-want > ---------------------------- > > If the upload-pack server advertises this capability, fetch-pack may > -send "want" lines with SHA-1s that exist at the server but are not > -advertised by upload-pack. > +send "want" lines with object names that exist at the server but are not > +advertised by upload-pack. (Same remark about "sha1" as above.)
This "as above" is brittle to future changes. I think it could be improved with
(As in "allow-tip-sha1-in-want", the "sha1" in this capability refers to object names, not the hash algorithm chosen for the repository.)
Or, just repeat the same note again.
Thanks, -Stolee