aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: ead96459cfc5254a00eaf0606332e570cf8cfd51 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# go-bumpver

_Inspired by the python bump2version tool._

bumpver - next semantec version in a given sequence

## Usage

```
bumpver part [major|minor|patch] file [-|file] [flags]
```

## Why?

- Most version bumpers are fairly tightly coupled to git.
- Most like to make commits for you
- Few seem to have useful pre release mechanisms
- None seem to provide simple interfaces
- Lack of unix philosophy

Many tools touch git and some opinionatedly like to touch it.

## How?

`go-bumpver` takes the sequence of version(s) from a file or stdin and prints the next version. It ignores invalid versions in the sequence and only uses valid ones.

### Inputs

*stdin*
```
❯ echo "1.1.1\n1.2.1" | bumpver patch -
1.2.2%
```

*file*
```
❯ echo v0.1.0 > VERSION
❯ bumpver patch VERSION
0.1.1%
```

*local repo*
```
❯ bumpver patch <(git tag -l)
3.3.2%
```

*remote repo*
```
❯ bumpver patch <(git ls-remote --tags --refs origin v\* | awk -F'[ /]' '{ print $NF }')
3.3.4%
```

### Bumps

*a patch*
```
❯ bumpver patch <(git tag -l)
3.3.2%
```

*a minor*
```
❯ bumpver minor <(git tag -l)
3.4.0%
```

*a major*
```
❯ bumpver major <(git tag -l)
4.0.0%
```