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

Re: [PATCH v2 2/2] fetch: send "refs/tags/" prefix upon CLI refspecs

From
BWBrandon Williams <bmwill@google.com>
Date
Jun 18, 2018, 19:53 UTC
Message-ID
<20180618195336.GE73085@google.com>
In-Reply-To
<20180618194750.137341-1-jonathantanmy@google.com>
On 06/18, Jonathan Tan wrote:
> 
> This would cause different behavior. For example, if I run "git fetch
> refs/heads/master refs/tags/foo", I would expect tag following to work
> even if the tag's name does not start with refs/tags/foo.

I understand that some people *may* want tag following, but really its confusing from an end user's standpoint. You can fetch a particular ref and end up with a bunch of tags that you didn't want. Aside from that my biggest issue is with performance. The ref filtering was added to cut down on the number of refs sent from the server, now we're basically adding them all back no matter what (unless a user goes and flips the default to not fetch tags).

I think we're probably going to need some people other than us to comment on how this should be handled.

Show 25 quoted lines
> 
> > > @@ -359,7 +359,7 @@ static struct ref *get_ref_map(struct transport *transport,
> > >                 refspec_ref_prefixes(&transport->remote->fetch, &ref_prefixes);
> > >
> > >         if (ref_prefixes.argc &&
> > > -           (tags == TAGS_SET || (tags == TAGS_DEFAULT && !rs->nr))) {
> > > +           (tags == TAGS_SET || tags == TAGS_DEFAULT)) {
> > 
> > Oh, I see. This always asks for refs/tags/ whereas before we only
> > asked for them if there were *no* refspec given. Maybe we can
> > change this to
> > 
> >     refspec_any_item_contains("refs/tags/")
> > 
> > instead of always asking for the tags?
> > (that function would need to be written; I guess for a short term bugfix
> > this is good enough)
> 
> Same answer as above.
> 
> > How is the tag following documented (i.e. when is the user least
> > surprised that we do not tag-follow all and unconditionally)?
> 
> It's documented under the --no-tags option in the man page for git
> fetch. I'm not sure what you mean by the user being surprised.
-- 
Brandon Williams
Previous: Jonathan TanNext: Junio C Hamano
Message 14 of 23 in “Fix protocol v2 tag following with CLI refspec”
  1. 0/2 Fix protocol v2 tag following with CLI refspecJonathan Tan, Jun 5, 2018
  2. 1/2 t5702: test fetch with multiple refspecs at a timeJonathan Tan, Jun 5, 2018
  3. 2/2 fetch: send "refs/tags/" prefix upon CLI refspecsJonathan Tan, Jun 5, 2018
  4. Brandon WilliamsJun 5, 2018
  5. Brandon WilliamsJun 5, 2018
  6. 0/2 Fix protocol v2 tag following with CLI refspecJonathan Tan, Jun 5, 2018
  7. 1/2 t5702: test fetch with multiple refspecs at a timeJonathan Tan, Jun 5, 2018
  8. Stefan BellerJun 18, 2018
  9. Jonathan TanJun 18, 2018
  10. Stefan BellerJun 18, 2018
  11. 2/2 fetch: send "refs/tags/" prefix upon CLI refspecsJonathan Tan, Jun 5, 2018
  12. Stefan BellerJun 18, 2018
  13. Jonathan TanJun 18, 2018
  14. Brandon WilliamsJun 18, 2018
  15. Junio C HamanoJun 18, 2018
  16. Jonathan TanJun 18, 2018
  17. Junio C HamanoJun 18, 2018
  18. Jonathan TanJun 18, 2018
  19. Jonathan NiederJul 9, 2018
  20. Brandon WilliamsJul 9, 2018
  21. Junio C HamanoJul 9, 2018
  22. Brandon WilliamsJul 9, 2018
  23. Junio C HamanoJul 9, 2018

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.