diff mbox

[v2,maintainer-tools] dim: Replace git commit --amend from dim_apply with dimrc option

Message ID 1447669035-6036-1-git-send-email-ander.conselvan.de.oliveira@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ander Conselvan de Oliveira Nov. 16, 2015, 10:17 a.m. UTC
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: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
 dim          | 5 ++++-
 dimrc.sample | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Daniel Vetter Nov. 18, 2015, 3:52 p.m. UTC | #1
On Mon, Nov 16, 2015 at 12:17:15PM +0200, Ander Conselvan de Oliveira wrote:
> 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: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  dim          | 5 ++++-
>  dimrc.sample | 3 +++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/dim b/dim
> index db92c57..78b3f30 100755
> --- a/dim
> +++ b/dim
> @@ -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 [...]
>  DIM_MUA=${DIM_MUA:-mutt}
>  
> +# command to run after dim apply
> +DIM_POST_APPLY_ACTION=${DIM_POST_APPLY_ACTION:-}
> +
>  # greetings pull request template
>  DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
>  
> @@ -383,7 +386,7 @@ function dim_apply
>  		commit_add_tag "Link" "http://patchwork.freedesktop.org/patch/msgid/$message_id"
>  	fi
>  
> -	git commit --amend &
> +	eval $DRY $DIM_POST_APPLY_ACTION
>  }
>  
>  function magic_patch
> diff --git a/dimrc.sample b/dimrc.sample
> index 5687eaf..ad463b4 100644
> --- a/dimrc.sample
> +++ b/dimrc.sample
> @@ -21,3 +21,6 @@
>  # Mail User Agent supporting a subset of mutt(1) command line options:
>  # [-s subject] [-i file] [-c cc-addr] to-addr [...]
>  #DIM_MUA=mutt
> +
> +# Command to run after dim apply
> +#DIM_POST_APPLY_ACTION=
> -- 
> 2.4.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ander Conselvan de Oliveira Nov. 19, 2015, 8:22 a.m. UTC | #2
On Wed, 2015-11-18 at 16:52 +0100, Daniel Vetter wrote:
> On Mon, Nov 16, 2015 at 12:17:15PM +0200, Ander Conselvan de Oliveira wrote:
> > 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: Ander Conselvan de Oliveira <
> > ander.conselvan.de.oliveira@intel.com>
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Thanks. Patch pushed.

Ander

> 
> > ---
> >  dim          | 5 ++++-
> >  dimrc.sample | 3 +++
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/dim b/dim
> > index db92c57..78b3f30 100755
> > --- a/dim
> > +++ b/dim
> > @@ -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 [...]
> >  DIM_MUA=${DIM_MUA:-mutt}
> >  
> > +# command to run after dim apply
> > +DIM_POST_APPLY_ACTION=${DIM_POST_APPLY_ACTION:-}
> > +
> >  # greetings pull request template
> >  DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
> >  
> > @@ -383,7 +386,7 @@ function dim_apply
> >  		commit_add_tag "Link" "
> > http://patchwork.freedesktop.org/patch/msgid/$message_id"
> >  	fi
> >  
> > -	git commit --amend &
> > +	eval $DRY $DIM_POST_APPLY_ACTION
> >  }
> >  
> >  function magic_patch
> > diff --git a/dimrc.sample b/dimrc.sample
> > index 5687eaf..ad463b4 100644
> > --- a/dimrc.sample
> > +++ b/dimrc.sample
> > @@ -21,3 +21,6 @@
> >  # Mail User Agent supporting a subset of mutt(1) command line options:
> >  # [-s subject] [-i file] [-c cc-addr] to-addr [...]
> >  #DIM_MUA=mutt
> > +
> > +# Command to run after dim apply
> > +#DIM_POST_APPLY_ACTION=
> > -- 
> > 2.4.3
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
diff mbox

Patch

diff --git a/dim b/dim
index db92c57..78b3f30 100755
--- a/dim
+++ b/dim
@@ -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 [...]
 DIM_MUA=${DIM_MUA:-mutt}
 
+# command to run after dim apply
+DIM_POST_APPLY_ACTION=${DIM_POST_APPLY_ACTION:-}
+
 # greetings pull request template
 DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
 
@@ -383,7 +386,7 @@  function dim_apply
 		commit_add_tag "Link" "http://patchwork.freedesktop.org/patch/msgid/$message_id"
 	fi
 
-	git commit --amend &
+	eval $DRY $DIM_POST_APPLY_ACTION
 }
 
 function magic_patch
diff --git a/dimrc.sample b/dimrc.sample
index 5687eaf..ad463b4 100644
--- a/dimrc.sample
+++ b/dimrc.sample
@@ -21,3 +21,6 @@ 
 # Mail User Agent supporting a subset of mutt(1) command line options:
 # [-s subject] [-i file] [-c cc-addr] to-addr [...]
 #DIM_MUA=mutt
+
+# Command to run after dim apply
+#DIM_POST_APPLY_ACTION=