git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Miles Bader <miles@gnu.org>
Cc: Yann Dirson <dirson@bertin.fr>, git list <git@vger.kernel.org>
Subject: Re: What's cooking in git.git (Dec 2010, #01; Sat, 4)
Date: Fri, 10 Dec 2010 13:59:50 -0800	[thread overview]
Message-ID: <7v4oalcmqx.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <AANLkTinJu0KzXZ2Rjbs2+XH7T=Gq5MOajxo51DHtqoGZ@mail.gmail.com> (Miles Bader's message of "Mon\, 6 Dec 2010 18\:13\:06 +0900")

Miles Bader <miles@gnu.org> writes:

> Maybe if you renamed every option simultaneously, there would be
> confusion, but seriously, it's only one option.  It's not going to be
> a problem.

Well, let's avoid all of that trouble before it is too late, by putting
this on top of what is in 'next' and ship 1.7.4 with it.

Between "find" and "detect", I do not have much preference either way.  It
may sound more active to "find" them, but if told to "detect" them, git
goes ahead and actively changes its internal behaviour in order to do so,
which amounts to an active "find"ing anyway, so...

-- >8 --
From: Yann Dirson <ydirson@altern.org>
Date: Wed, 10 Nov 2010 21:27:12 +0100
Subject: [PATCH] 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>
---
 Documentation/diff-options.txt |    5 ++---
 diff.c                         |   18 +++++++++---------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 7246e10..c93124b 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -230,7 +230,7 @@ eligible for being picked up as a possible source of a rename to
 another file.
 
 -M[<n>]::
---detect-renames[=<n>]::
+--find-renames[=<n>]::
 ifndef::git-log[]
 	Detect renames.
 endif::git-log[]
@@ -246,12 +246,11 @@ endif::git-log[]
 	hasn't changed.
 
 -C[<n>]::
---detect-copies[=<n>]::
+--find-copies[=<n>]::
 	Detect copies as well as renames.  See also `--find-copies-harder`.
 	If `n` is specified, it has the same meaning as for `-M<n>`.
 
 --find-copies-harder::
---detect-copies-harder::
 	For performance reasons, by default, `-C` option finds copies only
 	if the original file of the copy was modified in the same
 	changeset.  This flag makes the command
diff --git a/diff.c b/diff.c
index dee0bd8..b5ef1ec 100644
--- a/diff.c
+++ b/diff.c
@@ -3150,14 +3150,14 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 		if ((options->break_opt = diff_scoreopt_parse(arg)) == -1)
 			return -1;
 	}
-	else if (!prefixcmp(arg, "-M") || !prefixcmp(arg, "--detect-renames=") ||
-		 !strcmp(arg, "--detect-renames")) {
+	else if (!prefixcmp(arg, "-M") || !prefixcmp(arg, "--find-renames=") ||
+		 !strcmp(arg, "--find-renames")) {
 		if ((options->rename_score = diff_scoreopt_parse(arg)) == -1)
 			return -1;
 		options->detect_rename = DIFF_DETECT_RENAME;
 	}
-	else if (!prefixcmp(arg, "-C") || !prefixcmp(arg, "--detect-copies=") ||
-		 !strcmp(arg, "--detect-copies")) {
+	else if (!prefixcmp(arg, "-C") || !prefixcmp(arg, "--find-copies=") ||
+		 !strcmp(arg, "--find-copies")) {
 		if (options->detect_rename == DIFF_DETECT_COPY)
 			DIFF_OPT_SET(options, FIND_COPIES_HARDER);
 		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)
 		DIFF_OPT_SET(options, TEXT);
 	else if (!strcmp(arg, "-R"))
 		DIFF_OPT_SET(options, REVERSE_DIFF);
-	else if (!strcmp(arg, "--find-copies-harder") || !strcmp(arg, "--detect-copies-harder"))
+	else if (!strcmp(arg, "--find-copies-harder"))
 		DIFF_OPT_SET(options, FIND_COPIES_HARDER);
 	else if (!strcmp(arg, "--follow"))
 		DIFF_OPT_SET(options, FOLLOW_RENAMES);
@@ -3380,12 +3380,12 @@ static int diff_scoreopt_parse(const char *opt)
 			opt += strlen("break-rewrites");
 			if (*opt == 0 || *opt++ == '=')
 				cmd = 'B';
-		} else if (!prefixcmp(opt, "detect-copies")) {
-			opt += strlen("detect-copies");
+		} else if (!prefixcmp(opt, "find-copies")) {
+			opt += strlen("find-copies");
 			if (*opt == 0 || *opt++ == '=')
 				cmd = 'C';
-		} else if (!prefixcmp(opt, "detect-renames")) {
-			opt += strlen("detect-renames");
+		} else if (!prefixcmp(opt, "find-renames")) {
+			opt += strlen("find-renames");
 			if (*opt == 0 || *opt++ == '=')
 				cmd = 'M';
 		}
-- 
1.7.3.3.710.g2d012

  parent reply	other threads:[~2010-12-10 22:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-05  6:30 What's cooking in git.git (Dec 2010, #01; Sat, 4) Junio C Hamano
2010-12-05  7:39 ` Jeff King
2010-12-05 19:54   ` Junio C Hamano
2010-12-06  0:54     ` aleksi.aalto
2010-12-09 17:27     ` Jeff King
2010-12-10 19:55       ` Junio C Hamano
2010-12-05 10:13 ` Yann Dirson
2010-12-05 20:23   ` Junio C Hamano
2010-12-06  7:29     ` Yann Dirson
2010-12-06  8:13       ` Miles Bader
2010-12-06  8:21         ` Yann Dirson
2010-12-06  8:39           ` Miles Bader
2010-12-06  8:48             ` Yann Dirson
2010-12-06  9:13               ` Miles Bader
2010-12-06 11:31                 ` Yann Dirson
2010-12-06 11:37                 ` Matthieu Moy
2010-12-10 21:59                 ` Junio C Hamano [this message]
2010-12-05 12:36 ` aleksi.aalto
2010-12-05 15:51   ` Patrick Rouleau
2010-12-05 13:00 ` Erik Faye-Lund
2010-12-05 20:15   ` Junio C Hamano
2010-12-05 15:00 ` Michael J Gruber
2010-12-05 20:06   ` Junio C Hamano
2010-12-06  8:55     ` Michael J Gruber
2010-12-06 15:39       ` Thiago Farina
2010-12-08 11:23 ` t9010 broken in pu [Re: What's cooking in git.git (Dec 2010, #01; Sat, 4)] Thomas Rast
2010-12-08 11:28   ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v4oalcmqx.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=dirson@bertin.fr \
    --cc=git@vger.kernel.org \
    --cc=miles@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).