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

Re: [PATCH/RFC 4/6] transport: add refspec list parameters to functions

From
David Turner <dturner@twopensource.com>
Date
Apr 25, 2016, 16:44 UTC
Message-ID
<1461602647.25914.2.camel@twopensource.com>
In-Reply-To
<20160420205726.GA17876@sigill.intra.peff.net>
On Wed, 2016-04-20 at 16:57 -0400, Jeff King wrote:
Show 20 quoted lines
> On Wed, Apr 20, 2016 at 04:46:55PM -0400, David Turner wrote:
> 
> > As you note, it appears that git-daemon does sort-of have support
> > for
> > extra args -- see parse_host_arg.  So it wouldn't be hard to add
> > something here. Unfortunately, current versions of git die on
> > unknown
> > args.  So this change would not be backwards-compatible.  We could
> > put
> > a decider on it so that clients would only try it when explicitly
> > enabled.  Or we could have clients try it with, and in the event of
> > an
> > error, retry without.  Neither is ideal, but both are possible.
> 
> Right. This ends up being the same difficulty that the v2 protocol
> encountered; how do you figure out what you can speak without
> resorting
> to expensive fallbacks, when do you flip the switch, do you remember
> the
> protocol you used last time with this server, etc.
Right.
[moved]
Show 9 quoted lines
> > If I read this code correctly, git-over-ssh will pass through
> > arbitrary
> > arguments.  So this should be trivial.
> 
> It does if you are ssh-ing to a real shell-level account on the
> server,
> but if you are using git-shell or some other wrapper to restrict
> clients
> from running arbitrary commands, it will likely reject it.

Oh, I see how I was mis-reading shell.c. Oops. [/moved]

Show 7 quoted lines
> Which isn't to say it's necessarily a bad thing. Maybe the path
> forward
> instead of v2 is to shoe-horn this data into the pre-protocol
> conversation, and go from there. The protocol accepts that "somehow"
> it
> got some extra data from the transport layer, and acts on its
> uniformly.

OK, so it seems like only HTTP (and non-git-shell-git://) allow backwar ds-compatible optional pre-protocol messages. So we don't have good options; we only have bad ones. We have to decide which particular kind of badness we're willing to accept, and to what degree we care about extensibility. As I see it, the badness options are (in no particular order):

1. Nothing changes.
2. HTTP grows more extensions; other protocols stagnate.
3. HTTP grows extensions; other protocols get extensions but:
   a. only use them on explicit client configuration or
   b. try/fail/remember per-remote
4. A backwards-incompatible protocol v2 is introduced, which
   hits alternate endpoints (with the same a/b as above).  This is
   different from 3. in that protocol v2 is explicitly designed around
   a capabilities negotiation phase rather than unilateral client-side
   decisions.
5. Think of another way to make fetch performant with many refs, and 	
    defer the extension decision.
Previous: Jeff KingNext: Stefan Beller
Message 22 of 36 in “fetch with refspec”
  1. 0/6 fetch with refspecDavid Turner, Apr 15, 2016
  2. 1/6 http-backend: use argv_array functionsDavid Turner, Apr 15, 2016
  3. Junio C HamanoApr 18, 2016
  4. David TurnerApr 19, 2016
  5. 2/6 remote-curl.c: fix variable shadowingDavid Turner, Apr 15, 2016
  6. Junio C HamanoApr 18, 2016
  7. David TurnerApr 19, 2016
  8. 3/6 http-backend: handle refspec argumentDavid Turner, Apr 15, 2016
  9. Eric SunshineApr 17, 2016
  10. David TurnerApr 19, 2016
  11. 4/6 transport: add refspec list parameters to functionsDavid Turner, Apr 15, 2016
  12. Junio C HamanoApr 18, 2016
  13. Jeff KingApr 19, 2016
  14. Stefan BellerApr 19, 2016
  15. Junio C HamanoApr 19, 2016
  16. David TurnerApr 19, 2016
  17. Jeff KingApr 19, 2016
  18. David TurnerApr 19, 2016
  19. Jeff KingApr 20, 2016
  20. David TurnerApr 20, 2016
  21. Jeff KingApr 20, 2016
  22. David TurnerApr 25, 2016
  23. Stefan BellerApr 25, 2016
  24. Stefan BellerApr 27, 2016
  25. Jeff KingApr 27, 2016
  26. Junio C HamanoApr 27, 2016
  27. David TurnerApr 29, 2016
  28. Stefan BellerApr 29, 2016
  29. David TurnerApr 19, 2016
  30. 5/6 fetch: pass refspec to http serverDavid Turner, Apr 15, 2016
  31. Eric SunshineApr 17, 2016
  32. David TurnerApr 19, 2016
  33. 6/6 clone: send refspec for single-branch clonesDavid Turner, Apr 15, 2016
  34. Eric SunshineApr 17, 2016
  35. David TurnerApr 19, 2016
  36. Stefan BellerApr 15, 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.