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

Re: Simplify "git reset --hard"

From
Linus Torvalds <torvalds@osdl.org>
Date
May 15, 2006, 14:55 UTC
Message-ID
<Pine.LNX.4.64.0605150752490.3866@g5.osdl.org>
In-Reply-To
<7vr72vvigy.fsf@assigned-by-dhcp.cox.net>
On Mon, 15 May 2006, Junio C Hamano wrote:
Show 12 quoted lines
>
> read-tree -u one-way merge fix to check out locally modified paths.
> 
> The "-u" flag means "update the working tree files", but to
> other types of merges, it also implies "I want to keep my local
> changes" -- because they prevent local changes from getting lost
> by using verify_uptodate.  The one-way merge is different from
> other merges in that its purpose is opposite of doing something
> else while keeping unrelated local changes.  The point of
> one-way merge is to nuke local changes.  So while it feels
> somewhat wrong that this actively loses local changes, it is the
> right thing to do.

Ack. On the other hand, I wonder if it might not make sense to have this part potentially depend on the "--reset" flag.

That way you wouldn't even have to apologize for it.
		Linus
Previous: Junio C HamanoNext: Linus Torvalds
Message 7 of 8 in “Allow one-way tree merge to remove old files”
  1. Linus TorvaldsMay 14, 2006
  2. Junio C HamanoMay 14, 2006
  3. Simplify "git reset --hard"Linus Torvalds, May 14, 2006
  4. Junio C HamanoMay 15, 2006
  5. Junio C HamanoMay 15, 2006
  6. Junio C HamanoMay 15, 2006
  7. Linus TorvaldsMay 15, 2006
  8. Linus TorvaldsMay 15, 2006

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.