<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/git-mergetool.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-06-12T20:20:56Z</updated>
<entry>
<title>mergetool: use shell variable magic instead of `awk`</title>
<updated>2019-06-12T20:20:56Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2019-06-12T16:33:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7e6d6f7610965906d071022615bf64f14c60c0d2'/>
<id>urn:sha1:7e6d6f7610965906d071022615bf64f14c60c0d2</id>
<content type='text'>
git-mergetool spawns an enormous amount of processes. For this reason,
the test script, t7610, is exceptionally slow, in particular, on
Windows. Most of the processes are invocations of git. There are
also some that can be replaced with shell builtins. Avoid repeated
calls of `git ls-files` and `awk`.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: dissect strings with shell variable magic instead of `expr`</title>
<updated>2019-06-12T20:20:56Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2019-06-12T16:33:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=8b014655105e27d44cf62f61dd6b24322a57048f'/>
<id>urn:sha1:8b014655105e27d44cf62f61dd6b24322a57048f</id>
<content type='text'>
git-mergetool spawns an enormous amount of processes. For this reason,
the test script, t7610, is exceptionally slow, in particular, on
Windows. Most of the processes are invocations of git. There are
also some that can be replaced with shell builtins. Do so with `expr`.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&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>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: don't suggest to continue after last file</title>
<updated>2018-08-13T19:11:19Z</updated>
<author>
<name>Nicholas Guriev</name>
<email>guriev-ns@ya.ru</email>
</author>
<published>2018-08-13T05:09:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d651a54b8a22a307f5b061ba50c5348ae31e861c'/>
<id>urn:sha1:d651a54b8a22a307f5b061ba50c5348ae31e861c</id>
<content type='text'>
Eliminate an unnecessary prompt to continue after failed merger, by
not calling the prompt_after_failed_merge function when only one
iteration remains.

Uses positional parameters to count files in the list to make it
easier to see if we have any more paths to process from within the
loop.

Signed-off-by: Nicholas Guriev &lt;guriev-ns@ya.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: fix running in subdir when rerere enabled</title>
<updated>2017-01-10T21:22:51Z</updated>
<author>
<name>Richard Hansen</name>
<email>hansenr@google.com</email>
</author>
<published>2017-01-10T20:42:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d0e0cfe745e0c88ca2f4d4ed9f1d2871b659d872'/>
<id>urn:sha1:d0e0cfe745e0c88ca2f4d4ed9f1d2871b659d872</id>
<content type='text'>
"git mergetool" (without any pathspec on the command line) that is
not run from the top-level of the working tree no longer works in
Git v2.11, failing to get the list of unmerged paths from the output
of "git rerere remaining".  This regression was introduced by
57937f70a0 ("mergetool: honor diff.orderFile", 2016-10-07).

This is because the pathnames output by the 'git rerere remaining'
command are relative to the top-level directory but the 'git diff
--name-only' command expects its pathname arguments to be relative
to the current working directory.  To make everything consistent,
cd_to_toplevel before running 'git diff --name-only' and adjust any
relative pathnames.

Signed-off-by: Richard Hansen &lt;hansenr@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: take the "-O" out of $orderfile</title>
<updated>2017-01-10T21:22:20Z</updated>
<author>
<name>Richard Hansen</name>
<email>hansenr@google.com</email>
</author>
<published>2017-01-10T20:42:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c1b0d3a010eaed0d7683fe0593132f2211467b20'/>
<id>urn:sha1:c1b0d3a010eaed0d7683fe0593132f2211467b20</id>
<content type='text'>
This will make it easier for a future commit to convert a relative
orderfile pathname to either absolute or relative to the top-level
directory.  It also improves code readability.

Signed-off-by: Richard Hansen &lt;hansenr@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: honor -O&lt;orderfile&gt;</title>
<updated>2016-10-11T17:04:31Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-10-08T00:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=654311bf6ee0fbf530c088271c2c76d46f31f82d'/>
<id>urn:sha1:654311bf6ee0fbf530c088271c2c76d46f31f82d</id>
<content type='text'>
Teach mergetool to pass "-O&lt;orderfile&gt;" down to `git diff` when
specified on the command-line.

Helped-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Reviewed-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: honor diff.orderFile</title>
<updated>2016-10-11T17:04:27Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-10-07T23:58:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=57937f70a09c12ef484c290865dac4066d207c9c'/>
<id>urn:sha1:57937f70a09c12ef484c290865dac4066d207c9c</id>
<content type='text'>
Teach mergetool to get the list of files to edit via `diff` so that we
gain support for diff.orderFile.

Suggested-by: Luis Gutierrez &lt;luisgutz@gmail.com&gt;
Helped-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Reviewed-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool: move main program flow into a main() function</title>
<updated>2016-10-11T17:04:23Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-10-07T23:58:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=08221e3fa27396aca30cb539f006f78636782951'/>
<id>urn:sha1:08221e3fa27396aca30cb539f006f78636782951</id>
<content type='text'>
Make it easier to follow the program's flow by isolating all
logic into functions.  Isolate the main execution code path into
a single unit instead of having prompt_after_failed_merge()
interrupt it partyway through.

The use of a main() function is borrowing a convention from C,
Python, Perl, and many other languages.  This helps readers more
familiar with other languages understand the purpose of each
function when diving into the codebase with fresh eyes.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Reviewed-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
