Skip to content

Error for commiting without staging #580

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
TakenMC opened this issue Jul 14, 2023 · 5 comments · Fixed by #1583
Closed

Error for commiting without staging #580

TakenMC opened this issue Jul 14, 2023 · 5 comments · Fixed by #1583

Comments

@TakenMC
Copy link

TakenMC commented Jul 14, 2023

Is your feature request related to a problem? Please describe.
Not really tho seeing an error message makes it seem something bad happened

Describe the solution you'd like
If no files are currently staged it would be nice to have a message say "Please stage files before commiting" same as the message when pushing and pulling

Describe alternatives you've considered
I have none

Additional context
The request seems self explanatory

@ten3roberts
Copy link
Member

Good idea.

I suppose that the error you are getting now is the underlying git commit error of "no changes added to commit" and makes it sound like the world is about to end.

This would be covered by the aforementioned git output parsing in #537. Feel free to add a comment under that issue for a git error which can be parsed and recognized.

@TakenMC
Copy link
Author

TakenMC commented Jul 14, 2023

ok

@CKolkey
Copy link
Member

CKolkey commented Jul 14, 2023

Well, the possible issue is that you can do an empty commit with the --allow-empty flag, so... and empty commit is valid. Maybe parsing and explaining to the user more concisely what went wrong is the way to go

@rami3l
Copy link
Contributor

rami3l commented Dec 8, 2024

@CKolkey Thanks for making 9e3ae89!

However, didn't this make git commit --allow-empty no longer possible, since it is currently covered in the early-returning branch?

@CKolkey
Copy link
Member

CKolkey commented Dec 8, 2024

Thanks - fixed: 568415f (#1594) 😅

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

Successfully merging a pull request may close this issue.

4 participants