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

[PATCH] diff: resurrect XDF_NEED_MINIMAL with --minimal

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 2, 2011, 05:04 UTC
Message-ID
<7voby0j86c.fsf@alter.siamese.dyndns.org>

Earlier, 582aa00 (git diff too slow for a file, 2010-05-02) unconditionally dropped XDF_NEED_MINIMAL option from the internal xdiff invocation to help performance on pathological cases, while hinting that a follow-up patch could reintroduce it with "--minimal" option from the command line.

Make it so.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * This together with René's c5aa906 (Revert removal of multi-match
   discard heuristic in 27af01, 2011-09-25) on top of v1.7.7 seems to give
   identical diff output as v1.7.1 (e.g. "git diff-tree -p v2.6.39 v3.0"
   in the kernel repository, with "--minimal").
 diff.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 93ef9a2..34a88db 100644
--- a/diff.c
+++ b/diff.c
@@ -3511,6 +3511,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 	}
 	else if (!strcmp(arg, "--abbrev"))
 		options->abbrev = DEFAULT_ABBREV;
+	else if (!strcmp(arg, "--minimal"))
+		DIFF_XDL_SET(options, NEED_MINIMAL);
+	else if (!strcmp(arg, "--no-minimal"))
+		DIFF_XDL_CLR(options, NEED_MINIMAL);
 	else if (!prefixcmp(arg, "--abbrev=")) {
 		options->abbrev = strtoul(arg + 9, NULL, 10);
 		if (options->abbrev < MINIMUM_ABBREV)
-- 
1.7.7
Next: Jonathan Nieder
Message 1 of 3 in “diff: resurrect XDF_NEED_MINIMAL with --minimal”
  1. diff: resurrect XDF_NEED_MINIMAL with --minimalJunio C Hamano, Oct 2, 2011
  2. Jonathan NiederOct 3, 2011
  3. Tay Ray ChuanOct 3, 2011

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.