All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Pierre Habouzit <madcoder@debian.org>
Cc: Junio C Hamano <gitster@pobox.com>, Git ML <git@vger.kernel.org>
Subject: Re: [PATCH v2] status: display "doing what" information in git status
Date: Fri, 06 May 2011 21:15:26 +0200	[thread overview]
Message-ID: <vpqei4bvdwx.fsf@bauges.imag.fr> (raw)
In-Reply-To: <20110506184403.GC2872@madism.org> (Pierre Habouzit's message of "Fri, 6 May 2011 20:44:03 +0200")

Pierre Habouzit <madcoder@debian.org> writes:

> 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/

      reply	other threads:[~2011-05-06 19:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05 21:48 [PATCH 1/1] status: display "doing what" information in git status Pierre Habouzit
2011-05-05 23:06 ` Sverre Rabbelier
2011-05-05 23:26   ` Pierre Habouzit
2011-05-06  7:48     ` Michael J Gruber
2011-05-06  8:04       ` Pierre Habouzit
2011-05-05 23:37 ` Junio C Hamano
2011-05-05 23:39   ` Pierre Habouzit
2011-05-05 23:47     ` Pierre Habouzit
2011-05-05 23:49     ` Junio C Hamano
2011-05-05 23:51       ` Pierre Habouzit
2011-05-06  7:38       ` [PATCH v2] " Pierre Habouzit
2011-05-06 10:13         ` Jakub Narebski
2011-05-06 17:40           ` Pierre Habouzit
2011-05-06 17:29         ` Junio C Hamano
2011-05-06 17:36           ` Pierre Habouzit
2011-05-06 18:24             ` Junio C Hamano
2011-05-06 18:40         ` Matthieu Moy
2011-05-06 18:44           ` Pierre Habouzit
2011-05-06 19:15             ` Matthieu Moy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqei4bvdwx.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=madcoder@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.