git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: upload-pack/ls-remote: showing non-HEAD symbolic refs?

From
Stefan Beller <sbeller@google.com>
Date
Aug 16, 2016, 18:50 UTC
Message-ID
<CAGZ79kZ7dzh6AhQRQZsEFdWB4MQxW431yfDuEXao=k_meNE8Nw@mail.gmail.com>
In-Reply-To
<20160816182852.inyqzplee5m3wzt6@sigill.intra.peff.net>
On Tue, Aug 16, 2016 at 11:28 AM, Jeff King <peff@peff.net> wrote:
Show 25 quoted lines
> On Tue, Aug 16, 2016 at 10:34:44AM -0700, Josh Triplett wrote:
>
>> > Sadly you cannot use a capability to fix that, because all of this
>> > happens before the client agrees to any capabilities (you can find
>> > discussion of a "v2" protocol on the list which solves this, but it's
>> > sort of languishing in the design phase).
>>
>> As a potential 1.1 version, which could work in a backward-compatible
>> way with existing servers and no additional round-trip: what if, in the
>> smart HTTP protocol, the client advertised client capabilities with an
>> additional HTTP header (e.g.  "Git-Client-Caps: symrefs othershiny
>> featurenames"?  git-http-backend could then pass those capabilities to
>> git-upload-pack (--client-caps='...'), which could take them into
>> account in the initial response?
>>
>> That wouldn't work as a single-pass approach for SSH, since the client
>> can't know if the server's upload-pack supports --client-caps, but it
>> would work for the smart HTTP protocol.
>
> You can dig up the discussion on the list under the name "protocol v2",
> but basically yes, that approach has been considered. It's a little
> gross just because it leaves other protocols behind http (and it is not
> necessarily a good idea to push people into http, because it has some
> fundamental drawbacks over the other protocols because of its
> half-duplex nature).

Some more thoughts on protocol v2 (the good parts to be attributed to jrnieder@gmail.com):

* In case of http we can use the http header and know information
  about the client, i.e. if it may support the following ideas:
* Instead of introducing a new protocol we introduce a capability\
  "resend-ref-advertisement" and only advertise very few refs (e.g.
  only the branches, not the pending changes in case of Gerrit)
* The client can then ignore the refs advertisement and ask for a resend
  of the refs with more specification,
  e.g. "want refs/heads/*", so allowing more than just sha1s in the
  want line but complex things like branch patterns.
Show 15 quoted lines
>
>> > That should Just Work over the existing http protocol without requiring
>> > an extra request.
>>
>> It'd require one extra request for git ls-remote, which normally doesn't
>> need the second round-trip, but that still seems reasonable.
>
> Good point. I don't think there's an easy way around that short of v2 or
> v1.1 that you mention above. I agree it's probably reasonable, though.
>
> -Peff
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Jeff KingNext: Josh Triplett
Message 5 of 12 in “upload-pack/ls-remote: showing non-HEAD symbolic refs?”
  1. Josh TriplettAug 16, 2016
  2. Jeff KingAug 16, 2016
  3. Josh TriplettAug 16, 2016
  4. Jeff KingAug 16, 2016
  5. Stefan BellerAug 16, 2016
  6. Josh TriplettAug 16, 2016
  7. Josh TriplettAug 16, 2016
  8. Jeff KingAug 16, 2016
  9. Josh TriplettAug 16, 2016
  10. Jeff KingAug 16, 2016
  11. Josh TriplettAug 16, 2016
  12. Jeff KingAug 19, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.