mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2026-02-02 15:45:11 +01:00
Optional GITHASH directive for version_pattern
Optionally add GIT hash to your version number.
This commit is contained in:
parent
e96904438b
commit
da44922261
5 changed files with 34 additions and 0 deletions
24
README.md
24
README.md
|
|
@ -412,6 +412,30 @@ INFO - New Version: v2020.1060
|
|||
+__version__ = "v2020.1060"
|
||||
```
|
||||
|
||||
#### Add git hash to version string
|
||||
|
||||
In case you want to build a package straight from your git repository, without making a release first,
|
||||
you can explictly add git hash to the version number using ``GITHASH`` version part in ``setup.cfg``.
|
||||
|
||||
Let's say your ``setup.cfg`` looks like this:
|
||||
|
||||
```ini
|
||||
[bumpver]
|
||||
...
|
||||
version_pattern = "YYYY.BUILD[-TAG][GITHASH]"
|
||||
...
|
||||
```
|
||||
|
||||
Then, to update all configured files, you need to execute this command:
|
||||
|
||||
```shell
|
||||
$ bumpver update --no-commit --no-tag --set-version="v202202.1085.8+ged2c3aaf"
|
||||
```
|
||||
|
||||
This will modify your source tree, but won't commit or tag aything, so you can build your
|
||||
packages with that version number. Then, remember to reset local changes after (by
|
||||
typing ``git reset --hard``) as standard bumpver behaviour with such version number
|
||||
makes not much sense.
|
||||
|
||||
|
||||
### Searching for Patterns with `grep`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue