diff --git a/dim b/dim index 3991312ee31091785198a070d95e99029ae48e78..9500a9df102a4d176f122ef78954913c98081d16 100755 --- a/dim +++ b/dim @@ -500,6 +500,11 @@ function dim_rebuild_tip echo $fixup_file > .fixup_file_path git merge --rerere-autoupdate --no-commit $sha1 >& /dev/null || true + # normalize conflict markers + if git grep -l '^>>>>>>> ' &> /dev/null ; then + git grep -l '^>>>>>>> ' | xargs sed -e "s/^>>>>>>> .*$/>>>>>>> $repo\/$branch/" -i + fi + if [ -f $fixup_file ] ; then echo -n "Applying manual fixup patch for $integration_branch merge... " patch -p1 -i $fixup_file diff --git a/drm-intel.rst b/drm-intel.rst index 79db1cf64bcb5df143ed0418166b96b1470ba22d..9be1f086e9253cf90019db7304f67cd47f565eb2 100644 --- a/drm-intel.rst +++ b/drm-intel.rst @@ -276,6 +276,39 @@ when it's tricky or something fails in the below procedure. And if any step fails or the conflict is tricky just ping maintainers. +If the Conflict Reappears +------------------------- + +In some odd cases git rerere fails to recognize the conflict, and doesn't store +conflict resolution. This needs to be handled with a manual fixup patch, and the +best way to go about this is: + +1. Try to resolve the conflict normally, but then running :: + + $ dim rebuild-tip + + fails. First, store the current state, including the conflict markers and + with no other changes applied:: + + $ cd $DIM_PREFIX/drm-tip + $ git add -u + $ git commmit + +2. Resolve the conflict normally, but don't stage it or commit it in any + fashion. Check that the resolution looks correct and removes all the conflict + markers you've just committed:: + + $ git diff + + Then store it as a manual fixup patch:: + + $ git diff | dim cat-to-fixup + + And finally rebuild the integration tree, which should now go through + smoothly, at least for this merge:: + + $ dim rebuild-tip + Merge Timeline ==============