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

Re: [PATCH v2] difftool: add support for --trust-exit-code

From
Johannes Sixt <j6t@kdbg.org>
Date
Oct 26, 2014, 07:31 UTC
Message-ID
<544CA339.3000401@kdbg.org>
In-Reply-To
<1414287526-80060-1-git-send-email-davvid@gmail.com>
Am 26.10.2014 um 02:38 schrieb David Aguilar:
Show 22 quoted lines
> diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
> index 7ef36b9..fdbd768 100755
> --- a/git-difftool--helper.sh
> +++ b/git-difftool--helper.sh
> @@ -62,6 +62,8 @@ launch_merge_tool () {
>  	else
>  		run_merge_tool "$merge_tool"
>  	fi
> +	status=$?
> +	return $status
>  }
>  
>  if ! use_ext_cmd
> @@ -85,5 +87,10 @@ else
>  	do
>  		launch_merge_tool "$1" "$2" "$5"
>  		shift 7
> +		if test "$status" != 0 &&
> +			test "$GIT_DIFFTOOL_TRUST_EXIT_CODE" = true
> +		then
> +			exit $status
> +		fi

If you insert this new code block before the 'shift 7', you can set status here and do not have to hide it in the helper function.

>  	done
>  fi
-- Hannes
Previous: David Aguilar
Message 4 of 4 in “Quit git difftool on error code”
  1. Adri FarrOct 25, 2014
  2. difftool: add support for --trust-exit-codeDavid Aguilar, Oct 26, 2014
  3. difftool: add support for --trust-exit-codeDavid Aguilar, Oct 26, 2014
  4. Johannes SixtOct 26, 2014

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.