From: Barret Rhoden <brho@google.com>
To: git@vger.kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"David Kastrup" <dak@gnu.org>, "Jeff King" <peff@peff.net>,
"Jeff Smith" <whydoubt@gmail.com>,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Junio C Hamano" <gitster@pobox.com>,
"René Scharfe" <l.s.r@web.de>,
"Stefan Beller" <stefanbeller@gmail.com>,
"Michael Platings" <michael@platin.gs>
Subject: [PATCH v7 0/8] blame: add the ability to ignore commits
Date: Wed, 15 May 2019 17:44:55 -0400 [thread overview]
Message-ID: <20190515214503.77162-1-brho@google.com> (raw)
This patch set adds the ability to ignore a set of commits and their
changes when blaming. This can be used to ignore a commit deemed 'not
interesting,' such as reformatting.
The main change to this patchset from previous versions is the addition of
Michael's fuzzy fingerprinting logic. It's added in its own commit, and
integrated into the more generic blame-ignore logic in the final commit of the
patch set.
v6 -> v7
v6: https://public-inbox.org/git/20190410162409.117264-1-brho@google.com
- Split the init_skiplist commit into two commits: "change variable names" then
"move the function".
- Fixed the test's usage of grep, from grep "\+" to grep -E "+".
- Fixed comments related to fsck.skipList, added them to config/blame.txt
- A line in the blame output is either "ignored" or "unblamable", not both.
- Changed the way we mark lines. In particular, we don't zero-out the hash
anymore for unblamables, since all zeros already had a meaning. We also
distinguish between ignored and unblamable. Here's the new style:
? for ignored
* for unblamable
Both of those markings are controlled by config vars; the discussion on the
list shows that no default style works for everyone:
if blame.markIgnoredLines
Line was attributed to a commit that was not the most recent to
change it (i.e. the ignored commit) and will be marked with '?'.
Lines touched by an ignored commit that we could not blame on
another are unmarked.
if blame.markUnblamableLines
Lines touched by an ignored commit that we could not blame on
another are marked with *. I wanted to differentiate between
Ignored and Unblamable, so a single ? isn't enough.
- Added Michael's fuzzy fingerprinting code.
- We guess_line_blames() for an entire chunk, instead of per-blame entry. A diff
chunk can be made up of more than one blame_entry, which made the job of the
heuristic unnecessarily difficult.
- Rebased onto master.
v5 -> v6
v5: https://public-inbox.org/git/20190403160207.149174-1-brho@google.com/
- The "guess" heuristic can now look anywhere in the parent file for a
matching line, instead of just looking in the parent chunk. The
chunks passed to blame_chunk() are smaller than you'd expect: they are
just adjacent '-' and '+' sections. Any diff 'context' is a chunk
boundary.
- Fixed the parent_len calculation. I had been basing it off of
e->num_lines, and treating the blame entry as if it was the target
chunk, but the individual blame entries are subsets of the chunk. I
just pass the parent chunk info all the way through now.
- Use Michael's newest fingerprinting code, which is a large speedup.
- Made a config option to zero the hash for an ignored line when the
heuristic could not find a line in the parent to blame. Previously,
this was always 'on'.
- Moved the for loop variable declarations out of the for ().
- Rebased on master.
v4 -> v5
v4: https://public-inbox.org/git/20190226170648.211847-1-brho@google.com/
- Changed the handling of blame_entries from ignored commits so that you
can use any algorithm you want to map lines from the diff chunk to
different parts of the parent commit.
- fill_origin_blob() optionally can track the offsets of the start of
every line, similar to what we do in the scoreboard for the final
file. This can be used by the matching algorithm. It has no effect
if you are not ignoring commits.
- RFC of a fuzzy/fingerprinting heuristic, based on Michael Platings RFC
at https://public-inbox.org/git/20190324235020.49706-2-michael@platin.gs/
- Made the tests that detect unblamable entries more resilient to
different heuristics.
- Fixed a few bugs:
- tests were not grepping the line number from --line-porcelain
correctly.
- In the old version, when I passed the "upper" part of the
blame entry to the target and marked unblamable, the suspect
was incorrectly marked as the parent. The s_lno was also in
the parent's address space.
v3 -> v4
v3: https://public-inbox.org/git/20190212222722.240676-1-brho@google.com/
- Cleaned up the tests, especially removing usage of sed -i.
- Squashed the 'tests' commit into the other blame commits. Let me know
if you'd like further squashing.
v2 -> v3
v2: https://public-inbox.org/git/20190117202919.157326-1-brho@google.com/
- SHA-1 -> "object name", and fixed other comments
- Changed error string for oidset_parse_file()
- Adjusted existing fsck tests to handle those string changes
- Return hash of all zeros for lines we know we cannot identify
- Allow repeated options for blame.ignoreRevsFile and
--ignore-revs-file. An empty file name resets the list. Config
options are parsed before the command line options.
- Rebased to master
- Added regression tests
v1 -> v2
v1: https://public-inbox.org/git/20190107213013.231514-1-brho@google.com/
- extracted the skiplist from fsck to avoid duplicating code
- overhauled the interface and options
- split out markIgnoredFiles
- handled merges
Barret Rhoden (7):
fsck: rename and touch up init_skiplist()
Move oidset_parse_file() to oidset.c
blame: use a helper function in blame_chunk()
blame: add the ability to ignore commits and their changes
blame: add config options for the output of ignored or unblamable
lines
blame: optionally track line fingerprints during fill_blame_origin()
blame: use the fingerprint heuristic to match ignored lines
Michael Platings (1):
blame: add a fingerprint heuristic to match ignored lines
Documentation/blame-options.txt | 19 +
Documentation/config/blame.txt | 16 +
Documentation/git-blame.txt | 1 +
blame.c | 1024 +++++++++++++++++++++++++++++--
blame.h | 6 +
builtin/blame.c | 56 ++
fsck.c | 37 +-
oidset.c | 35 ++
oidset.h | 8 +
t/t5504-fetch-receive-strict.sh | 14 +-
t/t8013-blame-ignore-revs.sh | 274 +++++++++
t/t8014-blame-ignore-fuzzy.sh | 432 +++++++++++++
12 files changed, 1823 insertions(+), 99 deletions(-)
create mode 100755 t/t8013-blame-ignore-revs.sh
create mode 100755 t/t8014-blame-ignore-fuzzy.sh
--
2.21.0.1020.gf2820cf01a-goog
next reply other threads:[~2019-05-15 21:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 21:44 Barret Rhoden [this message]
2019-05-15 21:44 ` [PATCH v7 1/8] fsck: rename and touch up init_skiplist() Barret Rhoden
2019-05-15 21:44 ` [PATCH v7 2/8] Move oidset_parse_file() to oidset.c Barret Rhoden
2019-05-15 21:44 ` [PATCH v7 3/8] blame: use a helper function in blame_chunk() Barret Rhoden
2019-05-15 21:44 ` [PATCH v7 4/8] blame: add the ability to ignore commits and their changes Barret Rhoden
2019-05-15 21:45 ` [PATCH v7 5/8] blame: add config options for the output of ignored or unblamable lines Barret Rhoden
2019-05-15 21:45 ` [PATCH v7 6/8] blame: optionally track line fingerprints during fill_blame_origin() Barret Rhoden
2019-05-15 21:45 ` [PATCH v7 7/8] blame: add a fingerprint heuristic to match ignored lines Barret Rhoden
2019-05-16 7:49 ` Junio C Hamano
2019-05-16 21:57 ` [PATCH v7 7/8 (edit)] " Barret Rhoden
2019-05-17 5:12 ` Junio C Hamano
2019-05-20 20:32 ` Michael Platings
2019-05-20 20:34 ` Barret Rhoden
2019-05-28 16:39 ` Junio C Hamano
2019-05-15 21:45 ` [PATCH v7 8/8] blame: use the " Barret Rhoden
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190515214503.77162-1-brho@google.com \
--to=brho@google.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=avarab@gmail.com \
--cc=dak@gnu.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--cc=michael@platin.gs \
--cc=peff@peff.net \
--cc=stefanbeller@gmail.com \
--cc=whydoubt@gmail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).