commitizen / cz-cli

The commitizen command line utility. #BlackLivesMatter
http://commitizen.github.io/cz-cli/
MIT License
16.7k stars 547 forks source link

[Fix] Check for staged files prior to spawning the prompt #818

Closed ognjenjevremovic closed 2 years ago

ognjenjevremovic commented 3 years ago

Fixes #785 and #585 (since the cause of these issues was related)

Changes

Checklist

After the changes I ensured that:

Done

amaltson commented 3 years ago

Love this, thank you for adding it! I run into this several times a day because I'm used to running git commit -a, but forget to add -a to commitizen. It's definitely super frustrating to fill out the questionnaire and then have it do nothing b/c I forgot to stage files. This would preserve the behaviour that Git itself has:

$ git commit
On branch properly-approve-rfc-33
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   ... the files that are unstaged ...

no changes added to commit (use "git add" and/or "git commit -a")
ognjenjevremovic commented 3 years ago

Any updates on the PR review?

amaltson commented 2 years ago

Yeah this would be awesome to get a review of this, thank you!

LinusU commented 2 years ago

Thanks! Sorry for the delay on this

amaltson commented 2 years ago

👏 yay! Thank you so much! Can't wait for this to be released, appreciate all the hard work @LinusU!

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 4.2.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: