[PATCH] dim: Use your favorite git browser.

Martin Peres martin.peres at free.fr
Thu Jan 4 21:43:39 UTC 2018


On 04/01/18 23:37, Rodrigo Vivi wrote:
> By having to constantly monitor dinq and navigate on the patches
> I found a terminal solution that is very nifty and convenient: tig.
> 
> The big advantage from tig is that it runs on terminal.
> 
> Big disadvantage of gitk is that it has no ctrl+ to make fonts
> bigger like terminals.
> 
> Gitk is still the default.
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
>  dim          | 7 +++++--
>  dim.rst      | 6 ++++++
>  dimrc.sample | 7 +++++++
>  3 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/dim b/dim
> index 097a1602cfbb..02d787f8096d 100755
> --- a/dim
> +++ b/dim
> @@ -52,6 +52,9 @@ DIM_REPO=${DIM_REPO:-${DIM_DRM_INTEL:-src}}
>  # usage: $DIM_MUA [-s subject] [-i file] [-c cc-addr] to-addr [...]
>  DIM_MUA=${DIM_MUA:-mutt}
>  
> +# Git repository browser.
> +DIM_GIT_BROWSER=${DIM_GIT_BROSER:-gitk}

Typo in DIM_GIT_BROSER :)

> +
>  # make options (not used for C=1)
>  DIM_MAKE_OPTIONS=${DIM_MAKE_OPTIONS:--j20}
>  
> @@ -1625,7 +1628,7 @@ function dim_update_next
>  	$DRY git add drivers/gpu/drm/i915/i915_drv.h
>  	git commit $DRY_RUN -sm "drm/i915: Update DRIVER_DATE to $driver_date"
>  
> -	gitk drm-intel-next-queued ^$(repo_to_remote drm-upstream)/drm-next &
> +	$DIM_GIT_BROWSER drm-intel-next-queued ^$(repo_to_remote drm-upstream)/drm-next &
>  
>  	# try to push dinq first in case someone raced
>  	FORCE=1 dim_push_queued
> @@ -1764,7 +1767,7 @@ function dim_pull_request
>  		while git tag -l $tag | grep -q $tag ; do
>  			tag="$branch-$dim_today-$((++suffix))"
>  		done
> -		gitk "$branch@{upstream}" ^$upstream &
> +		$DIM_GIT_BROWSER "$branch@{upstream}" ^$upstream &

Can we safely assume that all the git browsers have the same arguments?
I guess we'll revisit that if someone has a compelling option that does
not work :)

>  		tag_branch $tag $branch
>  		$DRY git push $remote $tag
>  		prep_pull_mail $req_file $tag
> diff --git a/dim.rst b/dim.rst
> index 6f64d5cad364..915317e0c24d 100644
> --- a/dim.rst
> +++ b/dim.rst
> @@ -490,6 +490,12 @@ DIM_MUA
>  Mail user agent. Must support the following subset of **mutt(1)** command line
>  options: \$DIM_MUA [-s subject] [-i file] [-c cc-addr] to-addr [...]
>  
> +DIM_GIT_BROWSER
> +---------------
> +Git repository browser.
> +Must support revision range in the same way that gitk.
> +Must run detached.
> +
>  DIM_MAKE_OPTIONS
>  ----------------
>  Additional options to pass to **make(1)**. Defaults to "-j20".
> diff --git a/dimrc.sample b/dimrc.sample
> index 1b522fa47e8c..dcefeee448f0 100644
> --- a/dimrc.sample
> +++ b/dimrc.sample
> @@ -14,5 +14,12 @@
>  # [-s subject] [-i file] [-c cc-addr] to-addr [...]
>  #DIM_MUA=mutt
>  
> +# Git repository browser.
> +# Must support revision range in the same way that gitk.
> +# Must run detached.

Good that you documented it :)

> +# Examples:
> +#DIM_GIT_BROWSER="xterm -hold -e tig"
> +#DIM_GIT_BROWSER="konsole -e tig"
> +
>  # Command to run after dim apply
>  #DIM_POST_APPLY_ACTION=
> 

Acked-by: Martin Peres <martin.peres at free.fr>


More information about the dim-tools mailing list