-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imerge sometimes reports a conflict, leaving unmerged files with zero conflicts #161
Comments
If you could reproduce this problem in the form of a failing unit test, that would be a helpful step towards solving it. |
Yeah, I'll try to find it. I actually think this is something that happens
with Git even with no imerge involved.
…On Tue, Sep 22, 2020 at 5:11 AM Michael Haggerty ***@***.***> wrote:
If you could reproduce this problem in the form of a failing unit test,
that would be a helpful step towards solving it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#161 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKYIPOHXSURGOQX5YGVJTSHCIARANCNFSM4RD2OIQA>
.
--
-Dave
|
@dabrahams Are you aware of |
This is a possibility for merges done outside of |
Also, I pretty much always keep rerere disabled, because I often have to go back over a complicated merge and rerere just perpetuates my mistakes. |
The same for me even multiple times for that specific merge, number 4 or 5 then has a real conflict. Unfortunately the commits are too big and too proprietary to give out. But I can show you some anonymized… Output> git imerge rebase master
Attempting automerge of 6-7...failure.
Attempting automerge of 1-1...success.
Attempting automerge of 1-5...failure.
Attempting automerge of 1-3...failure.
Attempting automerge of 1-2...failure.
Attempting automerge of 6-1...success.
Autofilling 1-1...success.
Autofilling 2-1...success.
Autofilling 3-1...success.
Autofilling 4-1...success.
Autofilling 5-1...success.
Autofilling 6-1...success.
Recording autofilled block MergeState('gerrit-topic', tip1='master', tip2='gerrit-topic', goal='rebase')[0:7,0:2].
Attempting automerge of 6-7...failure.
Attempting automerge of 1-2...failure.
Switched to branch 'imerge/gerrit-topic'
Auto-merging path/to/some/file.py
Auto-merging path/to/another/file.py
CONFLICT (content): Merge conflict in path/to/conflict.py
Removing setup.py
Removing setup.cfg
Removing requirements.txt
Staged 'path/to/conflict.py' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
Original first commit:
commit 31d79731505113fc03c73601a660d30bc94ddb37 (refs/imerge/gerrit-topic/manual/1-0)
Author: Me <[email protected]>
Date: Mon Aug 23 16:01:59 2021 +0200
some commit message
Original second commit:
commit 5471e7539dbef11ce7eb854f98847d1e586266a3 (refs/imerge/gerrit-topic/manual/0-2)
Author: Me <[email protected]>
Date: Mon Jun 21 10:19:31 2021 +0200
another commit message
There was a conflict merging commit 1-2, shown above.
Please resolve the conflict, commit the result, then type
git-imerge continue
> git status
On branch imerge/gerrit-topic
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Changes to be committed:
modified: .gitignore
new file: .python-version
new file: .readthedocs.yaml
modified: Jenkinsfile
new file: scripts/build_docs.sh
deleted: setup.cfg
deleted: setup.py
modified: path/to/some/file.py
modified: path/to/another/file.py
modified: path/to/conflict.py
Config> git --version
git version 2.25.1
> git config --get rerere.enabled
true
> git config --get rerere.autoupdate
true |
☝️ I believe that this message comes from rerere.
You could test this theory by trying the same merge, with and without the following diff applied to diff --git a/gitimerge.py b/gitimerge.py
index 90997ba..f481800 100644
--- a/gitimerge.py
+++ b/gitimerge.py
@@ -653,7 +653,7 @@ class GitRepository(object):
worktree."""
call_silently(['git', 'checkout', '-f', commit1])
- cmd = ['git', '-c', 'rerere.enabled=false', 'merge']
+ cmd = ['git', '-c', 'rerere.enabled=false', '-c', 'rerere.autoupdate=false', 'merge']
if msg is not None:
cmd += ['-m', msg]
cmd += [commit2] If it succeeds with this patch but fails without it, then we should merge that patch in. But when testing, please remember that Thanks! |
Sorry for the late reply, I was on vacation. Just to see if I applied to the correct change: > which git-imerge
/home/linuxbrew/.linuxbrew/bin/git-imerge
> readlink -f /home/linuxbrew/.linuxbrew/bin/git-imerge
/home/linuxbrew/.linuxbrew/Cellar/git-imerge/1.2.0/libexec/bin/git-imerge
> find /home/linuxbrew/.linuxbrew/Cellar/git-imerge/1.2.0 -name gitimerge.py
/home/linuxbrew/.linuxbrew/Cellar/git-imerge/1.2.0/libexec/lib/python3.9/site-packages/gitimerge.py So that's what I edited. Added the second > git imerge rebase master
Attempting automerge of 6-7...failure.
Attempting automerge of 1-1...success.
Attempting automerge of 1-5...failure.
Attempting automerge of 1-3...failure.
Attempting automerge of 1-2...failure.
Attempting automerge of 6-1...success.
Autofilling 1-1...success.
Autofilling 2-1...success.
Autofilling 3-1...success.
Autofilling 4-1...success.
Autofilling 5-1...success.
Autofilling 6-1...success.
Recording autofilled block MergeState('gerrit-topic', tip1='master', tip2='gerrit-topic', goal='rebase')[0:7,0:2].
Attempting automerge of 6-7...failure.
Attempting automerge of 1-2...failure.
Switched to branch 'imerge/gerrit-topic'
Auto-merging path/to/some/file.py
Auto-merging path/to/another/file.py
CONFLICT (content): Merge conflict in path/to/conflict.py
Removing setup.py
Removing setup.cfg
Removing requirements.txt
Staged 'path/to/conflict.py' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
Original first commit:
…
Original second commit:
…
There was a conflict merging commit 1-2, shown above.
Please resolve the conflict, commit the result, then type
git-imerge continue So it seems pretty much the same to me. Maybe it's because |
After I deleted everything that > rm -rf .git/rr-cache
> git imerge rebase master
Attempting automerge of 6-7...failure.
Attempting automerge of 1-1...success.
Attempting automerge of 1-5...failure.
Attempting automerge of 1-3...failure.
Attempting automerge of 1-2...failure.
Attempting automerge of 6-1...success.
Autofilling 1-1...success.
Autofilling 2-1...success.
Autofilling 3-1...success.
Autofilling 4-1...success.
Autofilling 5-1...success.
Autofilling 6-1...success.
Recording autofilled block MergeState('gerrit-topic', tip1='master', tip2='gerrit-topic', goal='rebase')[0:7,0:2].
Attempting automerge of 6-7...failure.
Attempting automerge of 1-2...failure.
Switched to branch 'imerge/gerrit-topic'
Auto-merging path/to/some/file.py
Auto-merging path/to/conflict.py
CONFLICT (content): Merge conflict in path/to/conflict.py
Removing setup.py
Removing setup.cfg
Removing requirements.txt
Recorded preimage for 'path/to/conflict.py'
Automatic merge failed; fix conflicts and then commit the result.
Original first commit:
…
Original second commit:
…
There was a conflict merging commit 1-2, shown above.
Please resolve the conflict, commit the result, then type
git-imerge continue It tells me there's a conflict in one file and Note the line |
I find at least one other def manualmerge(self, commit, msg):
"""Initiate a merge of commit into the current HEAD.""" Maybe extract a git-calling function that simply always passes the Another idea I had: Before starting rename the current Maybe it's a workaround, but if |
Just wanna share that I was encountering this in a repository with git hooks controlled by |
The unmerged files have changes in them that just need to be staged, but no conflict markers
It's not terrible, but it's confusing, and it wastes time and energy in a process that is already, often, laborious… which is the whole reason we need git imerge!
The text was updated successfully, but these errors were encountered: