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

stg commit allows empty patches #158

Closed
joefiorini opened this issue Oct 22, 2021 · 2 comments
Closed

stg commit allows empty patches #158

joefiorini opened this issue Oct 22, 2021 · 2 comments

Comments

@joefiorini
Copy link

I've been caught by this a couple times. I create a patch, make changes to a file, then accidentally forget to stg refresh the change. If I use stg commit it creates an empty commit that I can then push. Since empty commits require a flag in git it seems like *stg commitshould work the same way, with an--allow-empty` flag to override.

@jpgrayson
Copy link
Collaborator

Hi @joefiorini. Thanks for submitting this issue. I protecting stg commit from empty patches is a good idea.

@joefiorini
Copy link
Author

@jpgrayson Thanks for replying! I opened up #159 to fix this issue.

joefiorini added a commit to joefiorini/stgit that referenced this issue Oct 25, 2021
jpgrayson added a commit that referenced this issue Oct 27, 2021
`stg commit` now refuses to commit empty patches by default, but also
learns the --allow-empty flag, which mirrors `git commit --allow-empty`,
to override this behavior.

Addresses #158

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants