In the article CVS acceptable date formats, I showed how flexible to retrive CVS revision files by date. However, more often what you really want to do is retrive the project as it was at the time of a specific event, perhaps a public release, a known stable point in the software's development, etc..

Trying to remember the date when that event took place would be a tedious process. Presumably, the event, because it was important, was marked as such in the formal revision history. The method CVS offers for making such marks is known as tagging.


Different from commits

Tags differ from commits in that they don't record any particular textual change to files, but rather a change in the developer's attitude about the files. A tag gives a label to the collection of revisions represented by one developer's working copy.

Not like commits, each time it commits, the revision number will increase, the tag is fixed, it sticks with each files revision numbers when it was marked. Just like a snapshot of the working directory.

Mark a Tag

In a working directory

$cvs -q tag release release-version1-2015-05-17
T projectABC/main.c

Note: It makes a label in repository, but not in working directory

Retrive a tag release

$cvs checkout -r release-version1-2015-05-17

Use tag with diff

If you want to compare a file's current state against its state at the time of the last release where the tag was made, use diff with tag release.

cvs diff -c -r release-version1-2015-05-17

Use tag with update

Similarily, if you want to revert it temporarily to that revision, you can do this:

cvs update -r release-version1-2015-05-17 main.c

Valid Tag names

No periods or spaces in the tag names, it must start with a letter and contain letters, digits,hyphens("-"), and underscores("_"). No spaces,periods,colons,commas,or any other symbols.


Comments powered by CComment