Repository navigation
git_mf: Skip submodules without TARGET under --subs - #143
Merged
Merged
Conversation
On homebox, boku's commonplace submodule has no ud/main branch, so git_mf ud/main --subs stopped with missing-target. Skip a submodule when TARGET is missing locally and git ls-remote reports it missing on origin (exit 2); other ls-remote failures still stop the run. Refs Unique-Divine/boku#201.
Query refs/heads/TARGET so a branch such as x/ud/main does not count as ud/main. A skipped submodule with uncommitted changes refuses the run, and a skipped submodule whose recorded pointer moved gets a git submodule update reminder. Found by an independent Codex review.
Record each skipped submodule's pointer before the run and print the git submodule update reminder only when the merge changed it and the checkout was in sync. A dirty skipped submodule says it needs manual handling. Tests assert the dry-run exit code and the dirty refusal. Found by an independent Codex review.
…skip run Found by an independent Codex review.
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.
Follow-up to dotfiles#142 for boku#201.
On homebox,
git_mf ud/main --subsin boku stopped at thecommonplacesubmodule (Unique-Divine/Commonplace-Book). It has no machine branches, so it reportedplan: missing-target.Under
--subs, a submodule is now skipped, with a message, whenTARGETis missing locally andgit ls-remote --exit-code --heads origin TARGETreports it missing (exit 2). Any otherls-remotefailure, such as no network, stops the run before anything changes. Skipped submodules stay out of the pointer checks, and git merges their pointers as usual.Tests:
bun test bin/git_mf.test.ts, 56 pass, including "a submodule without TARGET is skipped".