Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cvs tag vs. rtag

695 views
Skip to first unread message

Laird Nelson

unread,
Mar 13, 2000, 3:00:00 AM3/13/00
to info...@gnu.org
Can someone give me a pointer on when to use cvs tag vs. when to use cvs
rtag? I know, for example, that cvs tag doesn't show up in the history
file, and that cvs rtag requires you? I think? to feed it the revision
number of whatever you're tagging, thus preventing you from saying "cvs
rtag the tree the way it is now". What common situations is each
command used in?

Cheers,
Laird


Noel L Yap

unread,
Mar 13, 2000, 3:00:00 AM3/13/00
to ljne...@unix.amherst.edu
I rarely (if ever) use rtag. The reason is that "cvs rtag module" will tag the
Latest and Greatest (LAG) by default. Since, one is never really sure exactly
what is in the LAG, one will never really be sure exactly what's being tagged
(hey, I'm a poet and I don't even know it ;) unless, as you said, you specify
exactly what to rtag (but this is rarely useful).

Noel


ljne...@unix.amherst.edu on 03/13/2000 09:00:53 AM

Please respond to ljne...@unix.amherst.edu

To: info...@gnu.org
cc: (bcc: Noel L Yap)
Subject: cvs tag vs. rtag

Stephen Rasku

unread,
Mar 13, 2000, 3:00:00 AM3/13/00
to info...@gnu.org, ljne...@unix.amherst.edu
Laird Nelson wrote:
>
>Can someone give me a pointer on when to use cvs tag vs. when to use
cvs
>rtag? I know, for example, that cvs tag doesn't show up in the
history
>file, and that cvs rtag requires you? I think? to feed it the
revision
>number of whatever you're tagging, thus preventing you from saying
"cvs
>rtag the tree the way it is now". What common situations is each
>command used in?
>

The main difference is that you can tag the tree without having a
working copy for rtag. If you don't specify an existing revision, it
tags the head by default. "cvs tag", on the other hand, will tag the
current version of what is in your working copy. You could have
different files on different branches and they will all get the same
tag name.

--
Stephen Rasku E-mail: ste...@tgivan.com
Senior Software Engineer Phone: (604) 872-6676
TGI Technologies Web: http://www.tgivan.com/

Cameron, Steve

unread,
Mar 13, 2000, 3:00:00 AM3/13/00
to info...@gnu.org
Laird Nelson wrote:

> Can someone give me a pointer on when to use cvs tag vs. when to use cvs
> rtag? I know, for example, that cvs tag doesn't show up in the history
> file, and that cvs rtag requires you? I think? to feed it the revision
> number of whatever you're tagging, thus preventing you from saying "cvs
> rtag the tree the way it is now". What common situations is each
> command used in?
>

[smc] One big difference between "cvs tag" and "cvs rtag" is that
"cvs tag" requires you to do a "cvs checkout" first, while "cvs
rtag"
does not (which is why it requires you to feed it the revision
number
(or another tag.)

I use "cvs rtag" to tag builds prior to checking them out, because I

have to check them out on multiple architectures...

As for not being able to say "cvs rtag the tree the way it is
now"...

Well if, by "the tree", you mean your working directory, yes this
is true.

If you mean by "the tree" the current state of a branch...

cvs rtag -r branch_tag my_new_tag everythign

Or for the trunk...

cvs rtag -r HEAD my_new_tag everything

hmm. "HEAD" scares me a bit, I'm not sure how well it really works.
I don't use the trunk much, so I don't use the HEAD pseudo-tag much.

I do know that "cvs diff" treats HEAD differently than everything
else...

Hope it helps.

-- steve

Michael Gersten

unread,
Mar 13, 2000, 3:00:00 AM3/13/00
to ljne...@unix.amherst.edu

'rtag' is used to create a tab in the repository that is equal to another
tag in the repository. It is (afaict (as far as I can tell)) only used to
create a branch tag equal to another tag.

E.G.:

cvs tag base-name # create a base for branch
cvs rtag -r base-name -b name module # create branch

Note that rtag essentially requires both the module name, AND the old
version. So, it might be of more use for something like

cvs rtag -r rel-1.0 -b rel-1.0-patch1 releasedModule
cvs get -r rel-1.0-patch1 releasedModule

as that uses an existing tag (rel-1.0), and creates a new branch, then
checks that branch out.

Laird Nelson wrote:
>
> Can someone give me a pointer on when to use cvs tag vs. when to use cvs
> rtag? I know, for example, that cvs tag doesn't show up in the history
> file, and that cvs rtag requires you? I think? to feed it the revision
> number of whatever you're tagging, thus preventing you from saying "cvs
> rtag the tree the way it is now". What common situations is each
> command used in?
>

> Cheers,
> Laird


al...@orincon.com

unread,
Mar 14, 2000, 3:00:00 AM3/14/00
to info...@gnu.org

I frequently use cvs rtag to tag the head (newest) revision on the trunk, so I
can capture the state of the repository code before making a major change. It
looks like:

% cvs rtag codeBeforeChange moduleName
% <make major change and commit>
% cvs rtag codeAfterChange moduleName

If you mess it up (of course, I never have that problem personally...), you can
easily refer to either the new or previous revisions in a convenient manner.
This also documents you change for others in the future, as not all mistakes are
immediately apparent. For example:

% <2 weeks passes>
% <problem arises>
% cvs diff -r codeBeforeChange -r codeAfterChange moduleName # identify
error

Of course, you must document the 2 tags "codeBeforeChange" and "codeAfterChange"
and what they represent so that you can use the tags a few weeks or years later.

Alan Thompson

al...@orincon.com

unread,
Mar 14, 2000, 3:00:00 AM3/14/00
to info...@gnu.org


I generally prefer rtag to tag since:

1. You don't need a checked-out working copy of the repository. This is often
handy.

2. With tag, the new tag is placed on the revisions your working copy of each
file was based on. If some of your files have not been committed, you might not
be tagging what you think. Also, if you haven't checked out a complete copy of
the module (of if some files have been deleted, etc), tag will not apply to all
files in the repository. Since rtag applies to every file in the module, you
don't have to worry about what state your checked-out working copy is in.

3. Other people may commit changes to the repository of which you are unaware.
With rtag, your tag applies to all files in the repository, capturing their
state at the time the command is issued. If your local working copy of the
repository is out-of-date do to another's changes, you may not be tagging what
you think you are tagging.

Of course, there are situations where cvs tag is precisely what you do want to
do; i.e. when you want to capture the state of your local copy of the sources.
When you want to capture the state of the repository, cvs rtag is the best way
to go.

For what we do, we use cvs rtag >= 90% of the time; cvs tag less than 10%. Your
situation may vary, of course. You might consider looking at your operations,
and see if some of them might be more foolproof using cvs rtag rather than cvs
tag.

Good luck!

Alan Thompson


To: Alan Thompson/Orincon@Orincon
cc:
Subject: Re: cvs tag vs. rtag

How does this (doing an rtag just before committing a change) differ from doing
a
regular tag just before a change?

How does


> % cvs rtag codeBeforeChange moduleName
> % <make major change and commit>
> % cvs rtag codeAfterChange moduleName

differ from

(in directory for module)

cvs tag codeBeforeChange


<make major change and commit>

cvs tag codeAfterChange

Michael

0 new messages