git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC] Teach diff to imply --find-copies-harder upon -C -C

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 11, 2007, 20:12 UTC
Message-ID
<Pine.LNX.4.64.0706112109180.4059@racer.site>

earlier, a second "-C" on the command line had no effect. But since I use "--find-copies-harder" quite a bit, and it is so long to type, and I am an inherently lazy person, I'd like the second "-C" to be a shortcut for "--find-copies-harder".

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 diff.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 1d234d3..4aa9bbc 100644
--- a/diff.c
+++ b/diff.c
@@ -2201,6 +2201,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 		options->detect_rename = DIFF_DETECT_RENAME;
 	}
 	else if (!prefixcmp(arg, "-C")) {
+		if (options->detect_rename == DIFF_DETECT_COPY)
+			options->find_copies_harder = 1;
 		if ((options->rename_score =
 		     diff_scoreopt_parse(arg)) == -1)
 			return -1;
Next: Brian Gernhardt
Message 1 of 3 in “[RFC] Teach diff to imply --find-copies-harder upon -C -C”
  1. Johannes SchindelinJun 11, 2007
  2. Brian GernhardtJun 11, 2007
  3. Junio C HamanoJun 12, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.