Add --always parameter to git describe

This commit is contained in:
Benjamin Renard 2022-03-17 18:56:36 +01:00
parent 7987b25f66
commit 4d36fa0c0e
2 changed files with 4 additions and 4 deletions

View file

@ -3,7 +3,7 @@
Simple python script using GitPython library to generate debian Simple python script using GitPython library to generate debian
changelog file from git commit history. Each existing tags is changelog file from git commit history. Each existing tags is
considered as a release version and current working version is considered as a release version and current working version is
numbered using ''git describe --tags'' command. numbered using ''git describe --always --tags'' command.
# Installation # Installation
@ -51,7 +51,7 @@ optional arguments:
-n PACKAGE_NAME, --package-name PACKAGE_NAME -n PACKAGE_NAME, --package-name PACKAGE_NAME
Package name Package name
-V VERSION, --version VERSION -V VERSION, --version VERSION
Currrent version (default: autodetected using git describe --tags) Currrent version (default: autodetected using git describe --always --tags)
--version-suffix VERSION_SUFFIX --version-suffix VERSION_SUFFIX
Suffix for autodetected version Suffix for autodetected version
-c CODE_NAME, --code-name CODE_NAME -c CODE_NAME, --code-name CODE_NAME

4
gitdch
View file

@ -79,7 +79,7 @@ parser.add_argument(
'--version', '--version',
type=str, type=str,
dest='version', dest='version',
help='Currrent version (default: autodetected using git describe --tags)' help='Currrent version (default: autodetected using git describe --always --tags)'
) )
parser.add_argument( parser.add_argument(
@ -176,7 +176,7 @@ def add_version():
tag = None tag = None
version_commit = None version_commit = None
version = options.version or clean_deb_version(repo.git.describe('--tags')) version = options.version or clean_deb_version(repo.git.describe('--always', '--tags'))
messages = [] messages = []
for commit in repo.iter_commits(): for commit in repo.iter_commits():
if version_commit is None: if version_commit is None: