-
Notifications
You must be signed in to change notification settings - Fork 41
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
kart merge doesn't work with shallow clones #555
Comments
Correction - this fails within libgit2 function |
Related - libgit2 shallow-clones tracking issue libgit2/libgit2#3058 |
olsen232
added a commit
that referenced
this issue
Feb 17, 2022
libgit2 doesn't support shallow clones, and so operations that involve walking back through the commits like `git_merge_base` can fail (depending on the exact circumstances). This workaround simply switches to using `git merge-base` instead - the same functionality, but from within git, which does support shallow clones. Adds a test case to show it is fixed.
olsen232
added a commit
that referenced
this issue
Feb 17, 2022
libgit2 doesn't support shallow clones, and so operations that involve walking back through the commits like `git_merge_base` can fail (depending on the exact circumstances). This workaround simply switches to using `git merge-base` instead - the same functionality, but from within git, which does support shallow clones. Adds a test case to show it is fixed.
3 tasks
olsen232
added a commit
that referenced
this issue
Feb 17, 2022
Fix for #555 - issues with merge + shallow clones
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to merge two commits that share an ancestor, and that ancestor has a parent, and that parent is missing due to being a shallow clone, fails with the following error:
It's not clear why this wouldn't work - I'll do some digging. It fails within libgit2 function
git_merge_trees
somewhere.There is no issue with merging in a shallow clone as long as both the ancestor and the ancestor's parent are both present. So, this can be avoided by doing a clone one deeper than you think you need - if you think you need a clone with depth=1, clone it with depth=2 so that you have one more parent and everything will work fine.
There may also be an issue where merges fail if the ancestor itself is missing due to shallow-clone - this is more understandable / unavoidable however, since, without the merge-ancestor, we don't know how each branch has changed, so we don't really know what we are merging. In this case, the fix would be to deepen the clone at least as far as the merge ancestor before performing the merge.
This was found as part of spatial filtering testing but is not actually related to spatial filtering and is not a regression - all versions of Kart have this issue.
The text was updated successfully, but these errors were encountered: