clean up use get_source_tarball_from_git to use same checkout mechanism for creating tarball for Git repos with tags and commits#4797
Merged
boegel merged 4 commits intoeasybuilders:5.0.xfrom Mar 7, 2025
Conversation
get_source_tarball_from_git to use same checkout mechanism for creating tarball for Git repos with tags and commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is an extensive code cleanup of
get_source_tarball_from_git(+25 -61). There are no changes in behaviour and one little bugfix.Follow-up to the issues investigated in #4793
Motivation:
git clone --no-checkout {repo}git checkout {tag/commit}git submodules update --init ...git cloneis shallow (with--depth 1), but in all such cases we end up unshallowing the repo. So there is no speed gain in any case. And this is expected, since we only checkout specific tags or commits (that's required), we cannot know how old those are, so we always have to fetch the full history of the repo. So this PR removes shallow clones in all cases.git_configoptionrecurse-submodulesis currently broken. The git option--recurse-submodulescan only be used with a list of pathspecs ingit clone, not ingit submoduleas it is currently done. The fix is rather simple, we can pass those pathspecs in the same way directly togit submodulewithout any--recurse-submodulesThis PR adds several new tests to
test_github_get_source_tarball_from_gitto tests all these features with a test repo. Currently most of these features are not tested at all beyond checking the git command generated byget_source_tarball_from_git.The new tests need a companion PR to https://github.com/easybuilders/testrepository
update: companion PR ready