{"thread":{"id":"55145","subject":"[PATCH 0/1] mergetools/vimdiff: add vimdiff1 merge tool variant","startedAt":"2021-02-14T02:29:51Z","lastAt":"2021-02-27T02:18:39Z","messageCount":11,"participants":["Seth House","Junio C Hamano","David Aguilar","Philippe Blain"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"416851","messageId":"20210214022840.849312-1-seth@eseth.com","threadId":"55145","inReplyTo":null,"subject":"[PATCH 0/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Seth House","fromEmail":"seth@eseth.com","sentAt":"2021-02-14T02:28:39Z","receivedAt":"2021-02-14T02:29:51Z","isPatch":true,"sender":{"key":"seth@eseth.com","avatar":"https://avatars.githubusercontent.com/u/91293?v=4"},"body":"Add yet another vimdiff layout variant to present the simplest possible\ntwo-way diff when resolving conflicts.\n\nThe name is an attempt at UNIX-style humor -- vimdiff3 opens four\nbuffers and vimdiff2 opens three buffers so vimdiff1 should therefore\nopen two buffers. It also communicates that vimdiff will be used and\nfits cleanly into the existing layout variant naming. That said,\nsuggestions welcome if that isn't as great a fit as I think it is. :)\n\nSeth House (1):\n  mergetools/vimdiff: add vimdiff1 merge tool variant\n\n mergetools/vimdiff | 13 ++++++++++++-\n 1 file changed, 12 insertions(+), 1 deletion(-)\n\n-- \n2.29.2\n\n\n"},{"id":"416852","messageId":"20210214022840.849312-2-seth@eseth.com","threadId":"55145","inReplyTo":"20210214022840.849312-1-seth@eseth.com","subject":"[PATCH 1/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Seth House","fromEmail":"seth@eseth.com","sentAt":"2021-02-14T02:28:40Z","receivedAt":"2021-02-14T02:29:51Z","isPatch":true,"sender":{"key":"seth@eseth.com","avatar":"https://avatars.githubusercontent.com/u/91293?v=4"},"body":"This adds yet another vimdiff/gvimdiff variant and presents conflicts as\na two-way diff between 'LOCAL' and 'REMOTE'. 'MERGED' is not opened\nwhich deviates from the norm so usage text is echoed as a Vim message on\nstartup that instructs the user with how to proceed and how to abort.\n\nVimdiff is well-suited to two-way diffs so this is an option for a more\nsimple, more streamlined conflict resolution. For example: it is\ndifficult to communicate differences across more than two files using\nonly syntax highlighting; default vimdiff commands to get and put\nchanges between buffers do not need the user to manually specify\na source or destination buffer when only using two buffers.\n\nLike other merge tools that directly compare 'LOCAL' with 'REMOTE', this\ntool will benefit when paired with the new `mergetool.hideResolved`\nsetting.\n\nSigned-off-by: Seth House <seth@eseth.com>\n---\n mergetools/vimdiff | 13 ++++++++++++-\n 1 file changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/mergetools/vimdiff b/mergetools/vimdiff\nindex abc8ce4ec4..96f6209a04 100644\n--- a/mergetools/vimdiff\n+++ b/mergetools/vimdiff\n@@ -15,6 +15,17 @@ merge_cmd () {\n \t\t\t\t\"$LOCAL\" \"$MERGED\" \"$REMOTE\"\n \t\tfi\n \t\t;;\n+\t*vimdiff1)\n+\t\t\"$merge_tool_path\" -f -d \\\n+\t\t\t-c 'echon \"Resolve conflicts leftward then save. Use :cq to abort.\"' \\\n+\t\t\t\"$LOCAL\" \"$REMOTE\"\n+\t\tret=\"$?\"\n+\t\tif test \"$ret\" -eq 0\n+\t\tthen\n+\t\t\tcp -- \"$LOCAL\" \"$MERGED\"\n+\t\tfi\n+\t\treturn \"$ret\"\n+\t\t;;\n \t*vimdiff2)\n \t\t\"$merge_tool_path\" -f -d -c 'wincmd l' \\\n \t\t\t\"$LOCAL\" \"$MERGED\" \"$REMOTE\"\n@@ -52,7 +63,7 @@ exit_code_trustable () {\n \n list_tool_variants () {\n \tfor prefix in '' g n; do\n-\t\tfor suffix in '' 2 3; do\n+\t\tfor suffix in '' 1 2 3; do\n \t\t\techo \"${prefix}vimdiff${suffix}\"\n \t\tdone\n \tdone\n-- \n2.29.2\n\n\n"},{"id":"417086","messageId":"xmqqk0r7rh7l.fsf@gitster.c.googlers.com","threadId":"55145","inReplyTo":"20210214022840.849312-2-seth@eseth.com","subject":"Re: [PATCH 1/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-16T18:38:22Z","receivedAt":"2021-02-16T18:39:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Seth House <seth@eseth.com> writes:\n\n> This adds yet another vimdiff/gvimdiff variant and presents conflicts as\n> a two-way diff between 'LOCAL' and 'REMOTE'. 'MERGED' is not opened\n> which deviates from the norm so usage text is echoed as a Vim message on\n> startup that instructs the user with how to proceed and how to abort.\n>\n> Vimdiff is well-suited to two-way diffs so this is an option for a more\n> simple, more streamlined conflict resolution. For example: it is\n> difficult to communicate differences across more than two files using\n> only syntax highlighting; default vimdiff commands to get and put\n> changes between buffers do not need the user to manually specify\n> a source or destination buffer when only using two buffers.\n>\n> Like other merge tools that directly compare 'LOCAL' with 'REMOTE', this\n> tool will benefit when paired with the new `mergetool.hideResolved`\n> setting.\n>\n> Signed-off-by: Seth House <seth@eseth.com>\n> ---\n>  mergetools/vimdiff | 13 ++++++++++++-\n>  1 file changed, 12 insertions(+), 1 deletion(-)\n\nAny vimdiff$n + \"git mergetool\" users care to comment?  Thanks.\n\n> diff --git a/mergetools/vimdiff b/mergetools/vimdiff\n> index abc8ce4ec4..96f6209a04 100644\n> --- a/mergetools/vimdiff\n> +++ b/mergetools/vimdiff\n> @@ -15,6 +15,17 @@ merge_cmd () {\n>  \t\t\t\t\"$LOCAL\" \"$MERGED\" \"$REMOTE\"\n>  \t\tfi\n>  \t\t;;\n> +\t*vimdiff1)\n> +\t\t\"$merge_tool_path\" -f -d \\\n> +\t\t\t-c 'echon \"Resolve conflicts leftward then save. Use :cq to abort.\"' \\\n> +\t\t\t\"$LOCAL\" \"$REMOTE\"\n> +\t\tret=\"$?\"\n> +\t\tif test \"$ret\" -eq 0\n> +\t\tthen\n> +\t\t\tcp -- \"$LOCAL\" \"$MERGED\"\n> +\t\tfi\n> +\t\treturn \"$ret\"\n> +\t\t;;\n>  \t*vimdiff2)\n>  \t\t\"$merge_tool_path\" -f -d -c 'wincmd l' \\\n>  \t\t\t\"$LOCAL\" \"$MERGED\" \"$REMOTE\"\n> @@ -52,7 +63,7 @@ exit_code_trustable () {\n>  \n>  list_tool_variants () {\n>  \tfor prefix in '' g n; do\n> -\t\tfor suffix in '' 2 3; do\n> +\t\tfor suffix in '' 1 2 3; do\n>  \t\t\techo \"${prefix}vimdiff${suffix}\"\n>  \t\tdone\n>  \tdone\n"},{"id":"417580","messageId":"CAJDDKr7ibQH9fJEF2TuZ+S7cRFydX27d7sVvXt5bdfENqba_JA@mail.gmail.com","threadId":"55145","inReplyTo":"xmqqk0r7rh7l.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 1/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2021-02-23T18:55:00Z","receivedAt":"2021-02-23T18:56:29Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Tue, Feb 16, 2021 at 10:42 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Seth House <seth@eseth.com> writes:\n>\n> > This adds yet another vimdiff/gvimdiff variant and presents conflicts as\n> > a two-way diff between 'LOCAL' and 'REMOTE'. 'MERGED' is not opened\n> > which deviates from the norm so usage text is echoed as a Vim message on\n> > startup that instructs the user with how to proceed and how to abort.\n> >\n> > Vimdiff is well-suited to two-way diffs so this is an option for a more\n> > simple, more streamlined conflict resolution. For example: it is\n> > difficult to communicate differences across more than two files using\n> > only syntax highlighting; default vimdiff commands to get and put\n> > changes between buffers do not need the user to manually specify\n> > a source or destination buffer when only using two buffers.\n> >\n> > Like other merge tools that directly compare 'LOCAL' with 'REMOTE', this\n> > tool will benefit when paired with the new `mergetool.hideResolved`\n> > setting.\n> >\n> > Signed-off-by: Seth House <seth@eseth.com>\n> > ---\n> >  mergetools/vimdiff | 13 ++++++++++++-\n> >  1 file changed, 12 insertions(+), 1 deletion(-)\n>\n> Any vimdiff$n + \"git mergetool\" users care to comment?  Thanks.\n\nNicely done, thanks Seth.\n\nLooks good to me.  FWIW,\nTested-by: David Aguilar <davvid@gmail.com>\n\ncheers,\n\n--\nDavid\n"},{"id":"417822","messageId":"YDfJ+1owbwtNToTE@ellen.lan","threadId":"55145","inReplyTo":"CAJDDKr7ibQH9fJEF2TuZ+S7cRFydX27d7sVvXt5bdfENqba_JA@mail.gmail.com","subject":"Re: [PATCH 1/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Seth House","fromEmail":"seth@eseth.com","sentAt":"2021-02-25T16:02:03Z","receivedAt":"2021-02-25T16:15:04Z","isPatch":true,"sender":{"key":"seth@eseth.com","avatar":"https://avatars.githubusercontent.com/u/91293?v=4"},"body":"On Tue, Feb 23, 2021 at 10:55:00AM -0800, David Aguilar wrote:\n> Looks good to me.  FWIW,\n> Tested-by: David Aguilar <davvid@gmail.com>\n\nThank you for testing that, David.\n\n"},{"id":"417834","messageId":"b3467a47-dffd-154f-76f9-e09b8145a5e5@gmail.com","threadId":"55145","inReplyTo":"20210214022840.849312-1-seth@eseth.com","subject":"Re: [PATCH 0/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2021-02-25T18:45:16Z","receivedAt":"2021-02-25T18:46:16Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hi Seth,\n\nLe 2021-02-13 à 21:28, Seth House a écrit :\n> Add yet another vimdiff layout variant to present the simplest possible\n> two-way diff when resolving conflicts.\n> \n> The name is an attempt at UNIX-style humor -- vimdiff3 opens four\n> buffers and vimdiff2 opens three buffers so vimdiff1 should therefore\n> open two buffers. It also communicates that vimdiff will be used and\n> fits cleanly into the existing layout variant naming. That said,\n> suggestions welcome if that isn't as great a fit as I think it is. :)\n\nI like the name :P Slightly orthogonal though, when I first looked\nat the output of 'git mergetool --tool-help', I was sort of confused by\nvimdiff2 and vimdiff3 (and some others) because I looked for them in PATH and (of course)\ncould not find them, still Git was telling me they were available.\n\nI think it would be good to add a short note about these variants somewhere\nin Documentation/git-mergetool.txt. Might be in this patch, or not if you don't\nfeel like it...\n\nGoing further, we could even add a short (few words) description of each tool\nand have that description show up in the output of  'git mergetool --tool-help',\nsomething like this:\n\n$ git mergetool --tool-help\n'git mergetool --tool=<tool>' may be set to one of the following:\n\t\temerge\t\tEmacs (Emerge)\n\t\topendiff\tApple FileMerge\n\t\tvimdiff\t\tVim (??)\n\t\tvimdiff2\tVim (3 panes)\n\t\tvimdiff3\tVim (4 panes)\n\nCheers,\n\nPhilippe.\n"},{"id":"417854","messageId":"YDhBAPbU/T8BldrS@ellen.lan","threadId":"55145","inReplyTo":"b3467a47-dffd-154f-76f9-e09b8145a5e5@gmail.com","subject":"Re: [PATCH 0/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Seth House","fromEmail":"seth@eseth.com","sentAt":"2021-02-26T00:29:52Z","receivedAt":"2021-02-26T00:30:42Z","isPatch":true,"sender":{"key":"seth@eseth.com","avatar":"https://avatars.githubusercontent.com/u/91293?v=4"},"body":"On Thu, Feb 25, 2021 at 01:45:16PM -0500, Philippe Blain wrote:\n> I think it would be good to add a short note about these variants somewhere\n> in Documentation/git-mergetool.txt. Might be in this patch, or not if you don't\n> feel like it...\n> \n> Going further, we could even add a short (few words) description of each tool\n> and have that description show up in the output of  'git mergetool --tool-help',\n> something like this:\n> \n> $ git mergetool --tool-help\n> 'git mergetool --tool=<tool>' may be set to one of the following:\n> \t\temerge\t\tEmacs (Emerge)\n> \t\topendiff\tApple FileMerge\n> \t\tvimdiff\t\tVim (??)\n> \t\tvimdiff2\tVim (3 panes)\n> \t\tvimdiff3\tVim (4 panes)\n\nGreat suggestions, thanks. A little explanation would be very helpful --\nI've been confused by those variants too and wondered why I might want\nto use one over another.\n\nI'll roll those into this patch.\n\n"},{"id":"417867","messageId":"xmqqh7lzshx6.fsf@gitster.g","threadId":"55145","inReplyTo":"YDhBAPbU/T8BldrS@ellen.lan","subject":"Re: [PATCH 0/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-26T02:04:53Z","receivedAt":"2021-02-26T02:06:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Seth House <seth@eseth.com> writes:\n\n> On Thu, Feb 25, 2021 at 01:45:16PM -0500, Philippe Blain wrote:\n>> I think it would be good to add a short note about these variants somewhere\n>> in Documentation/git-mergetool.txt. Might be in this patch, or not if you don't\n>> feel like it...\n>> \n>> Going further, we could even add a short (few words) description of each tool\n>> and have that description show up in the output of  'git mergetool --tool-help',\n>> something like this:\n>> \n>> $ git mergetool --tool-help\n>> 'git mergetool --tool=<tool>' may be set to one of the following:\n>> \t\temerge\t\tEmacs (Emerge)\n>> \t\topendiff\tApple FileMerge\n>> \t\tvimdiff\t\tVim (??)\n>> \t\tvimdiff2\tVim (3 panes)\n>> \t\tvimdiff3\tVim (4 panes)\n>\n> Great suggestions, thanks. A little explanation would be very helpful --\n> I've been confused by those variants too and wondered why I might want\n> to use one over another.\n>\n> I'll roll those into this patch.\n\nI'd rather see it as a completely separate patch.\n\n"},{"id":"417922","messageId":"YDmFrd/zB4G93oHz@ellen.lan","threadId":"55145","inReplyTo":"xmqqh7lzshx6.fsf@gitster.g","subject":"Re: [PATCH 0/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Seth House","fromEmail":"seth@eseth.com","sentAt":"2021-02-26T23:35:09Z","receivedAt":"2021-02-26T23:35:56Z","isPatch":true,"sender":{"key":"seth@eseth.com","avatar":"https://avatars.githubusercontent.com/u/91293?v=4"},"body":"On Thu, Feb 25, 2021 at 06:04:53PM -0800, Junio C Hamano wrote:\n> Seth House <seth@eseth.com> writes:\n> > I'll roll those into this patch.\n> \n> I'd rather see it as a completely separate patch.\n\nOk, will do.\n\nShould I roll a v2 of this patch set to include David's tested-by tag\neven though there's no code changes?\n\n"},{"id":"417934","messageId":"xmqqblc6qnu1.fsf@gitster.g","threadId":"55145","inReplyTo":"YDmFrd/zB4G93oHz@ellen.lan","subject":"Re: [PATCH 0/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-27T01:52:22Z","receivedAt":"2021-02-27T01:53:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Seth House <seth@eseth.com> writes:\n\n> On Thu, Feb 25, 2021 at 06:04:53PM -0800, Junio C Hamano wrote:\n>> Seth House <seth@eseth.com> writes:\n>> > I'll roll those into this patch.\n>> \n>> I'd rather see it as a completely separate patch.\n>\n> Ok, will do.\n>\n> Should I roll a v2 of this patch set to include David's tested-by tag\n> even though there's no code changes?\n\nI think that is exactly what we have on sh/mergetools-vimdiff1 topic\nbranch in 'next'.\n\n    $ git fetch\n    $ git show 'origin/next^{/^mergetools/vimdiff:}'\n\nThanks.\n\n"},{"id":"417935","messageId":"YDmrwVQAwlzCVOO4@ellen","threadId":"55145","inReplyTo":"xmqqblc6qnu1.fsf@gitster.g","subject":"Re: [PATCH 0/1] mergetools/vimdiff: add vimdiff1 merge tool variant","fromName":"Seth House","fromEmail":"seth@eseth.com","sentAt":"2021-02-27T02:17:37Z","receivedAt":"2021-02-27T02:18:39Z","isPatch":true,"sender":{"key":"seth@eseth.com","avatar":"https://avatars.githubusercontent.com/u/91293?v=4"},"body":"On Fri, Feb 26, 2021 at 05:52:22PM -0800, Junio C Hamano wrote:\n> I think that is exactly what we have on sh/mergetools-vimdiff1 topic\n> branch in 'next'.\n\nOh, whoops. Thanks! I'll get into the habit of watching 'next' more\nclosely.\n\n"}]}