Skip to content
Snippets Groups Projects
Commit 7ce600ce authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira
Browse files

dim: Replace git commit --amend from dim_apply with dimrc option


Introduce DIM_POST_APPLY_ACTION to dimrc that allows the user to specify
a command to be run after a patch is applied. Use eval so enviroment
variables can be overriden with the option. For example:

DIM_POST_APPLY_ACTION="EDITOR=\"gedit -w\" git commit --amend"

v2: Initialize variable with default value.
    Fix dimrc.sample to match default value.

Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 85ec47a7
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,9 @@ DIM_DRM_UPSTREAM_REMOTE=${DIM_DRM_UPSTREAM_REMOTE:-airlied} ...@@ -65,6 +65,9 @@ DIM_DRM_UPSTREAM_REMOTE=${DIM_DRM_UPSTREAM_REMOTE:-airlied}
# usage: $DIM_MUA [-s subject] [-i file] [-c cc-addr] to-addr [...] # usage: $DIM_MUA [-s subject] [-i file] [-c cc-addr] to-addr [...]
DIM_MUA=${DIM_MUA:-mutt} DIM_MUA=${DIM_MUA:-mutt}
# command to run after dim apply
DIM_POST_APPLY_ACTION=${DIM_POST_APPLY_ACTION:-}
# greetings pull request template # greetings pull request template
DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello} DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
...@@ -383,7 +386,7 @@ function dim_apply ...@@ -383,7 +386,7 @@ function dim_apply
commit_add_tag "Link" "http://patchwork.freedesktop.org/patch/msgid/$message_id" commit_add_tag "Link" "http://patchwork.freedesktop.org/patch/msgid/$message_id"
fi fi
git commit --amend & eval $DRY $DIM_POST_APPLY_ACTION
} }
function magic_patch function magic_patch
......
...@@ -21,3 +21,6 @@ ...@@ -21,3 +21,6 @@
# Mail User Agent supporting a subset of mutt(1) command line options: # Mail User Agent supporting a subset of mutt(1) command line options:
# [-s subject] [-i file] [-c cc-addr] to-addr [...] # [-s subject] [-i file] [-c cc-addr] to-addr [...]
#DIM_MUA=mutt #DIM_MUA=mutt
# Command to run after dim apply
#DIM_POST_APPLY_ACTION=
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment