[PATCH RFC 0/5] Introduce git-blame-tree(1) command
- From
Toon Claes <toon@iotcl.com>
- Date
- Apr 22, 2025, 17:46 UTC
- Message-ID
- <20250422-toon-new-blame-tree-v1-0-fdb51b8a394a@iotcl.com>
This is another attempt to upstream the git-blame-tree(1) subcommand. After the previous attempt[1] the people of GitHub shared their version of the subcommand, and this version integrates those changes.
What is different from the series shared by GitHub:
* Patches for --max-depth are excluded. I think it's a separate topic to discuss and I'm not sure it needs to be part of blame-tree anyway. The main patch was submitted in the previous attempt[2] and if people consider it valuable, I'm happy to discuss that in a separate patch series.
* The patches in 'tb/blame-tree' at Taylor's fork[3] implements a caching layer. This feature reads/writes cached blame-tree results in `.git/blame-tree/<hash>.btc`. To keep this series to a reviewable size, that feature is excluded from this series. I think it's better to submit this as a separate series.
* Squashed various commits together. Like they introduced a flag `--go-faster`, which later became the default and only implementation. That story was wrapped up in a single commit.
* The blame-tree command isn't recursive by default. If you want recurse into subtrees, you need to pass `-r`.
* Fixed all memory leaks, and removed the use of USE_THE_REPOSITORY_VARIABLE.
I've attempted to reuse commit messages as good as possible, but feel free to correct me where you think I didn't give proper credit or messed up. Although I have no idea what to do with the Signed-off-by trailers.
I didn't modify the benchmark results in the commit messages, simply because I didn't get comparable results. In my benchmarks the difference between two implementations was negligible, and even in some scenarios the performance was worse in the "improved" implementation. As far as I can tell, I didn't break anything in my refactoring, because the version in these patches acts similar to Taylor's branch. To be honest, I cannot explain why...?
With this version I'd like to gather feedback as much as possible for a next version. I realize this feature is far from done, so that's why I'm submitting it as an RFC.
Again thanks to Taylor and the people at GitHub for sharing these patches. I hope we can work together to get this upstreamed.
[1]: https://lore.kernel.org/git/20250326-toon-blame-tree-v1-0-4173133f3786@iotcl.com/ [2]: https://lore.kernel.org/git/20250326-toon-blame-tree-v1-3-4173133f3786@iotcl.com/ [3]: git@github.com:ttaylorr/git.git
-- Toon
Signed-off-by: Toon Claes <toon@iotcl.com>
---
Jeff King (1):
t/perf: add blame-tree perf scriptTaylor Blau (2):
blame-tree: use Bloom filters when available
blame-tree: implement faster algorithmToon Claes (2):
blame-tree: introduce new subcommand to blame files
blame-tree.c: initialize revision machinery without walk.gitignore | 1 + Makefile | 2 + blame-tree.c | 496 +++++++++++++++++++++++++++++++++++++++++++++ blame-tree.h | 30 +++ builtin.h | 1 + builtin/blame-tree.c | 43 ++++ git.c | 1 + meson.build | 2 + t/helper/test-tool.h | 1 + t/meson.build | 1 + t/perf/p8020-blame-tree.sh | 21 ++ t/t8020-blame-tree.sh | 148 ++++++++++++++ 12 files changed, 747 insertions(+) ---
---
base-commit: 4bbb303af69990ccd05fe3a2eb58a1ce036f8220 change-id: 20250410-toon-new-blame-tree-bcdbb78c1c0f
Thanks -- Toon