Giter Club home page Giter Club logo

Comments (21)

LuckeeDev avatar LuckeeDev commented on May 23, 2024 2

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

from semver.

bjornharvold avatar bjornharvold commented on May 23, 2024 1

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

from semver.

edbzn avatar edbzn commented on May 23, 2024

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?

from semver.

LuckeeDev avatar LuckeeDev commented on May 23, 2024

Hi, thanks for reaching out so quickly!

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

from semver.

LuckeeDev avatar LuckeeDev commented on May 23, 2024

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.

from semver.

bjornharvold avatar bjornharvold commented on May 23, 2024

Same here.
@jscutlery/[email protected]
[email protected]

> 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)

from semver.

bjornharvold avatar bjornharvold commented on May 23, 2024

FYI It works with v1.3.1

from semver.

edbzn avatar edbzn commented on May 23, 2024

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.

from semver.

LuckeeDev avatar LuckeeDev commented on May 23, 2024

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. :/

from semver.

edbzn avatar edbzn commented on May 23, 2024

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

from semver.

LuckeeDev avatar LuckeeDev commented on May 23, 2024

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

from semver.

edbzn avatar edbzn commented on May 23, 2024

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.

from semver.

bjornharvold avatar bjornharvold commented on May 23, 2024

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

from semver.

bjornharvold avatar bjornharvold commented on May 23, 2024

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.

from semver.

edbzn avatar edbzn commented on May 23, 2024

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.

from semver.

LuckeeDev avatar LuckeeDev commented on May 23, 2024

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!

from semver.

LuckeeDev avatar LuckeeDev commented on May 23, 2024

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.

from semver.

edbzn avatar edbzn commented on May 23, 2024

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.

from semver.

LuckeeDev avatar LuckeeDev commented on May 23, 2024

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

Awesome, thank you very much!

from semver.

LuckeeDev avatar LuckeeDev commented on May 23, 2024

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 :)

from semver.

edbzn avatar edbzn commented on May 23, 2024

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

from semver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.