From: Toon Claes <toon@iotcl.com>
To: git@vger.kernel.org
Cc: "Jeff King" <peff@peff.net>, "Patrick Steinhardt" <ps@pks.im>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Toon Claes" <toon@iotcl.com>
Subject: [PATCH 0/8] Introduce git-blame-tree(1) command
Date: Wed, 26 Mar 2025 21:18:24 +0100 [thread overview]
Message-ID: <20250326-toon-blame-tree-v1-0-4173133f3786@iotcl.com> (raw)
This is yet another attempt to upstream the builtin command
`git-blame-tree(1)`. This command is similar to git-blame(1) and shows
the most recent modification to paths in a tree..
The last attempt (I'm aware of) was made by Ævar in 2023[1]. That
series was based of patches by Peff written in 2011[2].
In contrary to Ævar's attempt, my series implements the
`git-blame-tree(1)` standalone command. Ævar suggested to only implement
the blame-tree subsystem, and test it through test-tool. But since the
command line options of that test-tool subcommand were very similar to
the standalone command we want to land, I decided transfer the test-tool
subcommand into a real Git builtin. Also, nowadays if we want to test
the blame-tree subsystem independently, we should use clar unit tests
instead of test-tool.
This series brings back the --max-depth changes. I know Ævar removed
them because there was controversy, but I think they are relevant to
include. And I want to open up the conversation again.
Also extra patches from Peff are included to implement pathspec tries.
I've taken them from Peff's fork on GitHub[3], but they also have been
posted to this mailing list[4].
Other improvements I've made:
* Rebase onto current master.
* Remove the use of USE_THE_REPOSITORY_VARIABLE.
* Fix various memory leaks.
* Moved code from blame-tree.c to pathspec.c, as suggested in Peff's
last patch on GitHub.
* Updated the benchmark results in the last commit message, although the
numbers were roughly the same.
I don't expect this code to be deemed ready to merge, but I mainly want
to gather as much feedback as possible and use it to iterate toward
actually getting it merged.
There are some things I know that are missing, for example
`--porcelain`, but those can be added in a follow-up. At the moment
there's one test marked `test_expect_failure`, but I was not able yet
identify that bug.
So, let me know what you think?
--
Toon
[1]: https://lore.kernel.org/git/patch-1.1-0ea849d900b-20230205T204104Z-avarab@gmail.com/
[2]: https://lore.kernel.org/git/20110302164031.GA18233@sigill.intra.peff.net/
[3]: https://github.com/peff/git/tree/jk/faster-blame-tree-wip
[4]: https://lore.kernel.org/git/YN4zKVK7gvuIZ0vK@coredump.intra.peff.net/
---
Jeff King (7):
combine-diff: zero memory used for callback filepairs
within_depth: fix return for empty path
diff: teach tree-diff a max-depth parameter
pathspec: add optional trie index
pathspec: turn on tries when appropriate
tree-diff: use pathspec tries
blame-tree: narrow pathspec as we traverse
Toon Claes (1):
blame-tree: introduce new subcommand to blame files
.gitignore | 1 +
Documentation/diff-options.adoc | 26 +++++
Makefile | 3 +
blame-tree.c | 216 ++++++++++++++++++++++++++++++++++++++++
blame-tree.h | 43 ++++++++
builtin.h | 1 +
builtin/blame-tree.c | 67 +++++++++++++
combine-diff.c | 2 +-
diff-lib.c | 5 +
diff.c | 18 ++++
diff.h | 9 ++
dir.c | 2 +-
git.c | 1 +
meson.build | 2 +
pathspec.c | 216 ++++++++++++++++++++++++++++++++++++++++
pathspec.h | 27 +++++
t/helper/meson.build | 1 +
t/helper/test-pathspec.c | 96 ++++++++++++++++++
t/helper/test-tool.c | 1 +
t/helper/test-tool.h | 2 +
t/meson.build | 3 +
t/perf/p4003-diff-pathspec.sh | 26 +++++
t/t4071-diff-max-depth.sh | 109 ++++++++++++++++++++
t/t6137-pathspec-trie.sh | 57 +++++++++++
t/t8020-blame-tree.sh | 142 ++++++++++++++++++++++++++
tree-diff.c | 176 +++++++++++++++++++++++++++++---
26 files changed, 1235 insertions(+), 17 deletions(-)
---
---
base-commit: 683c54c999c301c2cd6f715c411407c413b1d84e
change-id: 20250326-toon-blame-tree-2ca74d7712ac
Thanks
--
Toon
next reply other threads:[~2025-03-26 20:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 20:18 Toon Claes [this message]
2025-03-26 20:18 ` [PATCH 1/8] combine-diff: zero memory used for callback filepairs Toon Claes
2025-03-26 20:18 ` [PATCH 2/8] within_depth: fix return for empty path Toon Claes
2025-03-26 20:18 ` [PATCH 3/8] diff: teach tree-diff a max-depth parameter Toon Claes
2025-03-26 20:18 ` [PATCH 4/8] blame-tree: introduce new subcommand to blame files Toon Claes
2025-03-26 20:18 ` [PATCH 5/8] pathspec: add optional trie index Toon Claes
2025-03-26 20:18 ` [PATCH 6/8] pathspec: turn on tries when appropriate Toon Claes
2025-03-26 20:18 ` [PATCH 7/8] tree-diff: use pathspec tries Toon Claes
2025-03-26 20:18 ` [PATCH 8/8] blame-tree: narrow pathspec as we traverse Toon Claes
2025-03-26 20:38 ` [PATCH 0/8] Introduce git-blame-tree(1) command Taylor Blau
2025-03-27 6:32 ` Jeff King
2025-03-27 21:58 ` Taylor Blau
2025-03-28 13:27 ` Toon Claes
2025-04-01 9:29 ` Jeff King
2025-03-27 12:04 ` Derrick Stolee
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=20250326-toon-blame-tree-v1-0-4173133f3786@iotcl.com \
--to=toon@iotcl.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=ps@pks.im \
/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).