Skip to content

feat: git nested patches create keeps the local changes of a nested repo as patch files - #212

Merged
thorsten-klein merged 1 commit into
mainfrom
feat/198-patches-create
Nov 13, 2026
Merged

thorsten-klein merged 1 commit into
mainfrom
feat/198-patches-create

Conversation

@thorsten-klein

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

Copy link
Copy Markdown
Owner

Fixes #198

First of five stacked PRs for the patches. Each builds on the one before: #212 → #213 → #214 → #215 → #216.

What

  • New field patches: <path> in .gitnested: the folder with the local changes as patch files, relative to the subdir. Without it, the patches are off.
  • New command git nested patches create [<subdir>]:
    • applies the patches on the upstream commit with git am,
    • writes what HEAD has on top as one more patch, with a TODO title,
    • writes all patches again in one form: no commit id, no signature, named after the title.
  • The folder is never pushed. diff and status do not count it.
  • Nested repos inside the subdir are left out. They can have their own folder.
  • verify --patches applies patches with git am now, so a plain diff given as a patch is refused. --diffs still uses git apply.
  • New module patchbuild.py: the temporary worktree, git am, and writing the patches. verify uses it too.

Docs

New page doc/cli/patches.md and guide doc/guides/patches.md. Updated the .gitnested reference, config, verify, the man page and the call diagrams.

Tests

New tests/e2e/test_patches.py. The full suite passes with 100% coverage.

@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 (440b8c5) to head (4695ff2).
⚠️ 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      #212    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           46        49     +3     
  Lines         2326      2525   +199     
==========================================
+ Hits          2326      2525   +199     
Files with missing lines Coverage Δ
src/git_nested/checks.py 100.00% <100.00%> (ø)
src/git_nested/cli/parser.py 100.00% <ø> (ø)
src/git_nested/cli/setup.py 100.00% <100.00%> (ø)
src/git_nested/cli/spec.py 100.00% <ø> (ø)
src/git_nested/commands/__init__.py 100.00% <ø> (ø)
src/git_nested/commands/diff.py 100.00% <100.00%> (ø)
src/git_nested/commands/patchset.py 100.00% <100.00%> (ø)
src/git_nested/commands/status.py 100.00% <100.00%> (ø)
src/git_nested/commands/verify.py 100.00% <100.00%> (ø)
src/git_nested/gitfile.py 100.00% <100.00%> (ø)
... and 4 more

@thorsten-klein
thorsten-klein force-pushed the feat/198-patches-create branch 2 times, most recently from 5826420 to f230ba4 Compare November 13, 2026 19:37
@thorsten-klein
thorsten-klein force-pushed the feat/198-patches-create branch from f230ba4 to 4695ff2 Compare November 13, 2026 20:02
@sonarqubecloud

Copy link
Copy Markdown

@thorsten-klein
thorsten-klein merged commit e5d04be into main Nov 13, 2026
20 of 24 checks passed
@thorsten-klein
thorsten-klein deleted the feat/198-patches-create branch November 13, 2026 20:35
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.

Support git nested patches create to keep the local changes of a nested repo as patch files

1 participant