bumpversion icon indicating copy to clipboard operation
bumpversion copied to clipboard

Not able to use bumpversion. Error in git commit and tag

Open CuriousLearner opened this issue 6 years ago • 12 comments

Hi,

I'm using Mac OS Sierra 10.12.5 and git version is: 2.9.2.

I'm using gpgsign to sign my commits. With the gpgsign turned on, It gives me error:

» bumpversion minor                                                                                                                                                     
Traceback (most recent call last):
  File "/usr/local/bin/bumpversion", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/bumpversion/__init__.py", line 994, in main
    vcs.commit(message=commit_message)
  File "/usr/local/lib/python2.7/site-packages/bumpversion/__init__.py", line 73, in commit
    list(os.environ.items()) + [(b'HGENCODING', b'utf-8')]
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'git', u'commit', u'-F', '/var/folders/16/zkkbtd3n1td1fb0z6lxhk2pw0000gn/T/tmpoxDKyt']' returned non-zero exit status 1

With --no-commit option, I still get an error while tagging.

» bumpversion minor --no-commit                                                                                                                
fatal: Failed to resolve 'HEAD' as a valid ref.
Traceback (most recent call last):
  File "/usr/local/bin/bumpversion", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/bumpversion/__init__.py", line 1004, in main
    vcs.tag(tag_name)
  File "/usr/local/lib/python2.7/site-packages/bumpversion/__init__.py", line 150, in tag
    subprocess.check_output(["git", "tag", name])
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'git', u'tag', u'v0.9.0']' returned non-zero exit status 128

Am I missing something here?

CuriousLearner avatar Jul 07 '17 11:07 CuriousLearner

@CuriousLearner what do you get with --no-tag --no-commit option. Also, can you attach you bumpversion config, it should be available either in .bumpversion or setup.cfg

theskumar avatar Jul 07 '17 12:07 theskumar

@theskumar it works with --no-tag --no-commit option.

The bumpversion config in setup.cfg is as follows:

[bumpversion]
current_version = 0.12.0
commit = True
tag = True

[bumpversion:file:hello_world/__init__.py]

[bumpversion:file:hello_world/templates/rest_framework/api.html]

[bumpversion:file:docs/index.md]

[bumpversion:file:README.md]

[bumpversion:part:release]
optional_value = placeholder
values =
	dev
	placeholder

CuriousLearner avatar Jul 07 '17 12:07 CuriousLearner

subprocess.CalledProcessError: Command '[u'git', u'tag', u'v0.8.7']' returned non-zero exit status 128 could mean that the tag already exists.

danmichaelo avatar Jul 31 '17 12:07 danmichaelo

@danmichaelo I'm pretty sure the tag does not exist already since this is a brand new repo.

CuriousLearner avatar Jul 31 '17 12:07 CuriousLearner

Does it work if you just run git tag v0.8.7 in the repo?

danmichaelo avatar Jul 31 '17 12:07 danmichaelo

bumpversion: v0.5.3 (using Python v2.7.5) --commit and --tag unable to use!

Traceback (most recent call last): File "/usr/bin/bumpversion", line 11, in sys.exit(main()) File "/usr/lib/python2.7/site-packages/bumpversion/init.py", line 994, in main vcs.commit(message=commit_message) File "/usr/lib/python2.7/site-packages/bumpversion/init.py", line 73, in commit list(os.environ.items()) + [(b'HGENCODING', b'utf-8')] File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '[u'git', u'commit', u'-F', '/tmp/tmpbSDEWh']' returned non-zero exit status 1

axiaoxin avatar Nov 15 '18 04:11 axiaoxin

bumpversion: v0.5.3 (using Python v2.7.5) --commit and --tag unable to use!

Traceback (most recent call last): File "/usr/bin/bumpversion", line 11, in sys.exit(main()) File "/usr/lib/python2.7/site-packages/bumpversion/init.py", line 994, in main vcs.commit(message=commit_message) File "/usr/lib/python2.7/site-packages/bumpversion/init.py", line 73, in commit list(os.environ.items()) + [(b'HGENCODING', b'utf-8')] File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '[u'git', u'commit', u'-F', '/tmp/tmpbSDEWh']' returned non-zero exit status 1

I'm facing the same issue.

My bumpversion.cfg file looks like this.

[bumpversion] current_version = 0.3.0 commit = True tag = True

[bumpversion:file:VERSION]

If commit=False, it works awesome. Looking for solution with commit=True

g1tvinod avatar Jan 01 '19 15:01 g1tvinod

any idea what's going on ? same issue here

cscetbon avatar May 03 '19 17:05 cscetbon

I'm facing the same issue.

My bumpversion.cfg file looks like this.

[bumpversion] current_version = 0.3.0 commit = True tag = True

[bumpversion:file:VERSION]

If commit=False, it works awesome. Looking for solution with commit=True

Had the same problem. Ensure that your VERSION and .bumpversion.cfg files are tracked. If don't, call git add VERSION .bumpversion.cfg.

If it doesn't help, try to manually call printed command from the error message:

subprocess.CalledProcessError: Command '[u'git', u'commit', u'-F', '/tmp/tmpbSDEWh']' returned non-zero exit status 1

git commit -F /tmp/tmpbSDEWh

to find out why git cannot make the commit.

baffolobill avatar Aug 25 '19 13:08 baffolobill

This is probably caused by the tag already existing locally, so Git throws this message when it attempts to re-create.

To clean your local tags up, see: https://stackoverflow.com/questions/1841341/remove-local-git-tags-that-are-no-longer-on-the-remote-repository

rukmal avatar Dec 03 '20 06:12 rukmal

Manually setting git's signing key worked for me. I'm not sure if I had set it manually in the past and it was still trying to use an old key but posting that here in case it helps someone else.

git config --global user.signingkey {gpg key id}

They key id should be the 8-character key as described here: https://www.eugenemdavis.net/finding-your-gnupg-key-id.html

fselmo avatar Jul 12 '21 18:07 fselmo

This may be a bug in bump2version. Use the following in the configuration file and it should resolve the problem:

no_sign_tags = True

shahabilb avatar Feb 16 '22 22:02 shahabilb