Re: [PATCH v2 4/5] Make sure to use Araxis' "compare" and not e.g. ImageMagick's
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 23, 2012, 16:50 UTC
- Message-ID
- <7vmx2qmnfw.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <500CFB19.6010905@gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 16 quoted lines
> Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
> ---
> mergetools/araxis | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/mergetools/araxis b/mergetools/araxis
> index 64f97c5..aeba1b9 100644
> --- a/mergetools/araxis
> +++ b/mergetools/araxis
> @@ -16,5 +16,11 @@ merge_cmd () {
> }
>
> translate_merge_tool_path() {
> - echo compare
> + # Make sure to use Araxis' "compare" and not e.g. ImageMagick's.
> + if ls "$(dirname "$(which compare)")"/Araxis* >/dev/null 2>&1Use of "which" in scripts that are meant to be portable is a no-no. Some platforms would say "compare is /usr/local/bin/compare" instead of saying "/usr/local/bin/compare".
Show 6 quoted lines
> + then > + echo compare > + else > + echo "$1" > + fi > }