Commit f6e3742
feat(gx): add
Adds a standalone command that, from a parent monorepo, advances each
submodule pointer to the tracked branch's remote tip and commits the
bump on the parent. Eliminates the manual `cd apps/storefront && git
fetch && git checkout origin/main && cd ../.. && git add && git commit`
ritual after submodule PRs merge.
Usage:
gx submodule advance [<path>] [--push] [--dry-run] [--branch <ref>]
[--no-commit] [--target <path>]
For each submodule in .gitmodules:
- skips uninitialized submodules (would-init in dry-run, init in live)
- skips submodules with local uncommitted changes (never overwrites)
- fetches origin, resolves origin/<branch>, advances detached HEAD,
stages the pointer bump
- after processing, commits `chore: bump submodule pointer(s) (...)`
when on a non-protected branch and the working tree is otherwise
clean; --push publishes immediately
Safety rails:
- protected branches (e.g. main) block the auto-commit; pointer bumps
are staged with a hint to run `gx branch start` first
- working trees with unrelated edits block the auto-commit
- dirty submodules are surfaced as skipped, never overwritten
Smoke-tested against:
- medusa-shops/compastor (dirty submodules) → both skipped-dirty
- medusa-shops/lifted/LIFTEDV2 (the screenshot) → both would-advance
with correct SHA ranges
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>gx submodule advance verb for monorepo pointer bumps (#558)1 parent 835d155 commit f6e3742
4 files changed
Lines changed: 427 additions & 0 deletions
File tree
- openspec/changes/agent-claude-add-submodule-advance-verb-2026-05-11-13-40
- src
- cli
- submodule
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 68 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
3723 | 3724 | | |
3724 | 3725 | | |
3725 | 3726 | | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
| 3793 | + | |
3726 | 3794 | | |
3727 | 3795 | | |
3728 | 3796 | | |
| |||
3887 | 3955 | | |
3888 | 3956 | | |
3889 | 3957 | | |
| 3958 | + | |
3890 | 3959 | | |
3891 | 3960 | | |
3892 | 3961 | | |
| |||
0 commit comments