Now that we experiment with dim for drm-next it's much more likely
that pull requests have conflicts. But also that dim already knows
about them, in the recent drm-intel-next pull it resolve 7/8
conflicts.

If it solves them all then just go ahead an commit.

Cc: Dave Airlie <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
---
 dim | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/dim b/dim
index 499ffcfdd807..b771f9dc5f0d 100755
--- a/dim
+++ b/dim
@@ -511,9 +511,7 @@ function check_conflicts # tree
                # we need an empty line to make it look pretty
                echoerr ""
                echoerr "FAILURE: Could not merge $1"
-               echoerr "See the section \"Resolving Conflicts when Rebuilding 
drm-tip\""
-               echoerr "in the drm-intel.rst documentation for how to handle 
this situation."
-               exit 1
+               return 1
        fi
        true
 }
@@ -709,7 +707,11 @@ function dim_rebuild_tip
                                echo -n "Applying manual fixup patch for 
$integration_branch merge... "
                                patch -p1 -i $fixup_file
                        fi
-                       check_conflicts "$repo/$branch"
+                       if ! check_conflicts "$repo/$branch" ; then
+                               echoerr "See the section \"Resolving Conflicts 
when Rebuilding drm-tip\""
+                               echoerr "in the drm-intel.rst documentation for 
how to handle this situation."
+                               return 1
+                       fi
                        git add -u
 
                        # because we filter out fast-forward merges there will
@@ -919,7 +921,15 @@ function dim_apply_pull
                checkpatch_commit_push $sha1 0
        done
 
-       $DRY git pull $pull_branch
+       if ! $DRY git pull $pull_branch ; then
+               if ! check_conflicts "$pull_branch" ; then
+                       echoerr "Please resolve and then commit normally using 
git"
+                       return 1
+               else
+                       git add -u
+                       git commit --no-edit --quiet
+               fi
+       fi
 
        message_id=$(message_get_id $file)
 
-- 
2.17.0

_______________________________________________
dim-tools mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dim-tools

Reply via email to