git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] bash completion: Add completion for 'git mergetool'

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 15, 2008, 00:05 UTC
Message-ID
<20080815000541.GE3782@spearce.org>
In-Reply-To
<1218753671-58099-2-git-send-email-lee.marlow@gmail.com>
Lee Marlow <lee.marlow@gmail.com> wrote:
Show 5 quoted lines
> 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.

Show 38 quoted lines
> 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.
Previous: Lee MarlowNext: Junio C Hamano
Message 4 of 6 in “Helpful completions for merging”
  1. 0/2 Helpful completions for mergingLee Marlow, Aug 14, 2008
  2. 1/2 bash completion: Add completion for 'git mergetool'Lee Marlow, Aug 14, 2008
  3. 2/2 bash completion: Add '--merge' long option for 'git log'Lee Marlow, Aug 14, 2008
  4. Shawn O. PearceAug 15, 2008
  5. Junio C HamanoAug 15, 2008
  6. Shawn O. PearceAug 15, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.