From: Junio C Hamano <gitster@pobox.com>
To: Stephan Beyer <s-beyer@gmx.net>
Cc: Ariel <asgit@dsgml.com>,
git@vger.kernel.org, Duy Nguyen <pclouds@gmail.com>,
Jeff King <peff@peff.net>
Subject: Re: git add -p with unmerged files
Date: Tue, 13 Dec 2016 11:59:25 -0800 [thread overview]
Message-ID: <xmqqwpf31tya.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <98817141-fa57-7687-09c4-dc96419d8a35@gmx.net> (Stephan Beyer's message of "Tue, 13 Dec 2016 20:21:59 +0100")
Stephan Beyer <s-beyer@gmx.net> writes:
> While we're on the topic that "git add -p" should behave like the
> "normal" "git add" (not "git add -u"): what about unmerged changes?
>
>
> When I have merge conflicts, I almost always use my aliases
> "edit-unmerged" and "add-unmerged":
>
> $ git config --global --list | grep unmerged
> alias.list-unmerged=diff --name-only --diff-filter=U
> alias.edit-unmerged=!vim `git list-unmerged`
> alias.add-unmerged=!git add `git list-unmerged`
> alias.reset-unmerged=!uf=`git list-unmerged`; git reset HEAD $uf; git
> checkout -- $uf
>
> The "add-unmerged" alias is always a little scary because I'd rather
> like to check the changes with the "git add -p" workflow I am used to.
>
> Opinions?
For this, you would NEVER want to use "add -p" to pick and choose.
By definition, while you are in conflicted merge, the path that had
conflicts before you started the merge-y operation (be it "pull",
"am -3", or "cherry-pick") did not have any change since HEAD, and
"pick this hunk, drop that hunk" cannot be correct for the conflict
resolution.
"git diff" while conflicted will highlight what conflicted by
showing the three-way diff (similar to "diff --cc" on a merge
result) and after conflict is resolved you can view "diff HEAD"
on the path to see what the merge brought in.
prev parent reply other threads:[~2016-12-13 19:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 1:18 git add -p with new file Ariel
2016-12-07 9:22 ` Duy Nguyen
2016-12-09 18:26 ` Ariel
2016-12-12 20:24 ` Stephan Beyer
2016-12-09 14:11 ` Jeff King
2016-12-09 18:43 ` Ariel
2016-12-10 8:55 ` Jeff King
2016-12-10 22:04 ` Junio C Hamano
2016-12-11 13:00 ` Jeff King
2016-12-12 20:31 ` Stephan Beyer
2016-12-13 17:33 ` Jeff King
2016-12-13 18:48 ` Junio C Hamano
2016-12-13 18:56 ` Jeff King
2016-12-13 19:12 ` Junio C Hamano
2016-12-13 19:21 ` git add -p with unmerged files (was: git add -p with new file) Stephan Beyer
2016-12-13 19:49 ` Jeff King
2016-12-13 19:59 ` Junio C Hamano [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=xmqqwpf31tya.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=asgit@dsgml.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
--cc=s-beyer@gmx.net \
/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.