Skip to content

fix: keep local changes in nested repos inside nested repos - #223

Merged
thorsten-klein merged 2 commits into
mainfrom
fix/184-inner-local-changes
Nov 14, 2026
Merged

thorsten-klein merged 2 commits into
mainfrom
fix/184-inner-local-changes

Conversation

@thorsten-klein

@thorsten-klein thorsten-klein commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

What this changes

pull and commit keep the local changes of nested repos inside a nested
repo.

  • Before, pull cloned inner nested repos again. Their local changes were
    lost. Now they come back from HEAD. Then each one is pulled to its new pin.
  • commit does the same after you finish a pull by hand.
  • No commit has a gitlink where a nested repo belongs. clone --recurse-submodules made one for a moment.
  • pull --force still drops all local changes.
  • If an inner repo stops on conflicts, a new pull does the rest.

Why

Found while working on #184. The submodules command (#202) builds on it.

Stack: #223 (this) → #224 → #225 → #226 → #202.

Checklist

  • uv run poe all passes (ruff, mypy, pyright, bandit, complexipy, and the
    tests at 100% coverage)
  • New behaviour has a test
  • README / --help / the man page updated, if the change is visible to users
  • The PR title reads as a Conventional Commit
    (feat:, fix:, docs:, …) — it becomes the squash-merge commit message
    and the changelog line

- pull cloned inner nested repos again, so their local changes were lost.
  Now they come back from HEAD. Then each one is pulled to the new pin.
- commit does the same after you finish a pull by hand.
- No commit has a gitlink where a nested repo belongs. clone
  --recurse-submodules made one for a moment.
- pull --force still drops all local changes.
- If an inner repo stops on conflicts, a new pull does the rest.

Refs #184
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (811db3a) to head (ae92869).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #223   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        50           
  Lines         2811      2863   +52     
=========================================
+ Hits          2811      2863   +52     
Files with missing lines Coverage Δ
src/git_nested/commands/clone.py 100.00% <100.00%> (ø)
src/git_nested/commands/commit.py 100.00% <100.00%> (ø)
src/git_nested/commands/pull.py 100.00% <100.00%> (ø)
src/git_nested/content.py 100.00% <100.00%> (ø)
src/git_nested/submodules.py 100.00% <100.00%> (ø)

@sonarqubecloud

Copy link
Copy Markdown

@thorsten-klein
thorsten-klein merged commit 3a1b0aa into main Nov 14, 2026
24 checks passed
@thorsten-klein
thorsten-klein deleted the fix/184-inner-local-changes branch November 14, 2026 07:25
thorsten-klein added a commit that referenced this pull request Nov 14, 2026
…ed pull <subdir>` (#224)

## What this changes

The subject of a nested commit names the subdir: `git nested pull
<subdir>`
instead of `git nested pull`.

## Why

A sync of many nested repos makes many commits. With the same subject
for
each, `git log --oneline` can't tell them apart.

Stack: #223 → #224 → #225 → #226 → #202.

## Checklist

- [x] `uv run poe all` passes (ruff, mypy, pyright, bandit, complexipy,
and the
      tests at 100% coverage)
- [x] New behaviour has a test
- [x] README / `--help` / the man page updated, if the change is visible
to users
- [x] The PR title reads as a [Conventional
Commit](https://www.conventionalcommits.org)
(`feat:`, `fix:`, `docs:`, …) — it becomes the squash-merge commit
message
      and the changelog line
thorsten-klein added a commit that referenced this pull request Nov 14, 2026
… `.gitattributes` (#225)

## What this changes

After a clone or pull, git-nested adds `-text` to the root
`.gitattributes`
for files that a rule there would change. This gets a commit of its own.
The
files stay as upstream has them.

## Why

For a submodule, the parent's `.gitattributes` does not count. For a
nested
repo it does. A rule like `*.bat text eol=crlf` then shows upstream's
CRLF
files as changed. The tree is never clean, and the next pull refuses.

Stack: #223 → #224 → #225 → #226 → #202.

## Checklist

- [x] `uv run poe all` passes (ruff, mypy, pyright, bandit, complexipy,
and the
      tests at 100% coverage)
- [x] New behaviour has a test
- [x] README / `--help` / the man page updated, if the change is visible
to users
- [x] The PR title reads as a [Conventional
Commit](https://www.conventionalcommits.org)
(`feat:`, `fix:`, `docs:`, …) — it becomes the squash-merge commit
message
      and the changelog line
thorsten-klein added a commit that referenced this pull request Nov 14, 2026
…226)

## What this changes

A relative submodule url resolves right against a local Windows path.

## Why

A local remote on Windows can have backslashes. `posixpath` took the
whole
path as one name, so `../foo` became just `foo`.

Stack: #223 → #224 → #225 → #226 → #202.

## Checklist

- [x] `uv run poe all` passes (ruff, mypy, pyright, bandit, complexipy,
and the
      tests at 100% coverage)
- [x] New behaviour has a test
- [x] README / `--help` / the man page updated, if the change is visible
to users
- [x] The PR title reads as a [Conventional
Commit](https://www.conventionalcommits.org)
(`feat:`, `fix:`, `docs:`, …) — it becomes the squash-merge commit
message
      and the changelog line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant