What do you use the svn tags directory for anyways?

前端 未结 9 1637
猫巷女王i
猫巷女王i 2020-12-17 17:30

Ok so we all know the standard SVN set-up of

trunk\\
branches\\
tags\\

And I realize that the recommendation is that tags should have \"spe

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-17 18:19

    Tags are supposed to reference immutable "version of the application" of a set of files.
    ("version of the application" as opposed to "technical internal version number used by the VCS", like revision for SVN, or SHA-1 for Git, or id for ClearCase, or...)
    They are supposed to serve as reference to be queried and deployed in another workspace (for testing or UAT - User Acceptance Tests -)

    Since SVN implements tags like branches: as directory, the incentive to modify files in a tag can be strong, but would defeat the purpose of a tag. Other VCS has the notion of label (or "baseline") which, once set, can not be moved anymore.

    To which George Mauer comments:

    Well thats kind of what I was saying. Tags should never be changed so its a very...odd to implement them as branches.

    "implements" ? But they did not "implemented" the notion of tag. SVN has no "tag" per se. They just reused their branches and said it could be also used as a tag.

    SVN RedBook clearly states:

    But wait a moment: isn't this tag creation procedure the same procedure we used to create a branch? Yes, in fact, it is.
    In Subversion, there's no difference between a tag and a branch. Both are just ordinary directories that are created by copying.
    Just as with branches, the only reason a copied directory is a “tag” is because humans have decided to treat it that way: as long as nobody ever commits to the directory, it forever remains a snapshot. If people start committing to it, it becomes a branch.

提交回复
热议问题