Skip to content

fix: resolve a relative url in .gitmodules against a Windows path - #226

Merged
thorsten-klein merged 1 commit into
mainfrom
fix/windows-relative-submodule-url
Nov 14, 2026
Merged

thorsten-klein merged 1 commit into
mainfrom
fix/windows-relative-submodule-url

Conversation

@thorsten-klein

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

Copy link
Copy Markdown
Owner

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

  • 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

@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 (b1fecf8) to head (09925a2).
⚠️ 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      #226   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        50           
  Lines         2905      2907    +2     
=========================================
+ Hits          2905      2907    +2     
Files with missing lines Coverage Δ
src/git_nested/submodules.py 100.00% <100.00%> (ø)

thorsten-klein added a commit that referenced this pull request Nov 14, 2026
## 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

- [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 thorsten-klein changed the title fix: resolve relative submodule urls against a Windows path fix: resolve a relative url in .gitmodules against a Windows path Nov 14, 2026
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
thorsten-klein force-pushed the fix/keep-upstream-bytes branch from 00ac107 to 497fbad Compare November 14, 2026 07:49
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
Base automatically changed from fix/keep-upstream-bytes to main November 14, 2026 08:02
A local remote on Windows can have backslashes. posixpath took the
whole path as one name, so `../foo` became just `foo`.
@thorsten-klein
thorsten-klein force-pushed the fix/windows-relative-submodule-url branch from d2b05f2 to 09925a2 Compare November 14, 2026 08:08
@sonarqubecloud

Copy link
Copy Markdown

@thorsten-klein
thorsten-klein merged commit 3189981 into main Nov 14, 2026
15 checks passed
@thorsten-klein
thorsten-klein deleted the fix/windows-relative-submodule-url branch November 14, 2026 08:19
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