Does PHPStorm support the rerere GIT option?
I was testing to see if the rerere GIT option works, by duplicating this example given here:
https://youtu.be/duqBHik7nRo?list=RD0SJCYPsef54&t=1162
Here's what showed up in the console:
Switched to branch 'master'
16:21:29.967: [IDIG DEV TEST] git -c core.quotepath=false merge Feature
Recorded preimage for 'The files/File 2.txt'
16:22:03.869: [IDIG DEV TEST] git -c core.quotepath=false add --ignore-errors -- "The files/File 2.txt"
16:23:08.903: [IDIG DEV TEST] git -c core.quotepath=false commit --only -F C:\Users\xxxx\AppData\Local\Temp\git-commit-msg-.txt -- "The files/File 2.txt"
fatal: cannot do a partial commit during a merge.
16:23:09.082: [IDIG DEV TEST] git -c core.quotepath=false commit -F C:\Users\xxxx\AppData\Local\Temp\git-commit-msg-.txt --
[master d7ff421] Merge branch 'Feature'
16:24:48.817: [IDIG DEV TEST] git -c core.quotepath=false checkout OtherFeature --
Switched to branch 'OtherFeature'
16:24:56.065: [IDIG DEV TEST] git -c core.quotepath=false merge Feature
Resolved 'The files/File 2.txt' using previous resolution.
According to the last line, it looks like rerere did the job. And in the editor it looked like it did (there's no conflict showing in the file).
But in "LocalChanges" preview, it's showing a conflict and if I try to commit the file, it says there are conflicts.
请先登录再写评论。
Rerere uses previously recorded changes and applies it to the file indeed, so its content gets updated - and you see it in the Editor.
But rerere does not stage the change, thus the file is still considered in conflict by git, you will see it if you run git status. This is actually shown in the video you refer to.
So the file is really still in conflict, and you cannot commit it. You need to mark it resolved. The easiest way is to git add this, e.g. by calling Git - Add from the context menu, then commit.
You could also call Resolve conflicts and select Merge, which will show you a 3-pane diff, but most likely it will show you no conflicting changes. Accepting it will automatically mark it resolved.
Thanks for the reply.
You said:
>> You could also call Resolve conflicts and select Merge, which will show you a 3-pane diff, but most likely it will show you no conflicting changes.
I was prompted with the 3-pane diff, but the problem was that even though the console said conflict resolved, it was not and the 3-pane diff showed conflicts which it should not as they were supposed resolved by rerere. That is why I asked if rerere is supported, as otherwise it seems there's a bug.
Try the exact example in the video linked (starting at the time index the URL will jump to) to reproduce the problem.
Well, you a right. Calling Merge in the IDE is not the option. You need to add the file using Git - Add.
It is not a bug since file really remains in conflict, and git status shows it.
The thing is that Merge dialog in IDE gets contents of files from Merge parents, so it is just my bad for offering this.
You could enable rerere.autoupdate though, this will tell git to execute git add on the automatically resolved files. BTW, with this option enabled you could even call merge from IDE, and rerere would work. Without this option enabled, merging from IDE will still show you Resolve conflicts dialog.