-
Notifications
You must be signed in to change notification settings - Fork 527
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
Use hunk dependency code for computing inter-commit dependencies #5393
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
data.into_iter() | ||
.fold(HashMap::new(), |mut acc, (commit_id, dependencies)| { | ||
acc.entry(*commit_id) | ||
.and_modify(|existing_dependencies| existing_dependencies.extend(dependencies)) | ||
.or_insert(dependencies.clone()); | ||
acc | ||
}) |
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.
Just noticed, we declared the data variable for debugging, so we can drop that, skip the .collect_vec()
and just return the concatenated the iter steps.
3922d1f
to
c9555d4
Compare
@mtsgrd Since your changes I've done a couple of things: 1. We iterate over all files and commits when calculating the dependency graphs.Before, we would only iterate over files that were present both in commits and in uncommitted changes because we were only interested on where the uncommitted files belonged. 2. I added a third hash-map that maps commit IDs to uncommitted hunks that depend on itThis enables to quickly check if a commit can't be moved because uncommitted hunks depend on it 3. Stack and Commits track dependency informationEvery time we call Missing: TestsI'll start adding some tests |
c9555d4
to
90bb67b
Compare
b133fd9
to
bf254b6
Compare
bf254b6
to
27ab858
Compare
caf4c28
to
e222389
Compare
e222389
to
ebf11d0
Compare
ebf11d0
to
cca3ccc
Compare
d9ebc9f
to
dc53da3
Compare
dc53da3
to
0618b80
Compare
4c417c3
to
22922bc
Compare
22922bc
to
0b889fa
Compare
0b889fa
to
c9c0476
Compare
c9c0476
to
49eed92
Compare
2f70aaf
to
2318577
Compare
2318577
to
8a42bc5
Compare
8a42bc5
to
9e04f52
Compare
Move fully to the new Hunk Locking algorithm, remove the references to that flag and the settings UI
Stack keeps a map of commit and uncommitted chanegs inter-dependencies
Propagate information about commit and uncommited change inter-dependencies to the commits for the FE to access
Re-implement the algorithm so that it takes account of different scenarios when comparing input diffs. Those changes include: - Awareness of change type - Detection of "special" diffs, like file deletion and file recreation - Correctly calculate the commit dependency graph between commits Also add and update unit and integration tests
Track what's the index of: - The next hunk range to visit - The index of the the first hunk range to shift after adding an incoming hunk. Also, calculate correctly the lines of the hunk ranges that are trimmed at the top in the following cases: - Incomming hunk is only deleting lines - Incomming hunk is only adding lines Add special handling for intersections with hunks that only add lines
9e04f52
to
d68dcb2
Compare
Add some high-level docs on the way the dependency graph is calculated
d68dcb2
to
0c1b127
Compare
0c1b127
to
bb86ef9
Compare
Implementation for computing dependencies and inverse dependencies between commits.
@estib-vega:
The scope of this PR escalated a bit.
Through implementing this extra functionality we discovered a couple of bugs with the new dependency calculation algorithm.
This PR reimplements parts of it to account for different (less frequent but possible) use-cases and tests to ensure that that works.
Changes