Re: [PATCH 1/2] [RFC] Use --find- instead of --detect- as prefix for long forms of -M and -C.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 29, 2010, at 2:42 PM, Junio C Hamano wrote:

>> I'm not sure I like the wording --find-copies and --find-renames. Maybe I'm
>> just being silly, but it sounds like those are directives, saying "I want you
>> to find copies/renames", as opposed to just saying "while you're working you
>> should also detect copies/renames". The original flag --find-copies-harder
>> is a bit different, because it's modifying the action of finding copies
>> rather than making finding copies the prime directive.
>> 
>> On the other hand, --detect-copies and --detect-renames sounds to me like
>> you're just telling it that it should, well, detect copies/renames as it goes
>> about its business.
> 
> Hmm, but your "harder is different" comes from the knowledge of how it
> works (namely, the set of paths the frontend feeds to diffcore is made
> larger), which does not concern the end user.  Also the same logic of
> yours can be applied to argue for renaming "detect renames" to "find
> renames", as it _does_ tell diffcore to activate the rename finding
> machinery, i.e. it is modifying the action of computing the differences.

I will admit I am not an unbiased observer, but I still think
--find-copies-harder is less of a directive and more of a modifier than
--find-copies is.

> So I think using the same verb would make sense, either by introducing a
> new synonym "detect-copies-harder", or by giving longer "find-copies" and
> "find-renames" options to not-so-hard ones.

Given my druthers, I'd prefer to go with --detect-copies-harder, but at this
point I don't have as much of a strong preference anymore.

-Kevin Ballard

-- 8< --
Subject: [PATCH] diff: add --detect-copies-harder as a synonym for --find-copies-harder


Signed-off-by: Kevin Ballard <kevin@xxxxxx>
---
 Documentation/diff-options.txt |    1 +
 diff.c                         |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index f3e9538..7246e10 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -251,6 +251,7 @@ endif::git-log[]
 	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 6991ed4..faa8dc0 100644
--- a/diff.c
+++ b/diff.c
@@ -3198,7 +3198,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"))
+	else if (!strcmp(arg, "--find-copies-harder") || !strcmp(arg, "--detect-copies-harder"))
 		DIFF_OPT_SET(options, FIND_COPIES_HARDER);
 	else if (!strcmp(arg, "--follow"))
 		DIFF_OPT_SET(options, FOLLOW_RENAMES);
-- 
1.7.3.2.615.g83f72.dirty


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]