{"thread":{"id":"44201","subject":"Feature Request: user defined suffix for temp files created by git-mergetool","startedAt":"2016-10-03T06:36:37Z","lastAt":"2016-10-13T05:13:37Z","messageCount":19,"participants":["Josef Ridky","Anatoly Borodin","David Aguilar","Junio C Hamano","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"303071","messageId":"1329039097.128066.1475476591437.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"88486231.114620.1475474318974.JavaMail.zimbra@redhat.com","subject":"Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-03T06:36:31Z","receivedAt":"2016-10-03T06:36:37Z","isPatch":false,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"Hello,\n\nI would like to request for implementing feature described in subject.\n\nIn several projects, we are using git mergetool for comparing files from different folders. \nUnfortunately, when we have opened three files  for comparing using meld tool (e.q. Old_version -- Result -- New_version), \nwe can see only name of temporary files created by mergetool in the labels (e.g. foo_REMOTE -- foo_BASE -- foo_LOCAL) \nand users (and sometime even we) are confused, which of the files should they edit and save.\n\nIf you will be so kind and approve this feature request, you will help us to solve this unfortunate issue by the easiest way.\n\nI have already prepared patch, which can be applied to resolve this request (see in attachment).\n\n\nBest regards\n\nJosef Ridky\nAssociate Software Engineer\nCore Services Team\nRed Hat Czech, s.r.o.\n\n"},{"id":"303090","messageId":"CACNzp2mANqmciMzvCahM_+=RnZYtU1SK9DRS2BmQru1fZY_wUQ@mail.gmail.com","threadId":"44201","inReplyTo":"1329039097.128066.1475476591437.JavaMail.zimbra@redhat.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Anatoly Borodin","fromEmail":"anatoly.borodin@gmail.com","sentAt":"2016-10-03T15:18:44Z","receivedAt":"2016-10-03T15:19:11Z","isPatch":false,"sender":{"key":"anatoly.borodin@gmail.com","avatar":"https://gravatar.com/avatar/59f11f1f45cf5ebb7bcca8da94b43cfe5f596d91c0a3e27ad0d2a861cc2bbce7?d=mp&s=160"},"body":"Hi Josef,\n\n\nOn Mon, Oct 3, 2016 at 8:36 AM, Josef Ridky <jridky@redhat.com> wrote:\n> In several projects, we are using git mergetool for comparing files from different folders.\n> Unfortunately, when we have opened three files  for comparing using meld tool (e.q. Old_version -- Result -- New_version),\n> we can see only name of temporary files created by mergetool in the labels (e.g. foo_REMOTE -- foo_BASE -- foo_LOCAL)\n> and users (and sometime even we) are confused, which of the files should they edit and save.\n\n`git mergetool` just creates temporary files (with some temporary\nnames) and calls `meld` (or `vimdiff`, etc) with the file names as\nparameters. So why wouldn't you call `meld` with the file names you\nwant?\n\n-- \nMit freundlichen Grüßen,\nAnatoly Borodin\n"},{"id":"303171","messageId":"597741871.671633.1475558327029.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"CACNzp2mANqmciMzvCahM_+=RnZYtU1SK9DRS2BmQru1fZY_wUQ@mail.gmail.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-04T05:18:47Z","receivedAt":"2016-10-04T05:19:41Z","isPatch":false,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"Hi Anatoly,\n\n\n| Sent: Monday, October 3, 2016 5:18:44 PM\n| \n| Hi Josef,\n| \n| \n| On Mon, Oct 3, 2016 at 8:36 AM, Josef Ridky <jridky@redhat.com> wrote:\n| > In several projects, we are using git mergetool for comparing files from\n| > different folders.\n| > Unfortunately, when we have opened three files  for comparing using meld\n| > tool (e.q. Old_version -- Result -- New_version),\n| > we can see only name of temporary files created by mergetool in the labels\n| > (e.g. foo_REMOTE -- foo_BASE -- foo_LOCAL)\n| > and users (and sometime even we) are confused, which of the files should\n| > they edit and save.\n| \n| `git mergetool` just creates temporary files (with some temporary\n| names) and calls `meld` (or `vimdiff`, etc) with the file names as\n| parameters. So why wouldn't you call `meld` with the file names you\n| want?\n\n\nBecause files, that we want, are temporary files created by git mergetool and we are not able to change their name.\n\nRegards\n\nJosef\n\n"},{"id":"303340","messageId":"1499287628.1324571.1475653631366.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"1329039097.128066.1475476591437.JavaMail.zimbra@redhat.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-05T07:47:11Z","receivedAt":"2016-10-05T07:47:16Z","isPatch":false,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"Hi, \n\nI have just realize, that my attachment has been cut off from my previous message.\nBelow you can find patch with requested change.\n\nAdd support for user defined suffix part of name of temporary files\ncreated by git mergetool\n---\n Documentation/git-mergetool.txt | 26 ++++++++++++++++++++-\n git-mergetool.sh                | 52 +++++++++++++++++++++++++++++++++++++----\n 2 files changed, 72 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e846c2e..6cf5935 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -8,7 +8,7 @@ git-mergetool - Run merge conflict resolution tools to resolve merge conflicts\n SYNOPSIS\n --------\n [verse]\n-'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]\n+'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [--local=<name>] [--remote=<name>] [--backup=<name>] [--base=<name>] [<file>...]\n \n DESCRIPTION\n -----------\n@@ -79,6 +79,30 @@ 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+--local=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (local) for merging. If not used or is equal with any\n+\tother (remote|backup|base), default value is used.\n+\tDefault suffix is LOCAL.\n+\n+--remote=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (remote) for merging. If not used or is equal with any\n+\tother (local|backup|base), default value is used.\n+\tDefault suffix is REMOTE.\n+\n+--backup=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (backup) for merging. If not used or is equal with any\n+\tother (local|remote|base), default value is used.\n+\tDefault suffix is BACKUP.\n+\n+--base=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (base) for merging. If not used or is equal with any\n+\tother (local|remote|backup), default value is used.\n+\tDefault suffix is BASE.\n+\n TEMPORARY FILES\n ---------------\n `git mergetool` creates `*.orig` backup files while resolving merges.\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex bf86270..e3433ee 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -8,11 +8,18 @@\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] [--local=name] [--remote=name] [--backup=name] [--base=name] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n NONGIT_OK=Yes\n OPTIONS_SPEC=\n TOOL_MODE=merge\n+\n+#optional name space convention\n+local_name=\"\"\n+remote_name=\"\"\n+base_name=\"\"\n+backup_name=\"\"\n+\n . git-sh-setup\n . git-mergetool--lib\n \n@@ -271,10 +278,33 @@ merge_file () {\n \t\tBASE=${BASE##*/}\n \tfi\n \n-\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n-\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n-\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext\"\n-\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n+\tif [ \"$local_name\" != \"\" ]  && [ \"$local_name\" != \"$remote_name\" ] && [ \"$local_name\" != \"$backup_name\" ] && [ \"$local_name\" != \"$base_name\" ]\n+\tthen\n+\t\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${local_name}_$$$ext\"\n+\telse\n+\t\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n+\tfi\n+\n+\tif [ \"$remote_name\" != \"\" ] && [ \"$remote_name\" != \"$local_name\" ] && [ \"$remote_name\" != \"$backup_name\" ] && [ \"$remote_name\" != \"$base_name\" ]\n+\tthen\n+\t\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_${remote_name}_$$$ext\"\n+\telse\n+\t\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext\"\n+\tfi\n+\n+\tif [ \"$backup_name\" != \"\" ] && [ \"$backup_name\" != \"$local_name\" ] && [ \"$backup_name\" != \"$remote_name\" ] && [ \"$backup_name\" != \"$base_name\" ]\n+\tthen\n+\t\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_${backup_name}_$$$ext\"\n+\telse\n+\t\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n+\tfi\n+\n+\tif [ \"$base_name\" != \"\" ] && [ \"$base_name\" != \"$local_name\" ] && [ \"$base_name\" != \"$remote_name\" ] && [ \"$base_name\" != \"$backup_name\" ]\n+\tthen\n+\t\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_${base_name}_$$$ext\"\n+\telse\n+\t\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n+\tfi\n \n \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n@@ -396,6 +426,18 @@ do\n \t--prompt)\n \t\tprompt=true\n \t\t;;\n+\t--local=*)\n+\t\tlocal_name=${1#--local=}\n+\t\t;;\n+\t--remote=*)\n+\t\tremote_name=${1#--remote=}\n+\t\t;;\n+\t--base=*)\n+\t\tbase_name=${1#--base=}\n+\t\t;;\n+\t--backup=*)\n+\t\tbackup_name=${1#--backup=}\n+\t\t;;\n \t--)\n \t\tshift\n \t\tbreak\n-- \n2.7.4\n"},{"id":"303342","messageId":"20161005094706.GA18574@gmail.com","threadId":"44201","inReplyTo":"597741871.671633.1475558327029.JavaMail.zimbra@redhat.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-10-05T09:47:06Z","receivedAt":"2016-10-05T09:47:16Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Tue, Oct 04, 2016 at 01:18:47AM -0400, Josef Ridky wrote:\n> Hi Anatoly,\n> \n> \n> | Sent: Monday, October 3, 2016 5:18:44 PM\n> | \n> | Hi Josef,\n> | \n> | \n> | On Mon, Oct 3, 2016 at 8:36 AM, Josef Ridky <jridky@redhat.com> wrote:\n> | > In several projects, we are using git mergetool for comparing files from\n> | > different folders.\n> | > Unfortunately, when we have opened three files  for comparing using meld\n> | > tool (e.q. Old_version -- Result -- New_version),\n> | > we can see only name of temporary files created by mergetool in the labels\n> | > (e.g. foo_REMOTE -- foo_BASE -- foo_LOCAL)\n> | > and users (and sometime even we) are confused, which of the files should\n> | > they edit and save.\n> | \n> | `git mergetool` just creates temporary files (with some temporary\n> | names) and calls `meld` (or `vimdiff`, etc) with the file names as\n> | parameters. So why wouldn't you call `meld` with the file names you\n> | want?\n> \n> \n> Because files, that we want, are temporary files created by\n> git mergetool and we are not able to change their name.\n\n[I didn't see your original patch, but we actually prefer inline\n patches in the email, as sent via `git send-email`.\n Documentation/SubmittingPatches has more details.\n\n Please also make sure to add a test to t/t7610-mergetool.sh\n exercising any new features.]\n\nAre you proposing support for config variables to control how\nthe temporary files are named?\n\ne.g. something like \"mergetool.strings.{local,remote,base}\" for\noverriding the hard-coded {LOCAL,REMOTE,BASE} strings?\n\nI don't want to over-engineer it, but do you want to support\nexecuting a command to get the name, or is having a replacement\nsufficient?\n\nNow I'm curious... if replacing the strings is sufficient, what\ndo you plan to call them?  I can imagine maybe something like\nOURS, and THEIRS might be helpful since it matches the\nnomenclature already used by Git, e.g. \"git merge -s ours\".\n\nSince these are temporary files, changing these names might not\nbe entirely out of the question.  This might be a case where\nusing the same words as a related Git feature might help reduce\nthe mental burden of using mergetool.  OURS and THEIRS are\nprobably the only names that fit that category, IMO.\nBASE is already good enough (merge-base).\n\nThe downside of making it configurable is that it can confuse\nusers who use mergetool at someone else's desk where they've\nnamed these strings to \"catty\", \"wombat\", and \"jimbo\".  This\ndoesn't seem like the kind of place where we want to allow users\nto be creative, but we do care about having a good default.\n\nOURS and THEIRS are intuitive names, so switching existing users\nto those would not have much downside IMO, and it's a little\nless \"I just merged a REMOTE branch\" centric, which is good.\n\nDo you think these names should be changed?\nIf so, did you have those names in mind, or something else\nentirely?\n\ncheers,\n-- \nDavid\n"},{"id":"303344","messageId":"389765533.1406436.1475662779510.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"20161005094706.GA18574@gmail.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-05T10:19:39Z","receivedAt":"2016-10-05T10:19:46Z","isPatch":false,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"Hi David,\n\nthank you very much for your reply.\nToday I realized, that my attachment has been cut off, so I sent it in the morning [1].\n\nI believe, that most of answer can be find in my previous email from this morning.\nOnly change, that should be done by this request is add possibility to edit hard-coded suffix of temporary files. \nI don't think, that change hard-coded suffix to switch between two hard-coded suffix of temporary files is suitable solution, but as well it's not bad solution.\n\nPlease look at the patch [1] and tell me, what do you think about this change.\n\n[1] http://marc.info/?l=git&m=147565363609649&w=2\n\nRegards\nJosef\n\n| Sent: Wednesday, October 5, 2016 11:47:06 AM\n| \n| On Tue, Oct 04, 2016 at 01:18:47AM -0400, Josef Ridky wrote:\n| > Hi Anatoly,\n| > \n| > \n| > | Sent: Monday, October 3, 2016 5:18:44 PM\n| > | \n| > | Hi Josef,\n| > | \n| > | \n| > | On Mon, Oct 3, 2016 at 8:36 AM, Josef Ridky <jridky@redhat.com> wrote:\n| > | > In several projects, we are using git mergetool for comparing files\n| > | > from\n| > | > different folders.\n| > | > Unfortunately, when we have opened three files  for comparing using\n| > | > meld\n| > | > tool (e.q. Old_version -- Result -- New_version),\n| > | > we can see only name of temporary files created by mergetool in the\n| > | > labels\n| > | > (e.g. foo_REMOTE -- foo_BASE -- foo_LOCAL)\n| > | > and users (and sometime even we) are confused, which of the files\n| > | > should\n| > | > they edit and save.\n| > | \n| > | `git mergetool` just creates temporary files (with some temporary\n| > | names) and calls `meld` (or `vimdiff`, etc) with the file names as\n| > | parameters. So why wouldn't you call `meld` with the file names you\n| > | want?\n| > \n| > \n| > Because files, that we want, are temporary files created by\n| > git mergetool and we are not able to change their name.\n| \n| [I didn't see your original patch, but we actually prefer inline\n|  patches in the email, as sent via `git send-email`.\n|  Documentation/SubmittingPatches has more details.\n| \n|  Please also make sure to add a test to t/t7610-mergetool.sh\n|  exercising any new features.]\n| \n| Are you proposing support for config variables to control how\n| the temporary files are named?\n| \n| e.g. something like \"mergetool.strings.{local,remote,base}\" for\n| overriding the hard-coded {LOCAL,REMOTE,BASE} strings?\n| \n| I don't want to over-engineer it, but do you want to support\n| executing a command to get the name, or is having a replacement\n| sufficient?\n| \n| Now I'm curious... if replacing the strings is sufficient, what\n| do you plan to call them?  I can imagine maybe something like\n| OURS, and THEIRS might be helpful since it matches the\n| nomenclature already used by Git, e.g. \"git merge -s ours\".\n| \n| Since these are temporary files, changing these names might not\n| be entirely out of the question.  This might be a case where\n| using the same words as a related Git feature might help reduce\n| the mental burden of using mergetool.  OURS and THEIRS are\n| probably the only names that fit that category, IMO.\n| BASE is already good enough (merge-base).\n| \n| The downside of making it configurable is that it can confuse\n| users who use mergetool at someone else's desk where they've\n| named these strings to \"catty\", \"wombat\", and \"jimbo\".  This\n| doesn't seem like the kind of place where we want to allow users\n| to be creative, but we do care about having a good default.\n| \n| OURS and THEIRS are intuitive names, so switching existing users\n| to those would not have much downside IMO, and it's a little\n| less \"I just merged a REMOTE branch\" centric, which is good.\n| \n| Do you think these names should be changed?\n| If so, did you have those names in mind, or something else\n| entirely?\n| \n| cheers,\n| --\n| David\n| \n"},{"id":"303378","messageId":"xmqqponerdaw.fsf@gitster.mtv.corp.google.com","threadId":"44201","inReplyTo":"1499287628.1324571.1475653631366.JavaMail.zimbra@redhat.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-05T16:05:59Z","receivedAt":"2016-10-05T16:06:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Ridky <jridky@redhat.com> writes:\n\n> Hi, \n>\n> I have just realize, that my attachment has been cut off from my previous message.\n> Below you can find patch with requested change.\n>\n> Add support for user defined suffix part of name of temporary files\n> created by git mergetool\n> ---\n\nThe first two paragraphs above do not look like they are meant for\nthe commit log for this change.\n\nPlease sign-off your patch.\n\n> -USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [file to merge] ...'\n> +USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [--local=name] [--remote=name] [--backup=name] [--base=name] [file to merge] ...'\n>  SUBDIRECTORY_OK=Yes\n>  NONGIT_OK=Yes\n>  OPTIONS_SPEC=\n>  TOOL_MODE=merge\n> +\n> +#optional name space convention\n> +local_name=\"\"\n> +remote_name=\"\"\n> +base_name=\"\"\n> +backup_name=\"\"\n\nIf you initialize these to LOCAL, REMOTE, etc. instead of empty,\nwouldn't it make the remainder of the code a lot simpler?  For\nexample,\n\n> +\tif [ \"$local_name\" != \"\" ]  && [ \"$local_name\" != \"$remote_name\" ] && [ \"$local_name\" != \"$backup_name\" ] && [ \"$local_name\" != \"$base_name\" ]\n> +\tthen\n> +\t\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${local_name}_$$$ext\"\n> +\telse\n> +\t\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n> +\tfi\n\nThis can just be made an unconditional\n\n\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${local_name}_$$$ext\"\n\nwithout any \"if\" check in front.  The same for all others.\n\nThe conditional you added is doing two unrelated things.  It is\ntrying to switch between an unset $local_name and default LOCAL,\nwhile it tries to make sure the user did not give the same string\nfor two different things (which is a nonsense).  It is probably\nbetter to check for nonsense just once just before all these\nassuments of LOCAL, REMOTE, etc. begins, not at each point where\nthey are set like this patch does.\n"},{"id":"303440","messageId":"e3306f5a-1fb3-bd66-48ac-72b75fc7681c@kdbg.org","threadId":"44201","inReplyTo":"1499287628.1324571.1475653631366.JavaMail.zimbra@redhat.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-10-05T21:04:17Z","receivedAt":"2016-10-05T21:04:45Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 05.10.2016 um 09:47 schrieb Josef Ridky:\n> Add support for user defined suffix part of name of temporary files\n> created by git mergetool\n\nDo I understand correctly that your users have problems to identify \nwhich of the \"_BASE_\", \"_LOCAL_\", \"_REMOTE_\" and \"_BACKUP_\" files they \nmust edit? I agree that there is some room for improvement.\n\nThe goal is that you want the user to see the label, e.g., \"_EDIT_THIS_\" \ninstead of \"_LOCAL_\". Now you have to teach your users that they have to \npass --local=_EDIT_THIS_. Why don't you just teach your users to edit \nthe file labeled \"_LOCAL_\"?\n\nTherefore, I think that your patch as written does not help to reduce \nthe confusion. It may be a building block for further improvement, but \nif you stop here, it is pointless.\n\n>  SYNOPSIS\n>  --------\n>  [verse]\n> -'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]\n> +'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [--local=<name>] [--remote=<name>] [--backup=<name>] [--base=<name>] [<file>...]\n>\n>  DESCRIPTION\n>  -----------\n> @@ -79,6 +79,30 @@ 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> +--local=<name>::\n> +\tUse string from <name> as part of suffix of name of temporary\n> +\tfile (local) for merging. If not used or is equal with any\n> +\tother (remote|backup|base), default value is used.\n> +\tDefault suffix is LOCAL.\n> +\n> +--remote=<name>::\n> +\tUse string from <name> as part of suffix of name of temporary\n> +\tfile (remote) for merging. If not used or is equal with any\n> +\tother (local|backup|base), default value is used.\n> +\tDefault suffix is REMOTE.\n> +\n> +--backup=<name>::\n> +\tUse string from <name> as part of suffix of name of temporary\n> +\tfile (backup) for merging. If not used or is equal with any\n> +\tother (local|remote|base), default value is used.\n> +\tDefault suffix is BACKUP.\n> +\n> +--base=<name>::\n> +\tUse string from <name> as part of suffix of name of temporary\n> +\tfile (base) for merging. If not used or is equal with any\n> +\tother (local|remote|backup), default value is used.\n> +\tDefault suffix is BASE.\n\n"},{"id":"303459","messageId":"174484314.1957110.1475736448828.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"xmqqponerdaw.fsf@gitster.mtv.corp.google.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-06T06:47:28Z","receivedAt":"2016-10-06T06:47:43Z","isPatch":false,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"Hi Junio,\n\nthank you very much for the tips. I'll make new patch with a simpler code.\n\nJosef\n\n| Sent: Wednesday, October 5, 2016 6:05:59 PM\n| Josef Ridky <jridky@redhat.com> writes:\n| \n| > Hi,\n| >\n| > I have just realize, that my attachment has been cut off from my previous\n| > message.\n| > Below you can find patch with requested change.\n| >\n| > Add support for user defined suffix part of name of temporary files\n| > created by git mergetool\n| > ---\n| \n| The first two paragraphs above do not look like they are meant for\n| the commit log for this change.\n| \n| Please sign-off your patch.\n| \n| > -USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [file to\n| > merge] ...'\n| > +USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt]\n| > [--local=name] [--remote=name] [--backup=name] [--base=name] [file to\n| > merge] ...'\n| >  SUBDIRECTORY_OK=Yes\n| >  NONGIT_OK=Yes\n| >  OPTIONS_SPEC=\n| >  TOOL_MODE=merge\n| > +\n| > +#optional name space convention\n| > +local_name=\"\"\n| > +remote_name=\"\"\n| > +base_name=\"\"\n| > +backup_name=\"\"\n| \n| If you initialize these to LOCAL, REMOTE, etc. instead of empty,\n| wouldn't it make the remainder of the code a lot simpler?  For\n| example,\n| \n| > +\tif [ \"$local_name\" != \"\" ]  && [ \"$local_name\" != \"$remote_name\" ] && [\n| > \"$local_name\" != \"$backup_name\" ] && [ \"$local_name\" != \"$base_name\" ]\n| > +\tthen\n| > +\t\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${local_name}_$$$ext\"\n| > +\telse\n| > +\t\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n| > +\tfi\n| \n| This can just be made an unconditional\n| \n| \tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${local_name}_$$$ext\"\n| \n| without any \"if\" check in front.  The same for all others.\n| \n| The conditional you added is doing two unrelated things.  It is\n| trying to switch between an unset $local_name and default LOCAL,\n| while it tries to make sure the user did not give the same string\n| for two different things (which is a nonsense).  It is probably\n| better to check for nonsense just once just before all these\n| assuments of LOCAL, REMOTE, etc. begins, not at each point where\n| they are set like this patch does.\n| \n"},{"id":"303460","messageId":"1214659824.1976049.1475738509473.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"e3306f5a-1fb3-bd66-48ac-72b75fc7681c@kdbg.org","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-06T07:21:49Z","receivedAt":"2016-10-06T07:21:57Z","isPatch":false,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"Hi Johannes,\n\nthank you very much for this reply.\n\n| Sent: Wednesday, October 5, 2016 11:04:17 PM\n| \n| Am 05.10.2016 um 09:47 schrieb Josef Ridky:\n| > Add support for user defined suffix part of name of temporary files\n| > created by git mergetool\n| \n| Do I understand correctly that your users have problems to identify\n| which of the \"_BASE_\", \"_LOCAL_\", \"_REMOTE_\" and \"_BACKUP_\" files they\n| must edit? I agree that there is some room for improvement.\n| \n| The goal is that you want the user to see the label, e.g., \"_EDIT_THIS_\"\n| instead of \"_LOCAL_\". Now you have to teach your users that they have to\n| pass --local=_EDIT_THIS_. Why don't you just teach your users to edit\n| the file labeled \"_LOCAL_\"?\n\nThe goal of this request is not to teach our users, how to change labels using git mergetool.\nThe point is, that git mergetool is used by several of our packages in specific use-case. \n\nIf I understand well, git mergetool expecting comparing LOCAL changes against REMOTE status in git repository.\nWe use git mergetool to compare LOCAL OLD version of package with LOCAL NEW version of package.\n\nIn this use-case is really nonsense to label old version of package as LOCAL and new version of package as REMOTE.\nThis is point of confusion. This is the reason, why I am asking for the possibility to change the suffix of temporary files, which are shown to user for comparison.\n\nAnd as well, users do not open these files themselves, these files are automatically opened by our packages, so users are not responsible for the name of temporary files. They just see the results.\n\n| \n| Therefore, I think that your patch as written does not help to reduce\n| the confusion. It may be a building block for further improvement, but\n| if you stop here, it is pointless.\n| \n\nI agree, that this patch is written as general as possible and can possibly bring more confusion than benefits.\nI will make new version of this patch, where will be just simple switch between LOCAL/REMOTE and NEW/OLD.\n \n| >  SYNOPSIS\n| >  --------\n| >  [verse]\n| > -'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]\n| > +'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [--local=<name>]\n| > [--remote=<name>] [--backup=<name>] [--base=<name>] [<file>...]\n| >\n| >  DESCRIPTION\n| >  -----------\n| > @@ -79,6 +79,30 @@ success of the resolution after the custom tool has\n| > exited.\n| >  \tPrompt before each invocation of the merge resolution program\n| >  \tto give the user a chance to skip the path.\n| >\n| > +--local=<name>::\n| > +\tUse string from <name> as part of suffix of name of temporary\n| > +\tfile (local) for merging. If not used or is equal with any\n| > +\tother (remote|backup|base), default value is used.\n| > +\tDefault suffix is LOCAL.\n| > +\n| > +--remote=<name>::\n| > +\tUse string from <name> as part of suffix of name of temporary\n| > +\tfile (remote) for merging. If not used or is equal with any\n| > +\tother (local|backup|base), default value is used.\n| > +\tDefault suffix is REMOTE.\n| > +\n| > +--backup=<name>::\n| > +\tUse string from <name> as part of suffix of name of temporary\n| > +\tfile (backup) for merging. If not used or is equal with any\n| > +\tother (local|remote|base), default value is used.\n| > +\tDefault suffix is BACKUP.\n| > +\n| > +--base=<name>::\n| > +\tUse string from <name> as part of suffix of name of temporary\n| > +\tfile (base) for merging. If not used or is equal with any\n| > +\tother (local|remote|backup), default value is used.\n| > +\tDefault suffix is BASE.\n| \n| \n"},{"id":"303482","messageId":"255814448.2197583.1475759366093.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"1911899288.2172724.1475757782111.JavaMail.zimbra@redhat.com","subject":"[PATCH 2/2] Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-06T13:09:26Z","receivedAt":"2016-10-06T13:09:32Z","isPatch":true,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"This is the second of two variant for request to add option to change\nsuffix of name of temporary files generated by git mergetool. This\nchange is requested for cases, when is git mergetool used for local\ncomparison between two version of same package during package rebase.\n\nSigned-off-by: Josef Ridky <jridky@redhat.com>\n---\n Documentation/git-mergetool.txt | 26 ++++++++++++++++++++++++-\n git-mergetool.sh                | 43 ++++++++++++++++++++++++++++++++++++-----\n 2 files changed, 63 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e846c2e..6cf5935 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -8,7 +8,7 @@ git-mergetool - Run merge conflict resolution tools to resolve merge conflicts\n SYNOPSIS\n --------\n [verse]\n-'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]\n+'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [--local=<name>] [--remote=<name>] [--backup=<name>] [--base=<name>] [<file>...]\n \n DESCRIPTION\n -----------\n@@ -79,6 +79,30 @@ 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+--local=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (local) for merging. If not used or is equal with any\n+\tother (remote|backup|base), default value is used.\n+\tDefault suffix is LOCAL.\n+\n+--remote=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (remote) for merging. If not used or is equal with any\n+\tother (local|backup|base), default value is used.\n+\tDefault suffix is REMOTE.\n+\n+--backup=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (backup) for merging. If not used or is equal with any\n+\tother (local|remote|base), default value is used.\n+\tDefault suffix is BACKUP.\n+\n+--base=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (base) for merging. If not used or is equal with any\n+\tother (local|remote|backup), default value is used.\n+\tDefault suffix is BASE.\n+\n TEMPORARY FILES\n ---------------\n `git mergetool` creates `*.orig` backup files while resolving merges.\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex bf86270..096ee5e 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -8,7 +8,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] [--local=name] [--remote=name] [--backup=name] [--base=name] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n NONGIT_OK=Yes\n OPTIONS_SPEC=\n@@ -16,6 +16,12 @@ TOOL_MODE=merge\n . git-sh-setup\n . git-mergetool--lib\n \n+# Can be changed by user\n+LOCAL_NAME='LOCAL'\n+BASE_NAME='BASE'\n+BACKUP_NAME='BACKUP'\n+REMOTE_NAME='REMOTE'\n+\n # Returns true if the mode reflects a symlink\n is_symlink () {\n \ttest \"$1\" = 120000\n@@ -271,10 +277,10 @@ merge_file () {\n \t\tBASE=${BASE##*/}\n \tfi\n \n-\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n-\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n-\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext\"\n-\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n+\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_${BACKUP_NAME}_$$$ext\"\n+\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${LOCAL_NAME}_$$$ext\"\n+\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_${REMOTE_NAME}_$$$ext\"\n+\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_${BASE_NAME}_$$$ext\"\n \n \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n@@ -396,6 +402,33 @@ do\n \t--prompt)\n \t\tprompt=true\n \t\t;;\n+\t--local=*)\n+\t\ttemp_name=${1#--local=}\n+\t\tif [ \"$temp_name\" != \"\" ] && [ \"$temp_name\" != \"$REMOTE_NAME\" ] && [ \"$temp_name\" != \"$BASE_NAME\" ] && [ \"$temp_name\" != \"$BACKUP_NAME\" ]\n+\t\tthen\n+\t\t\tLOCAL_NAME=$temp_name\n+\t\tfi\n+\t\t;;\n+\t--remote=*)\n+\t\ttemp_name=${1#--remote=}\n+\t\tif [ \"$temp_name\" != \"\" ] && [ \"$temp_name\" != \"$LOCAL_NAME\" ] && [ \"$temp_name\" != \"$BASE_NAME\" ] && [ \"$temp_name\" != \"$BACKUP_NAME\" ]\n+\t\tthen\n+\t\t\tREMOTE_NAME=$temp_name\n+\t\tfi\n+\t\t;;\n+\t--base=*)\n+\t\ttemp_name=${1#--base=}\n+\t\tif [ \"$temp_name\" != \"\" ] && [ \"$temp_name\" != \"$LOCAL_NAME\" ] && [ \"$temp_name\" != \"$REMOTE_NAME\" ] && [ \"$temp_name\" != \"$BACKUP_NAME\" ]\n+\t\tthen\n+\t\t\tBASE_NAME=$temp_name\n+\t\tfi\n+\t\t;;\n+\t--backup=*)\n+\t\ttemp_name=${1#--backup=}\n+\t\tif [ \"$temp_name\" != \"\" ] && [ \"$temp_name\" != \"$LOCAL_NAME\" ] && [ \"$temp_name\" != \"$REMOTE_NAME\" ] && [ \"$temp_name\" != \"$BASE_NAME\" ]\n+\t\t\tBACKUP_NAME=$temp_name\n+\t\tfi\n+\t\t;;\n \t--)\n \t\tshift\n \t\tbreak\n-- \n2.7.4\n"},{"id":"303486","messageId":"1911899288.2172724.1475757782111.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"1214659824.1976049.1475738509473.JavaMail.zimbra@redhat.com","subject":"[PATCH 1/2] Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-06T12:43:02Z","receivedAt":"2016-10-06T13:39:07Z","isPatch":true,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"This is the first of two variant for request to add option to change\nsuffix of name of temporary files generated by git mergetool. This\nchange is requested for cases, when is git mergetool used for local\ncomparision between two version of same package during package rebase.\n\nSigned-off-by: Josef Ridky <jridky@redhat.com>\n---\n Documentation/git-mergetool.txt |  7 ++++++-\n git-mergetool.sh                | 23 ++++++++++++++++++-----\n 2 files changed, 24 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e846c2e..a212cef 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -8,7 +8,7 @@ git-mergetool - Run merge conflict resolution tools to resolve merge conflicts\n SYNOPSIS\n --------\n [verse]\n-'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]\n+'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [-l | --local] [<file>...]\n \n DESCRIPTION\n -----------\n@@ -79,6 +79,11 @@ 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+-l::\n+--local::\n+\tChange suffix of name of temporary files generated by git\n+\tmergetool from `_REMOTE_` and `_LOCAL_` to `_OLD_` and `_NEW_`.\n+\n TEMPORARY FILES\n ---------------\n `git mergetool` creates `*.orig` backup files while resolving merges.\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex bf86270..1e04368 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -8,10 +8,11 @@\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] [-l|--local] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n NONGIT_OK=Yes\n OPTIONS_SPEC=\n+LOCAL_MODE=false\n TOOL_MODE=merge\n . git-sh-setup\n . git-mergetool--lib\n@@ -271,10 +272,19 @@ merge_file () {\n \t\tBASE=${BASE##*/}\n \tfi\n \n-\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n-\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n-\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext\"\n-\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n+\tif test \"$LOCAL_MODE\"\n+\tthen\n+\n+\t\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n+\t\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_NEW_$$$ext\"\n+\t\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_OLD_$$$ext\"\n+\t\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n+\telse\n+\t\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n+\t\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n+\t\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext\"\n+\t\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n+\tfi\n \n \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n@@ -396,6 +406,9 @@ do\n \t--prompt)\n \t\tprompt=true\n \t\t;;\n+\t-l|--local)\n+\t\tLOCAL_MODE=true\n+\t\t;;\n \t--)\n \t\tshift\n \t\tbreak\n-- \n2.7.4\n"},{"id":"303492","messageId":"xmqqfuo9mq1e.fsf@gitster.mtv.corp.google.com","threadId":"44201","inReplyTo":"e3306f5a-1fb3-bd66-48ac-72b75fc7681c@kdbg.org","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-06T15:54:21Z","receivedAt":"2016-10-06T15:54:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Therefore, I think that your patch as written does not help to reduce\n> the confusion. It may be a building block for further improvement, but\n> if you stop here, it is pointless.\n\nYup, you're right.\n\n"},{"id":"303501","messageId":"xmqqbmyxmn1q.fsf@gitster.mtv.corp.google.com","threadId":"44201","inReplyTo":"1214659824.1976049.1475738509473.JavaMail.zimbra@redhat.com","subject":"Re: Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-06T16:58:57Z","receivedAt":"2016-10-06T17:00:46Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Ridky <jridky@redhat.com> writes:\n\n> I agree, that this patch is written as general as possible and can\n> possibly bring more confusion than benefits.\n\nI am not sure about that.  Other people would have similar but\ndifferent workflow needs where they compare local new one with local\nold one that would be helped by renaming local to old and remote to\nnew (i.e. the other way around from your need).  If you just add a\ntoggle between local-remote vs new-old, that would be just an\nadditional code baggage that does not help people other than you.\n\nI think J6t's \"EDIT THIS\" hits the center of the issue.  If users\nare trained to know LOCAL is the one to be edited, would the current\nUI work well enough for them thru your custom workflow tools?  If we\nrename LOCAL to \"EDIT THIS\" and do nothing else, would such UI work\nwell for even untrained users thru your custom workflow tools?\n\n"},{"id":"303502","messageId":"xmqq7f9lmmol.fsf@gitster.mtv.corp.google.com","threadId":"44201","inReplyTo":"255814448.2197583.1475759366093.JavaMail.zimbra@redhat.com","subject":"Re: [PATCH 2/2] Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-06T17:06:50Z","receivedAt":"2016-10-06T17:06:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Ridky <jridky@redhat.com> writes:\n\n> +\t--local=*)\n> +\t\ttemp_name=${1#--local=}\n> +\t\tif [ \"$temp_name\" != \"\" ] && [ \"$temp_name\" != \"$REMOTE_NAME\" ] && [ \"$temp_name\" != \"$BASE_NAME\" ] && [ \"$temp_name\" != \"$BACKUP_NAME\" ]\n> +\t\tthen\n> +\t\t\tLOCAL_NAME=$temp_name\n> +\t\tfi\n\nIt is not a good idea to ignore an explicit user request without\ngiving any indication and without giving any explanation.\n\nYou may have noticed that we do not say \"[ cond ]\" in this shell\nscript (we say \"test\" instead; see Documentation/CodingGuidelines).\n\nInstead of having such a test all over the place, I'd suggest doing\nit outside the loop:\n\n    while test $# != 0\n    do\n\tcase \"$1\" in\n\t...\n\t--local=*)\n\t\tLOCAL_NAME=${1#--local=} ;;\n\t--remote=*)                \n\t\tREMOTE_NAME=${1#--local=} ;;\n\t...\n        esac\n    done\n    \n    # sanity check _after_ parsing the command line\n    case \",$LOCAL_NAME,$REMOTE_NAME,$BASE_NAME,$BACKUP_NAME,\" in\n    *,,*) die \"You cannot set --local/remote/... to empty\" ;;\n    esac\n    ... similarly, duplicate check comes here ...\n\n"},{"id":"303969","messageId":"1550673688.5271111.1476260677732.JavaMail.zimbra@redhat.com","threadId":"44201","inReplyTo":"xmqq7f9lmmol.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 2/2] Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Josef Ridky","fromEmail":"jridky@redhat.com","sentAt":"2016-10-12T08:24:37Z","receivedAt":"2016-10-12T08:32:25Z","isPatch":true,"sender":{"key":"jridky@redhat.com","avatar":null},"body":"This is update of the second variant for request to add option to change\nsuffix of name of temporary files generated by git mergetool. This\nchange is requested for cases, when is git mergetool used for local\ncomparison between two version of same package during package rebase.\n\nSigned-off-by: Josef Ridky <jridky@redhat.com>\n---\n Documentation/git-mergetool.txt | 22 ++++++++++++++-\n git-mergetool.sh                | 60 +++++++++++++++++++++++++++++++++++++----\n 2 files changed, 76 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e846c2e..a0466ac 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -8,7 +8,7 @@ git-mergetool - Run merge conflict resolution tools to resolve merge conflicts\n SYNOPSIS\n --------\n [verse]\n-'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]\n+'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [--local=<name>] [--remote=<name>] [--backup=<name>] [--base=<name>] [<file>...]\n \n DESCRIPTION\n -----------\n@@ -79,6 +79,26 @@ 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+--local=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (local) for merging. If not set, default value is used.\n+\tDefault suffix is LOCAL.\n+\n+--remote=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (remote) for merging. If not set, default value is used.\n+\tDefault suffix is REMOTE.\n+\n+--backup=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (backup) for merging. If not set, default value is used.\n+\tDefault suffix is BACKUP.\n+\n+--base=<name>::\n+\tUse string from <name> as part of suffix of name of temporary\n+\tfile (base) for merging. If not set, default value is used.\n+\tDefault suffix is BASE.\n+\n TEMPORARY FILES\n ---------------\n `git mergetool` creates `*.orig` backup files while resolving merges.\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex bf86270..ed9ba82 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -8,7 +8,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] [--local=name] [--remote=name] [--backup=name] [--base=name] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n NONGIT_OK=Yes\n OPTIONS_SPEC=\n@@ -16,6 +16,13 @@ TOOL_MODE=merge\n . git-sh-setup\n . git-mergetool--lib\n \n+# Can be changed by user\n+LOCAL_NAME='LOCAL'\n+BASE_NAME='BASE'\n+BACKUP_NAME='BACKUP'\n+REMOTE_NAME='REMOTE'\n+\n+\n # Returns true if the mode reflects a symlink\n is_symlink () {\n \ttest \"$1\" = 120000\n@@ -271,10 +278,10 @@ merge_file () {\n \t\tBASE=${BASE##*/}\n \tfi\n \n-\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n-\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n-\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext\"\n-\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n+\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_${BACKUP_NAME}_$$$ext\"\n+\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${LOCAL_NAME}_$$$ext\"\n+\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_${REMOTE_NAME}_$$$ext\"\n+\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_${BASE_NAME}_$$$ext\"\n \n \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n@@ -396,6 +403,18 @@ do\n \t--prompt)\n \t\tprompt=true\n \t\t;;\n+\t--local=*)\n+\t\tLOCAL_NAME=${1#--local=}\n+\t\t;;\n+\t--remote=*)\n+\t\tREMOTE_NAME=${1#--remote=}\n+\t\t;;\n+\t--base=*)\n+\t\tBASE_NAME=${1#--base=}\n+\t\t;;\n+\t--backup=*)\n+\t\tBACKUP_NAME=${1#--backup=}\n+\t\t;;\n \t--)\n \t\tshift\n \t\tbreak\n@@ -410,6 +429,37 @@ do\n \tshift\n done\n \n+# sanity check after parsing command line\n+case \"\" in\n+\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n+\tdie \"You cannot set any of --local/remote/base/backup to empty.\"\n+\t;;\n+esac\n+\n+case \"$LOCAL_NAME\" in\n+\"$REMOTE_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n+\tdie \"You cannot set any of --remote/base/backup to same as --local.\"\n+\t;;\n+esac\n+\n+case \"$REMOTE_NAME\" in\n+\"$LOCAL_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n+\tdie \"You cannot set any of --local/base/backup to same as --remote.\"\n+\t;;\n+esac\n+\n+case \"$BASE_NAME\" in\n+\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BACKUP_NAME\")\n+\tdie \"You cannot set any of --local/remote/backup to same as --base.\"\n+\t;;\n+esac\n+\n+case \"$BACKUP_NAME\" in\n+\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BASE_NAME\")\n+\tdie \"You cannot set any of --local/remote/base to same as --backup.\"\n+\t;;\n+esac\n+\n prompt_after_failed_merge () {\n \twhile true\n \tdo\n-- \n2.7.4\n"},{"id":"304018","messageId":"xmqqpon54fe5.fsf@gitster.mtv.corp.google.com","threadId":"44201","inReplyTo":"1550673688.5271111.1476260677732.JavaMail.zimbra@redhat.com","subject":"Re: [PATCH v2 2/2] Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-12T17:59:46Z","receivedAt":"2016-10-12T18:05:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Ridky <jridky@redhat.com> writes:\n\n> This is update of the second variant for request to add option to change\n> suffix of name of temporary files generated by git mergetool. This\n> change is requested for cases, when is git mergetool used for local\n> comparison between two version of same package during package rebase.\n>\n> Signed-off-by: Josef Ridky <jridky@redhat.com>\n> ---\n\nDavid, what do you think?\n\nI don't think you were ever CC'ed on any of the messages in\nthis thread, and I don't think you've commented on the topic.  The\nthread begins here:\n\n  https://public-inbox.org/git/1329039097.128066.1475476591437.JavaMail.zimbra@redhat.com/\n\n\nIn any case, I suggest update to the log message to something like\nthis:\n\n    Subject: mergetool: allow custom naming for temporary files\n\n    A front-end program that is spawned by \"git mergetool\" is given\n    three temporary files (e.g. it may get \"x_LOCAL.txt\",\n    \"x_REMOTE.txt\", and \"x_BASE.txt\" while merging \"x.txt\").  \n\n    Custom wrappers to \"git mergetool\" benefits if they are allowed\n    to rename these hardcoded suffixes to match the workflow they\n    implement.  For example, they may be used to compare and merge\n    two versions that is available locally, and OLD/NEW may be more\n    appropriate than LOCAL/REMOTE in such a context.\n\nprimarily because \"the second variant\" is meaningless thing to say\nin our long term history, when the first variant never was recorded\nthere.  Josef may want to elaborate more on the latter paragraph.\n\n>  Documentation/git-mergetool.txt | 22 ++++++++++++++-\n>  git-mergetool.sh                | 60 +++++++++++++++++++++++++++++++++++++----\n>  2 files changed, 76 insertions(+), 6 deletions(-)\n>\n> diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\n> index e846c2e..a0466ac 100644\n> --- a/Documentation/git-mergetool.txt\n> +++ b/Documentation/git-mergetool.txt\n> @@ -8,7 +8,7 @@ git-mergetool - Run merge conflict resolution tools to resolve merge conflicts\n>  SYNOPSIS\n>  --------\n>  [verse]\n> -'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]\n> +'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [--local=<name>] [--remote=<name>] [--backup=<name>] [--base=<name>] [<file>...]\n>  \n>  DESCRIPTION\n>  -----------\n> @@ -79,6 +79,26 @@ 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> +--local=<name>::\n> +\tUse string from <name> as part of suffix of name of temporary\n> +\tfile (local) for merging. If not set, default value is used.\n> +\tDefault suffix is LOCAL.\n> +\n> +--remote=<name>::\n> +\tUse string from <name> as part of suffix of name of temporary\n> +\tfile (remote) for merging. If not set, default value is used.\n> +\tDefault suffix is REMOTE.\n> +\n> +--backup=<name>::\n> +\tUse string from <name> as part of suffix of name of temporary\n> +\tfile (backup) for merging. If not set, default value is used.\n> +\tDefault suffix is BACKUP.\n> +\n> +--base=<name>::\n> +\tUse string from <name> as part of suffix of name of temporary\n> +\tfile (base) for merging. If not set, default value is used.\n> +\tDefault suffix is BASE.\n> +\n>  TEMPORARY FILES\n>  ---------------\n>  `git mergetool` creates `*.orig` backup files while resolving merges.\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index bf86270..ed9ba82 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -8,7 +8,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] [--local=name] [--remote=name] [--backup=name] [--base=name] [file to merge] ...'\n>  SUBDIRECTORY_OK=Yes\n>  NONGIT_OK=Yes\n>  OPTIONS_SPEC=\n> @@ -16,6 +16,13 @@ TOOL_MODE=merge\n>  . git-sh-setup\n>  . git-mergetool--lib\n>  \n> +# Can be changed by user\n> +LOCAL_NAME='LOCAL'\n> +BASE_NAME='BASE'\n> +BACKUP_NAME='BACKUP'\n> +REMOTE_NAME='REMOTE'\n> +\n> +\n>  # Returns true if the mode reflects a symlink\n>  is_symlink () {\n>  \ttest \"$1\" = 120000\n> @@ -271,10 +278,10 @@ merge_file () {\n>  \t\tBASE=${BASE##*/}\n>  \tfi\n>  \n> -\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n> -\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n> -\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext\"\n> -\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n> +\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_${BACKUP_NAME}_$$$ext\"\n> +\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${LOCAL_NAME}_$$$ext\"\n> +\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_${REMOTE_NAME}_$$$ext\"\n> +\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_${BASE_NAME}_$$$ext\"\n>  \n>  \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n>  \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n> @@ -396,6 +403,18 @@ do\n>  \t--prompt)\n>  \t\tprompt=true\n>  \t\t;;\n> +\t--local=*)\n> +\t\tLOCAL_NAME=${1#--local=}\n> +\t\t;;\n> +\t--remote=*)\n> +\t\tREMOTE_NAME=${1#--remote=}\n> +\t\t;;\n> +\t--base=*)\n> +\t\tBASE_NAME=${1#--base=}\n> +\t\t;;\n> +\t--backup=*)\n> +\t\tBACKUP_NAME=${1#--backup=}\n> +\t\t;;\n>  \t--)\n>  \t\tshift\n>  \t\tbreak\n> @@ -410,6 +429,37 @@ do\n>  \tshift\n>  done\n>  \n> +# sanity check after parsing command line\n> +case \"\" in\n> +\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n> +\tdie \"You cannot set any of --local/remote/base/backup to empty.\"\n> +\t;;\n> +esac\n> +\n> +case \"$LOCAL_NAME\" in\n> +\"$REMOTE_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n> +\tdie \"You cannot set any of --remote/base/backup to same as --local.\"\n> +\t;;\n> +esac\n> +\n> +case \"$REMOTE_NAME\" in\n> +\"$LOCAL_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n> +\tdie \"You cannot set any of --local/base/backup to same as --remote.\"\n> +\t;;\n> +esac\n> +\n> +case \"$BASE_NAME\" in\n> +\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BACKUP_NAME\")\n> +\tdie \"You cannot set any of --local/remote/backup to same as --base.\"\n> +\t;;\n> +esac\n> +\n> +case \"$BACKUP_NAME\" in\n> +\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BASE_NAME\")\n> +\tdie \"You cannot set any of --local/remote/base to same as --backup.\"\n> +\t;;\n> +esac\n> +\n>  prompt_after_failed_merge () {\n>  \twhile true\n>  \tdo\n"},{"id":"304058","messageId":"20161013045532.GA25745@gmail.com","threadId":"44201","inReplyTo":"xmqqpon54fe5.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 2/2] Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-10-13T04:55:32Z","receivedAt":"2016-10-13T04:55:58Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Oct 12, 2016 at 10:59:46AM -0700, Junio C Hamano wrote:\n> Josef Ridky <jridky@redhat.com> writes:\n> \n> > This is update of the second variant for request to add option to change\n> > suffix of name of temporary files generated by git mergetool. This\n> > change is requested for cases, when is git mergetool used for local\n> > comparison between two version of same package during package rebase.\n> >\n> > Signed-off-by: Josef Ridky <jridky@redhat.com>\n> > ---\n> \n> David, what do you think?\n> \n> I don't think you were ever CC'ed on any of the messages in\n> this thread, and I don't think you've commented on the topic.  The\n> thread begins here:\n> \n>   https://public-inbox.org/git/1329039097.128066.1475476591437.JavaMail.zimbra@redhat.com/\n> \n> \n> In any case, I suggest update to the log message to something like\n> this:\n> \n>     Subject: mergetool: allow custom naming for temporary files\n> \n>     A front-end program that is spawned by \"git mergetool\" is given\n>     three temporary files (e.g. it may get \"x_LOCAL.txt\",\n>     \"x_REMOTE.txt\", and \"x_BASE.txt\" while merging \"x.txt\").  \n> \n>     Custom wrappers to \"git mergetool\" benefits if they are allowed\n>     to rename these hardcoded suffixes to match the workflow they\n>     implement.  For example, they may be used to compare and merge\n>     two versions that is available locally, and OLD/NEW may be more\n>     appropriate than LOCAL/REMOTE in such a context.\n> \n> primarily because \"the second variant\" is meaningless thing to say\n> in our long term history, when the first variant never was recorded\n> there.  Josef may want to elaborate more on the latter paragraph.\n\n\nI do see why this can be helpful but what makes me reluctant is,\n\n> > +'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [--local=<name>] [--remote=<name>] [--backup=<name>] [--base=<name>] [<file>...]\n\nWe're parking on 4 new flags that are really all about changing\none small aspect of the program.\n\nI don't typically like going overboard with environment\nvariables but for this use case they seem to be a good fit.\n\nIt's already been expressed that the intention is for these to\nbe supplied by some other tool, and environment variables have\nthe nice property that you can update all your tools without\nneeding to touch anything except the environment.\n\nAnother nice thing is that the the user can choose to set it\nglobally, or to set it local to specific tools.\n\nAnother reason why I think it's a good fit is,\n\n> +# Can be changed by user\n> +LOCAL_NAME='LOCAL'\n> +BASE_NAME='BASE'\n> +BACKUP_NAME='BACKUP'\n> +REMOTE_NAME='REMOTE'\n\nThese lines would become simply,\n\nLOCAL_NAME=${GIT_MERGETOOL_LOCAL_NAME:-LOCAL}\nBASE_NAME=${GIT_MERGETOOL_BASE_NAME:-BASE}\nBACKUP_NAME=${GIT_MERGETOOL_BACKUP_NAME:-BACKUP}\nREMOTE_NAME=${GIT_MERGETOOL_REMOTE_NAME:-REMOTE}\n\nand we wouldn't need any other change besides this part:\n\n> -\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext\"\n> -\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext\"\n> -\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext\"\n> -\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext\"\n> +\tBACKUP=\"$MERGETOOL_TMPDIR/${BASE}_${BACKUP_NAME}_$$$ext\"\n> +\tLOCAL=\"$MERGETOOL_TMPDIR/${BASE}_${LOCAL_NAME}_$$$ext\"\n> +\tREMOTE=\"$MERGETOOL_TMPDIR/${BASE}_${REMOTE_NAME}_$$$ext\"\n> +\tBASE=\"$MERGETOOL_TMPDIR/${BASE}_${BASE_NAME}_$$$ext\"\n\n\nThen, just update the documentation to mention the environment\nvariables instead of the flags and we're all set.\n\nWe also won't need this part if we go down that route:\n\n> +# sanity check after parsing command line\n> +case \"\" in\n> +\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n> +\tdie \"You cannot set any of --local/remote/base/backup to empty.\"\n> +\t;;\n> +esac\n> +\n> +case \"$LOCAL_NAME\" in\n> +\"$REMOTE_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n> +\tdie \"You cannot set any of --remote/base/backup to same as --local.\"\n> +\t;;\n> +esac\n> +\n> +case \"$REMOTE_NAME\" in\n> +\"$LOCAL_NAME\"|\"$BASE_NAME\"|\"$BACKUP_NAME\")\n> +\tdie \"You cannot set any of --local/base/backup to same as --remote.\"\n> +\t;;\n> +esac\n> +\n> +case \"$BASE_NAME\" in\n> +\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BACKUP_NAME\")\n> +\tdie \"You cannot set any of --local/remote/backup to same as --base.\"\n> +\t;;\n> +esac\n> +\n> +case \"$BACKUP_NAME\" in\n> +\"$LOCAL_NAME\"|\"$REMOTE_NAME\"|\"$BASE_NAME\")\n> +\tdie \"You cannot set any of --local/remote/base to same as --backup.\"\n> +\t;;\n> +esac\n\n\nWhat do you think?\n-- \nDavid\n"},{"id":"304059","messageId":"20161013051329.GA26538@gmail.com","threadId":"44201","inReplyTo":"1911899288.2172724.1475757782111.JavaMail.zimbra@redhat.com","subject":"Re: [PATCH 1/2] Feature Request: user defined suffix for temp files created by git-mergetool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-10-13T05:13:29Z","receivedAt":"2016-10-13T05:13:37Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Thu, Oct 06, 2016 at 08:43:02AM -0400, Josef Ridky wrote:\n> This is the first of two variant for request to add option to change\n> suffix of name of temporary files generated by git mergetool. This\n> change is requested for cases, when is git mergetool used for local\n> comparision between two version of same package during package rebase.\n> \n> Signed-off-by: Josef Ridky <jridky@redhat.com>\n> ---\n>  Documentation/git-mergetool.txt |  7 ++++++-\n>  git-mergetool.sh                | 23 ++++++++++++++++++-----\n>  2 files changed, 24 insertions(+), 6 deletions(-)\n\nWhile I do like that this variant only uses a single flag, I was\ncurious whether it would make sense for us to change our\ndefaults to OLD/NEW?  I'm thinking \"no\" since it's totally legit\nto merge \"old\" branches so I'll stop there.\n\nWhat I really wanted to mention was...\n\nIf the patch does not update t/t7610-mergetool.sh then there is\nno guarantee that my clumsy fingers won't break the new feature\nin the future ;-)  So please make sure to update the tests once\nwe decide on the final direction.  It makes sense we wouldn't\nwant to update them just yet (in this patch) since this is still\nRFC, but the final one should include it.\n\nI'm still leaning towards environment variables personally,\nand would have no qualms against taking a patch that teaches it\nto support environment variables as long as it adds a test case\nfor the new feature.\n\nThanks for sticking with it, Josef!\n\ncheers,\n-- \nDavid\n"}]}