git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Branchaud <marcnarc@xiplink.com>
To: Andrew Wong <andrew.kw.w@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 3/3] reset: Print a warning when user uses "git reset" during a merge
Date: Fri, 14 Mar 2014 10:33:00 -0400	[thread overview]
Message-ID: <5323131C.7070506@xiplink.com> (raw)
In-Reply-To: <1394771872-25940-4-git-send-email-andrew.kw.w@gmail.com>

On 14-03-14 12:37 AM, Andrew Wong wrote:
> During a merge, "--mixed" is most likely not what the user wants. Using
> "--mixed" during a merge would leave the merged changes and new files
> mixed in with the local changes. The user would have to manually clean
> up the work tree, which is non-trivial. In future releases, we want to
> make "git reset" error out when used in the middle of a merge. For now,
> we simply print out a warning to the user.

I know this approach was suggested earlier, but given these dangers it seems
silly to give this big warning on a plain "git reset" but still go ahead and
do the things the warning talks about.

Is there any issue with changing "git reset" to error-out now but letting
"git reset --mixed" proceed?  Something like (note the reworded warning message):

$ git reset
Cowardly refusing to implicitly run 'git reset --mixed' during a merge.
This would not clean up any merged changes and would not remove any new
files that were created in the work tree.  It would also make it impossible
for git to automatically clean up the work tree later, so you would have to
clean up the work tree manually.
You probably meant to run 'git merge --abort' instead.
$ git reset --mixed   # Stoopid git!  I know what I'm doing!
$

This would mean that the 10% of git users who like to do "git reset" in the
middle of a conflicted merge will have to teach their fingers some extra
motions.  But these users are all veterans, and they can more easily type in
8 extra characters (6 with completion) than new users can recover from
accidentally misusing git-reset's power.

		M.

  reply	other threads:[~2014-03-14 14:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14  4:37 [PATCH 0/3] Make git more user-friendly during a merge conflict Andrew Wong
2014-03-14  4:37 ` [PATCH 1/3] wt-status: Make status messages more consistent with others Andrew Wong
2014-03-17 21:51   ` Junio C Hamano
2014-03-14  4:37 ` [PATCH 2/3] merge: Advise user to use "git merge --abort" to abort merges Andrew Wong
2014-03-17 21:58   ` Junio C Hamano
2014-03-14  4:37 ` [PATCH 3/3] reset: Print a warning when user uses "git reset" during a merge Andrew Wong
2014-03-14 14:33   ` Marc Branchaud [this message]
2014-03-14 17:04     ` Andrew Wong
2014-03-14 20:55       ` Junio C Hamano
2014-03-14 21:35         ` Andrew Wong
2014-03-15 19:23         ` Marc Branchaud
2014-03-17 21:54   ` Junio C Hamano
2014-03-17 23:04 ` [PATCH 0/3] Make git more user-friendly during a merge conflict Junio C Hamano
2014-03-17 23:25   ` Andrew Wong
2014-03-19 22:30     ` Junio C Hamano

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=5323131C.7070506@xiplink.com \
    --to=marcnarc@xiplink.com \
    --cc=andrew.kw.w@gmail.com \
    --cc=git@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).