summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2018-05-04 09:02:10 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2018-05-07 14:56:17 +0200
commit3f56245f179352790620c92be996c165528a4b38 (patch)
treed31bca83da5e3dbe079e2a7ab39ca97f9bde6158
parent89b5b463a10c57190623a5858fec22716ad804fc (diff)
dim: store Link: in MERGE_MSG in apply-pull
This way there's no need for a dim apply-pull-continue, plain old git commit is enough. Aside: We might want to do the same trick for dim apply-branch, but git am is a bit harder to script. v2: Drop cat, use shell redirects to appeas shellcheck. Acked-by: Jani Nikula <jani.nikula@intel.com> Cc: Dave Airlie <airlied@gmail.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rwxr-xr-xdim17
1 files changed, 16 insertions, 1 deletions
diff --git a/dim b/dim
index cecd80eb7161..6b684ba5308c 100755
--- a/dim
+++ b/dim
@@ -519,6 +519,15 @@ function rr_cache_dir
fi
}
+function git_dir
+{
+ if [ -d $PWD/.git ] ; then
+ echo $PWD/.git
+ else
+ cut -d ' ' -f 2 < $PWD/.git
+ fi
+}
+
function pull_rerere_cache
{
cd $DIM_PREFIX/drm-rerere/
@@ -905,7 +914,7 @@ function dim_apply_branch
function dim_apply_pull
{
- local branch file message_id pull_branch rv
+ local branch file message_id pull_branch rv merge_msg_file
branch=${1:?$usage}
file=$(mktemp)
@@ -935,6 +944,12 @@ function dim_apply_pull
if ! $DRY git pull $pull_branch ; then
if ! check_conflicts "$pull_branch" ; then
echoerr "Please resolve and then commit normally using git"
+
+ merge_msg_file="$(git_dir)/MERGE_MSG"
+ if [ -n "$message_id" ]; then
+ echo "Link: https://patchwork.freedesktop.org/patch/msgid/$message_id" >> $merge_msg_file
+ fi
+
return 1
else
git add -u