Error "fatal: unknown refname: format lstrip=2" raised when running "cz bump" #1032
Labels
good first issue
issue-status: wait-for-implementation
maintainers agree on the bug / feature
type: bug
Description
When running
cz bump
, I'm getting the following output:> cz bump --yes --retry bump: version 0.1.0 → 0.2.0 tag to create: v0.2.0 increment detected: MINOR fatal: unknown refname: format lstrip=2
I've been investigating about and it looks like the problem is when commitizen try to fetch the git tags from the repository, specifically in the command statement executed at the file commitizen/git.py:180.
Basically, the translated command is:
git tag --format="%(refname:lstrip=2)---inner_delimiter---%(objectname)---inner_delimiter---%(committerdate:format:%Y-%m-%d)" --sort=-committerdate
The problem goes away if I use
strip
instead oflstrip
. Interesting enough,strip
can be used as a synonym tolstrip
, according to Git's official documentation.Steps to reproduce
cz bump --yes --retry
Current behavior
The problem occurs when trying to run the command
git tag --format="%(refname:lstrip=2)---inner_delimiter---%(objectname)---inner_delimiter---%(committerdate:format:%Y-%m-%d)" --sort=-committerdate
because of thelstrip
option, which is not recognizedDesired behavior
Getting the list of git tags and finishing the execution normally
Screenshots
No response
Environment
cz version
: 3.20.0python --version
: 3.9.7python3 -c "import platform;print(platform.system())"
: Linuxgit --version
: 2.7.4bash cz version --report
:The text was updated successfully, but these errors were encountered: