streamich / git-cz Goto Github PK
View Code? Open in Web Editor NEWSemantic Git commits
Semantic Git commits
I love you package and my team wants to use it. But some are not happy with the emoji. Could you provide an option in the changelog.config.js that maybe disables emojis instead of showing a question mark
Firstly, thanks for the excellent project!
I would like to use git-cz
as husky
prepare-commit-msg
hook. I still couldn’t get it to work correctly with commitizen (looped message generation or this issue). Looking at your source code, I found that cli.js
script starts the commit mechanism after message generation.
Line 43 in dd2e35a
process.env.HUSKY_GIT_PARAMS
and if exists then write message into .git/COMMIT_EDITMSG
instead of run commit.
...
const message = formatCommitMessage(state);
if (process.env.HUSKY_GIT_PARAMS) {
// process.env.HUSKY_GIT_PARAMS = something like '.git/COMMIT_EDITMSG message'
const arrHuskyGitParams = process.env.HUSKY_GIT_PARAMS.split(' ');
fs.writeFileSync(arrHuskyGitParams[0], message);
process.exit(0);
}
... // continue commiting
After this changes we also can use git-cz
as husky hook without commitizen
. Something like this (package.json):
{
...
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && git-cz || true"
}
}
...
}
P.S. Sorry for my english
In the past version, I can pass some git commit
args to git cz
, E.g: git cz -a
.
But I found it's not working since the latest version. Did you remove this feature?
$ npm ls -g git-cz
/home/fengyu/.nvm/versions/node/v12.18.2/lib
└── [email protected]
$ git-cz --version
4.5.0
Is there a way to include a "Skip CI?" question? I keep on forgetting to add it on my own. Or there is a way for me to include it on my project?
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project ✨
Your semantic-release bot 📦🚀
It's really confusing about which of the repos actually owns npx git-cz
, but here's a link to the already open issue: commitizen/cz-cli#701
I'm unable to commit anything with npx git-cz
right now.
@streamich This is a major breaking issue! Please help
This will invalidate the “disableEmoji” option in the configuration file
Translated by Google Translate
Latest npm available version is 3.0.1
. When will be new versions get published?
When running npx git-cz it is failing right now with:
fatal Error: Could not find Git root folder.
Since 15min which is the release time :(
Edit: I'm on Mac
Hello there!
I found a bug with disableEmoji, but it turns out the fix is already in master and is tagged with the 3.3.0 release: 62915be
However... I have installed 3.3.0 and in my node_modules/git-cz/dist/cz.js
I find this: const closedIssueEmoji = config.disableEmoji ? config.closedIssuePrefix : '';
.
So it turns out that this fix has not actually been released yet. Don't know where that went wrong, but it does mean that I still experience the bug 😅
Create a binary distributable of this package that does not require Node to be installed to run.
Scope and type search in inquirer-list-search-prompt
could use fuzzy
package.
I was looking at the project and noticed that all devDependencies
are pinned.
"devDependencies": {
"@semantic-release/changelog": "3.0.6",
"@semantic-release/git": "8.0.0",
"any-shell-escape": "0.1.1",
"browserify": "16.5.2",
"chai": "4.2.0",
"chalk": "2.4.2",
"commitizen": "2.10.1",
"eslint": "^4.19.1",
"eslint-config-mailonline": "9.0.1",
"fuzzy": "0.1.3",
"global": "4.4.0",
"husky": "4.2.5",
"inquirer": "6.5.2",
"inquirer-list-search-prompt": "1.0.2",
"jest": "25.5.4",
"minimist": "1.2.5",
"mocha": "6.2.3",
"pkg": "4.4.8",
"rimraf": "3.0.2",
"semantic-release": "16.0.4",
"signale": "1.4.0",
"spawncommand": "2.2.0",
"word-wrap": "1.2.3"
},
Then tracked it down to @renovate-bot, more precisely to:
"devDependencies": {
"automerge": true,
"pinVersions": true
}
in renovate.json
I do understand that you might want to have the same "base" for everyone while developing instead of allowing differences due to patches and new features released in a given dev dependency...
My question for you @streamich is:
Do you think this should be the default behavior? Or should we change it by adding ^
for all the devDependencies
? 🤔
Allowing for patches and new features.
Example: "eslint": "^7.7.0",
.
May be I will do this when I have time.
package.json
's value: config.git-cz.i18n
, which is object. try get custom locale file path.en
locale file as alertnative.Any other idea?
Allow user to set global config. git-cz
would look for global config if it cannot find a local one.
Global config could be placed in ~/.git-cz.json
file.
Add --version
and -v
that prints version of this package, taken from package.json
.
Using "Install locally with Commitizen"
npm i -g commitizen
npm i -D git-cz
npm i -D commitiquette
"config": {
"commitizen": {
"path": "commitiquette"
}
},
When running
> git cz
Could not resolve commitiquette. Cannot find module 'commitiquette'
> git-cz
Could not resolve commitiquette. Cannot find module 'commitiquette'
This works
"scripts": {
"commit": "git-cz"
},
> npm run commit
Add interactive command for creating semantic branch names.
Format would be:
<emoji>-<type>/<date>/<name>
type
is one ofExample:
🔥-hotfix/2020-07-17/broken-db-connection
Command could be:
git-cz b
git-cz branch
type
and emoji
should be customizable.feat
fix
hotfix
release
date
should be in YYYY-MM-DD
format.date
could be disabled in configThis issue is with global version installed of git-cz.
version installed - 4.6.0
npx git-cz
&& git-cz
giving same error of
'!' is not recognized as an internal or external command, operable program or batch file. × fatal Error: No files staged.
I am running command in right folder, and it has files staged as well, which I double check and get
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
${complete_file_path}
Hi
I'd like to be able to make the config file global to all my projects instead of the current one as I expressed here: #161 (comment)
Because I'm following this "standard" https://gitmoji.carloscuesta.me/ and some of the emojis are not the same, for example ✨ is for features and I agree more with that standard than with the 🎸, same goes for other emojis you guys chose.
and I dont want to have to create a config file for each of my projects....
Thanks
Hi. Have been using this tool and while its awesome, only issue is that I have to end up writing all the commit messages in a single line.
Is it possible to allow \n or support opening up an editor for long descriptions so that we can have messages formatted properly?
I hope cz-cli is using git-cz and they have posted similar issues like this:
commitizen/cz-cli#580
commitizen/cz-cli#398
commitizen/cz-conventional-changelog#41
Any help appreciated. Thanks.
As addressed here #8, we can disable emojis in commits by not sending them configuring the changelog.config.js
file.
Now my question is: how can we opt-out them completely? I configured the file but whenever there is a breaking change or an issue closing commit, the emojis 🧨 and ✅are being sent. I see no option except to fork and remove them myself.
Usages of /dev/null
make this package unusable on Windows. Please, could you look at these files
git-cz/lib/util/getGitRootDir.js
Line 4 in c0e4ca8
Line 31 in c0e4ca8
npx git-cz
breaks with
✖ fatal TypeError: changedFiles is not iterable
at getChangedPackages (/Users/avi/.npm/_npx/22780/lib/node_modules/git-cz/dist/cli.js:657:26)
at Object.exports.createQuestion (/Users/avi/.npm/_npx/22780/lib/node_modules/git-cz/dist/cli.js:470:27)```
Add ability to create git-cz
-like commits in non-interactive mode where all parameters are provided through CLI arguments and no UI is displayed. For example:
git-cz --non-interactive --message="First commit" --type=feat
All arguments could be optional, but could also be overwritten through CLI arguments:
--message
--type
--scope
--description
In lerna you can set the directory of the packages by setting them in lerna.json
:
...
"packages": [
"workspaces/*"
],
...
and in package.json
...
"workspaces": {
"packages": [
"workspaces/*"
]
},
...
Unfortunately git-cz is not respecting these settings.
Workaround:
ln -s workspaces packages
For companies that do a fair amount of paired programming, it's valuable to be able to represent multiple authors for commits. So we use Git's co-author feature:
https://help.github.com/en/articles/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line
It would be great if this was a feature with these capabilities:
git-cz
config add flag to disable/enable co-author CLI step.Check that there is staged content before proceeding with anything.
Otherwise we fill everything and then it tells us that there's no staged changes. 😭
nothing added to commit.....
Moving this issue from a fork to here.
Anyone has any idea how to go about doing this?
If Scopes is null => Your code will ignore the writing scope 😢.
Besides, I don't want to fix the scopes, nobody does that!
How can I do that?
When running npm pack
, the changelog.cofig.js file gets included - and it is not possible to exclude it because .npmignore
always includes any file that looks like a changelog. This is somewhat undesirable as it means shipping dev configuration files.
It might be a good idea to support an alternate config file name (.gitcz.js
or .changelog.config.js
) to avoid colliding with what npm considers to be a changelog.
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project ✨
Your semantic-release bot 📦🚀
README.md
into separate files:
/docs/Installation.md
/docs/Configuration.md
/docs/CLI-options.md
--dry-run
--hook
--non-interactive
/docs/Semantic-commits.md
README.md
npx git-cz
/docs
folderNote: I just gave a quick look at the source so I might make wrong assumptions.
It seems that, by default, git-cz
does not give the option to enter the commit's scope.
I don't know if it's intentional. I could understand it so that it must be configured before, allowing to have a finite set of scopes in which the user can choose (and avoid the infinite growing scope list problem).
However I am facing a use case where this is blocking (sort of) something I am trying to do.
I am creating a project template that can be used to bootstrap projects quickly in our company with some sort of sane defaults.
I included the cz-conventional-changelog
adapter as well as husky and commitlint
with the config-conventinal
config for commitlint
. If i try to commit something, husky does not validate any commit as the scope is empty (the question is not asked).
Do you think that would make sense to configure it, so that the question can be asked and the user create a new scope if the list is empty ? That would make sense for that use case even though i would understand that thinking about scopes beforehand would be wiser.
Also, is there an option to disable emoji ? (I will look deeper in the codebase for this one)
Hi there @streamich!
Looks cool what you are building. I have been having people open issues like commitizen/cz-cli#595 asking why they are sometimes seeing your package and other times commitizen. As I said this is my fault for using git-cz as the package name. Still people are getting confused so I was wondering if you would ever consider taking git-c and then giving over git-cz to commitizen as a package. If not I understand but just wanted to check to stop the confusion.
Anyhow have a good day.
Hello :)
When I was scanning my mac with AVG I got following malware warning for git-cz node module. I am not sure if this is true or false but worried since I have used this package in number of different projects. Could anyone help me out what to do.
This is the screenshot
https://imgur.com/a/2FmbZwY
git-cz
is a fork of a project that did not have unit tests and it is fortunate to be real-life tested by hundreds of developers every day, however, this should change. We should add unit tests to cover all most important parts of git-cz
.
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
semantic-release cannot push the version tag to the branch master
on remote Git repository with URL git+ssh://[email protected]/streamich/git-cz.git
.
Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment and make sure the repositoryUrl is configured with a valid Git URL.
Good luck with your project ✨
Your semantic-release bot 📦🚀
Add option on CLI to disable emoji, like:
git-cz --disable-emoji
Many times I only want commit without emoji, and to do that I need to create the file changelog.config.js
.
Hi @streamich
I'm not that familiar with ESLint and much less with the configurations, but this project is dependent on a project that is causing issues and it might never be updated/fixed: eslint-config-mailonline
According to GitHub, we are their main dependant: https://github.com/MailOnline/eslint-config-mailonline/network/dependents
This project is holding quite a few dependencies from being updated:
https://github.com/MailOnline/eslint-config-mailonline/network/dependencies
Namely: eslint, babel-eslint, semantic-release, etc which causes our build to break when trying to update eslint: #171
I've open an issue there but something tells me no one will fix it because even though a commit was recently added the project hasn't been modified since 2017
With all this said, what can we do? Do we need that dependency? Can we substitute it with a better/updated one? What would the alternatives be? 🤔
Like I said I don't know enough about ESLint to know what can be done here...
I'm just trying to help and move this project forward by keeping everything well oiled and moving 😄
Regards
The default behavior of this plugin does not work on my windows machine because the commit message must be formed with double quotes, not single.
Reproduction:
C:\projects\some-testing>git-cz dry-run
Running in dry mode.
? Select the type of change that you're committing: 🎸 feat: A new feature
? Write a short, imperative mood description of the change:
[-------------------------------------------------------------] 55 chars left
feat: testing feat
? Provide a longer description of the change:
? List any breaking changes
BREAKING CHANGE:
? Issues this commit closes, e.g #123:
Will execute command:
git commit --message 'feat: 🎸 testing feat'
C:\projects\some-testing>git commit --message 'feat: 🎸 testing feat'
error: pathspec '🎸' did not match any file(s) known to git
error: pathspec 'testing' did not match any file(s) known to git
error: pathspec 'feat'' did not match any file(s) known to git
C:\projects\some-testing>git commit --message "feat: 🎸 testing feat"
[master cce34e3] feat: 🎸 testing feat
3 files changed, 22 insertions(+), 11 deletions(-)
Running non-dry just gives the expected error: pathspec [...]
.
Is it possible to make an option so that double quotes are used? Thank you.
Add --help
and -h
flags that print usage instructions.
This config means the project tests run only on node 10 right? 🤔
Line 10 in 815c424
We should include 12 and maybe even 14...
Is there a way to configure the default commit-message-format?
I would really like to shift emojis left, like this:
module.exports = {
...
commitMessageFormat: "<emoji> <type>: <subject>",
...
}
i was run npx git-cz
in new project and add first commit . it was missing body and footer. did i miss sth?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.