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

Command Commit [enter] closes/crashes gitui-win #74

Closed
alistaircarscadden opened this issue May 20, 2020 · 11 comments
Closed

Command Commit [enter] closes/crashes gitui-win #74

alistaircarscadden opened this issue May 20, 2020 · 11 comments
Labels
bug Something isn't working

Comments

@alistaircarscadden
Copy link
Contributor

Describe the bug
In gitui-win v0.2.6 after staging, and after writing a commit message, pressing Enter abruptly closes the gitui.exe window. Inspecting the repo after shows that the commit is not made.

To Reproduce

  1. Create new directory and cd into it
  2. Run git init
  3. Add a file to be committed (file.txt)
  4. Run gitui.exe
  5. Press enter on the file in the unstaged menu
  6. Press 2 to enter the staged menu
  7. Press Commit [c]
  8. Enter a message
  9. Press Commit [enter]

Expected behavior
The commit should be made and the ui would update to reflect that without closing.

Desktop (please complete the following information):
gitui-win v0.2.6

@alistaircarscadden
Copy link
Contributor Author

After some testing I discovered that the bug does not occur after I run git config user.name myname. So, without a username it crashes, and with a username it works just fine. With or without an email it works, as long as it has a name.

@extrawurst
Copy link
Owner

Good point! Currently it is expected to have the name set. Let me look into it

@extrawurst extrawurst added the bug Something isn't working label May 20, 2020
@extrawurst
Copy link
Owner

so instead of panicking it should show an expressive error now:
Screenshot 2020-05-20 at 11 24 11

will roll out in next release

@extrawurst
Copy link
Owner

should be fixed in 0.3.0: https://github.com/extrawurst/gitui/releases/tag/v0.3.0

@alistaircarscadden
Copy link
Contributor Author

I did a bit more looking around, and discovered I was wrong in my most recent comment. The git behaviour is it allows a commit to be made as long as at least a user.name or user.email is provided. The author shows up as unknown <email@example.com> if only an email is provided or name <> if only a name is provided.

When the condition is not met it shows the *** Please tell me who you are. message.

So, as it is right now gitui does not allow me to make a commit when git commit allows me to. Good work, by the way! :)

@extrawurst
Copy link
Owner

I am not sure I follow. Does the crash persist for you? Is there a different behavior that we need to look into?

@extrawurst
Copy link
Owner

@alistaircarscadden make sure to reopen the ticket if there is still the issue

@alistaircarscadden
Copy link
Contributor Author

alistaircarscadden commented May 20, 2020

The crash is fixed, and I see the menu that you showed in your screenshot. I'm considering it may be a bug that gitui does not allow a commit in the same conditions git does allow one.

The conditions are when a user.email is present, and a user.name is not. git commit works, but committing with gitui does not.

e: but I am not familliar with the internals of your program, so to you this may be the correct behaviour. I would imagine it's needing a name for some reason, but if your program is just making a call to git commit, it should work.

@extrawurst
Copy link
Owner

@alistaircarscadden what error does it show when trying to commit in those conditions?

@extrawurst
Copy link
Owner

@alistaircarscadden gitui does not use the git cli and you are right, what works in regular git, should be possible in gitui. Please file a new ticket for this and please add the error message that gitui currently returns in that case.

@alistaircarscadden
Copy link
Contributor Author

alistaircarscadden commented May 20, 2020

Ok! It's more complicated than I thought, I'll make an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants