why tag doesn't need commit ?

William Dode wilk at flibuste.net
Thu Sep 20 18:41:41 BST 2007


On 20-09-2007, Aaron Bentley wrote:
>
> William Dode wrote:
>> I wonder why setting a tag doesn't need a 'commit' like others changes 
>> in the branch ? It's not really a problem but i find it not very 
>> consistent.
>
> Tags are not versioned.  They are not part of revisions.  So they don't
> have commit messages, and they can be changed after the fact.  In fact,
> tags aren't stored in the repository, only in the branch.  The
> fundamental reason why they don't need a commit is because they don't
> affect the repository.
>
> We did not want to force people to commit in order to tag an existing
> revision, or prevent people from tagging existing revisions.  And we did
> want it to be possible to move a tag from one revision to another.
> These meant that tags could not be part of the revision they apply to.

Thanks to explain. I think it was difficult for me to understand because 
i used to commit for a tag when they was not managed by bazaar. I played 
a litle bit more with them (didn't know that we can have not only one 
and so...) and see now how it can be more possibilities like that.

>
>> bzr tag mytag
>> bzr ci -m 'set my tag'
>
> We should probably add a --tag flag to commit, as we do with --fixes.  I

It can be interresting, it's in the spec page of the wiki "This is the 
recommended way to place tags,...".

> don't really understand the rest of your complaint.  Why is it a
> disadvantage to *not* be forced to commit?

Not a disadvantage, a surprise. And a doubt (should i commit or not?), 
not more.

>
>> Also, it's strange to don't see any comment when pushing
>> bzr tag mytag
>> bzr st
>> => i was waiting for 'you add a tag'
>
> Status shows you uncommitted changes, but tags don't need to be
> committed.  "mytag" has already been completely applied to your branch,
> so there are no changes to show.

It's the key, i thought about tag as 'applied to a project'.

>
>> bzr push
>> No new revisions to push. (should be no 's' isn't it ?)
>
> No, either form is correct here.  "revisions" suggests that multiple
> revisions could be pushed, while "revision" suggests that only one
> revision would be pushed, even if there were multiple revisions
> available to push.  So while both are correct, I prefer "revisions".
>
> However, when using the number zero, the plural form is always used:
> 0 revisions pushed
> 1 revision pushed
> 2 revisions pushed
>
>> => but yes something was pushed silently.
>
> That should be fixed.

fine

>
>> I read the wiki page about the spec but could'nt find an answer, could 
>> you explain me or point me to the discussion about this ?
>
> http://article.gmane.org/gmane.comp.version-control.bazaar-ng.general/8540
> http://article.gmane.org/gmane.comp.version-control.bazaar-ng.general/13658
> http://article.gmane.org/gmane.comp.version-control.bazaar-ng.general/21387
>
> And no doubt more.  It's been quite a contentious issue-- centralized
> tags are well understood (and also don't require a commit, in most
> systems), but extending tagging to decentralized systems is not an
> obvious transformation.

But it's done :-)

thanks again to give your time to explain.

-- 
William Dodé  -  http://flibuste.net
Informaticien indépendant




More information about the bazaar mailing list