All of lore.kernel.org
 help / color / mirror / Atom feed
* [1.8.0] Remote tag namespace
@ 2011-02-01 10:44 Nguyen Thai Ngoc Duy
  2011-02-01 14:10 ` Leo Razoumov
                   ` (2 more replies)
  0 siblings, 3 replies; 105+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2011-02-01 10:44 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Nicolas Pitre

On Tue, Feb 1, 2011 at 11:16 AM, Nicolas Pitre <nico@fluxnic.net> wrote:
> On Tue, 1 Feb 2011, Nguyen Thai Ngoc Duy wrote:
>> Another random wish, which does not come with a proposal. How about
>> tag namespace (ie. tags from a remote stay in remote namespace)?
>
> Please make this into a proper proposal.  this would be indeed a huge
> improvement.

OK I'm not familiar with tag code, but I can try.

Proposal:

Reserve refs/remote-tags namespace to store tags from remotes. Its
structure is the same as in refs/remotes. When pulling tags, put them
in refs/remote-tags/<remote> instead of refs/tags.
Tag dereference code will be taught about refs/remote-tags with
similar deref order as in remote branches.

Config branch.*.globalTags (perhaps takes a pattern?) may be defined
to create refs/tags/* in addition to refs/remote-tags/<remote>/* when
fetching tags.

Migration plan:

refs/remote-tags will be used to store new tags unconditionally, which
means there will be duplicates with the already-fetched tags in global
namespace. Perhaps we can check if they point to the same sha-1, then
choose not to annoy users with ambiguous tag messages?

I suggest to add config compatibility.remoteTagNamespace, default to
false, which retains current behavior (i.e. also create tags in global
namespace in addition to refs/remote-tags). After 1.8.0 (or a few more
cycles) the default value becomes true. Users who wish to keep old
behavior can put "false" in their ~/.gitconfig.

After a few years, remove support for the config key. Unrecognized
compatibility.* keys will abort program. Users are forced to new
behavior. I don't know, we may want to start annoy users that have the
config key set a few cycles before we drop support.
-- 
Duy

^ permalink raw reply	[flat|nested] 105+ messages in thread
* Re: [1.8.0] Provide proper remote ref namespaces
@ 2011-02-07  3:35 Johan Herland
  0 siblings, 0 replies; 105+ messages in thread
From: Johan Herland @ 2011-02-07  3:35 UTC (permalink / raw)
  To: Dmitry Potapov
  Cc: git, Nicolas Pitre, Nguyen Thai Ngoc Duy, Jeff King,
	Sverre Rabbelier, Junio C Hamano

(resend without HTML part; I apologize for the inconvenience)

On Monday 07 February 2011, Dmitry Potapov wrote:
> On Sun, Feb 06, 2011 at 11:12:51PM +0100, Johan Herland wrote:
> There are two sorts of tags:
> - local tags, which are never intended to be shared with others but used
>   by users to mark some points in the working repository.
> - global tags, which are just _social_convention_ about what the current
>   project considers as official versions. Without social convention, they
>   make no sense.

Agreed.

> > The core of this discussion is where we want to place Git in the space
> > between "technically correct" and "socially conventional", where the
> > former means owning up to the fact that each repo really is its own
> > namespace, and there's no way around that in a proper DVCS, and the
> > latter means building social convention into our tools, thereby making
> > it harder to deal with the few unconventional cases (like my two
> > semi-related repos case).
> 
> Tags like words are social convention, which are used for communication
> between people participated in a project. But accordingly to you, it
> seems somehow "technically correct" to invent their own words in Humpty
> Dumpty's ways:
> 
> 'When I use a word,' Humpty Dumpty said, in rather a scornful tone, 'it
> means just what I choose it to mean — neither more nor less.'
> 
> I am afraid you got the wrong idea about "proper DVCS", because DVCS
> does not imply that there is no social convention. It just means that
> there is no single authority that dictates everything. Like with words,
> there is no single authority that assigns meaning to new words, but
> that does not mean that you cannot just say "When I use a word... "
> if you want to be understood by others.

I think there is a misunderstanding in my use of the phrase "technically 
correct". I use it to merely state what is a theoretical truth: In a DVCS 
world there is no single authority that dictates the meaning of a tag name.

I do not mean that "technically correct" is inherently _better_ than the 
alternative (maybe "theoretically true" is a better phrase). I certainly do 
NOT mean that the Humpty Dumpty approach is somehow more desirable than 
following project conventions. To the contrary, I very much _support_ the 
idea of project-wide tags. I'm merely stating that the technical facts of a 
DVCS makes it _theoretically_ impossible to enforce project-wide agreement 
on tag names.

Of course, in _practice_ we use project-wide tags without problems all the 
time. And they obviously form a _semantic_ namespace that spans the entire 
project. I don't disagree with you here.

Where we disagree is whether Git should base its tag refs on the 
_theoretically_true_ model, or on the _common_practice_ model. Of course, 
the real solution lies somewhere in between the two extremes:

I propose that even though we base Git on the theoretical DVCS truths, we 
try very hard to make it Just Work (tm) in the common case (especially 
making sure that existing use cases are preserved as much as possible).

As I understand your view (I do apologize if I somehow misrepresent it), you 
want Git to assume that the common practice of one semantic namespace is 
followed. Furthermore, you also want to enforce that practice where 
possible, while still improving the handling of the uncommon (but 
theoretically inevitable) case (warning and presumably guiding the user when 
a tag conflict occurs).

> > AFAICS, my proposal does not harm the common case (unambiguous tags are
> > still interpreted unambiguously, even if they may exist in multiple
> > namespaces), while it _does_ help the uncommon case (by allowing
> > ambiguous tags to co-exist in the same repo).
> 
> It hurts the common case in a few ways:
> 1. It breaks existing user scripts

Yes, but that was sort of in the pretext of this thread ;)

Seriously, though, we should of course try to keep as many scripts as 
possible working smoothly. For instance, existing remotes will not be 
updated, so everything should keep working for them. It shall also be 
possible to use old-style refspecs when creating new remotes, meaning that 
whatever scripts depend on the old-style refspecs can be upgraded at 
leisure. We could even add a config variable choosing between old-style 
(default) and new-style refspecs.

With this in place, I believe the user script breakage will be minimal. If 
there is still significant breakage, we should reconsider the relevant part 
of the proposal.

> 2. It complicates things for users (as Matthieu wrote above).

I guess this depends on your POV. Fundamentally, I do NOT want to change how 
people refer to tags. I only want to provide them the possibility of doing 
so when ambiguity is present.

> 3. git fetch cannot report a tag clash if it happens

Yes it can: For each tag fetched from the remote, if resolving its shorthand 
name ("v1.7.4") results in ambiguity (i.e. there exists a conflicting tag 
elsewhere in this repo), then warn the user about this conflict, and explain 
how to refer to each tag candidate using the full ref name. Also explain how 
the user may resolve the ambiguity by creating a local tag 
("refs/tags/v1.7.4") pointing to the preferred target.

> I believe that the right interface when the common case is simple, but
> an uncommon case is still possible to handle. I don't think that
> currently git meets this criterion, but making tag namespaces based on
> the remote name strikes me as a really bad idea. Tags are attributes of
> a project and not particular remote.

Yes they are (in pratice), and no they aren't (in theory). See above.

> > My proposal tries very hard to present a single namespace
> > _semantically_ to the user in the common case (when tags are
> > unambiguous). I'd even go as far as proposing that "git tag -l" should
> > by default list only a single shortened tag name in the cases where
> > there are multiple unambiguous alternatives.
> 
> IMHO, it is very confusing, especially for people whose script was
> suddenly broken by those namespaces.

I believe script breakage can be minimized. See above.

> > Alternatively, I'd suggest a compromise (already mentioned elsewhere in
> > this thread) where we add a config variable tags.preferredRemote
> > (defaults to "origin") which allows you to directly select which
> > namespace you consider official. You could even implement this as
> > physically copying
> > refs/remotes/${tag.preferredRemote}/tags/* into refs/tags/*.
> 
> It seems you do not understand the problem that I am trying to say all
> way along: there is more than one repo from which I fetch tags, and
> because they are belong to the same project, they should be in the same
> namespace.
> 
> So, IMHO, the proper solution should be ability to specify the desired
> namespace for any remote repository, like this:
> 
> remote.<name>.tagNameSpace = foo

Interesting. I'm not sure what "foo" means in this context. Would I use it 
like this?:

    remote.origin.tagNameSpace = refs/tags

(to place origin's tags in refs/tags/*)

If so, what's the difference between this option, and using this?:

    remote.origin.fetch = refs/tags/*:refs/tags/*

> So, those who want to have many namespaces should be able to that
> easily, but forcing multiple namespaces on those who have a single
> namespace semantically is simple wrong. Not to mention that it breaks
> existing scripts for no good reason.

In practice, this discussion boils down to whether we should use

    remote.origin.fetch = refs/tags/*:refs/remotes/origin/tags/*
or
    remote.origin.fetch = refs/tags/*:refs/tags/*

as the default refspec for tags. AFAICS, we both agree that whichever 
refspec is chosen by default, it should be possible for the user to (fairly 
easily) override, and use the other refspec instead.

With that, my main concern about this part of the proposal is satisfied: 
Putting remote tags in separate namespaces will be easy to accomplish (if 
not the default behavior).


Thanks for the feedback,

...Johan


PS: I'd be interested if you have a suggestion for how to deal with the 
issue presented by Nicolas' elsewhere in this thread. Quoting:

The extraordinary misfeature of the tag namespace at the moment comes 
from the fact that whenever you add a remote repo to fetch, and do fetch 
it, then your flat tag namespace gets polluted with all the tags the 
remote might have.  If you decide to delete some of those remote 
branches, the tags that came with it are still there and 
indistinguishable from other tags making it a real pain to sort out.

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 105+ messages in thread

end of thread, other threads:[~2011-02-18  0:57 UTC | newest]

Thread overview: 105+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 10:44 [1.8.0] Remote tag namespace Nguyen Thai Ngoc Duy
2011-02-01 14:10 ` Leo Razoumov
2011-02-01 15:07 ` Marc Branchaud
2011-02-01 15:35   ` Nguyen Thai Ngoc Duy
2011-02-02 19:38     ` Marc Branchaud
2011-02-01 18:14 ` Jeff King
2011-02-01 23:14   ` Sverre Rabbelier
2011-02-02  2:21     ` [1.8.0] Provide proper remote ref namespaces Johan Herland
2011-02-02 13:27       ` Santi Béjar
2011-02-02 15:51         ` Johan Herland
2011-02-02 16:19           ` Santi Béjar
2011-02-03  5:33       ` Nguyen Thai Ngoc Duy
2011-02-03  8:46         ` Johan Herland
2011-02-03 11:35       ` Nguyen Thai Ngoc Duy
2011-02-03 13:10         ` Johan Herland
2011-02-03 14:10           ` Santi Béjar
2011-02-03 15:48             ` Nguyen Thai Ngoc Duy
2011-02-04 22:39       ` Junio C Hamano
2011-02-05  1:18         ` Johan Herland
2011-02-05 18:00           ` Kevin P. Fleming
2011-02-05 21:40           ` Dmitry Potapov
2011-02-06  0:04             ` Johan Herland
2011-02-06 12:03               ` Dmitry Potapov
2011-02-06 14:09                 ` Nicolas Pitre
2011-02-06 15:17                   ` Dmitry Potapov
2011-02-06 16:11                 ` Johan Herland
2011-02-06 17:28                   ` Dmitry Potapov
2011-02-06 22:12                     ` Johan Herland
2011-02-07  0:07                       ` Dmitry Potapov
2011-02-07 19:05                         ` Bernhard R. Link
2011-02-08  1:20                           ` Dmitry Potapov
     [not found]                         ` <201102070429.05033.johan@herland.net>
2011-02-07  3:47                           ` Nicolas Pitre
2011-02-08  1:06                           ` Dmitry Potapov
2011-02-08  8:15                             ` Johan Herland
2011-02-08 19:11                               ` Enrico Weigelt
2011-02-08 23:13                               ` Junio C Hamano
2011-02-09  1:24                                 ` Johan Herland
2011-02-06 20:28               ` Matthieu Moy
2011-02-06 23:22                 ` Johan Herland
2011-02-06 23:51                   ` Matthieu Moy
2011-02-07  3:51                     ` Johan Herland
2011-02-07  5:11                       ` Jeff King
2011-02-07  8:58                         ` Johan Herland
2011-02-07  9:01                           ` Sverre Rabbelier
2011-02-07 10:06                             ` Johan Herland
2011-02-07 10:22                               ` Nguyen Thai Ngoc Duy
2011-02-07 20:19                           ` Jeff King
2011-02-08  0:59                             ` Johan Herland
2011-02-11 15:13                               ` Jakub Narebski
2011-02-13 23:36                                 ` Johan Herland
2011-02-14  7:35                                   ` Junio C Hamano
2011-02-14  9:18                                     ` Johan Herland
2011-02-14  9:59                                       ` Jakub Narebski
2011-02-14 17:30                                         ` Junio C Hamano
2011-02-14 18:06                                       ` Re* " Junio C Hamano
2011-02-14 18:53                                         ` Jay Soffian
2011-02-14 19:44                                           ` Sverre Rabbelier
2011-02-14 19:50                                             ` Jay Soffian
2011-02-14 21:21                                               ` [1.8.0 RFC] push: start warning upcoming default change for push.default Jonathan Nieder
2011-02-14 21:41                                                 ` Jay Soffian
2011-02-14 21:55                                                   ` Jonathan Nieder
2011-02-14 21:57                                               ` Re* [1.8.0] Provide proper remote ref namespaces Matthieu Moy
2011-02-14 22:35                                                 ` Jeff King
2011-02-14 22:38                                                   ` Sverre Rabbelier
2011-02-14 23:36                                                   ` [1.8.0 RFC] push: start warning upcoming default change for push.default Jonathan Nieder
2011-02-14 23:45                                                   ` Re* [1.8.0] Provide proper remote ref namespaces Junio C Hamano
2011-02-14 23:05                                             ` Junio C Hamano
2011-02-15 15:06                                         ` Johan Herland
2011-02-15 18:06                                           ` Junio C Hamano
2011-02-16  0:54                                             ` [PATCH] push.default: Rename 'tracking' to 'upstream' Johan Herland
2011-02-16  6:35                                               ` Junio C Hamano
2011-02-16  8:55                                               ` Matthieu Moy
2011-02-16  9:42                                                 ` Martin von Zweigbergk
2011-02-16 10:08                                                   ` Jakub Narebski
2011-02-16 10:26                                                     ` Matthieu Moy
2011-02-16 10:27                                                       ` Sverre Rabbelier
2011-02-16 17:56                                                         ` Junio C Hamano
2011-02-16 18:08                                                           ` Sverre Rabbelier
2011-02-16 18:37                                                           ` Junio C Hamano
2011-02-18  0:51                                                           ` Martin von Zweigbergk
2011-02-18  0:57                                                             ` Martin von Zweigbergk
2011-02-16 10:54                                                   ` Bernhard R. Link
2011-02-14  9:40                                   ` [1.8.0] Provide proper remote ref namespaces Jakub Narebski
2011-02-14 15:45                                     ` Marc Branchaud
2011-02-14 19:35                                       ` Nicolas Pitre
2011-02-14 18:30                                     ` Junio C Hamano
2011-02-14 19:06                                       ` Nicolas Pitre
2011-02-14 19:46                                         ` Sverre Rabbelier
2011-02-07  6:54                       ` Matthieu Moy
2011-02-07  0:14                   ` Dmitry Potapov
2011-02-05 18:39         ` Nicolas Pitre
2011-02-05 19:37           ` Jeff King
2011-02-05 19:55             ` Nicolas Pitre
2011-02-05 23:39               ` Johan Herland
2011-02-06 20:04               ` Junio C Hamano
2011-02-07 16:10                 ` Marc Branchaud
2011-02-07 19:40                   ` Junio C Hamano
2011-02-07 20:37                     ` Nicolas Pitre
2011-02-07  5:18               ` Jeff King
2011-02-07 14:53                 ` Nicolas Pitre
2011-02-07 20:25                   ` Jeff King
2011-02-07 20:51                     ` Nicolas Pitre
2011-02-07 20:56                       ` Jeff King
2011-02-01 23:15   ` [1.8.0] Remote tag namespace Johan Herland
2011-02-07  3:35 [1.8.0] Provide proper remote ref namespaces Johan Herland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.