-
Notifications
You must be signed in to change notification settings - Fork 12
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
git: Fix submodule fetch, rewrite logic #104
Conversation
I don't tell you how to live your life CI |
80093d4
to
d5ec53d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic is sane to me. If this has been tested, then feel free to go ahead and merge!
The logic for this was quite broken and had several failure cases due to that. This commit re-writes that to be saner. Changes: - Individual exec commands are all split out to separate functions so that they can be more easily composed. No function does more than a single command - Control flow now happens entirely in the Fetch() function - Before there were several failure states around submodules due to the `git switch` command happening immediately after the `git fetch` if the repo was already cloned. This is fixed by moving to a unified control flow. - `Fetch()` will now run either the initial clone OR update refs before moving onto further steps - `git clone` no longer attempts to initialize submodules. Several features from `git submodules` aren't yet implemented by `git clone` and so submodule initialization is moved entirely into a `git submodule` command - `git switch` now happens after the clone/fetch but before `git submodule` - `git switch` now no longer runs with any submodule-related flags. Like `git clone` the features we need are just not implemented yet and as far as I can tell there are subtle behavioral differences that were causing issues. - `git submodule` will now use `--filter=blob:none` to specify that submodule checkouts should themselves be blobless when possible. As far as I can tell this works correctly with `--recursive` and recursive submodules. - Because we are now checking out submodules with blobless clones when possible the `fixPermissions()` logic has been updated to account for promisor files that could be in submodule `.git` directories
d5ec53d
to
a6c2b80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
The logic for this was quite broken and had several failure cases due to that. This commit re-writes that to be saner.
Changes:
git switch
command happening immediately after thegit fetch
if the repo was already cloned. This is fixed by moving to a unified control flow.Fetch()
will now run either the initial clone OR update refs before moving onto further stepsgit clone
no longer attempts to initialize submodules. Several features fromgit submodules
aren't yet implemented bygit clone
and so submodule initialization is moved entirely into agit submodule
commandgit switch
now happens after the clone/fetch but beforegit submodule
git switch
now no longer runs with any submodule-related flags. Likegit clone
the features we need are just not implemented yet and as far as I can tell there are subtle behavioral differences that were causing issues.git submodule
will now use--filter=blob:none
to specify that submodule checkouts should themselves be blobless when possible. As far as I can tell this works correctly with--recursive
and recursive submodules.fixPermissions()
logic has been updated to account for promisor files that could be in submodule.git
directories