@matheusbsbs / matheus-bagliano / commits / f611ddc774
Fork 0

diff: use "find" instead of "detect" as prefix for long forms of -M and -C

It is more consistent with existing --find-copies-harder; luckily "detect" variant has not appeared in any officially released version of git. Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Yann Dirson committed Nov 10, 2010 at 21:27 UTC f611ddc774b58864b1f0b02962c524683a2f6c59
2 files changed +11 -12
Documentation/diff-options.txt
+2 -3
@@ -230,7 +230,7 @@ eligible for being picked up as a possible source of a rename to
230 another file.
231
232 -M[<n>]::
233 ---detect-renames[=<n>]::
233 +--find-renames[=<n>]::
234 ifndef::git-log[]
235 Detect renames.
236 endif::git-log[]
@@ -246,12 +246,11 @@ endif::git-log[]
246 hasn't changed.
247
248 -C[<n>]::
249 ---detect-copies[=<n>]::
249 +--find-copies[=<n>]::
250 Detect copies as well as renames. See also `--find-copies-harder`.
251 If `n` is specified, it has the same meaning as for `-M<n>`.
252
253 --find-copies-harder::
254 ---detect-copies-harder::
254 For performance reasons, by default, `-C` option finds copies only
255 if the original file of the copy was modified in the same
256 changeset. This flag makes the command
diff.c
+9 -9
@@ -3150,14 +3150,14 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
3150 if ((options->break_opt = diff_scoreopt_parse(arg)) == -1)
3151 return -1;
3152 }
3153 - else if (!prefixcmp(arg, "-M") || !prefixcmp(arg, "--detect-renames=") ||
3154 - !strcmp(arg, "--detect-renames")) {
3153 + else if (!prefixcmp(arg, "-M") || !prefixcmp(arg, "--find-renames=") ||
3154 + !strcmp(arg, "--find-renames")) {
3155 if ((options->rename_score = diff_scoreopt_parse(arg)) == -1)
3156 return -1;
3157 options->detect_rename = DIFF_DETECT_RENAME;
3158 }
3159 - else if (!prefixcmp(arg, "-C") || !prefixcmp(arg, "--detect-copies=") ||
3160 - !strcmp(arg, "--detect-copies")) {
3159 + else if (!prefixcmp(arg, "-C") || !prefixcmp(arg, "--find-copies=") ||
3160 + !strcmp(arg, "--find-copies")) {
3161 if (options->detect_rename == DIFF_DETECT_COPY)
3162 DIFF_OPT_SET(options, FIND_COPIES_HARDER);
3163 if ((options->rename_score = diff_scoreopt_parse(arg)) == -1)
@@ -3194,7 +3194,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
3194 DIFF_OPT_SET(options, TEXT);
3195 else if (!strcmp(arg, "-R"))
3196 DIFF_OPT_SET(options, REVERSE_DIFF);
3197 - else if (!strcmp(arg, "--find-copies-harder") || !strcmp(arg, "--detect-copies-harder"))
3197 + else if (!strcmp(arg, "--find-copies-harder"))
3198 DIFF_OPT_SET(options, FIND_COPIES_HARDER);
3199 else if (!strcmp(arg, "--follow"))
3200 DIFF_OPT_SET(options, FOLLOW_RENAMES);
@@ -3380,12 +3380,12 @@ static int diff_scoreopt_parse(const char *opt)
3380 opt += strlen("break-rewrites");
3381 if (*opt == 0 || *opt++ == '=')
3382 cmd = 'B';
3383 - } else if (!prefixcmp(opt, "detect-copies")) {
3384 - opt += strlen("detect-copies");
3383 + } else if (!prefixcmp(opt, "find-copies")) {
3384 + opt += strlen("find-copies");
3385 if (*opt == 0 || *opt++ == '=')
3386 cmd = 'C';
3387 - } else if (!prefixcmp(opt, "detect-renames")) {
3388 - opt += strlen("detect-renames");
3387 + } else if (!prefixcmp(opt, "find-renames")) {
3388 + opt += strlen("find-renames");
3389 if (*opt == 0 || *opt++ == '=')
3390 cmd = 'M';
3391 }