{"thread":{"id":"25703","subject":"[PATCH] rationalize diffcore-rename options and their doc","startedAt":"2010-11-10T20:27:11Z","lastAt":"2010-11-30T07:28:08Z","messageCount":17,"participants":["Yann Dirson","Thomas Rast","Kevin Ballard","Miles Bader","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"155620","messageId":"1289420833-20602-1-git-send-email-ydirson@altern.org","threadId":"25703","inReplyTo":null,"subject":"[PATCH] rationalize diffcore-rename options and their doc","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2010-11-10T20:27:11Z","receivedAt":"2010-11-10T20:27:11Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"I am ready to take the blame for being the first to introduce\n--detect-* options in diff-opts, with the directory-rename stuff.\nHowever, since --find-copies-harder predates everything and is the\nonly one to be part of a release today, I'd think it would be much\nmore consistent to use --find- as a common prefix.  And, last but not\nleast, shorter long options do not hurt.\n\nAt the same time, I noticed the manpage could benefit from a small\nimprovement.\n"},{"id":"155621","messageId":"1289420833-20602-2-git-send-email-ydirson@altern.org","threadId":"25703","inReplyTo":"1289420833-20602-1-git-send-email-ydirson@altern.org","subject":"[PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2010-11-10T20:27:12Z","receivedAt":"2010-11-10T20:27:12Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"Rationale: this is both shorter to spell and consistent with\n--find-copies-harder.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n Documentation/diff-options.txt |    4 ++--\n diff.c                         |    8 ++++----\n 2 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex bfd0b57..ed9c44e 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -230,7 +230,7 @@ eligible for being picked up as a possible source of a rename to\n another file.\n \n -M[<n>]::\n---detect-renames[=<n>]::\n+--find-renames[=<n>]::\n ifndef::git-log[]\n \tDetect renames.\n endif::git-log[]\n@@ -246,7 +246,7 @@ endif::git-log[]\n \thasn't changed.\n \n -C[<n>]::\n---detect-copies[=<n>]::\n+--find-copies[=<n>]::\n \tDetect copies as well as renames.  See also `--find-copies-harder`.\n \tIf `n` is specified, it has the same meaning as for `-M<n>`.\n \ndiff --git a/diff.c b/diff.c\nindex d1c6b91..3837ffd 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -3145,14 +3145,14 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n \t\tif ((options->break_opt = diff_scoreopt_parse(arg)) == -1)\n \t\t\treturn -1;\n \t}\n-\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--detect-renames=\") ||\n-\t\t !strcmp(arg, \"--detect-renames\")) {\n+\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--find-renames=\") ||\n+\t\t !strcmp(arg, \"--find-renames\")) {\n \t\tif ((options->rename_score = diff_scoreopt_parse(arg)) == -1)\n \t\t\treturn -1;\n \t\toptions->detect_rename = DIFF_DETECT_RENAME;\n \t}\n-\telse if (!prefixcmp(arg, \"-C\") || !prefixcmp(arg, \"--detect-copies=\") ||\n-\t\t !strcmp(arg, \"--detect-copies\")) {\n+\telse if (!prefixcmp(arg, \"-C\") || !prefixcmp(arg, \"--find-copies=\") ||\n+\t\t !strcmp(arg, \"--find-copies\")) {\n \t\tif (options->detect_rename == DIFF_DETECT_COPY)\n \t\t\tDIFF_OPT_SET(options, FIND_COPIES_HARDER);\n \t\tif ((options->rename_score = diff_scoreopt_parse(arg)) == -1)\n-- \n1.7.2.3\n"},{"id":"155622","messageId":"1289420833-20602-3-git-send-email-ydirson@altern.org","threadId":"25703","inReplyTo":"1289420833-20602-1-git-send-email-ydirson@altern.org","subject":"[PATCH 2/2] Keep together options controlling the behaviour of diffcore-rename.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2010-11-10T20:27:13Z","receivedAt":"2010-11-10T20:27:13Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"It makes little sense to have --diff-filter in the middle of them, and\neven spares an ifndef::git-format-patch.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n Documentation/diff-options.txt |   26 ++++++++++++--------------\n 1 files changed, 12 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex ed9c44e..c93124b 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -250,20 +250,6 @@ endif::git-log[]\n \tDetect copies as well as renames.  See also `--find-copies-harder`.\n \tIf `n` is specified, it has the same meaning as for `-M<n>`.\n \n-ifndef::git-format-patch[]\n---diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::\n-\tSelect only files that are Added (`A`), Copied (`C`),\n-\tDeleted (`D`), Modified (`M`), Renamed (`R`), have their\n-\ttype (i.e. regular file, symlink, submodule, ...) changed (`T`),\n-\tare Unmerged (`U`), are\n-\tUnknown (`X`), or have had their pairing Broken (`B`).\n-\tAny combination of the filter characters (including none) can be used.\n-\tWhen `*` (All-or-none) is added to the combination, all\n-\tpaths are selected if there is any file that matches\n-\tother criteria in the comparison; if there is no file\n-\tthat matches other criteria, nothing is selected.\n-endif::git-format-patch[]\n-\n --find-copies-harder::\n \tFor performance reasons, by default, `-C` option finds copies only\n \tif the original file of the copy was modified in the same\n@@ -281,6 +267,18 @@ endif::git-format-patch[]\n \tnumber.\n \n ifndef::git-format-patch[]\n+--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::\n+\tSelect only files that are Added (`A`), Copied (`C`),\n+\tDeleted (`D`), Modified (`M`), Renamed (`R`), have their\n+\ttype (i.e. regular file, symlink, submodule, ...) changed (`T`),\n+\tare Unmerged (`U`), are\n+\tUnknown (`X`), or have had their pairing Broken (`B`).\n+\tAny combination of the filter characters (including none) can be used.\n+\tWhen `*` (All-or-none) is added to the combination, all\n+\tpaths are selected if there is any file that matches\n+\tother criteria in the comparison; if there is no file\n+\tthat matches other criteria, nothing is selected.\n+\n -S<string>::\n \tLook for differences that introduce or remove an instance of\n \t<string>. Note that this is different than the string simply\n-- \n1.7.2.3\n"},{"id":"155662","messageId":"201011111147.04365.trast@student.ethz.ch","threadId":"25703","inReplyTo":"1289420833-20602-2-git-send-email-ydirson@altern.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-11-11T10:47:04Z","receivedAt":"2010-11-11T10:47:04Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Yann Dirson wrote:\n> Rationale: this is both shorter to spell and consistent with\n> --find-copies-harder.\n[...]\n>  -M[<n>]::\n> ---detect-renames[=<n>]::\n> +--find-renames[=<n>]::\n\nUmm.  The reasoning seems ok for me, but the farthest you can go is\ndeprecating the options.  Removing them as in\n\n> -\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--detect-renames=\") ||\n> -\t\t !strcmp(arg, \"--detect-renames\")) {\n> +\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--find-renames=\") ||\n> +\t\t !strcmp(arg, \"--find-renames\")) {\n\nwould break backwards compatibility.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"155666","messageId":"20101111114404.GF8911@home.lan","threadId":"25703","inReplyTo":"201011111147.04365.trast@student.ethz.ch","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Yann Dirson","fromEmail":"ydirson@free.fr","sentAt":"2010-11-11T11:44:04Z","receivedAt":"2010-11-11T11:44:04Z","isPatch":true,"sender":{"key":"ydirson@free.fr","avatar":null},"body":"On Thu, Nov 11, 2010 at 11:47:04AM +0100, Thomas Rast wrote:\n> Yann Dirson wrote:\n> > Rationale: this is both shorter to spell and consistent with\n> > --find-copies-harder.\n> [...]\n> >  -M[<n>]::\n> > ---detect-renames[=<n>]::\n> > +--find-renames[=<n>]::\n> \n> Umm.  The reasoning seems ok for me, but the farthest you can go is\n> deprecating the options.  Removing them as in\n> \n> > -\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--detect-renames=\") ||\n> > -\t\t !strcmp(arg, \"--detect-renames\")) {\n> > +\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--find-renames=\") ||\n> > +\t\t !strcmp(arg, \"--find-renames\")) {\n> \n> would break backwards compatibility.\n\nI don't think we care with compatibility here, since those are not\npart of any release.\n\n-- \nYann\n"},{"id":"155744","messageId":"201011112324.57572.trast@student.ethz.ch","threadId":"25703","inReplyTo":"20101111114404.GF8911@home.lan","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-11-11T22:24:57Z","receivedAt":"2010-11-11T22:24:57Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Yann Dirson wrote:\n> On Thu, Nov 11, 2010 at 11:47:04AM +0100, Thomas Rast wrote:\n> > Yann Dirson wrote:\n> > > Rationale: this is both shorter to spell and consistent with\n> > > --find-copies-harder.\n> > [...]\n> > >  -M[<n>]::\n> > > ---detect-renames[=<n>]::\n> > > +--find-renames[=<n>]::\n> > \n> > Umm.  The reasoning seems ok for me, but the farthest you can go is\n> > deprecating the options.  Removing them as in\n> > \n> > > -\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--detect-renames=\") ||\n> > > -\t\t !strcmp(arg, \"--detect-renames\")) {\n> > > +\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--find-renames=\") ||\n> > > +\t\t !strcmp(arg, \"--find-renames\")) {\n> > \n> > would break backwards compatibility.\n> \n> I don't think we care with compatibility here, since those are not\n> part of any release.\n\nAh well.  You're right of course, but you could have mentioned that\nsomewhere :-)\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"155755","messageId":"7884E3F5-D622-49E2-BEBE-12936F388C30@sb.org","threadId":"25703","inReplyTo":"1289420833-20602-2-git-send-email-ydirson@altern.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-12T03:00:05Z","receivedAt":"2010-11-12T03:00:05Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 10, 2010, at 12:27 PM, Yann Dirson wrote:\n\n> -M[<n>]::\n> ---detect-renames[=<n>]::\n> +--find-renames[=<n>]::\n> ifndef::git-log[]\n> \tDetect renames.\n> endif::git-log[]\n> @@ -246,7 +246,7 @@ endif::git-log[]\n> \thasn't changed.\n> \n> -C[<n>]::\n> ---detect-copies[=<n>]::\n> +--find-copies[=<n>]::\n> \tDetect copies as well as renames.  See also `--find-copies-harder`.\n> \tIf `n` is specified, it has the same meaning as for `-M<n>`.\n\nI'm not sure I like the wording --find-copies and --find-renames. Maybe I'm\njust being silly, but it sounds like those are directives, saying \"I want you\nto find copies/renames\", as opposed to just saying \"while you're working you\nshould also detect copies/renames\". The original flag --find-copies-harder\nis a bit different, because it's modifying the action of finding copies\nrather than making finding copies the prime directive.\n\nOn the other hand, --detect-copies and --detect-renames sounds to me like\nyou're just telling it that it should, well, detect copies/renames as it goes\nabout its business.\n\n-Kevin Ballard\n"},{"id":"155756","messageId":"buomxpfry90.fsf@dhlpc061.dev.necel.com","threadId":"25703","inReplyTo":"7884E3F5-D622-49E2-BEBE-12936F388C30@sb.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2010-11-12T03:56:11Z","receivedAt":"2010-11-12T03:56:11Z","isPatch":true,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Kevin Ballard <kevin@sb.org> writes:\n> I'm not sure I like the wording --find-copies and --find-renames. Maybe I'm\n> just being silly, but it sounds like those are directives, saying \"I want you\n> to find copies/renames\", as opposed to just saying \"while you're working you\n> should also detect copies/renames\". The original flag --find-copies-harder\n> is a bit different, because it's modifying the action of finding copies\n> rather than making finding copies the prime directive.\n>\n> On the other hand, --detect-copies and --detect-renames sounds to me like\n> you're just telling it that it should, well, detect copies/renames as it goes\n> about its business.\n\nI agree.  The current names are better than the proposed names.\n\n[For the reasons you state.]\n\n-Miles\n\n-- \nThe automobile has not merely taken over the street, it has dissolved the\nliving tissue of the city.  Its appetite for space is absolutely insatiable;\nmoving and parked, it devours urban land, leaving the buildings as mere\nislands of habitable space in a sea of dangerous and ugly traffic.\n[James Marston Fitch, New York Times, 1 May 1960]\n"},{"id":"155763","messageId":"20101112072154.GJ3167@home.lan","threadId":"25703","inReplyTo":"201011112324.57572.trast@student.ethz.ch","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Yann Dirson","fromEmail":"ydirson@free.fr","sentAt":"2010-11-12T07:21:55Z","receivedAt":"2010-11-12T07:21:55Z","isPatch":true,"sender":{"key":"ydirson@free.fr","avatar":null},"body":"On Thu, Nov 11, 2010 at 11:24:57PM +0100, Thomas Rast wrote:\n> Yann Dirson wrote:\n> > On Thu, Nov 11, 2010 at 11:47:04AM +0100, Thomas Rast wrote:\n> > > Yann Dirson wrote:\n> > > > Rationale: this is both shorter to spell and consistent with\n> > > > --find-copies-harder.\n> > > [...]\n> > > >  -M[<n>]::\n> > > > ---detect-renames[=<n>]::\n> > > > +--find-renames[=<n>]::\n> > > \n> > > Umm.  The reasoning seems ok for me, but the farthest you can go is\n> > > deprecating the options.  Removing them as in\n> > > \n> > > > -\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--detect-renames=\") ||\n> > > > -\t\t !strcmp(arg, \"--detect-renames\")) {\n> > > > +\telse if (!prefixcmp(arg, \"-M\") || !prefixcmp(arg, \"--find-renames=\") ||\n> > > > +\t\t !strcmp(arg, \"--find-renames\")) {\n> > > \n> > > would break backwards compatibility.\n> > \n> > I don't think we care with compatibility here, since those are not\n> > part of any release.\n> \n> Ah well.  You're right of course, but you could have mentioned that\n> somewhere :-)\n\nAh, I was sure I did, but apprently not :)\n"},{"id":"155764","messageId":"20101112074312.GG8911@home.lan","threadId":"25703","inReplyTo":"7884E3F5-D622-49E2-BEBE-12936F388C30@sb.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Yann Dirson","fromEmail":"ydirson@free.fr","sentAt":"2010-11-12T07:43:12Z","receivedAt":"2010-11-12T07:43:12Z","isPatch":true,"sender":{"key":"ydirson@free.fr","avatar":null},"body":"On Thu, Nov 11, 2010 at 07:00:05PM -0800, Kevin Ballard wrote:\n> On Nov 10, 2010, at 12:27 PM, Yann Dirson wrote:\n> \n> > -M[<n>]::\n> > ---detect-renames[=<n>]::\n> > +--find-renames[=<n>]::\n> > ifndef::git-log[]\n> > \tDetect renames.\n> > endif::git-log[]\n> > @@ -246,7 +246,7 @@ endif::git-log[]\n> > \thasn't changed.\n> > \n> > -C[<n>]::\n> > ---detect-copies[=<n>]::\n> > +--find-copies[=<n>]::\n> > \tDetect copies as well as renames.  See also `--find-copies-harder`.\n> > \tIf `n` is specified, it has the same meaning as for `-M<n>`.\n> \n> I'm not sure I like the wording --find-copies and --find-renames. Maybe I'm\n> just being silly, but it sounds like those are directives, saying \"I want you\n> to find copies/renames\", as opposed to just saying \"while you're working you\n> should also detect copies/renames\". The original flag --find-copies-harder\n> is a bit different, because it's modifying the action of finding copies\n> rather than making finding copies the prime directive.\n\nWell, I don't see how --find-copies-harder is much different: it is\njust a more powerful version of -C, as seen by the fact that it implies -C.\n\n\n> On the other hand, --detect-copies and --detect-renames sounds to me like\n> you're just telling it that it should, well, detect copies/renames as it goes\n> about its business.\n\nI can understand this.  However, I feel that the fact they are just\noptions, as opposed to the explicit \"diff/show/whatever\" commands that\ntake them as modifiers, would be enough to balance the nuance in the\nwords.  That may just be a matter of taste, but the consistency with\n--find-copies-harder may be important here.\n\n-- \nYann\n"},{"id":"156002","messageId":"7vtyjhi3a5.fsf@alter.siamese.dyndns.org","threadId":"25703","inReplyTo":"1289420833-20602-3-git-send-email-ydirson@altern.org","subject":"Re: [PATCH 2/2] Keep together options controlling the behaviour of diffcore-rename.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-16T17:31:14Z","receivedAt":"2010-11-16T17:31:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <ydirson@altern.org> writes:\n\n> It makes little sense to have --diff-filter in the middle of them, and\n> even spares an ifndef::git-format-patch.\n\nMakes sense; thanks.\n"},{"id":"156844","messageId":"20101129215355.GA3445@home.lan","threadId":"25703","inReplyTo":"1289420833-20602-2-git-send-email-ydirson@altern.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Yann Dirson","fromEmail":"ydirson@free.fr","sentAt":"2010-11-29T21:53:55Z","receivedAt":"2010-11-29T21:53:55Z","isPatch":true,"sender":{"key":"ydirson@free.fr","avatar":null},"body":"So is there an official decision that this idea was a bad one and\nshould I drop this patch from my outq ?\n"},{"id":"156847","messageId":"7vmxorzr8k.fsf@alter.siamese.dyndns.org","threadId":"25703","inReplyTo":"7884E3F5-D622-49E2-BEBE-12936F388C30@sb.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-29T22:42:35Z","receivedAt":"2010-11-29T22:42:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kevin Ballard <kevin@sb.org> writes:\n\n> On Nov 10, 2010, at 12:27 PM, Yann Dirson wrote:\n>\n>> -M[<n>]::\n>> ---detect-renames[=<n>]::\n>> +--find-renames[=<n>]::\n>> ifndef::git-log[]\n>> \tDetect renames.\n>> endif::git-log[]\n>> @@ -246,7 +246,7 @@ endif::git-log[]\n>> \thasn't changed.\n>> \n>> -C[<n>]::\n>> ---detect-copies[=<n>]::\n>> +--find-copies[=<n>]::\n>> \tDetect copies as well as renames.  See also `--find-copies-harder`.\n>> \tIf `n` is specified, it has the same meaning as for `-M<n>`.\n>\n> I'm not sure I like the wording --find-copies and --find-renames. Maybe I'm\n> just being silly, but it sounds like those are directives, saying \"I want you\n> to find copies/renames\", as opposed to just saying \"while you're working you\n> should also detect copies/renames\". The original flag --find-copies-harder\n> is a bit different, because it's modifying the action of finding copies\n> rather than making finding copies the prime directive.\n>\n> On the other hand, --detect-copies and --detect-renames sounds to me like\n> you're just telling it that it should, well, detect copies/renames as it goes\n> about its business.\n\nHmm, but your \"harder is different\" comes from the knowledge of how it\nworks (namely, the set of paths the frontend feeds to diffcore is made\nlarger), which does not concern the end user.  Also the same logic of\nyours can be applied to argue for renaming \"detect renames\" to \"find\nrenames\", as it _does_ tell diffcore to activate the rename finding\nmachinery, i.e. it is modifying the action of computing the differences.\n\nSo I think using the same verb would make sense, either by introducing a\nnew synonym \"detect-copies-harder\", or by giving longer \"find-copies\" and\n\"find-renames\" options to not-so-hard ones.\n"},{"id":"156848","messageId":"7vipzfzr58.fsf@alter.siamese.dyndns.org","threadId":"25703","inReplyTo":"20101129215355.GA3445@home.lan","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-29T22:44:35Z","receivedAt":"2010-11-29T22:44:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <ydirson@free.fr> writes:\n\n> So is there an official decision that this idea was a bad one and\n> should I drop this patch from my outq ?\n\nI was hoping that I didn't have to make any official decision ;-)\n\nFor what I think, please see my other message.\n"},{"id":"156850","messageId":"34E173EF-658B-49CC-99C4-C455074D4A05@sb.org","threadId":"25703","inReplyTo":"7vmxorzr8k.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-29T22:52:59Z","receivedAt":"2010-11-29T22:52:59Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 29, 2010, at 2:42 PM, Junio C Hamano wrote:\n\n>> I'm not sure I like the wording --find-copies and --find-renames. Maybe I'm\n>> just being silly, but it sounds like those are directives, saying \"I want you\n>> to find copies/renames\", as opposed to just saying \"while you're working you\n>> should also detect copies/renames\". The original flag --find-copies-harder\n>> is a bit different, because it's modifying the action of finding copies\n>> rather than making finding copies the prime directive.\n>> \n>> On the other hand, --detect-copies and --detect-renames sounds to me like\n>> you're just telling it that it should, well, detect copies/renames as it goes\n>> about its business.\n> \n> Hmm, but your \"harder is different\" comes from the knowledge of how it\n> works (namely, the set of paths the frontend feeds to diffcore is made\n> larger), which does not concern the end user.  Also the same logic of\n> yours can be applied to argue for renaming \"detect renames\" to \"find\n> renames\", as it _does_ tell diffcore to activate the rename finding\n> machinery, i.e. it is modifying the action of computing the differences.\n\nI will admit I am not an unbiased observer, but I still think\n--find-copies-harder is less of a directive and more of a modifier than\n--find-copies is.\n\n> So I think using the same verb would make sense, either by introducing a\n> new synonym \"detect-copies-harder\", or by giving longer \"find-copies\" and\n> \"find-renames\" options to not-so-hard ones.\n\nGiven my druthers, I'd prefer to go with --detect-copies-harder, but at this\npoint I don't have as much of a strong preference anymore.\n\n-Kevin Ballard\n\n-- 8< --\nSubject: [PATCH] diff: add --detect-copies-harder as a synonym for --find-copies-harder\n\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\n Documentation/diff-options.txt |    1 +\n diff.c                         |    2 +-\n 2 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex f3e9538..7246e10 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -251,6 +251,7 @@ endif::git-log[]\n \tIf `n` is specified, it has the same meaning as for `-M<n>`.\n \n --find-copies-harder::\n+--detect-copies-harder::\n \tFor performance reasons, by default, `-C` option finds copies only\n \tif the original file of the copy was modified in the same\n \tchangeset.  This flag makes the command\ndiff --git a/diff.c b/diff.c\nindex 6991ed4..faa8dc0 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -3198,7 +3198,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n \t\tDIFF_OPT_SET(options, TEXT);\n \telse if (!strcmp(arg, \"-R\"))\n \t\tDIFF_OPT_SET(options, REVERSE_DIFF);\n-\telse if (!strcmp(arg, \"--find-copies-harder\"))\n+\telse if (!strcmp(arg, \"--find-copies-harder\") || !strcmp(arg, \"--detect-copies-harder\"))\n \t\tDIFF_OPT_SET(options, FIND_COPIES_HARDER);\n \telse if (!strcmp(arg, \"--follow\"))\n \t\tDIFF_OPT_SET(options, FOLLOW_RENAMES);\n-- \n1.7.3.2.615.g83f72.dirty\n"},{"id":"156866","messageId":"7vfwujy7co.fsf@alter.siamese.dyndns.org","threadId":"25703","inReplyTo":"34E173EF-658B-49CC-99C4-C455074D4A05@sb.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-30T00:37:27Z","receivedAt":"2010-11-30T00:37:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kevin Ballard <kevin@sb.org> writes:\n\n>> So I think using the same verb would make sense, either by introducing a\n>> new synonym \"detect-copies-harder\", or by giving longer \"find-copies\" and\n>> \"find-renames\" options to not-so-hard ones.\n>\n> Given my druthers, I'd prefer to go with --detect-copies-harder, but at this\n> point I don't have as much of a strong preference anymore.\n\nThe patch is smaller, and we often say \"rename detection\", not \"rename\nfinding\", so it may probably make more sense.\n\nThanks.\n\n> -Kevin Ballard\n>\n> -- 8< --\n> Subject: [PATCH] diff: add --detect-copies-harder as a synonym for --find-copies-harder\n>\n>\n> Signed-off-by: Kevin Ballard <kevin@sb.org>\n> ---\n>  Documentation/diff-options.txt |    1 +\n>  diff.c                         |    2 +-\n>  2 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\n> index f3e9538..7246e10 100644\n> --- a/Documentation/diff-options.txt\n> +++ b/Documentation/diff-options.txt\n> @@ -251,6 +251,7 @@ endif::git-log[]\n>  \tIf `n` is specified, it has the same meaning as for `-M<n>`.\n>  \n>  --find-copies-harder::\n> +--detect-copies-harder::\n>  \tFor performance reasons, by default, `-C` option finds copies only\n>  \tif the original file of the copy was modified in the same\n>  \tchangeset.  This flag makes the command\n> diff --git a/diff.c b/diff.c\n> index 6991ed4..faa8dc0 100644\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -3198,7 +3198,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n>  \t\tDIFF_OPT_SET(options, TEXT);\n>  \telse if (!strcmp(arg, \"-R\"))\n>  \t\tDIFF_OPT_SET(options, REVERSE_DIFF);\n> -\telse if (!strcmp(arg, \"--find-copies-harder\"))\n> +\telse if (!strcmp(arg, \"--find-copies-harder\") || !strcmp(arg, \"--detect-copies-harder\"))\n>  \t\tDIFF_OPT_SET(options, FIND_COPIES_HARDER);\n>  \telse if (!strcmp(arg, \"--follow\"))\n>  \t\tDIFF_OPT_SET(options, FOLLOW_RENAMES);\n> -- \n> 1.7.3.2.615.g83f72.dirty\n"},{"id":"156883","messageId":"20101130082808.415dc3c1@chalon.bertin.fr","threadId":"25703","inReplyTo":"7vfwujy7co.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for","fromName":"Yann Dirson","fromEmail":"dirson@bertin.fr","sentAt":"2010-11-30T07:28:08Z","receivedAt":"2010-11-30T07:28:08Z","isPatch":true,"sender":{"key":"dirson@bertin.fr","avatar":null},"body":"Junio:\n> Kevin wrote:\n> > Given my druthers, I'd prefer to go with --detect-copies-harder, but\n> > at this point I don't have as much of a strong preference anymore.\n>\n> The patch is smaller, and we often say \"rename detection\", not \"rename\n> finding\", so it may probably make more sense.\n\nOTOH:\n\n* when cumulated to the still-recent patch adding the long forms, not\n  using a synonym is shorter\n\n* if it is just \"adding a synonym\" without deprecation, it only\n  adds a new option for little gain; OTOH deprecating such an old\n  option may not be such a good idea (not to mention it would make the\n  patch longer ;)\n\n* The --find-* forms are still shorter to spell\n\n-- \nYann Dirson - Bertin Technologies\n"}]}