Re: [PATCH] mergetool: Use merge.tool config option.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



James Bowes <jbowes@xxxxxxxxxxxxxxxxxx> writes:

> If no merge program was supplied on the commandline, and the config option
> merge.tool was set to a valid value, then mergetool would unset $merge_tool
> and instead try to find an installed merge program. This patch removes the code
> that unset $merge_tool, so the merge.tool config option will always be used, if
> set.

The problem description looks correct, but I think the original
meant to reject configuration value for merge_tool that is not
supported with the version of the script (and screwed up).

> Signed-off-by: James Bowes <jbowes@xxxxxxxxxxxxxxxxxx>
> ---
>  git-mergetool.sh |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/git-mergetool.sh b/git-mergetool.sh
> index 52386a5..19788a1 100755
> --- a/git-mergetool.sh
> +++ b/git-mergetool.sh
> @@ -288,10 +288,6 @@ done
>  
>  if test -z "$merge_tool"; then
>      merge_tool=`git-config merge.tool`
> -    if test $merge_tool = kdiff3 -o $merge_tool = tkdiff -o \
> -	$merge_tool = xxdiff -o $merge_tool = meld ; then
> -	unset merge_tool
> -    fi
>  fi
>  
>  if test -z "$merge_tool" ; then

IOW, wouldn't this be a better way?

        if test -z "$merge_tool"
        then
                merge_tool=`git-config merge.tool`
                case "$merge_tool" in
                kdiff3 | tkdiff | xxdiff | meld | emerge)
                        ;; # happy
                *)
                        echo >&2 "We do not know how to drive $merge_tool"
                        echo >&2 "Resetting to default..."
                        unset merge_tool
                        ;;
                esac
        fi


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]