Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating annotated tags #58

Closed
wants to merge 1 commit into from
Closed

Conversation

ekohl
Copy link

@ekohl ekohl commented Oct 9, 2014

When creating annotated tags (by passing a message into them), you can use "git describe".

@@ -181,7 +184,8 @@ def add_path(cls, path):
pass

@classmethod
def tag(cls, name):
def tag(cls, name, message):
# TODO: use message?
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appears mercurial has no concept of annotated tags, so maybe throw an error if one is passed instead of silently ignoring it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but it looks like you can still add a message to a tag?

hg tag v1.0.0 -m "Finally v1.0.0"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@ekohl
Copy link
Author

ekohl commented Oct 21, 2014

@peritus ping

describe_out = subprocess.call([vcs, "describe"])
assert 128 == describe_out

main(['patch', '--current-version', '42.3.2', '--commit', '--tag', 'VERSION', '--tag-message', 'test {new_version}-tag'])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a second test, please split.

@peritus
Copy link
Owner

peritus commented Oct 22, 2014

Needs docs, needs a test using a configuration file.

@ekohl
Copy link
Author

ekohl commented Oct 22, 2014

The docs would go in README?

@peritus
Copy link
Owner

peritus commented Oct 22, 2014

Sorry, yes, "docs". README it is ;)

@ekohl
Copy link
Author

ekohl commented Jan 2, 2015

I reworked the tests so they also cover mercurial where appropriate. If you think it's alright then I'll update README as well.

@ekohl
Copy link
Author

ekohl commented Jan 2, 2015

Btw, since I discovered that git describe --tags does what I want, my need for this has decreased. However, I do want to finish this.

@jgilchrist
Copy link

What's left to do on this before it can be merged?

@ekohl
Copy link
Author

ekohl commented Sep 15, 2015

I think a rebase, a review and docs in README.

@ekohl
Copy link
Author

ekohl commented Sep 15, 2015

Rebased

@cmeeren cmeeren mentioned this pull request Oct 8, 2015
def tag(cls, name, message):
command = ["git", "tag", name]
if message:
command += ['-m', message]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be using --message, because it's clearer.

@peritus
Copy link
Owner

peritus commented Nov 9, 2015

I really like the straightforwardness (is that even a word?) of this pull request, it just does the one thing it says on the box.

However, I'd really like "annotated commits" to be the default, that is, bumpversion should make annotated commits without users configuring that specifically because they know about annotated commits and they know that they're important.

That being said, tag_message = should have a nice default, similar to how message = (which would then be commit_message =, to avoid confusion) has a nice, recognizable default (compare

default=defaults.get('message', 'Bump version: {current_version} → {new_version}'))
)

@peritus
Copy link
Owner

peritus commented Nov 9, 2015

Also, what's common practice regarding information to include in annotated tags ? If there are any pointers to blog posts etc. describing what people put in them when releasing, now's the time.

@gst
Copy link

gst commented Nov 19, 2015

@peritus I agree with you for the use of annotated tags by default.
For what they should include as information I would point you to this SO answer : http://stackoverflow.com/a/4971817/2451329

basically what they contains for the annotation itself, by default, is not that important, what's important is that with annotated tag you know who has submitted it and when it was done.
So I'd suggest simply put the same value as the tag value itself..

By the way : I'm waiting for this PR quite actively, I've a project where I work and we switched to gerrit code review and it requires annotated tags.. So for now I'm a bit stuck with current bumpversion ..

thanks.

@cmeeren
Copy link

cmeeren commented Nov 19, 2015

@gst as a workaround you can tag manually (you can configure bumpversion not to tag the commits)

@ekohl
Copy link
Author

ekohl commented Nov 20, 2015

I will have a look at rebasing + addressing the comments this weekend.

@gst
Copy link

gst commented Nov 24, 2015

@cmeeren thx for the tip, effectively, integrated in my .bumpversion.cfg :)

When creating annotated tags (by passing a message into them), you can
use "git describe".

This is based on work by @gvangool.
@ekohl
Copy link
Author

ekohl commented Nov 25, 2015

@gst Thanks for the reminder :)

Updated. It now has a default tag message (can be disabled by passing an empty string) and passes --message to git/hg instead of -m.

@kynan
Copy link

kynan commented Feb 15, 2016

@peritus Can this please be merged? I was about to implement this feature myself, glad I checked first :)

If the sticking point is docs I'll be happy to pr those once this is in.

@kynan kynan mentioned this pull request Feb 15, 2016
@kynan
Copy link

kynan commented Feb 15, 2016

Relates to #74

kynan added a commit to kynan/nbstripout that referenced this pull request Feb 15, 2016
NOTE: due to missing support for annotated tags in bumpversion, this
requires https://github.com/ekohl/bumpversion@annotated-tags:

  pip install git+https://github.com/ekohl/bumpversion@annotated-tags

See also peritus/bumpversion#58
@schechter
Copy link

Can this feature be added please. We running into issues because bumpversion is not making annotated tags.

@MarcMeszaros
Copy link

Any timeline on when this is being merged in? It would also help us.

@dbrgn
Copy link
Contributor

dbrgn commented Apr 12, 2016

Any news on this, now that Github actually shows signatures?

@nehalecky
Copy link

We really enjoy using bumpversion, but really need to have this feature added. When can we expect it?

@schechter
Copy link

@peritus Is there anything additional you want in this PR? I'm sure someone would do it if you let us know what you think it missing.

@anthrotype
Copy link

+1

@anthrotype
Copy link

Apologies for my insistence. I know there are more important things in life than annotated git tags.
However, this little change would make a lot of difference for my workflow.
I just noticed the last commit to master was more than a year ago. May I ask if this package is still maintained? I see it's being used by major projects, like setuptools for example...
Anyway, thanks for this great tool!

anthrotype pushed a commit to fonttools/fonttools that referenced this pull request Oct 12, 2016
I had to remove the comments because bumpversion will strip them out anyway upon re-writing the updated version string in setup.cfg file.
Similarly, I had to normalize the whitespace like bumpversion would do. :-/

`tag=True` option means a tag is automatically created when bumping the version with bumpversion script.
However, in order to get 'annotated' instead of 'lightweight' tags -- i.e. the tag also contains the tag author, date and message --, we need to (temporarily?) use a fork of bumpversion that includes an unmerged PR: peritus/bumpversion#58
@jobevers
Copy link

+1 on annotated tags

@jaraco
Copy link
Contributor

jaraco commented Dec 3, 2016

I'd like to see this feature as I use bumpversion for tagging setuptools releases, and without annotated tags, I have to remember to dual push (git push and git push --tags), whereas with annotated tags, I can rely on the followTags option to ensure that my tags are pushed.

@JamshedVesuna
Copy link

+1

@c4urself
Copy link

I was hoping that this would've been merged by now, unfortunately, it doesn't look like this repo is being actively maintained. In the interim, I've forked the project and named it bump2version (to reduce conflicts and allow a push to pypi). This version allows annotated tags support. I'm happy to change the README to point back to this repo if development resumes!

@anthrotype
Copy link

maybe we should consider proposing bumpversion to https://jazzband.co/

@ekohl
Copy link
Author

ekohl commented Mar 28, 2017

For the lazy people like me a clickable link: https://github.com/c4urself/bump2version

@c4urself I considered forking myself but didn't want to commit myself to it and couldn't come up with a name. I like bump2version.

@anthrotype It may be a good but that still requires @peritus to transfer the repository.

@ulope
Copy link

ulope commented Mar 28, 2017

@c4urself Awesome. Thanks for taking this on. Could you enable Issues in your fork?

@c4urself
Copy link

@ulope -- done
@ekohl -- want to join as a contributor?
@anthrotype -- i like that idea as well but contacted @peritus who suggested that a fork was the way to go for now

@ekohl
Copy link
Author

ekohl commented Mar 28, 2017

@c4urself Done.

It would be nice if @peritus would officially endorse the fork, for example by making a note in the README both on github and pypi.

anthrotype pushed a commit to googlefonts/ufo2ft that referenced this pull request Apr 14, 2017
The original bumpversion is no longer maintained, this is the new blessed fork

peritus/bumpversion#58 (comment)
https://github.com/c4urself/bump2version
https://pypi.python.org/pypi/bump2version/0.5.5

Annotated tags, e.g. `git tag -am "blah blah"`, can have a message, record
the date and the name of the tagger, and work with git `describe`.
@ekohl ekohl mentioned this pull request Sep 5, 2017
@ekohl
Copy link
Author

ekohl commented Oct 11, 2018

Closing because bump2version has been available for quite a while.

@ekohl ekohl closed this Oct 11, 2018
@ekohl ekohl deleted the annotated-tags branch October 11, 2018 13:31
ooiM added a commit to ooiM/nbstripout that referenced this pull request Jun 2, 2020
NOTE: due to missing support for annotated tags in bumpversion, this
requires https://github.com/ekohl/bumpversion@annotated-tags:

  pip install git+https://github.com/ekohl/bumpversion@annotated-tags

See also peritus/bumpversion#58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.