diff mbox series

protocol-capabilities.txt: document symref

Message ID 4ffb11ff776166944673ba3bdb96a9d20eb14df7.1549929088.git.steadmon@google.com (mailing list archive)
State New, archived
Headers show
Series protocol-capabilities.txt: document symref | expand

Commit Message

Josh Steadmon Feb. 11, 2019, 11:52 p.m. UTC
In 7171d8c15f ("upload-pack: send symbolic ref information as
capability"), we added a symref capability to the pack protocol, but it
was never documented. Adapt the patch notes from that commit and add
them to the capabilities documentation.

Signed-off-by: Josh Steadmon <steadmon@google.com>
---
 Documentation/technical/protocol-capabilities.txt | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Jonathan Nieder Feb. 11, 2019, 11:58 p.m. UTC | #1
Josh Steadmon wrote:

> In 7171d8c15f ("upload-pack: send symbolic ref information as
> capability"), we added a symref capability to the pack protocol, but it
> was never documented. Adapt the patch notes from that commit and add
> them to the capabilities documentation.
>
> Signed-off-by: Josh Steadmon <steadmon@google.com>
> ---
>  Documentation/technical/protocol-capabilities.txt | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks.
Jeff King Feb. 12, 2019, 12:05 a.m. UTC | #2
On Mon, Feb 11, 2019 at 03:52:24PM -0800, Josh Steadmon wrote:

> In 7171d8c15f ("upload-pack: send symbolic ref information as
> capability"), we added a symref capability to the pack protocol, but it
> was never documented. Adapt the patch notes from that commit and add
> them to the capabilities documentation.

Good catch, and your explanation (especially the SHOULD/MAY bits) looks
good.

I think this is obsoleted by v2, which will send symref info along with
each ref. I don't know if it's worth mentioning that here (the v2 docs
discuss it, but I don't know if this capabilities document is clear
about which ones apply only to v0).

-Peff
Josh Steadmon Feb. 12, 2019, 12:07 a.m. UTC | #3
On 2019.02.11 19:05, Jeff King wrote:
> On Mon, Feb 11, 2019 at 03:52:24PM -0800, Josh Steadmon wrote:
> 
> > In 7171d8c15f ("upload-pack: send symbolic ref information as
> > capability"), we added a symref capability to the pack protocol, but it
> > was never documented. Adapt the patch notes from that commit and add
> > them to the capabilities documentation.
> 
> Good catch, and your explanation (especially the SHOULD/MAY bits) looks
> good.
> 
> I think this is obsoleted by v2, which will send symref info along with
> each ref. I don't know if it's worth mentioning that here (the v2 docs
> discuss it, but I don't know if this capabilities document is clear
> about which ones apply only to v0).
> 
> -Peff

I believe this doc is only for v0/v1. I'll add a note.
diff mbox series

Patch

diff --git a/Documentation/technical/protocol-capabilities.txt b/Documentation/technical/protocol-capabilities.txt
index 332d209b58..0ccdbadbe9 100644
--- a/Documentation/technical/protocol-capabilities.txt
+++ b/Documentation/technical/protocol-capabilities.txt
@@ -172,6 +172,20 @@  agent strings are purely informative for statistics and debugging
 purposes, and MUST NOT be used to programmatically assume the presence
 or absence of particular features.
 
+symref
+------
+
+This parameterized capability is used to inform the receiver which symbolic ref
+points to which ref; for example, "symref=HEAD:refs/heads/master" tells the
+receiver that HEAD points to master. This capability can be repeated to
+represent multiple symrefs.
+
+Servers SHOULD include this capability for the HEAD symref if it is one of the
+refs being sent.
+
+Clients MAY use the parameters from this capability to select the proper initial
+branch when cloning a repository.
+
 shallow
 -------