git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git rerere is confused with identical conflicts in multiple files
@ 2015-07-10  8:04 Markos Chandras
  2015-07-10 14:13 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Markos Chandras @ 2015-07-10  8:04 UTC (permalink / raw)
  To: git

Hi,

(Please keep me on CC as I am not subscribed to the list)

I am having a weird problem when merging a branch which causes some
conflicts

This is the initial status for the rerere cache

$ tree .git/rr-cache
.git/rr-cache [error opening dir]

0 directories, 0 files


I then go ahead and merge the said branch and I end up with the
following conflicts

Auto-merging arch/mips/mm/sc-mips.c
Auto-merging arch/mips/mm/c-r4k.c
CONFLICT (content): Merge conflict in arch/mips/mm/c-r4k.c
Auto-merging arch/mips/kernel/traps.c
CONFLICT (content): Merge conflict in arch/mips/kernel/traps.c
Auto-merging arch/mips/kernel/spram.c
CONFLICT (content): Merge conflict in arch/mips/kernel/spram.c
Auto-merging arch/mips/kernel/idle.c
CONFLICT (content): Merge conflict in arch/mips/kernel/idle.c
Auto-merging arch/mips/kernel/cpu-probe.c
Auto-merging arch/mips/include/asm/mipsregs.h
Auto-merging arch/mips/include/asm/cpu.h
CONFLICT (content): Merge conflict in arch/mips/include/asm/cpu.h
Auto-merging arch/mips/include/asm/cpu-type.h
CONFLICT (content): Merge conflict in arch/mips/include/asm/cpu-type.h
Recorded preimage for 'arch/mips/include/asm/cpu-type.h'
Recorded preimage for 'arch/mips/include/asm/cpu.h'
Automatic merge failed; fix conflicts and then commit the result.

As you see, git only records two preimage files instead of 6.

the rr-cache is like this now

$ tree .git/rr-cache
.git/rr-cache
├── 5563edc0fb427275a0ca5677c93c40def8b53258
│   └── preimage
└── f175ff6228f624296b661664bce4ab4e84d712cc
    └── preimage

2 directories, 2 files

and .git/MERGE_RR

$ cat .git/MERGE_RR
5563edc0fb427275a0ca5677c93c40def8b53258
arch/mips/include/asm/cpu-type.hf175ff6228f624296b661664bce4ab4e84d712cc

arch/mips/include/asm/cpu.h5563edc0fb427275a0ca5677c93c40def8b53258
   arch/mips/kernel/idle.c5563edc0fb427275a0ca5677c93c40def8b53258
arch/mips/kernel/spram.c5563edc0fb427275a0ca5677c93c40def8b53258
arch/mips/kernel/traps.c5563edc0fb427275a0ca5677c93c40def8b53258
arch/mips/mm/c-r4k.c

so as you see, multiple files share the same hash. That's probably
because the "conflicting context ( the part between >>> <<<<)" in every
file but cpu.h is identical and git seems to calculate the hash purely
on the conflicting context. That makes git rerere thinks that it only
has to resolve 2 conflicts instead of 6.

Does anyone have an idea how to resolve that? If my assumption is
correct (I only looked at the git code briefly) I believe it would make
sense to throw the filepath into the sha1 calculation as well in order
to ensure it will not conflict with similar changes across different files.

-- 
markos

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-10 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-10  8:04 git rerere is confused with identical conflicts in multiple files Markos Chandras
2015-07-10 14:13 ` Junio C Hamano
2015-07-10 15:21   ` Markos Chandras

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).