gitgit-rerere

Git rerere and resolution covering non-conflicting files


I experienced the following situation:

I ran into a conflict during a merge with git rerere enabled.

I fixed the conflicting file, but other non-conflicting files had to be adjusted, too.
All touched files were added and committed. git rerere stated that it has recorded the resolution.

A later git pull --rebase=preserve repeated the merge conflicts and git rerere came to the rescue.
However, only the part of the resolution in the conflicting files was applied, the changes in the other files were not.
A quick glance in the rr-cache indicates that those other changes have not been recorded.

Is git rerere only recording changes in the directly conflicting files and nothing else?

Is there an option to record all changes done in the resolving commit, not only the conflicting file?


Solution

  • Is git rerere only recording changes in the directly conflicting files and nothing else?

    Yes. Well, almost—it's slightly more complicated.

    Is there an option to record all changes done in the resolving commit, not only the conflicting file?

    No, and this is where the "slightly more complicated" part comes in. The rerere code doesn't record all the changes and resolutions; it only records the conflicting changes and their corresponding resolutions. The non-conflicting bits are not saved at all.

    (Note, by the way, that git rebase --preserve actually re-creates the merges, i.e., does new git merge commands, as I think you've already observed. Invoking it from git pull has no effect on this part of the process.)