Chatie / git-scripts

Git Hooks Integration for Chatie Projects
https://npmjs.com/package/@chatie/git-scripts
Apache License 2.0
1 stars 4 forks source link

Does npm version really need tag ? #21

Closed binsee closed 2 years ago

binsee commented 2 years ago

We seem to rarely use tags, and npm version in the push hook will create new tags by default. And tags only exist in the local record and will not be uploaded to the remote repo. The tags are displayed in the git log, which is annoying.

So I think tag should not be created in push hook. The --no-git-tag-version flag can be added to npm version to skip creating tags.

image
huan commented 2 years ago

Thanks for raising this issue!

The tag can be removed because we are not using it at all.

Please feel free to create a PR to disable the tag creation.

The --no-git-tag-version flag can be added to npm version to skip creating tags.

binsee commented 2 years ago

[DOCS] git-tag-version=false does not commit https://github.com/npm/cli/issues/3710

--no-git-tag-version doesn't work as I understand it, and it causes commits not to be executed.

So we can only abandon this option and use delayed execution git tag -d to delete the tag.

huan commented 2 years ago

Merged.

Please let me know if it works as expected or not.

Thank you very much for your improvement!

binsee commented 2 years ago

Please let me know if it works as expected or not.

Yes, it works.

binsee@localhost > ~/CodeWork/sidecar > test3 > git push --dry-run            

> sidecar@1.0.29 lint
> npm-run-all lint:es lint:ts

> sidecar@1.0.29 lint:es
> eslint --ignore-pattern fixtures/ "src/**/*.ts" "tests/**/*.ts"

> sidecar@1.0.29 lint:ts
> tsc --isolatedModules --noEmit

v1.0.30
Deleted tag 'v1.0.30' (was e1626d8)
To github.com:binsee/sidecar.git
   6e813d3..335daca  test3 -> test3

____ _ _        ____            _
/ ___(_) |_     |  _ \ _   _ ___| |__
| |  _| | __|    | |_) | | | / __| '_ \
| |_| | | |_     |  __/| |_| \__ \ | | |
\____|_|\__|    |_|    \__,_|___/_| |_|

____                              _ _
/ ___| _   _  ___ ___ ___  ___  __| | |
\___ \| | | |/ __/ __/ _ \/ _ \/ _^ | |
___) | |_| | (_| (_|  __/  __/ (_| |_|
|____/ \__,_|\___\___\___|\___|\__,_(_)

 ### Npm version bumped and pushed by inner push inside hook pre-push ###"
 -- vvvvvv outer push will be canceled, don't worry, not bug :) vvvvvv --"

Failed to exec pre-push hook script
error: failed to push some refs to 'github.com:binsee/sidecar.git'
binsee@localhost > ~/CodeWork/sidecar > test3 > git push --dry-run
Everything up-to-date
huan commented 2 years ago

Glad to know, cheers!