* Usability suggestion: Catch `git commit -amend`
@ 2017-11-16 4:06 Ryan Govostes
0 siblings, 0 replies; only message in thread
From: Ryan Govostes @ 2017-11-16 4:06 UTC (permalink / raw)
To: git
Despite being a native English speaker, I've often typo'd when trying
to invoke `git commit --amend`. Recently I wrote `git commit -ammend`
which of course added everything to the commit and attached the commit
message "mend".
This doesn't seem to be an uncommon error, there are 64,000 commits
like this on GitHub:
https://github.com/search?utf8=✓&q=mend&type=Commits
The search for simply "end" (as in `-amend`) returns millions of hits
but it's hard to tell how many of those are false positives.
It might be reasonable to try to catch `-amend` (at least) and prevent
an errant commit. Trying to roll back a commit is a place where people
often get into trouble and get confused about the state of their
repository. (Of course, if they just cursor-up and fix the typo, now
they're editing the "end" commit and not the one they were trying to
amend in the first place.)
Git could suggest the user instead pass the commit message as a
separate argument, like `-am end` if they really want to do it.
I'm OK with getting an error if I type `--ammend`, but it is nice that
Git does do spell check on subcommand names. That would make it easier
to figure out which argument I mistyped. (In this case, there's
usually only one.)
Ryan
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-11-16 4:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-16 4:06 Usability suggestion: Catch `git commit -amend` Ryan Govostes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).