git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: why is git destructive by default? (i suggest it not be!)

From
JXJing Xue <jingxue@digizenstudio.com>
Date
Jun 25, 2008, 17:56 UTC
Message-ID
<20080625135647.wiohgih5hc0scgw0@intranet.digizenstudio.com>
In-Reply-To
<willow-jeske-01l5xqJDFEDjCftd>
Quoting David Jeske <jeske@google.com>:
> - add "checkout" to the git-gui history right-click menu, and make the
> danger of
> "reset --hard" more obvious and require a confirmation dialog (the gui
> equivilant of -f)

Is that really necessary? The way it works now, when I choose "reset foo branch to here", a dialog prompts me to pick from the three reset modes, with 'Mixed' being the default. So I'd have to explicitly pick 'Hard', which has a message "discards ALL local changes" right next to it. If people are so conditioned to ignore that, I doubt it'll take very long for them to be conditioned to just automatically confirm the confirmation dialog.

The same applies to the command line as well I guess - if having to manually type "--hard" does not make one stop and think about what they are doing, I can hardly see how "--hard --force" would do any better.

Cheers.
-- 
Jing Xue
Previous: Matthieu Moy
Message 8 of 8 in “Re: why is git destructive by default? (i suggest it not be!)”
  1. David JeskeJun 24, 2008
  2. David JeskeAug 14, 2016
  3. Brandon CaseyJun 24, 2008
  4. David JeskeJun 24, 2008
  5. David JeskeAug 14, 2016
  6. Brandon CaseyJun 24, 2008
  7. Matthieu MoyJun 25, 2008
  8. Jing XueJun 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.