From: Michael Haggerty <mhagger@alum.mit.edu>
To: git@vger.kernel.org
Cc: "Ramsay Jones" <ramsay@ramsayjones.plus.com>,
"René Scharfe" <l.s.r@web.de>,
"Stefan Beller" <sbeller@google.com>,
"Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"Jakub Narębski" <jnareb@gmail.com>,
"Jacob Keller" <jacob.keller@gmail.com>,
"Michael Haggerty" <mhagger@alum.mit.edu>
Subject: [PATCH v3 0/8] Better heuristics make prettier diffs
Date: Mon, 5 Sep 2016 11:44:45 +0200 [thread overview]
Message-ID: <cover.1473068229.git.mhagger@alum.mit.edu> (raw)
This is v3 of the diff-indent-heuristic patch series. Thanks to René,
Junio, and Ramsay for their comments about v2 [1,2].
The heuristic itself hasn't changed since v2. Most of the changes are
in the tests and in how `git blame` is wired up to support the new
options. Changes since v1:
* In "diff: improve positioning of add/delete blocks in diffs":
* Make `score_cmp()` static.
* Add test t4059 as part of this commit, not as part of its
successor.
* t4059: Create commits to use for the tests (rather than diffing
loose files with `--no-cache`), so that the same prep can be used
to test `git blame`. Split the tests into multiple smaller tests.
* Add a test that `--no-indent-heuristic` overrides the config.
* Add a new commit "parse-options: add parse_opt_unknown_cb()":
* Allow "-h" help text to be generated for options even if they are
being handled by code external to `parse_options()`.
If there's already a way to do this, I didn't find it.
* In "blame: honor the diff heuristic options and config":
* In v2, I suggested making `blame` honor all diff-related options.
Junio explained why this was a bad idea. So this version only
makes `blame` honor `--indent-heuristic` and
`--compaction-heuristic`.
* Add some smoke tests.
This patch series is also available from my GitHub fork [3], branch
"diff-indent-heuristic"
[1] http://public-inbox.org/git/cover.1471864378.git.mhagger@alum.mit.edu/
[2] http://public-inbox.org/git/a27aa17e-f602-fc49-92b3-2198e4772e47@ramsayjones.plus.com/
[3] https://github.com/mhagger/git
Michael Haggerty (8):
xdl_change_compact(): fix compaction heuristic to adjust ixo
xdl_change_compact(): only use heuristic if group can't be matched
is_blank_line(): take a single xrecord_t as argument
recs_match(): take two xrecord_t pointers as arguments
xdl_change_compact(): introduce the concept of a change group
diff: improve positioning of add/delete blocks in diffs
parse-options: add parse_opt_unknown_cb()
blame: honor the diff heuristic options and config
Documentation/diff-config.txt | 7 +-
Documentation/diff-heuristic-options.txt | 7 +
Documentation/diff-options.txt | 7 +-
Documentation/git-annotate.txt | 1 +
Documentation/git-blame.txt | 2 +
builtin/blame.c | 12 +
diff.c | 36 +-
diff.h | 1 +
git-add--interactive.perl | 5 +-
parse-options-cb.c | 12 +
parse-options.h | 1 +
t/t4059-diff-indent.sh | 216 +++++++++++
xdiff/xdiff.h | 1 +
xdiff/xdiffi.c | 635 ++++++++++++++++++++++++++-----
14 files changed, 828 insertions(+), 115 deletions(-)
create mode 100644 Documentation/diff-heuristic-options.txt
create mode 100755 t/t4059-diff-indent.sh
--
2.9.3
next reply other threads:[~2016-09-05 9:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-05 9:44 Michael Haggerty [this message]
2016-09-05 9:44 ` [PATCH v3 1/8] xdl_change_compact(): fix compaction heuristic to adjust ixo Michael Haggerty
2016-09-05 9:44 ` [PATCH v3 2/8] xdl_change_compact(): only use heuristic if group can't be matched Michael Haggerty
2016-09-05 9:44 ` [PATCH v3 3/8] is_blank_line(): take a single xrecord_t as argument Michael Haggerty
2016-09-05 9:44 ` [PATCH v3 4/8] recs_match(): take two xrecord_t pointers as arguments Michael Haggerty
2016-09-05 9:44 ` [PATCH v3 5/8] xdl_change_compact(): introduce the concept of a change group Michael Haggerty
2016-09-05 9:44 ` [PATCH v3 6/8] diff: improve positioning of add/delete blocks in diffs Michael Haggerty
2016-09-05 9:44 ` [PATCH v3 7/8] parse-options: add parse_opt_unknown_cb() Michael Haggerty
2016-09-05 9:44 ` [PATCH v3 8/8] blame: honor the diff heuristic options and config Michael Haggerty
2016-09-07 18:11 ` [PATCH v3 0/8] Better heuristics make prettier diffs Junio C Hamano
2016-09-07 21:21 ` Jacob Keller
2016-09-07 23:25 ` Junio C Hamano
2016-09-19 6:35 ` Michael Haggerty
2016-09-19 16:05 ` Junio C Hamano
2016-09-19 17:27 ` Junio C Hamano
2016-09-20 6:33 ` Michael Haggerty
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=cover.1473068229.git.mhagger@alum.mit.edu \
--to=mhagger@alum.mit.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.keller@gmail.com \
--cc=jnareb@gmail.com \
--cc=l.s.r@web.de \
--cc=peff@peff.net \
--cc=ramsay@ramsayjones.plus.com \
--cc=sbeller@google.com \
/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).