-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[v2] git commit --amend -m "": errors now: error: switch `m' requires a value #725
Comments
Good catch, thanks for letting us know! Git itself is also supposed to fail when an empty commit message is given, but its error message should be: "Aborting commit due to empty commit message." This is obviously a case of us not forwarding command-line arguments correctly. |
Git does not fail, but re-uses the last message (at least with I am using this alias/function, which results in an empty arg always at the end:
|
Empty string arguments are removed when building an executable command, causing problems like #725. However, we need to remove empty string arguments constructed from the commands layer, e.g., https://github.com/github/hub/blob/master/commands/browse.go#L112. We fix it by moving the removal logic to `Args.ToCmd`.
Good catch! I attempted a fix in #727. The |
You can also try |
Yes, and for that particular case But the point of my alias is to provide an optional argument (which could be fixed/worked around), but that wouldn't have shown this bug.. ;) |
@blueyed The fixes have been merged into master. Please update. I'm closing the issue. Feel free to reopen if it still happens. |
In hub 2,
git commit --amend -m ""
stopped working:git version 2.1.0
hub version 2.2.0-preview1-66-ga16a121
Using
git
directly works.It seems to not bypass empty shell arguments properly.
The text was updated successfully, but these errors were encountered: