{"thread":{"id":"47217","subject":"Usability suggestion: Catch `git commit -amend`","startedAt":"2017-11-16T04:06:46Z","lastAt":"2017-11-16T04:06:46Z","messageCount":1,"participants":["Ryan Govostes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"332649","messageId":"CAMtyXZYMU6fR4MTzRqOCgnqdhNhAVbLu7kUqGW6UXf9wq5P1zQ@mail.gmail.com","threadId":"47217","inReplyTo":null,"subject":"Usability suggestion: Catch `git commit -amend`","fromName":"Ryan Govostes","fromEmail":"rgovostes@gmail.com","sentAt":"2017-11-16T04:06:40Z","receivedAt":"2017-11-16T04:06:46Z","isPatch":false,"sender":{"key":"rgovostes@gmail.com","avatar":null},"body":"Despite being a native English speaker, I've often typo'd when trying\nto invoke `git commit --amend`. Recently I wrote `git commit -ammend`\nwhich of course added everything to the commit and attached the commit\nmessage \"mend\".\n\nThis doesn't seem to be an uncommon error, there are 64,000 commits\nlike this on GitHub:\nhttps://github.com/search?utf8=✓&q=mend&type=Commits\n\nThe search for simply \"end\" (as in `-amend`) returns millions of hits\nbut it's hard to tell how many of those are false positives.\n\nIt might be reasonable to try to catch `-amend` (at least) and prevent\nan errant commit. Trying to roll back a commit is a place where people\noften get into trouble and get confused about the state of their\nrepository. (Of course, if they just cursor-up and fix the typo, now\nthey're editing the \"end\" commit and not the one they were trying to\namend in the first place.)\n\nGit could suggest the user instead pass the commit message as a\nseparate argument, like `-am end` if they really want to do it.\n\nI'm OK with getting an error if I type `--ammend`, but it is nice that\nGit does do spell check on subcommand names. That would make it easier\nto figure out which argument I mistyped. (In this case, there's\nusually only one.)\n\nRyan\n"}]}