git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Holger Hellmuth <hellmuth@ira.uka.de>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Junio C Hamano <gitster@pobox.com>,
	kusmabite@gmail.com, Git Mailing List <git@vger.kernel.org>
Subject: Re: git add -p and unresolved conflicts
Date: Wed, 28 Mar 2012 13:50:44 -0700	[thread overview]
Message-ID: <7vvclotpp7.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4F737027.5020503@ira.uka.de> (Holger Hellmuth's message of "Wed, 28 Mar 2012 22:10:15 +0200")

Holger Hellmuth <hellmuth@ira.uka.de> writes:

> But the conflicted chunks are of the form "<<<< our ... ||||||||||
> theirs >>>>>>" in your work tree. So there are two cases:
>
> a) You have removed the markers thereby removing the conflict -> this
> means the chunk will not be offered to you as a conflicting chunk
>
> b) You haven't removed the markers. Then there is a choice between
> base, our and their version.
> If you had edited one of the versions between the conflict markers in
> your working tree without removing the markers (which wouldn't be a
> sensible thing) then it depends on whether the chunk in the working
> tree or the versions in the index are used as a basis for the
> choosing, but I suspect using the working tree version is easier to
> do.

I think Matthieu is not thinking about the "resolve conflicted merge (or
rebase, am) and make a single commit" use case, for which your "pick one
of the sides" makes sense.  His is more about "I like some change in that
unrelated commit---while I have no intention to replay that change as a
whole, I want to use "cherry-pick --no-commit" and pick only the bits out
of the change that are useful for what I am doing" use case.

In such a context, after resolving conflicts in the working tree, "add -p"
would be a good tool to pick hunks in the diff between the HEAD and the
working tree.

I tend to think that use case, while valid, may be a minority case and
giving a version of "add -p" to make that mode too easy to use by mistake
during a true conflict resolution is inviting trouble for newbies.  As I
said, "reset $path" followed by regular "add -p $path" would be a usable
workaround for Matthieu's workflow.

  reply	other threads:[~2012-03-28 20:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28  9:51 git add -p and unresolved conflicts Erik Faye-Lund
2012-03-28 15:10 ` Junio C Hamano
2012-03-28 15:21   ` Matthieu Moy
2012-03-28 19:14     ` Holger Hellmuth
2012-03-28 19:19       ` Junio C Hamano
2012-03-28 19:52         ` Holger Hellmuth
2012-03-29  6:08           ` Jeff King
2012-03-29 10:19             ` Holger Hellmuth
2012-03-28 19:38       ` Matthieu Moy
2012-03-28 19:54         ` Junio C Hamano
2012-03-28 20:10         ` Holger Hellmuth
2012-03-28 20:50           ` Junio C Hamano [this message]
2012-03-28 22:50             ` Holger Hellmuth
2012-03-28 23:01               ` Junio C Hamano
2012-03-28 23:05                 ` Junio C Hamano
2012-03-29  1:32                 ` Holger Hellmuth
2012-03-29  7:26           ` Matthieu Moy
2012-03-29 21:08             ` Junio C Hamano
2012-03-30  8:11               ` Matthieu Moy
2012-03-28 15:33   ` Erik Faye-Lund
2012-03-28 17:17     ` 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=7vvclotpp7.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=hellmuth@ira.uka.de \
    --cc=kusmabite@gmail.com \
    /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).