Re: [PATCH 2/2] mergetool: avoid letting `list_tool_variants` break user-defined setups

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

 



"Johannes Schindelin via GitGitGadget" <gitgitgadget@xxxxxxxxx>
writes:

> From: Johannes Schindelin <johannes.schindelin@xxxxxx>
>
> In 83bbf9b92ea8 (mergetool--lib: improve support for vimdiff-style tool
> variants, 2020-07-29), we introduced a `list_tool_variants` function
> in the spirit of Postel's Law: be lenient in what you accept as input.
> In this particular instance, we wanted to allow not only `bc` but also
> `bc3` as name for the Beyond Compare tool.
>
> However, what this patch overlooked is that it is totally allowed for
> users to override the defaults in `mergetools/`. But now that we strip
> off trailing digits, the name that the user gave the tool might not
> actually be in the list produced by `list_tool_variants`.
>
> So let's do the same as for the `diff_cmd` and the `merge_cmd`: override
> it with the trivial version in case a user-defined setup was detected.

Makes sense.  Will queue.  Thanks.

>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
> ---
>  git-mergetool--lib.sh | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
> index 2defef28cd..7225abd811 100644
> --- a/git-mergetool--lib.sh
> +++ b/git-mergetool--lib.sh
> @@ -138,6 +138,10 @@ setup_user_tool () {
>  	merge_cmd () {
>  		( eval $merge_tool_cmd )
>  	}
> +
> +	list_tool_variants () {
> +		echo "$tool"
> +	}
>  }
>  
>  setup_tool () {



[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]

  Powered by Linux