arcyqwerty
arcyqwerty

Reputation: 10685

git rerere manual resolution only

git rerere happily stores my conflict resolutions and automagically applies them when the same conflicts appear again.

However, sometimes, I encounter a merge conflict with a different context that I don't want auto merged.

Is there a way to make git rerere remember conflict resolutions, but require an explicit call to git rerere to apply them?

To be clear, I'm not looking to git rerere clear or git rerere forget, but rather, simply, not automatically resolve merge conflicts unless explicitly directed (bonus if it can show me the proposed resolution before applying!)

Upvotes: 6

Views: 491

Answers (1)

VonC
VonC

Reputation: 1324547

I don't know of a way to not apply rerere for a particular hunk.
You can indeed forget rerere resolution for a file (as discussed here), but not for just a hunk.

You would have to mess directly with .git/rr-cache, as mentioned in this patch:

We record a previously seen conflict and its resolution in a subdirectory of $GIT_DIR/rr-cache, and the name of the subdirectory is computed by hashing the "shape" of the conflicted hunk.
When a similar-looking conflict is encountered later in the working tree, "git rerere" tries to replay the recorded resolution by running a three-way merge to apply the change to go from the previous conflict to the previous resolution to the current conflicted state.

Upvotes: 3

Related Questions