Closed derrickstolee closed 4 weeks ago
I created derrickstolee/git#31 as a potential extension to include a more complicated edge walk to better mimic the behavior when constructing a packfile with shallow commits in it.
I created derrickstolee#31 as a potential extension to include a more complicated edge walk to better mimic the behavior when constructing a packfile with shallow commits in it.
This is really important. I was able to confirm that without the second commit, my pushes from a shallow client to a full clone caused huge packfile sizes.
I'm not sure what caused this to happen, as the revision walk should have been the same. But I guess we need to do things the hard way.
I'm not sure what caused this to happen, as the revision walk should have been the same.
Maybe the "shallow commits" are treated as uninteresting, which would be the explanation of bad deltas because they contain the valuable delta targets in --depth=1
clones.
I'm not sure what caused this to happen, as the revision walk should have been the same.
Maybe the "shallow commits" are treated as uninteresting, which would be the explanation of bad deltas because they contain the valuable delta targets in
--depth=1
clones.
In the case where I'm pushing a single commit on top of my shallow commit, that shallow commit should be revealed as a "boundary" commit. I will try to debug into things to figure out what's going on to cause this to be different.
I'm taking a break for the night. I'm running in circles and need to come back with fresh eyes.
This version should be good to go. My testing that caused issues last night were 100% because I wasn't using --no-reuse-delta
and that was causing my git pack-objects
command to trip over existing deltas. That won't happen for our targeted use case which has freshly created the objects and so no deltas will exist on disk to reuse.
Huge thanks to @dscho for prompting me to add an extra test case, demonstrating an issue with shallow pushes. We now have a lot more confidence in the correctness.
Update: I also rechecked the thin pack tests in p5313 across a variety of full and shallow repos. Everything looks good there.
I pushed the minor test name change updates in order to trigger new builds that won't time out on mac now that #700 is merged.
This pull request aims to correct a pretty big issue when dealing with UNINTERESTING objects in the path-walk API. They somehow were only exposed when trying to perform a push from a shallow clone.
This will require rewriting the upstream version so this is avoided from the start, but we can do a forward fix for now.
The key issue is that the path-walk API was not walking UNINTERESTING trees at the right time, and the way it was being done was more complicated than it needed to be. This changes some of the way the path-walk API works in the presence of UNINTERSTING commits, but these are good changes to make.
I had briefly attempted to remove the use of the
edge_aggressive
option instruct path_walk_info
in favor of using the--objects-edge-aggressive
option in the revision struct. When I started down that road, though, I somehow got myself into a bind of things not working correctly. I backed out to this version that is working with our test cases.I tested this using the thin and big pack tests in
p5313
which had the same performance as before this change.The new change is that in a shallow clone we can get the same
git push
improvements.I was hung up on testing this for a long time as I wasn't getting the same results in my shallow clone as in my regular clones. It turns out that I had forgotten to use
--no-reuse-delta
in my test command, so it was picking the deltas that were given by the initial clone instead of picking new ones per the algorithm. 🤦🏻