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

Blank commit created if the command results in no changes #7

Open
motiz88 opened this issue May 16, 2017 · 2 comments
Open

Blank commit created if the command results in no changes #7

motiz88 opened this issue May 16, 2017 · 2 comments
Labels

Comments

@motiz88
Copy link
Owner

motiz88 commented May 16, 2017

Originally reported by @Stupidism in #5 (comment):

When there's nothing to commit after cmd executed(original diff is fixed back to unchanged), the commit is blank now. It should abort commit process by exit 1

@Stupidism
Copy link

How to reproduce:

  1. make an auto-fixable change (e.g. remove a trail-coma or a ;)
  2. git add . && git commit
  3. git reset --mixed back to last commit, you will find there's nothing changed in the commit

@motiz88
Copy link
Owner Author

motiz88 commented May 17, 2017

I see. This functionality would ideally need to interop with git commit --allow-empty somehow. I wonder if we can detect this flag in a hook.

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

2 participants