Skip to content

Commit afe187e

Browse files
Updated usage files.
1 parent a220f01 commit afe187e

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ I wanted a highly portable tool with no dependency on tools outside of git. In s
88

99
### Why bash?
1010

11-
It's a shell that I use on Windows and of course linux. It's also supported on Mac OS. Many CI/CD tools are built on `docker`, and therefore, by default, Linux.
11+
It's a shell that I use on Windows and of course Linux. It's also supported on Mac OS. Many CI/CD tools are built on `docker`, and therefore, by default, Linux.
1212

1313
### Why not just use GitVersion?
1414

@@ -32,7 +32,7 @@ For more details on the individual commands type `git-ver help [command]`
3232

3333
`get-rev` : Counts the number of commits from the last tag and returns that as a revision number. (placed in info as _info_**#**)
3434

35-
`get-semver` : Retrieves a full semantic version, optionally with
35+
`get-semver` : Retrieves a full semantic version, optionally with metadata (+r1; +dYYYYMMDD-hhmmss)
3636

3737
`get-suffix` : gets the suffix for a pre-release semantic version. (e.g. -alpha1)
3838

src/git-ver-help

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ get-prefix : Returns the version with a prefix, prefix defaults to 'v'
1616
1717
get-rev : Counts the number of commits from the last tag and returns that as a revision number. (placed in info as .rev#)
1818
19-
get-semver : Retrieves a full semantic version, optionally with
19+
get-semver : Retrieves a full semantic version, optionally with metadata (+r1; +dYYYYMMDD-hhmmss)
2020
2121
get-suffix : gets the suffix for a pre-release semantic version. (e.g. -alpha.1)
2222

src/git-ver-help-get-semver

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -e
3+
echo "
4+
usage: git-ver get-semver [-r] [-d]
5+
get-semver : Retrieves a full semantic version, optionally with metadata (+r1; +dYYYYMMDD-hhmmss)
6+
7+
To establish a suffix, the following steps are taken.
8+
1. The candidate revision number is retrieved.
9+
2. If present, the suffix from the latest tag is used.
10+
3. If no tag suffix is extract, the branch name is used instead.
11+
4. The master branch gets no suffix. Only actual releases happen from it.
12+
5. A branch with a name starting with release gets the suffix of -rc
13+
6. A branch with a name starting with develop gets the suffix of -beta
14+
7. A branch with a name starting with feature gets the suffix of -alpha
15+
8. All other branches get a suffix of -pre
16+
17+
There are two additional optional metadata parameters.
18+
-r | --rev : This includes the results of git-ver get-rev as metadata after the main part of the suffix. For example: -rc+5
19+
-d | --date : This includes the build date and time in the following format: YYMMDD-HHmmss. For example: -alpha+20180606.211206
20+
21+
COMING SOON: -r and -d can be used with each other. When this is done -r is appended first, then -d. For example: -rc+5+20180806.011033
22+
"

src/git-ver-help-get-suffix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ To establish a suffix, the following steps are taken.
1414
7. A branch with a name starting with feature gets the suffix of -alpha
1515
8. All other branches get a suffix of -pre
1616
17-
There are two additional optional meta data parameters.
17+
There are two additional optional metadata parameters.
1818
-r | --rev : This includes the results of git-ver get-rev as metadata after the main part of the suffix. For example: -rc+5
19-
-d | --date : This includes the build date and time in the following format: YYMMDD.HHmmss. For example: -alpha+20180606.211206
19+
-d | --date : This includes the build date and time in the following format: YYMMDD-HHmmss. For example: -alpha+20180606.211206
2020
21-
-r and -d can be used with each other. When this is done -r is appended first, then -d. For example: -rc+5+20180806.011033
21+
COMING SOON: -r and -d can be used with each other. When this is done -r is appended first, then -d. For example: -rc+5+20180806.011033
2222
23-
NOTE: -r and -d are passed on tho this command when calling git-ver get-semver
23+
NOTE: -r and -d are passed on to this command when calling git-ver get-semver
2424
"

0 commit comments

Comments
 (0)