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

check for staged commits before questionnaire #785

Closed
waynevanson opened this issue Sep 25, 2020 · 4 comments
Closed

check for staged commits before questionnaire #785

waynevanson opened this issue Sep 25, 2020 · 4 comments
Labels

Comments

@waynevanson
Copy link
Contributor

Sometimes I forget to do git add <path>, so when I get to the end of the cli quesitonnaire, it gives me an error.
I then have to do git add <path> and then run the cli, going through the questionnaire again.
Doing this on a breaking change is frustrating because I have to rewrite what I just wrote.

Was this intended for a reason? If so, why? I'd like to hear about it.

@travi
Copy link
Contributor

travi commented Sep 25, 2020

i might not be the right person to answer your direct question, but you can avoid needing to go through the wizard a second time in cases like this using the --retry flag

@waynevanson
Copy link
Contributor Author

@travi NICE! That's a good workaround for now, but will still love to hear what others have to say.

@dbofmmbt
Copy link

I agree with @waynevanson. As the CLI is able to know upfront that there's nothing staged, I don't see why it asks for information. I think it would be better to just send a message like "There's nothing staged! To commit, first stage something."

Actually, I've just checked out the open issues and this one looks to be related to #585. Fixing that issue would resolve this one too.

ognjenjevremovic pushed a commit to ognjenjevremovic/cz-cli that referenced this issue Mar 25, 2021
Check for staged files before running the prompt. Running the `git-cz` command with no files staged
reports "No files added to staging". Preserve the functionality of `git -a` (--all) flag - `git-cz
-a` command with no files added to staging area, adds all files to staging and opens the prompt (no
error thrown).

"fix commitizen#785"
ognjenjevremovic pushed a commit to ognjenjevremovic/cz-cli that referenced this issue Mar 26, 2021
Extend upon the existing staging unit tests. Assert that the files are added to staging area when
running commitizen commit command with -a (--all) flag, prior to spawning the prompt.

"re commitizen#785"
@LinusU LinusU closed this as completed in fdb73cd Nov 8, 2021
@github-actions
Copy link

🎉 This issue has been resolved in version 4.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants