{"thread":{"id":"44249","subject":"[PATCH v4 4/4] mergetool: honor -O<orderfile>","startedAt":"2016-10-08T00:01:38Z","lastAt":"2016-10-11T17:05:14Z","messageCount":5,"participants":["David Aguilar","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":4,"patchTotal":4},"messages":[{"id":"303623","messageId":"20161008000130.22858-1-davvid@gmail.com","threadId":"44249","inReplyTo":null,"subject":"[PATCH v4 4/4] mergetool: honor -O<orderfile>","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-10-08T00:01:30Z","receivedAt":"2016-10-08T00:01:38Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Teach mergetool to pass \"-O<orderfile>\" down to `git diff` when\nspecified on the command-line.\n\nHelped-by: Johannes Sixt <j6t@kdbg.org>\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nSince v3:\n\nI missed one last piped invocation of \"git mergetool\" in the tests,\nwhich has been fixed.\n\n Documentation/git-mergetool.txt | 10 ++++++----\n git-mergetool.sh                |  9 +++++++--\n t/t7610-mergetool.sh            | 27 +++++++++++++++++++++++++++\n 3 files changed, 40 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex c4c1a9b..3622d66 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -79,10 +79,12 @@ success of the resolution after the custom tool has exited.\n \tPrompt before each invocation of the merge resolution program\n \tto give the user a chance to skip the path.\n \n-DIFF ORDER FILES\n-----------------\n-`git mergetool` honors the `diff.orderFile` configuration variable\n-used by `git diff`.  See linkgit:git-config[1] for more details.\n+-O<orderfile>::\n+\tProcess files in the order specified in the\n+\t<orderfile>, which has one shell glob pattern per line.\n+\tThis overrides the `diff.orderFile` configuration variable\n+\t(see linkgit:git-config[1]).  To cancel `diff.orderFile`,\n+\tuse `-O/dev/null`.\n \n TEMPORARY FILES\n ---------------\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 65696d8..e52b4e4 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -9,7 +9,7 @@\n # at the discretion of Junio C Hamano.\n #\n \n-USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [file to merge] ...'\n+USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-O<orderfile>] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n NONGIT_OK=Yes\n OPTIONS_SPEC=\n@@ -390,6 +390,7 @@ print_noop_and_exit () {\n main () {\n \tprompt=$(git config --bool mergetool.prompt)\n \tguessed_merge_tool=false\n+\torderfile=\n \n \twhile test $# != 0\n \tdo\n@@ -419,6 +420,9 @@ main () {\n \t\t--prompt)\n \t\t\tprompt=true\n \t\t\t;;\n+\t\t-O*)\n+\t\t\torderfile=\"$1\"\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -460,7 +464,8 @@ main () {\n \tfi\n \n \tfiles=$(git -c core.quotePath=false \\\n-\t\tdiff --name-only --diff-filter=U -- \"$@\")\n+\t\tdiff --name-only --diff-filter=U \\\n+\t\t${orderfile:+\"$orderfile\"} -- \"$@\")\n \n \tcd_to_toplevel\n \ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 38c1e4d..6d9f215 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -638,5 +638,32 @@ test_expect_success 'diff.orderFile configuration is honored' '\n \ttest_cmp expect actual &&\n \tgit reset --hard >/dev/null\n '\n+test_expect_success 'mergetool -Oorder-file is honored' '\n+\ttest_config diff.orderFile order-file &&\n+\ttest_config mergetool.myecho.cmd \"echo \\\"\\$LOCAL\\\"\" &&\n+\ttest_config mergetool.myecho.trustExitCode true &&\n+\ttest_must_fail git merge order-file-side1 &&\n+\tcat >expect <<-\\EOF &&\n+\t\tMerging:\n+\t\ta\n+\t\tb\n+\tEOF\n+\tgit mergetool -O/dev/null --no-prompt --tool myecho >output &&\n+\tgit grep --no-index -h -A2 Merging: output >actual &&\n+\ttest_cmp expect actual &&\n+\tgit reset --hard >/dev/null 2>&1 &&\n+\n+\tgit config --unset diff.orderFile &&\n+\ttest_must_fail git merge order-file-side1 &&\n+\tcat >expect <<-\\EOF &&\n+\t\tMerging:\n+\t\tb\n+\t\ta\n+\tEOF\n+\tgit mergetool -Oorder-file --no-prompt --tool myecho >output &&\n+\tgit grep --no-index -h -A2 Merging: output >actual &&\n+\ttest_cmp expect actual &&\n+\tgit reset --hard >/dev/null 2>&1\n+'\n \n test_done\n-- \n2.10.1.386.g8ee99a0\n\n"},{"id":"303626","messageId":"a0725074-b82e-06dd-13b8-7730cbebe50c@kdbg.org","threadId":"44249","inReplyTo":"20161008000130.22858-1-davvid@gmail.com","subject":"Re: [PATCH v4 4/4] mergetool: honor -O<orderfile>","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-10-08T07:46:23Z","receivedAt":"2016-10-08T07:46:33Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"With this final fixup, the series looks good to me, and I have no \nfurther comments.\n\nReviewed-by: Johannes Sixt <j6t@kdbg.org>\n\n-- Hannes\n\n"},{"id":"303779","messageId":"xmqqa8ecf48c.fsf@gitster.mtv.corp.google.com","threadId":"44249","inReplyTo":"20161008000130.22858-1-davvid@gmail.com","subject":"Re: [PATCH v4 4/4] mergetool: honor -O<orderfile>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-10T18:28:35Z","receivedAt":"2016-10-10T18:28:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> Teach mergetool to pass \"-O<orderfile>\" down to `git diff` when\n> specified on the command-line.\n>\n> Helped-by: Johannes Sixt <j6t@kdbg.org>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n> Since v3:\n>\n> I missed one last piped invocation of \"git mergetool\" in the tests,\n> which has been fixed.\n\nI only see 4/4 in v4; am I correct to assume that 1-3/4 of v4 are\nthe same as their counterparts in v3?\n"},{"id":"303854","messageId":"20161011050623.GA14278@gmail.com","threadId":"44249","inReplyTo":"xmqqa8ecf48c.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v4 4/4] mergetool: honor -O<orderfile>","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-10-11T05:06:23Z","receivedAt":"2016-10-11T05:06:49Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Mon, Oct 10, 2016 at 11:28:35AM -0700, Junio C Hamano wrote:\n> David Aguilar <davvid@gmail.com> writes:\n> \n> > Teach mergetool to pass \"-O<orderfile>\" down to `git diff` when\n> > specified on the command-line.\n> >\n> > Helped-by: Johannes Sixt <j6t@kdbg.org>\n> > Signed-off-by: David Aguilar <davvid@gmail.com>\n> > ---\n> > Since v3:\n> >\n> > I missed one last piped invocation of \"git mergetool\" in the tests,\n> > which has been fixed.\n> \n> I only see 4/4 in v4; am I correct to assume that 1-3/4 of v4 are\n> the same as their counterparts in v3?\n\nYes, 1-3 are unchanged since v3.\nThanks for checking,\n-- \nDavid\n"},{"id":"303888","messageId":"xmqqr37makak.fsf@gitster.mtv.corp.google.com","threadId":"44249","inReplyTo":"20161011050623.GA14278@gmail.com","subject":"Re: [PATCH v4 4/4] mergetool: honor -O<orderfile>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-11T17:05:07Z","receivedAt":"2016-10-11T17:05:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n>> I only see 4/4 in v4; am I correct to assume that 1-3/4 of v4 are\n>> the same as their counterparts in v3?\n>\n> Yes, 1-3 are unchanged since v3.\n> Thanks for checking,\n\nI'll queue these four with Reviewed-by's from j6t.\n\nThanks, both.\n"}]}