Skip to content

Fast-forward submodules on their branches with --submodules - #10

Merged
kova1max merged 1 commit into
mainfrom
feat/submodules
Sep 23, 2026
Merged

kova1max merged 1 commit into
mainfrom
feat/submodules

Conversation

@kova1max

Copy link
Copy Markdown
Owner

--submodules

Each submodule checked out on a branch is treated as a repository of its own: fetched, fast-forwarded with the same rules (dirty, diverged, --rebase, --dry-run all apply) and listed under its parent with its full path:

= front-portal (fix/DIIAP-4555)
  = front-portal/src/core (diia-portal-prod)
  - front-portal/src/application (detached HEAD)

Submodules on a detached HEAD are skipped; uninitialized ones are left out. Tested on a real workspace of 62 repositories with 14 that have submodules.

Fixes

  • submodule.recurse is honoured again. Since 0.5.0 replaced git pull with fetch + fast-forward, pullr ignored it; now, as with git pull, submodules are checked out at the recorded commits after an update.
  • A submodule on its own commit no longer counts as a local change. Git updates the parent over it and leaves it alone, but pullr's checks counted it, so --dry-run could predict "dirty" and --rebase could refuse whenever upstream bumped a submodule pointer.

6 new tests; 38 pass on bash 5 and 3.2.

- --submodules treats each submodule checked out on a branch as a
  repository of its own: fetched, fast-forwarded with the same rules and
  listed under its parent. Detached submodules are skipped.
- Honour submodule.recurse again, as git pull does: the switch from git pull
  to fetch + merge in 0.5.0 had silently dropped it.
- A submodule checked out at a different commit than the parent records no
  longer counts as a local change, so it can't make --dry-run predict dirty
  or stop --rebase; git itself updates over it.
@kova1max kova1max added the enhancement New feature or request label Sep 23, 2026
@kova1max
kova1max merged commit 08540dc into main Sep 23, 2026
4 checks passed
@kova1max
kova1max deleted the feat/submodules branch September 23, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant