-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
52 lines (40 loc) · 1.09 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
This script attempts to generate a useful version number
in a git or mercurial repository using tags, revisions and
dirtiness. For example, consider a simple untagged repo:
$ mkdir foo
$ cd foo
$ git init
$ touch README
$ git add README
$ git commit -m "first commit"
$ tagver
0.0.ffbcc93
If there aren't any tags in a repo, tagver prepends 0.0 to
the changeset number. Now let's tag a revision for release
and try again:
$ git tag v1.0
$ tagver
1.0
If there's a "v" on the front of the tag, tagver assumes
it's extraneous. Now add an untagged revision:
$ echo >> README
$ git commit -am "second commit"
$ tagver
1.0.1.gad8eb1e
and another:
$ echo >> README
$ git commit -am "third commit"
$ tagver
1.0.2.g621c4f3
You get the idea. What happens if we have uncommitted
changes lying around?
$ echo >> README
$ tagver
1.0.2.g621c4f3+
Note the trailing + indicating a dirty working directory.
And now let's make a new release:
$ git commit -am "fourth commit"
$ git tag v1.1
$ tagver
1.1
vim: tw=60