<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/git-mergetool--lib.sh, branch v2.26.0-rc2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.26.0-rc2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.26.0-rc2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2019-05-19T07:45:30Z</updated>
<entry>
<title>Merge branch 'dl/difftool-mergetool'</title>
<updated>2019-05-19T07:45:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-05-19T07:45:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=85ac27e04fd0cf1d086028e87f69ffb498c1451b'/>
<id>urn:sha1:85ac27e04fd0cf1d086028e87f69ffb498c1451b</id>
<content type='text'>
Update "git difftool" and "git mergetool" so that the combinations
of {diff,merge}.{tool,guitool} configuration variables serve as
fallback settings of each other in a sensible order.

* dl/difftool-mergetool:
  difftool: fallback on merge.guitool
  difftool: make --gui, --tool and --extcmd mutually exclusive
  mergetool: fallback to tool when guitool unavailable
  mergetool--lib: create gui_mode function
  mergetool: use get_merge_tool function
  t7610: add mergetool --gui tests
  t7610: unsuppress output
</content>
</entry>
<entry>
<title>mergetool: fallback to tool when guitool unavailable</title>
<updated>2019-05-13T14:11:59Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-04-29T06:21:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=60aced3dfa68df60952fed28c4ae63a5bbda0275'/>
<id>urn:sha1:60aced3dfa68df60952fed28c4ae63a5bbda0275</id>
<content type='text'>
In git-difftool, if the tool is called with --gui but `diff.guitool` is
not set, it falls back to `diff.tool`. Make git-mergetool also fallback
from `merge.guitool` to `merge.tool` if the former is undefined.

If git-difftool, when called with `--gui`, were to use
`get_configured_mergetool` in a future patch, it would also get the
fallback behavior in the following precedence:

1. diff.guitool
2. merge.guitool
3. diff.tool
4. merge.tool

The behavior for when difftool or mergetool are called without `--gui`
should be identical with or without this patch.

Note that the search loop could be written as

	sections="merge"
	keys="tool"
	if diff_mode
	then
		sections="diff $sections"
	fi
	if gui_mode
	then
		keys="guitool $keys"
	fi

	merge_tool=$(
		IFS=' '
		for key in $keys
		do
			for section in $sections
			do
				selected=$(git config $section.$key)
				if test -n "$selected"
				then
					echo "$selected"
					return
				fi
			done
		done)

which would make adding a mode in the future much easier. However,
adding a new mode will likely never happen as it is highly discouraged
so, as a result, it is written in its current form so that it is more
readable for future readers.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool--lib: create gui_mode function</title>
<updated>2019-05-13T14:11:59Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-04-29T06:21:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=884630b2e2634969656faabc7f4e33cab2e32b35'/>
<id>urn:sha1:884630b2e2634969656faabc7f4e33cab2e32b35</id>
<content type='text'>
Before, in `get_configured_merge_tool`, we would test the value of the
first argument directly, which corresponded to whether we were using
guitool. However, since `$GIT_MERGETOOL_GUI` is available as an
environment variable, create the `gui_mode` function which increases the
clarify of functions which use it.

While we're at it, add a space before `()` in function definitions to
fix the style.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: use get_merge_tool function</title>
<updated>2019-05-13T14:11:59Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-04-29T06:21:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=05fb8726cccc74908853c166248ff9b6abdafae5'/>
<id>urn:sha1:05fb8726cccc74908853c166248ff9b6abdafae5</id>
<content type='text'>
In git-mergetool, the logic for getting which merge tool to use is
duplicated in git-mergetool--lib, except for the fact that it needs to
know whether the tool was guessed or not.

Rewrite `get_merge_tool` to return whether or not the tool was guessed
through the return code and make git-mergetool call this function
instead of duplicating the logic. Note that 1 was chosen to be the
return code of when a tool is guessed because it seems like a slightly
more abnormal condition than getting a tool that's explicitly specified
but this is completely arbitrary.

Also, let `$GIT_MERGETOOL_GUI` be set to determine whether or not the
guitool will be selected.

This change is not completely backwards compatible as there may be
external users of git-mergetool--lib. However, only one user,
git-diffall[1], was found from searching GitHub and Google, and this
tool is superseded by `git difftool --dir-diff` anyway. It seems very
unlikely that there exists an external caller that would take into
account the return code of `get_merge_tool` as it would always return 0
before this change so this change probably does not affect any external
users.

[1]: https://github.com/thenigan/git-diffall

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: add support for smerge (Sublime Merge)</title>
<updated>2019-04-04T09:21:25Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2019-04-04T07:34:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=eb12adc74cf22add318f884072be2071d181abaa'/>
<id>urn:sha1:eb12adc74cf22add318f884072be2071d181abaa</id>
<content type='text'>
Teach difftool and mergetool about the Sublime Merge "smerge" command.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: accept -g/--[no-]gui as arguments</title>
<updated>2018-10-25T05:01:10Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2018-10-24T16:25:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=063f2bdbf767dd24bc0a35b5476d8025ee8646c7'/>
<id>urn:sha1:063f2bdbf767dd24bc0a35b5476d8025ee8646c7</id>
<content type='text'>
In line with how difftool accepts a -g/--[no-]gui option, make mergetool
accept the same option in order to use the `merge.guitool` variable to
find the default mergetool instead of `merge.tool`.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Anmol Mago &lt;anmolmago@gmail.com&gt;
Signed-off-by: Brian Ho &lt;briankyho@gmail.com&gt;
Signed-off-by: David Lu &lt;david.lu97@outlook.com&gt;
Signed-off-by: Ryan Wang &lt;shirui.wang@hotmail.com&gt;
Acked-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: honor mergetool.$tool.trustExitCode for built-in tools</title>
<updated>2016-11-29T18:54:03Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-11-29T09:38:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7c10605d2ccf499af6136e993cf248892be39168'/>
<id>urn:sha1:7c10605d2ccf499af6136e993cf248892be39168</id>
<content type='text'>
Built-in merge tools contain a hard-coded assumption about
whether or not a tool's exit code can be trusted to determine
the success or failure of a merge.  Tools whose exit codes are
not trusted contain calls to check_unchanged() in their
merge_cmd() functions.

A problem with this is that the trustExitCode configuration is
not honored for built-in tools.

Teach built-in tools to honor the trustExitCode configuration.
Extend run_merge_cmd() so that it is responsible for calling
check_unchanged() when a tool's exit code cannot be trusted.
Remove check_unchanged() calls from scriptlets since they are no
longer responsible for calling it.

When no configuration is present, exit_code_trustable() is
checked to see whether the exit code should be trusted.
The default implementation returns false.

Tools whose exit codes can be trusted override
exit_code_trustable() to true.

Reported-by: Dun Peal &lt;dunpealer@gmail.com&gt;
Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nf/mergetool-prompt'</title>
<updated>2016-05-03T21:08:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-05-03T21:08:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b97414352746967c72e5b87cce39efea4b93e2bf'/>
<id>urn:sha1:b97414352746967c72e5b87cce39efea4b93e2bf</id>
<content type='text'>
UI consistency improvements.

* nf/mergetool-prompt:
  difftool/mergetool: make the form of yes/no questions consistent
</content>
</entry>
<entry>
<title>difftool/mergetool: make the form of yes/no questions consistent</title>
<updated>2016-04-25T22:15:17Z</updated>
<author>
<name>Nikola Forró</name>
<email>nforro@redhat.com</email>
</author>
<published>2016-04-12T14:44:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=cce076e37107217faa942dddc20e79ae7350bc1f'/>
<id>urn:sha1:cce076e37107217faa942dddc20e79ae7350bc1f</id>
<content type='text'>
Every yes/no question in difftool/mergetool scripts has slightly
different form, and none of them is consistent with the form git
itself uses.

Make the form of all the questions consistent with the form used
by git.

Reviewed-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Nikola Forró &lt;nforro@redhat.com&gt;
Acked-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: create mergetool_find_win32_cmd() helper function for winmerge</title>
<updated>2016-04-04T16:15:00Z</updated>
<author>
<name>Jacob Nisnevich</name>
<email>jacob.nisnevich@gmail.com</email>
</author>
<published>2016-03-25T23:17:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e36d716751d3477694325e1ff2ece33747133a5b'/>
<id>urn:sha1:e36d716751d3477694325e1ff2ece33747133a5b</id>
<content type='text'>
Signed-off-by: Jacob Nisnevich &lt;jacob.nisnevich@gmail.com&gt;
Acked-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
