Skip to content

Conversation

@dominicbarnes
Copy link
Contributor

@dominicbarnes dominicbarnes commented Jan 23, 2018

If you are buliding on CircleCI for example, pushing the commits first can lead to a race where CI env will not see the tags since the pull happened before the tags were finished pushing.

It should be fully safe (and backwards-compatible) to change the order of pushing to the remote. This should make integrating with CI tools less of a race.

If you are buliding on CircleCI for example, pushing the commits first
can lead to a race where CI env will not see the tags since the pull
happened before the tags were finished pushing.

It should be fully safe (and backwards-compatible) to change the order
of pushing to the remote.
git tag $version -a -m "$msg" \
&& git push $remote \
&& git push $remote --tags \
&& git push $remote \
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMHO, we could omit this line because git push $remote --tags already pushes the commit to remote branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know if that's the case, I'll run a quick test.

Copy link
Contributor Author

@dominicbarnes dominicbarnes Jan 24, 2018

Choose a reason for hiding this comment

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

I just did a test. The tag will be pushed, and you can find the commit if you reference it by SHA. However, the commit will not be pushed to the branch, so we still need both commands.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dominicbarnes
My mistake. Push commit in this way doesn't push it to proper branch.

@spacewander spacewander merged commit db2d045 into tj:master Jan 25, 2018
@spacewander
Copy link
Collaborator

Merged. Thank you!

@dominicbarnes dominicbarnes deleted the release-push-tags-first branch January 25, 2018 18:48
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