Re: Bug Report - Git does not require a space between shorthand flags and the commit-message
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Jul 14, 2023, 00:48 UTC
- Message-ID
- <ZLCbWn2qXZhmf8XD@tapette.crustytoothpaste.net>
- In-Reply-To
- <fcdf19b3-269b-aa9f-38c2-d0f775524a89@student.kit.edu>
On 2023-07-13 at 13:04:37, uxecw wrote:
Show 15 quoted lines
> Thank you for filling out a Git bug report! > Please answer the following questions to help us understand your issue. > > What did you do before the bug happened? (Steps to reproduce your issue) > Rebasing. > I entered `git commit —amend` (one hypen istead of two) accidently and it > passed as defacto `git commit —all —message "end"`. > I think because of the missing space git should have rejected the given > input. > > What did you expect to happen? (Expected behavior) > Input should have been rejected > > What happened instead? (Actual behavior) > `git commit —all —message "end"`
I believe this is standard Unix behaviour. One can combine single-character options, including a final single-character option that takes an argument, and the argument can be appended to the option.
For example, I frequently type "git commit -svS", and I could well type "git commit -svS0223b187" (my OpenPGP key ID). That also works similarly with OpenSSH: the command "ssh -CoUser=foo server" works just fine.
So I think it's best for Git to preserve the existing behaviour since it's standard for other tools as well (and, I believe, the POSIX-mandated behaviour).
-- brian m. carlson (he/him or they/them) Toronto, Ontario, CA