Story Details

  • Why is Git Autocorrect too fast for Formula One drivers?

    Posted: 2025-01-19 19:20:23

    Git's autocorrect, specifically the help.autocorrect setting, can be frustratingly quick, correcting commands before users finish typing. This blog post explores the speed of this feature, demonstrating that even with deliberately slow, hunt-and-peck typing, Git often corrects commands before a human could realistically finish inputting them. The author argues that this aggressive correction behavior disrupts workflow and can lead to unintended actions, especially for complex or unfamiliar commands. They propose increasing the default autocorrection delay from 50ms to a more human-friendly value, suggesting 200ms as a reasonable starting point to allow users more time to complete their input. This would improve the user experience by striking a better balance between helpful correction and premature interruption.

    Summary of Comments ( 209 )
    https://news.ycombinator.com/item?id=42760620

    HN commenters largely discussed the annoyance of Git's aggressive autocorrect, particularly git push becoming git pull, leading to unintended overwrites of local changes. Some suggested the speed of the correction is disorienting, making it hard to interrupt, even for experienced users. Several proposed solutions were mentioned, including increasing the correction delay, disabling autocorrect for certain commands, or using aliases entirely. The behavior of git help was also brought up, with some arguing its prompt should be less aggressive as typos are common when searching documentation. A few questioned the blog post's F1 analogy, finding it weak, and others pointed out alternative shell configurations like zsh and fish which offer improved autocorrection experiences. There was also a thread discussing the implementation of the autocorrection feature itself, suggesting improvements based on Levenshtein distance and context.