All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Alan Mackenzie <acm@muc.de>
Cc: Dennis Kaarsemaker <dennis@kaarsemaker.net>, git@vger.kernel.org
Subject: Re: "git stash pop" is doing an unwanted "git add" when there are conflicts.
Date: Wed, 30 Dec 2015 02:02:38 -0500	[thread overview]
Message-ID: <20151230070238.GA29896@sigill.intra.peff.net> (raw)
In-Reply-To: <20151229212038.GD1884@acm.fritz.box>

On Tue, Dec 29, 2015 at 09:20:38PM +0000, Alan Mackenzie wrote:

> > Yeah, I think I agree. But keep in mind that we have to mention the
> > conflicts _somewhere_, so we're going to touch the index regardless (and
> > the user is going to have to erase the conflicts in the index
> > eventually, either with `git add` or `git reset`).
> 
> When the stash consists entirely of changes in the working directory,
> and "git stash pop" has conflicts, why can't these conflicts simply be
> marked by "<<<<<<<<" (etc.) in the working directory, leaving the index
> unchanged?  The index is left unchanged when there are no conlicts.

I don't think that's a good idea. Git always marks conflicts in the
index for other operations. Besides being inconsistent with the rest of
git, it drops useful information that other tools can use. For example,
one cannot "git checkout --conflict=diff3" afterwards, or use "git
mergetool" to kick off a third-party merge tool.

Not to mention that the information is lost to the user themselves. If
we touched 10 files and 2 had conflicts, there is now no way for the
user to ask "where were the conflicts?". They can either find the stash
output in their terminal scrollback, or grep for things that look like
conflict markers.

-Peff

      reply	other threads:[~2015-12-30  7:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-21 14:29 "git stash pop" is doing an unwanted "git add" when there are conflicts Alan Mackenzie
2015-12-21 20:34 ` Alan Mackenzie
2015-12-22  8:17 ` Dennis Kaarsemaker
2015-12-22  9:30   ` Jeff King
2015-12-24  9:20     ` Alan Mackenzie
2015-12-29  7:53       ` Jeff King
2015-12-29 19:04         ` Junio C Hamano
2015-12-30  7:13           ` Jeff King
2015-12-29 21:20         ` Alan Mackenzie
2015-12-30  7:02           ` Jeff King [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=20151230070238.GA29896@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=acm@muc.de \
    --cc=dennis@kaarsemaker.net \
    --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 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.