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
Use --atomic
when running git push
in lerna version
#2392
Comments
Yep, sounds reasonable to me. |
Sorry for the troubles caused by the PR #2393 , and thanks for the fixes @evocateur . But, the latest fix 6f0e2bb#diff-4a3a3aa992c599b130c66225bed2e8f4R16 seems to reintroduced the original issue here . It will try a non-atomic pushing after a failed atomic pushing (which is not caused by older git but by rejected by updated origin). I can give a detailed log later. |
@weareoutman Do you know if there is a specific non-zero exit code that can distinguish this atomic rejection from unsupported atomic? |
@evocateur I can't find official docs about exit code list of git. But i tried on my Mac. When meet atomic rejection, exit code is
When meet unsupported options, exit code is
However, I can't ensure other versions of git on other platforms work as the same. Maybe we can try like this: if (/atomic/.test(error.stderr) && !/atomic push failed/.test(error.stderr)) {
// Now we say the git client does not support `--atomic`.
} |
same issue in asure devops |
Same on AWS code suite |
I fixed it using
|
Currently,
lerna version
will push repository bygit push --follow-tags
, which defaults to non-atomic, that could cause problems in certain situations.E.g., when somebody else pushed new commits to origin/master during one running
lerna version
.Expected Behavior
Do an atomic pushing when running
lerna version
.Current Behavior
Tags are pushed, but master is rejected. These orphan tags need to be manually deleted, to avoid conflicts in future.
Possible Solution
Use
git push --follow-tags --atomic
(which is supported since git v2.4.0).Steps to Reproduce (for bugs)
lerna version
.yes
in the prompt oflerna version
.lerna.json
Context
Your Environment
lerna --version
npm --version
yarn --version
node --version
The text was updated successfully, but these errors were encountered: