[PATCH] dim: Allow user to select a different repository browser

Liviu Dudau Liviu.Dudau at arm.com
Fri Jun 22 16:01:48 UTC 2018


On Thu, Jun 21, 2018 at 01:13:09PM -0700, Rodrigo Vivi wrote:
> On Thu, Jun 21, 2018 at 03:37:11PM +0100, Liviu Dudau wrote:
> > gitk is a fine repository browser but it requires a graphical
> > interface that doesn't work very well with remote access.
> > Alternative repository browsers like tig are a good replacement
> > for those cases.
> 
> \o/ yes, please!
> 
> https://lists.freedesktop.org/archives/dim-tools/2018-January/000116.html

Hi Rodrigo,

Sorry, I was not aware of your patch. Why hasn't it been merged?

> 
> > 
> > Signed-off-by: Liviu Dudau <liviu.dudau at arm.com>
> > ---
> >  dim          | 7 +++++--
> >  dim.rst      | 5 +++++
> >  dimrc.sample | 3 +++
> >  3 files changed, 13 insertions(+), 2 deletions(-)
> > 
> > diff --git a/dim b/dim
> > index e477d043458b3..b3c933827f572 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_BROWSER=${DIM_BROWSER:-gitk}
> > +
> >  # make options (not used for C=1)
> >  DIM_MAKE_OPTIONS=${DIM_MAKE_OPTIONS:--j20}
> >  
> > @@ -1795,7 +1798,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 --first-parent drm-intel-next-queued ^$(branch_to_remote drm-next)/drm-next &
> > +	$DIM_BROWSER --first-parent drm-intel-next-queued ^$(branch_to_remote drm-next)/drm-next &
> 
> Does it work directly? with "&" as parameter it will detatch to where?

You're right, I need to do a bit more testing. I usually start a tmux
session on the remote machine and then run all the commands there, but
when I have tested this I only validated that the parameters are
compatible, not that the detaching works.


> 
> My first attempt was to use xterm, them I adapted later to a terminator opening in a new tab,
> but directly I don't think it ever worked.
> 
> my versions here was:
> 
> DIM_GIT_BROWSER="xterm -hold -e tig"
> DIM_GIT_BROWSER="konsole -e tig"

These are still graphical terminal emulators. Were you just trying to
move away from gitk?

Best regards,
Liviu

> DIM_GIT_BROWSER="terminator -l simple -x tig 2>/dev/null"
> 
> >  
> >  	# try to push dinq first in case someone raced
> >  	FORCE=1 dim_push_queued
> > @@ -1896,7 +1899,7 @@ function dim_pull_request
> >  		repo="drm-intel"
> >  	else
> >  		tag=$(tag_name "$branch")
> > -		gitk --first-parent "$branch" ^$upstream &
> > +		$DIM_BROWSER --first-parent "$branch" ^$upstream &
> >  		tag_branch $tag $branch
> >  		$DRY git push $remote $tag
> >  		prep_pull_mail $req_file $tag
> > diff --git a/dim.rst b/dim.rst
> > index a99e40678a2f0..d6149a6e5b069 100644
> > --- a/dim.rst
> > +++ b/dim.rst
> > @@ -444,6 +444,11 @@ 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_BROWSER
> > +-----------
> > +Browser for git repositories. Defaults to **gitk(1)**, but for non-graphical
> > +remote access a suitable replacement can be found in **tig(1)**.
> > +
> >  DIM_MAKE_OPTIONS
> >  ----------------
> >  Additional options to pass to **make(1)**. Defaults to "-j20".
> > diff --git a/dimrc.sample b/dimrc.sample
> > index 1b522fa47e8c2..d2ea5ad245d18 100644
> > --- a/dimrc.sample
> > +++ b/dimrc.sample
> > @@ -14,5 +14,8 @@
> >  # [-s subject] [-i file] [-c cc-addr] to-addr [...]
> >  #DIM_MUA=mutt
> >  
> > +# Git repository browser. gitk (default) and tig are know to work
> > +#DIM_BROWSER=gitk
> > +
> >  # Command to run after dim apply
> >  #DIM_POST_APPLY_ACTION=
> > -- 
> > 2.17.1
> > 
> > _______________________________________________
> > dim-tools mailing list
> > dim-tools at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dim-tools

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯


More information about the dim-tools mailing list