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

Git: only push released tag #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janmotin
Copy link

When using git and performing a release all tags will be pushed and not only the released tag. This produces an error that tags already exists. This pull request will change that behavior so only the released tag is pushed.

private def pushTags = cmd("push", "--tags", trackingRemote)
private def pushTags = {
val lastTag = (cmd("for-each-ref", "--count=1", "--sort=-taggerdate", "--format", "%(tag)", "refs/tags") !!).
linesIterator.next()
Copy link
Member

Choose a reason for hiding this comment

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

This feels a bit fragile - we know what the tag was because we tagged it, so we should use that. It will require a change to the signature of pushChanges, to take the tag (maybe an option of the tag), and it'll also require storing the tag in the state.

@janmotin
Copy link
Author

I also realized that the best would be change the signature as the tag is known. Some VCSs might not support getting the last added tag as in my change. It works but I agree with your comments.

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.

2 participants