All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Lee Marlow <lee.marlow@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] bash completion: Add completion for 'git mergetool'
Date: Thu, 14 Aug 2008 17:05:41 -0700	[thread overview]
Message-ID: <20080815000541.GE3782@spearce.org> (raw)
In-Reply-To: <1218753671-58099-2-git-send-email-lee.marlow@gmail.com>

Lee Marlow <lee.marlow@gmail.com> wrote:
> The --tool= long option can be completed with
> 	kdiff3 tkdiff meld xxdiff emerge
> 	vimdiff gvimdiff ecmerge opendiff
> 
> Signed-off-by: Lee Marlow <lee.marlow@gmail.com>

Acked-by: Shawn O. Pearce <spearce@spearce.org>

... for both patches in this series.  But this is new functionality
so it probably won't be in 1.6.0; its too late in that release cycle.

> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 78189c1..4089670 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1001,6 +1001,25 @@ _git_merge ()
>  	__gitcomp "$(__git_refs)"
>  }
>  
> +_git_mergetool ()
> +{
> +	local cur="${COMP_WORDS[COMP_CWORD]}"
> +	case "$cur" in
> +	--tool=*)
> +		__gitcomp "
> +			kdiff3 tkdiff meld xxdiff emerge
> +			vimdiff gvimdiff ecmerge opendiff
> +			" "" "${cur##--tool=}"
> +		return
> +		;;
> +	--*)
> +		__gitcomp "--tool="
> +		return
> +		;;
> +	esac
> +	COMPREPLY=()
> +}
> +
>  _git_merge_base ()
>  {
>  	__gitcomp "$(__git_refs)"
> @@ -1650,6 +1669,7 @@ _git ()
>  	ls-remote)   _git_ls_remote ;;
>  	ls-tree)     _git_ls_tree ;;
>  	merge)       _git_merge;;
> +	mergetool)   _git_mergetool;;
>  	merge-base)  _git_merge_base ;;
>  	mv)          _git_mv ;;
>  	name-rev)    _git_name_rev ;;

-- 
Shawn.

  parent reply	other threads:[~2008-08-15  0:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14 22:41 [PATCH 0/2] Helpful completions for merging Lee Marlow
2008-08-14 22:41 ` [PATCH 1/2] bash completion: Add completion for 'git mergetool' Lee Marlow
2008-08-14 22:41   ` [PATCH 2/2] bash completion: Add '--merge' long option for 'git log' Lee Marlow
2008-08-15  0:05   ` Shawn O. Pearce [this message]
2008-08-15  0:15     ` [PATCH 1/2] bash completion: Add completion for 'git mergetool' Junio C Hamano
2008-08-15  0:18       ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080815000541.GE3782@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=lee.marlow@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.