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

fatal: bad revision 'v1.10.10..HEAD' #132

Closed
LuckeeDev opened this issue Mar 26, 2021 · 21 comments
Closed

fatal: bad revision 'v1.10.10..HEAD' #132

LuckeeDev opened this issue Mar 26, 2021 · 21 comments
Labels
bug Something isn't working

Comments

@LuckeeDev
Copy link

Running nx run workspace:version fails and logs Error: fatal: bad revision 'v1.10.10..HEAD'.
Any idea about how to solve this?

@edbzn
Copy link
Member

edbzn commented Mar 26, 2021

Hi, could you tell me what is the version in your package.json file and also what is the name of the last git tag?

@LuckeeDev
Copy link
Author

Hi, thanks for reaching out so quickly!

Package.json version: 1.10.12
Last git tag: v1.10.12

@LuckeeDev
Copy link
Author

Actually, the error is now Error: fatal: bad revision 'v1.10.12..HEAD' because I tried manually bumping versions to see if it changed anything.

@bjornharvold
Copy link

Same here.
@jscutlery/semver@1.3.2
git-describe@4.0.4

> nx run workspace:version 
Error: fatal: bad revision 'v13.0.0..HEAD'

    at Transform._transform (/Users/crash/git/iko-travel-spa/node_modules/git-raw-commits/index.js:83:30)
    at Transform._read (/Users/crash/git/iko-travel-spa/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:177:10)
    at Transform._write (/Users/crash/git/iko-travel-spa/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:164:83)
    at doWrite (/Users/crash/git/iko-travel-spa/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (/Users/crash/git/iko-travel-spa/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:398:5)
    at Transform.Writable.write (/Users/crash/git/iko-travel-spa/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:307:11)
    at Socket.ondata (_stream_readable.js:718:22)
    at Socket.emit (events.js:326:22)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:268:11)

@bjornharvold
Copy link

FYI It works with v1.3.1

@edbzn
Copy link
Member

edbzn commented Mar 26, 2021

v1.3.2 was basically a fix to log this kind of error in the terminal, instead of silently failing, I'm not sure the issue comes from this release, by any chance is your repo accessible? It would help me a lot, meanwhile, I will try to reproduce this locally.

@edbzn edbzn added the bug Something isn't working label Mar 26, 2021
@LuckeeDev
Copy link
Author

LuckeeDev commented Mar 26, 2021

v1.3.2 was basically a fix to log this kind of error in the terminal, instead of silently failing

Just tried with v1.3.1 and v1.3.0 and they both fail silently, so the issue is not with this version itself.

If it's of any help, I switched from WSL back to Windows few days ago and the issue only started happening after that.

I'm afraid I can't share the repo since it's for internal use only. :/

@edbzn
Copy link
Member

edbzn commented Mar 26, 2021

Interesting! it means it's possibly a compatibilty issue with windows, how will I debug this since I'm on Linux. 😄

@LuckeeDev
Copy link
Author

Does tagging the commit as a simple tag or an annotated tag make any difference in how the library handles the following tags?

@edbzn
Copy link
Member

edbzn commented Mar 26, 2021

I don't think so, both should be a valid pointer in the git history.

Could you run git describe --tags --abbrev=0 and tell me what it returns? If it returns v1.10.10, the last tag in the history, then v1.10.10..HEAD is a valid comparison. You can try by running git diff v1.10.10..HEAD for example, let me know what you get from both.

To make it clear, the version in package.json should refer to a valid git tag, for example, if you have "version": "1.10.10" in your package.json, but no tag v1.10.10 exist in your git history, then it will throw this bad revision error because v1.10.10 is not a valid git reference.

This behavior was recently changed (#117 and #102), but it's not yet released, now on master we just pull the last semver tag, the version in the package.json is not used as an input anymore.

@bjornharvold
Copy link

I am on Mac OS Big Sur and have the same issue

@bjornharvold
Copy link

bjornharvold commented Mar 27, 2021

Running the command:

git describe --tags --abbrev=0

Produces:
fatal: No names found, cannot describe anything.

My package.json is at 13.0.0. It was a version I recently added arbitrarily because of previous failures with the semver plugin.

FYI I never develop in a tag that contains the version number. Is that a requirement of your plugin? I am confused.

We use gitflow and work in "develop" branch. We just migrated our existing code to a new Git repo that contains no tags.

FYI This error also occurs in a clean new project when using v1.3.2 of your plugin.

Sorry. Also cannot share the company codebase.

@edbzn
Copy link
Member

edbzn commented Mar 27, 2021

This is the reason why it's failing, semver relies on git tags, to compute the next version it tries to retrieve all commits since last git tag, if no tag found then it couldn't know from which point in the history it should compute the next version, to fix it you have to create a tag wherever it has a sense in your history, and sync it with the version in your package.json.

@LuckeeDev
Copy link
Author

Just found where the issue was: running nx run workspace:version from v1.10.9 produced a v1.1.10 tag instead of v1.10.10. I went back and manually deleted and recreated the tag, works fine now. Might be a bug in the library? In the meantime, thanks a lot for your time @edbzn!

@LuckeeDev
Copy link
Author

Well, apparently it's not fully solved. It worked until doing a dry run, but at the moment of actually running the command I get this error: fatal: Unable to create 'C:/src/projects/csl/.git/index.lock': File exists.

@edbzn
Copy link
Member

edbzn commented Mar 27, 2021

from v1.10.9 produced a v1.1.10 tag instead of v1.10.10

I can't help you more without seeing your git history. To produce the next version we depend on a module used by almost 10 million projects on GitHub, I'm quite confident it's not a bug from the library, but in case you can reproduce it, feel free to open another issue.

Well, apparently it's not fully solved. It worked until doing a dry run, but at the moment of actually running the command I get this error: fatal: Unable to create 'C:/src/projects/csl/.git/index.lock': File exists.

This one was also solved previously (#108), but not yet released. I will see today if I can release a new version.

@LuckeeDev
Copy link
Author

I will see today if I can release a new version.

Awesome, thank you very much!

@bjornharvold
Copy link

Creating a Git tag with the name v13.0.0 (current version in package.json) fixed this issue for me.

@LuckeeDev
Copy link
Author

Hey there @edbzn! Any news on the update? Sorry to bother you and thanks in advance, but I was wondering when it will be available :)

@edbzn
Copy link
Member

edbzn commented Apr 8, 2021

Sorry for the delay I just released a new version 1.4.0 with all the fixes, let me know if any problems persist.

@edbzn edbzn closed this as completed Apr 8, 2021
@LuckeeDev
Copy link
Author

Everything works, thanks for your time @edbzn! And no worries about the delay ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants