-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip uninteresting commits for blame #1743
base: main
Are you sure you want to change the base?
Skip uninteresting commits for blame #1743
Conversation
50e9f97
to
20a90a2
Compare
Pass blame to parent in `process_change`. `git`’s algorithm only seems to keep the current suspect for unblamed hunks that were the direct result of splitting an existing unblamed hunk because it matched with a change. All other hunks appear to be blamed on the parent without further checks.
20a90a2
to
efa0057
Compare
I think (and hope :-)) that this PR is now ready for the first round of reviews. There’s still two or three Also, the traversal is now much closer to what
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a massive speedup, fantastic work! And sorry for the late (first) review, I am now totally behind on emails each, catching up only during the weekend.
When looking at the commits I saw that they are a bit all over the place, often touching multiple crates at the same time. This is OK when not using <prefix>: <subject>
notation, but it's not otherwise.
Can we practice this by adjusting the <prefix>: <subject>
commits so that they only touch a single crate? This can be followed by an adapt to changes in <crate>
commit to make fixes that make it compile (yes, unfortunately not every commit would pass CI, but it's for getting proper changelogs).
In that moment, please feel free to squash other commits that might not be so valuable all by themselves.
I am also more than happy to do this as part of my review, just let me know.
Sure, no problem, thanks a lot for the detailed explanation! (I wasn’t aware that this means accepting intermediate commits that don’t pass CI.) I will rearrange the commits, but I will only get to it on Monday or Tuesday, so feel free to take over if you get to it earlier! |
This PR is a PoC. It is a first attempt at implementing custom graph traversal for
blame::file
. This allows us to skip commits that we know don’t contain changes to the file being blamed. The PR is rough around the edges and contains a lot ofTODO
s andtodo!()
s.A first round of tests showed a significant reduction in the number of commits traversed for
gix blame STABILITY.md
:Also, profiling
gix blame STABILITY.md
on my machine revealed that the command took about 20 % less time to run.