info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stickiness


From: Kaz Kylheku
Subject: Re: Stickiness
Date: Thu, 13 Sep 2001 18:06:30 GMT
User-agent: slrn/0.9.6.3 (Linux)

In article <address@hidden>, Cornellious Mann wrote:
>Does someone have a good definition of what
>"stickiness" is in relation to CVS?  Thanks.

Think of command line parameters as being local variables in a function
call. When you type

        ls -l

in your UNIX shell, it carries out your request to show the directory
listing in a certain way. And then that -l parameter is forgotten.

Sometimes you want such a parameter to be global, so that ls just
``knows'' that you want the -l without having to pass it every time. In
some shells, you can make an alias for the ls command, so that when you
type ls, it expands to ``ls -l''. So in effect, you are making the -l
parameter ``stick'' to the ls command, and this is where the terminology
``stickiness'' comes from.

In CVS, a similar, but somewhat more sophisticated effect is achieved
by stickiness. Some information is associated with the working copy of
a file, and that information is then added to some CVS commands which
operate on that file.

For example, if you are working on a branch, then whenever you commit,
you want your changes to be commited to the branch. Now how do you do that?
You could specify, in every invocation of ``cvs commit'', that you want
the changes to go to a certain branch, whose name you provide.
But that would be tedious, and severely error-prone.

So the solution is to make it a sticky property of the files that they
are ``on'' a branch. This is done by giving them a ``sticky tag'',
which happens to be a branch tag. When you do a cvs commit, then that
tag is automatically added to the command line, and the end result is
that the commit goes to a branch, just as if you typed -r <branch_tag>
on the command line. Or when you cvs update, again that tag is added to
the command line, so that you get the latest copies from that branch,
rather then the main trunk. 

So that is what stickiness is: recording some context information in
the meta-data of the working copy, which then modifies the semantics of
various CVS operations, on a per-file basis, so that they behave in a
sensible way.

Stickiness happens automatically in situations where it makes sense.
When you ``cvs update'' some files to a tag, for instance, that tag
sticks to all the working copies. This way, if the tag is not a branch
tag, commits will be prevented, and if it is a branch tag, commits will
go to the branch, as I described earlier.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]