From: Tay Ray Chuan Date: Wed, 09 May 2012 15:06:59 GMT Subject: Re: [PATCH 4/4] allow recovery from command name typos Message-ID: In-Reply-To: <7v62c77uss.fsf@alter.siamese.dyndns.org> On Tue, May 8, 2012 at 1:41 AM, Junio C Hamano wrote: > By the way, does anybody actually use the deciseconds grace period to ^C > the process?  I know I was the guilty party for suggesting it, but it > strikes me that it is rather a dangerous option.  When checking out > another branch with great difference with "git chekcout foo", you would be > asked "did you mean checkout?", and if you hit ^C a bit too late, you may > not kill autocorrect but end up killing a lengthy "checkout" in the > middle, messing up the working tree with a mixture of files in old and new > branches, needing a "reset --hard" to recover.  We might want to update > the documentation to warn about this, even though I personally do not > think it is worth removing the support (and going through the trouble of > having to deal with "why did you remove the useful feature" complaints). > Actually, I've never heard of that feature, until I was reading help.c. However, it's listed on Progit [1], so I'd imagine there'd be *some* users in the wild. [1] http://git-scm.com/book/ch7-1.html Personally, I think it's a little dangerous - imagine your script has a typo'd command that just runs anyway if help.autocorrect without any chance for user intervention. Perhaps there should be a isatty(2) check to guard it, like the prompting patch does. -- Cheers, Ray Chuan