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

[DOCS] git-tag-version=false does not commit #3710

Closed
1 task done
y-nk opened this issue Sep 2, 2021 · 6 comments · Fixed by #4574
Closed
1 task done

[DOCS] git-tag-version=false does not commit #3710

y-nk opened this issue Sep 2, 2021 · 6 comments · Fixed by #4574
Labels
Bug thing that needs fixing Documentation documentation related issue Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@y-nk
Copy link

y-nk commented Sep 2, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

the npm version command does not perform the git commit operation.

Expected Behavior

the npm version command still performs the git commit operation.

Steps To Reproduce

  1. In any repo
  2. Run npm version --git-tag-version=false
  3. the package.json will be modified, but the git commit won't be there.

Environment

  • OS: irrelevant
  • Node: latest
  • npm: 7.18.1
@y-nk y-nk added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Sep 2, 2021
@y-nk
Copy link
Author

y-nk commented Sep 2, 2021

PS: it's specified in the documentation that the git-tag-version options "tags the commit", so it should be expected that turning it to false only "does not tag the commit", implicitly that the commit should still exist.

@isaacs
Copy link
Contributor

isaacs commented Sep 2, 2021

Yeah, we don't commit it if we're not creating the tag. That's how it's been for at least 2 majors now, and changing that would be a breaking change.

I think this just needs a docs fix, tbh.

@y-nk
Copy link
Author

y-nk commented Sep 3, 2021

@isaacs the parameter's name would still be misleading imho.

@isaacs
Copy link
Contributor

isaacs commented Sep 6, 2021

@y-nk That's a fair complaint, but it's also been that way since "use git when doing npm version" has been around, so it's a disruptive breaking change to make the behavior different.

We could split the config into two different options (say, version-git-commit and version-git-tag or something) in npm v9 with the upcoming config refactor, but we'd likely keep the existing config option as an alias for backwards compatibility.

@isaacs
Copy link
Contributor

isaacs commented Sep 6, 2021

We could split the config into two different options (say, version-git-commit and version-git-tag or something)

Actually, that'd be kind of weird, because setting version-git-tag without version-git-commit would be an error, so one would have to imply the other. The plan is to get away from cases where one config flag has to imply another, because that just creates a lot of side effects and weirdness today that's hard to reason about.

So maybe the best option would be something like a --version-git=("tag", "commit", false) enum option? Idk, just spitballing.

@wraithgar wraithgar changed the title [BUG] git-tag-version=false does not commit [DOCS] git-tag-version=false does not commit Mar 16, 2022
@wraithgar wraithgar added Documentation documentation related issue Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Mar 16, 2022
@wraithgar
Copy link
Member

Made a PR to update docs so that this is clarified. Having this flag do something different than it does now should go through the rfc process

@nlf nlf closed this as completed in #4574 Mar 17, 2022
binsee added a commit to binsee/chatie-git-scripts that referenced this issue Apr 9, 2022
huan pushed a commit to Chatie/git-scripts that referenced this issue Apr 9, 2022
* feat: no git tag version
Fixes:  #21

* fix: 🐛 --no-git-tag-version does not commit

see npm/cli#3710

* 0.7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Documentation documentation related issue Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants