Skip to content

fatal: no tag exactly matches 'id' #53

Open

Description

@VinceBT

Git version 2.17 on Windows
My Git repo has many folders at the root and the app is in one of these folders
image

Activity

  1. stovmascript commented on Jun 1, 2018

    @stovmascript
    Owner

    Looks like HEAD isn't pointing to any Git tag. Is that correct?

    Thought: Maybe RNV should just skip adjusting Git tags when it doesn't find any, instead of throwing.

  2. VinceBT commented on Jun 2, 2018

    @VinceBT
    Author

    Yes you are maybe correct. Such a behaviour would be great

  3. added 2 commits that reference this issue on Jun 2, 2018
  4. added a commit that references this issue on Jun 2, 2018
    f5228b0
  5. stovmascript commented on Jun 2, 2018

    @stovmascript
    Owner

    @VinceBT New version (2.6.1) is out now on npm.

  6. VinceBT commented on Jun 2, 2018

    @VinceBT
    Author

    I used --amend to try your modification and got the same error, I'm on 2.6.1
    Could the && be the reason of the bug here ? :

    EDIT: Changing it to || did nothing

  7. stovmascript commented on Jun 2, 2018

    @stovmascript
    Owner

    Hm, weird. Here's what I just tried:

    $ npm version patch
    $ react-native-version -a
    # commit amended, git tag adjusted
    
    $ npm version patch
    # another test commit
    $ react-native-version -a
    # commit amended, no git tag adjusted

    LGTM

  8. VinceBT commented on Jun 4, 2018

    @VinceBT
    Author

    Could you reopen this issue ? I still don't have the amend working even with latest version :(

  9. stovmascript commented on Jun 4, 2018

    @stovmascript
    Owner

    I'm going to need a reproducible example in order to dig deeper.

    From your description I gather that you have something like a monorepo with multiple projects or apps in it. This shouldn't be a problem. However, about Git tags... Do you utilize them somehow in the other apps? Do you skip tag creation (--no-git-tag-version or disabling in npm config) when using npm version ... or are you using default settings?

    AFAIK Git tags are global inside a repo, so they can be overwritten by the other apps.

  10. VinceBT commented on Jun 4, 2018

    @VinceBT
    Author

    I think my issue is related to this npm/npm#9111

    Since my app is inside a subfolder, it doesnt not create a tag, so there is nothing to amend.

    I've adapted my package.json to look like that:
    image

    But when using npm version, it creates two tags now:
    image

    EDIT:
    I think this ticket can be closed and a second known issue can be added to your readme haha
    If you can help me on the double tag issue tell me if I need to create a second issue of if there is a simple fix

  11. stovmascript commented on Jun 4, 2018

    @stovmascript
    Owner

    Hm, wasn't aware of this. Maybe a check that Git exists in that directory should also be added. npm version simply skips tag creation if there isn't a .git/ directory. I think we should mirror that behaviour.

  12. added 2 commits that reference this issue on Jun 5, 2018
  13. stovmascript commented on Jun 6, 2018

    @stovmascript
    Owner

    @VinceBT Can you try out react-native-version@next (2.6.3-0) and see if that works ok?

  14. VinceBT commented on Jun 8, 2018

    @VinceBT
    Author

    When using your new version I get this output and no git tag

    [RNV] Versioning Android...
    [RNV] Android updated
    [RNV] Versioning iOS...
    [RNV] iOS updated
    [RNV] Amending...
    [RNV] Done
    

    But when creating a .git folder, I get this output and a git tag

    [RNV] Versioning Android...
    [RNV] Android updated
    [RNV] Versioning iOS...
    [RNV] iOS updated
    [RNV] Amending...
    [RNV] Adjusting Git tag...
    [RNV] Done
    

    The [RNV] Adjusting Git tag... step is triggered in the second case
    I dont have the double tag issue anymore

  15. stovmascript commented on Jun 8, 2018

    @stovmascript
    Owner

    Yeah, but isn't that what we want?

    With "preversion": "mkdir .git", when you run npm version and the Git tag for that version does not exist in your repo, it will create the tag and proceed with "postversion": "react-native-version --amend", which will find the tag and adjust it to point to the amended commit.

    If the Git tag already exists in the repo, npm version will throw an error because it does not use the --force option like RNV does.


    But I have found and issue in the case when there is no .git/ folder, npm version will skip creating a Git tag and will not even commit the changes in package.json. RNV will then do its work and amend the current commit in error. The same commit validation we do for determining when to search for Git tags should be added before amending.

  16. christophliftoff commented on Aug 8, 2023

    @christophliftoff

    For me this was happening when I would try and run the react-native-version script without committing my changes. It seems that you can only run this script once per commit? Otherwise I'd get the error you shared above.

  17. arafatalim commented on Jan 29, 2024

    @arafatalim

    I fixed the problem by adding the missing .git folder to the apps/mobile folder.

    Q. How can I check if my folder is missing?
    A. I checked on vs code for this.

    • Open Settings -> Search or type exclude -> find the pattern **/.git, remove it temporarily, and click ok.
    • Check for the .git folder in the main project directory and the apps/mobile folder.
    • If the .git folder is not in the apps/mobile folder, create it. [Leave it empty]
    • Now, execute your command, like yarn mobile:staging:release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions