6
As projects grow larger and more complicated, it is often useful
7
to be able to give a symbolic name to particular revisions within an
11
For example, let's suppose that the @code{hello-world} project has many
33
It may be that, as development proceeds, occasional "snapshot"
34
releases are made from the @code{mainline}. Not every revision becomes a
35
snapshot, but some do.
38
It would be convenient to provide a label of which revisions became
62
The @code{tag} command, introduced earlier, can be used for this purpose
63
(see @strong{Making a Branch from a Remote Project in a Local Archive} in @ref{Elementary Branches -- Maintaining Private Changes}).
66
When we first encountered @code{tag}, it was used just to create the
67
@code{base-0} revision of an elementary branch. It can also be used to
68
create a branch @emph{all} of whose revisions are tags.
71
Let's suppose that we'll be creating a branch called
72
@code{hello-world--snapshots--0.1}. Diagramatically, we'll have:
81
base-0 --------> base-0 (tag)
82
patch-1 -------------' ------> patch-1 (tag)
85
patch-12 ------------'
94
To create the @code{snapshot} tag for @code{patch-23}:
101
% tla tag hello-world--mainline--0.1--patch-23 \
102
hello-world--snapshots--0.1
110
after which we'll have:
119
base-0 --------> base-0 (tag)
120
patch-1 -------------' ------> patch-1 (tag)
121
patch-2 ' -----> patch-2 (tag)
123
patch-12 ------------' '
125
patch-23 ------------'
132
In effect, the @code{snapshots} branch is a kind of "symbolic name" with
133
history. We can get the latest revision named by that symbol with:
137
% tla get hello-world--snapshots--0.1
144
and earlier revisions by naming specific revisions, e.g.:
148
% tla get hello-world--snapshots--0.1--patch-1
154
@strong{Usage Caution:} As a rule of thumb, your branches should be either
155
@code{commit} based branches (all revisions after @code{base-0} are created by
156
@code{commit}) or tag-based branches (all revisions are created by @code{tag}).
157
Commands such as @code{replay}, @code{update}, and @code{star-merge} are based on the
158
presumption that you stick to that rule. While it can be tempting, in
159
obscure circumstances, to mix @code{commit} and @code{tag} on a single branch --
160
it isn't generally recommended.