Conversation
.gitmodules URLs like "../system.git" (used throughout boostorg/boost) were passed straight to git clone/remote, which treats them as filesystem paths rather than resolving them against the parent repository's own URL. Add resolve_submodule_url() to do that resolution the way git itself does, threaded through checkout_repo via a new fourth parameter. Absolute URLs are unaffected. Fixes tuna#161.
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.
git-recursive.shpasses each submodule's.gitmodulesURL straight togit clone --mirror/git remote set-url. When that URL is relative (e.g.url = ../system.git), git treats it as a filesystem path instead of resolving it against the parent repository's own URL, so the clone fails. The return value of the recursivegit_sync_recursivecall is never checked, so the job still reports success while those submodules are left empty. This is the root cause identified in #161 by @ZenithalHourlyRate.What changed
resolve_submodule_url(). A URL starting with./or../is resolved against the parent repository's URL the way git does (seegitsubmodules(7)). Every other form (https://,ssh://, scp-like,file://, absolute paths, ...) passes through unchanged.checkout_repotakes the current repository's own upstream URL as a fourth argument (the caller already has it as$upstream) and resolves each submodule URL before recursing. Nested submodules resolve against their already-resolved parent.Results
offline,
file://repos. Columns are exit status / gitlinks in the parent / submodule mirrors populated:./-relative submoduleFor the absolute-URL control, the generated client script is identical before and after. A fresh
git clone --recurse-submodulesfrom the patched output has every submodule at its pinned commit.Real world:
boostorg/boost(all 173 submodules use relative URLs):Environment and caveats
tunathu/tunasync-scriptsimage itself (bash 5.2.37, git 2.47.3) with identical results.shellcheckreports no new warnings on the changed lines.boostorg/boost, not every URL scheme git accepts.Fixes #161