From: Phil Hord <hordp@cisco.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
David Aguilar <davvid@gmail.com>
Subject: rerere affects handling of git-stash-pop merge conflicts
Date: Thu, 14 Jul 2011 13:09:51 -0400 [thread overview]
Message-ID: <4E1F22DF.7060209@cisco.com> (raw)
I was investigating a git-stash-pop anomaly when I ran across this one.
I think this is residual breakage from [1] bb0a484 (mergetool: Skip
autoresolved paths, 2010-08-17). A similar problem aimed at 'git merge'
was ostensibly fixed by [2] 2f59c9 (mergetool: don't skip modify/remove
conflicts, 2011-02-16).
[1] http://thread.gmane.org/gmane.comp.version-control.git/153420
[2] http://thread.gmane.org/gmane.comp.version-control.git/164622
Summary:
After a 'git stash pop' with conflicts, 'git mergetool' fails to notice
the conflicted files if 'rerere.enabled=true'. git mergetool
erroneously reports 'no files need merging'.
After a 'git merge' with conflicts, 'git mergetool' seems to work ok in
either case.
Here's my test script:
------8<------ /tmp/stash.sh
#!/bin/bash
#enable/disable rerere for this test
git config --global rerere.enabled ${1:false}
# run the test
rm -rf foo
mkdir foo && cd foo && git init &&
echo A>file && git add file && git commit --quiet -m "A" &&
echo B>file && git stash &&
echo C>file && git add file && git commit --quiet -m "C" &&
git stash pop
git mergetool
------8<------ /tmp/stash.sh
git --version
git version 1.7.6.178.g55272
# With rerere.enabled=false, it works ok (mergetool offers to
# merge the conflicting file):
./stash.sh false
Initialized empty Git repository in /tmp/foo/.git/
Saved working directory and index state WIP on master: ac67a86 A
HEAD is now at ac67a86 A
Auto-merging file
CONFLICT (content): Merge conflict in file
merge tool candidates: meld opendiff kdiff3 tkdiff xxdiff
tortoisemerge gvimdiff diffuse ecmerge p4merge araxis bc3 vimdiff
emerge
Merging:
file
Normal merge conflict for 'file':
{local}: modified
{remote}: modified
Hit return to start merge resolution tool (xxdiff): ^C
# But with rerere.enabled=true, mergetool thinks there is no conflict:
./stash.sh true
Initialized empty Git repository in /tmp/foo/.git/
Saved working directory and index state WIP on master: d40e77b A
HEAD is now at d40e77b A
Auto-merging file
CONFLICT (content): Merge conflict in file
merge tool candidates: meld opendiff kdiff3 tkdiff xxdiff
tortoisemerge gvimdiff diffuse ecmerge p4merge araxis bc3 vimdiff
emerge
No files need merging
Phil
next reply other threads:[~2011-07-14 17:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 17:09 Phil Hord [this message]
2011-07-15 20:19 ` rerere affects handling of git-stash-pop merge conflicts Phil Hord
2011-07-15 21:05 ` [PATCH/RFC] Add two basic tests for "rerere remaining" Phil Hord
2011-07-16 2:19 ` rerere affects handling of git-stash-pop merge conflicts Martin von Zweigbergk
2011-07-17 21:59 ` Junio C Hamano
2011-07-25 22:31 ` [PATCH] Add two basic tests for "rerere remaining" Phil Hord
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=4E1F22DF.7060209@cisco.com \
--to=hordp@cisco.com \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=martin.von.zweigbergk@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).