Re: [PATCH v2 2/5] Use variables for the lists of tools that support merging / diffing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 23, 2012, 16:46 UTC
- Message-ID
- <7vvchemnmn.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <500CFAB4.4050905@gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 19 quoted lines
> Also, add a few comments that clarify the meaning of these variables. > > Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> > --- > contrib/completion/git-completion.bash | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index f2c4894..6b9b79d 100755 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -1325,17 +1325,24 @@ _git_diff () > __git_complete_revlist_file > } > > +# Tools that support both merging and diffing. > __git_mergetools_common="araxis bc3 diffuse ecmerge emerge gvimdiff > kdiff3 meld opendiff p4merge tkdiff vimdiff xxdiff > "
As the set of merge capable tools is not a superset of diff capable tools (tortoise can only merge but not diff), perhaps rename this to __git_diffmerge_tools or something?
Show 6 quoted lines
> +# Tools that support diffing. > +__git_difftools="$__git_mergetools_common kcompare" > + > +# Tools that support merging. > +__git_mergetools="$__git_mergetools_common tortoisemerge" > +
This patch makes sense to me, but at the same time makes [PATCH 1/5] a "Meh", methinks.
Show 20 quoted lines
> _git_difftool ()
> {
> __git_has_doubledash && return
>
> case "$cur" in
> --tool=*)
> - __gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}"
> + __gitcomp "$__git_difftools" "" "${cur##--tool=}"
> return
> ;;
> --*)
> @@ -1623,7 +1630,7 @@ _git_mergetool ()
> {
> case "$cur" in
> --tool=*)
> - __gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}"
> + __gitcomp "$__git_mergetools" "" "${cur##--tool=}"
> return
> ;;
> --*)