From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "René Scharfe" <rene.scharfe@lsrfire.ath.cx>,
"Tay Ray Chuan" <rctay89@gmail.com>
Subject: Re: [PATCH] diff: resurrect XDF_NEED_MINIMAL with --minimal
Date: Mon, 3 Oct 2011 07:38:43 -0500 [thread overview]
Message-ID: <20111003123843.GA15493@elie> (raw)
In-Reply-To: <7voby0j86c.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> * 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").
Very neat.
> --- 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=")) {
I think this would fit well near --patience (the "xdiff options"
section), instead of hidden between the unsticked and sticked forms of
--abbrev. ;-)
Like this:
diff --git i/Documentation/diff-options.txt w/Documentation/diff-options.txt
index b620b3af..4d87256e 100644
--- i/Documentation/diff-options.txt
+++ w/Documentation/diff-options.txt
@@ -48,6 +48,10 @@ endif::git-format-patch[]
--patience::
Generate a diff using the "patience diff" algorithm.
+--minimal::
+ Spend extra time to make sure the smallest possible
+ diff is produced.
+
--stat[=<width>[,<name-width>[,<count>]]]::
Generate a diffstat. You can override the default
output width for 80-column terminal by `--stat=<width>`.
diff --git i/diff.c w/diff.c
index fcc00780..2282f86f 100644
--- i/diff.c
+++ w/diff.c
@@ -3393,6 +3393,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
DIFF_XDL_SET(options, IGNORE_WHITESPACE_AT_EOL);
else if (!strcmp(arg, "--patience"))
DIFF_XDL_SET(options, PATIENCE_DIFF);
+ 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 (!strcmp(arg, "--histogram"))
DIFF_XDL_SET(options, HISTOGRAM_DIFF);
next prev parent reply other threads:[~2011-10-03 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-02 5:04 [PATCH] diff: resurrect XDF_NEED_MINIMAL with --minimal Junio C Hamano
2011-10-03 12:38 ` Jonathan Nieder [this message]
2011-10-03 13:04 ` Tay Ray Chuan
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111003123843.GA15493@elie \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=rctay89@gmail.com \
--cc=rene.scharfe@lsrfire.ath.cx \
/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.
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 NNTP newsgroup(s).