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

Re: [PATCH v2] status: display "doing what" information in git status

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 6, 2011, 19:15 UTC
Message-ID
<vpqei4bvdwx.fsf@bauges.imag.fr>
In-Reply-To
<20110506184403.GC2872@madism.org>
Pierre Habouzit <madcoder@debian.org> writes:
Show 12 quoted lines
> On Fri, May 06, 2011 at 08:40:04PM +0200, Matthieu Moy wrote:
>> Pierre Habouzit <madcoder@debian.org> writes:
>> 
>> > +	const char * const merge_advice =
>> > +		_("use \"git reset --hard\" to abort, or resolve conflicts and commit");
>> 
>> I think that should be "git reset --merge" (which preserves files not
>> touched by the merge, and makes sure "git merge; git reset" doesn't
>> permanently loose data).
>
> Wow, I didn't know about that one, so /maybe/ the hint isn't that
> useless after all :)

Actually, there's very few reason to run "git reset --hard" these days, and we should really consider it as a very dangerous command that should not be advertized to beginners. There's almost always a safer alternative:

* You want to cancel a merge => git reset --merge
  (doesn't touch files not impacted by merges)
* You want to change the commit your HEAD points to => git reset --keep
  (in case you have local changes, they won't be overridden)
* You want to discard local changes => git stash
  (you may not think these changes are important, but you may be wrong)
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Pierre Habouzit
Message 19 of 19 in “status: display "doing what" information in git status”
  1. 1/1 status: display "doing what" information in git statusPierre Habouzit, May 5, 2011
  2. Sverre RabbelierMay 5, 2011
  3. Pierre HabouzitMay 5, 2011
  4. Michael J GruberMay 6, 2011
  5. Pierre HabouzitMay 6, 2011
  6. Junio C HamanoMay 5, 2011
  7. Pierre HabouzitMay 5, 2011
  8. Pierre HabouzitMay 5, 2011
  9. Junio C HamanoMay 5, 2011
  10. Pierre HabouzitMay 5, 2011
  11. status: display "doing what" information in git statusPierre Habouzit, May 6, 2011
  12. Jakub NarebskiMay 6, 2011
  13. Pierre HabouzitMay 6, 2011
  14. Junio C HamanoMay 6, 2011
  15. Pierre HabouzitMay 6, 2011
  16. Junio C HamanoMay 6, 2011
  17. Matthieu MoyMay 6, 2011
  18. Pierre HabouzitMay 6, 2011
  19. Matthieu MoyMay 6, 2011

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.