What I'm trying to do: test pull requests from github. I want to locally merge a pull request into master and run some tests on the result. Since the repository is huge, I do a shallow clone.
To be able to do the merge, I fetch more and more commits (git fetch
with increasing --depth
) until I have the merge-commit
between master the pull request.
However, it doesn't work every time. It looks like I do not only need the merge-base, but also every commit in the master..merge
_base range. I'm not sure however how to do that.
So, the question is: how do I fetch enough history to do the merge?
What you need (I think), in a catch-22 way, is 'git describe --all --first-parent' to tell you the depth of the given commit from the appropriate branch. However I'm not sure how to get that from Github before you do your shallow fetch ;-)