Usability suggestion: Catch `git commit -amend`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux