Skip to content

feat: patches-ignore keeps paths in a nested repo local - #215

Open
thorsten-klein wants to merge 1 commit into
feat/210-pull-with-patchesfrom
feat/211-patches-ignore
Open

thorsten-klein wants to merge 1 commit into
feat/210-pull-with-patchesfrom
feat/211-patches-ignore

Conversation

@thorsten-klein

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

Copy link
Copy Markdown
Owner

Fixes #211

Based on #214. Part 4 of 5.

What

patches-ignore in .gitnested lists paths in the subdir that stay local:

  • patches create and patches verify leave them out.
  • A pull keeps the local copy.
  • A push leaves them as upstream has them.
  • One path or a list. A path outside the subdir is refused.

Tests

A list and a single path, through pull and push, and refused paths.

@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 (21d9c8c) to head (3d0dff6).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                      @@
##           feat/210-pull-with-patches      #215   +/-   ##
============================================================
  Coverage                      100.00%   100.00%           
============================================================
  Files                              49        49           
  Lines                            2660      2685   +25     
============================================================
+ Hits                             2660      2685   +25     
Files with missing lines Coverage Δ
src/git_nested/content.py 100.00% <100.00%> (ø)
src/git_nested/gitfile.py 100.00% <ø> (ø)
src/git_nested/history.py 100.00% <100.00%> (ø)
src/git_nested/models.py 100.00% <100.00%> (ø)
src/git_nested/patches.py 100.00% <100.00%> (ø)

@thorsten-klein
thorsten-klein force-pushed the feat/210-pull-with-patches branch from 1d0ee21 to 21d9c8c Compare November 13, 2026 20:02
@thorsten-klein
thorsten-klein force-pushed the feat/211-patches-ignore branch from e0d019e to 3d0dff6 Compare November 13, 2026 20:02
@sonarqubecloud

Copy link
Copy Markdown

thorsten-klein added a commit that referenced this pull request Nov 13, 2026
… repo as patch files (#212)

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.
@thorsten-klein
thorsten-klein force-pushed the feat/210-pull-with-patches branch from 21d9c8c to 861646f Compare November 13, 2026 20:48
@thorsten-klein
thorsten-klein force-pushed the feat/211-patches-ignore branch from 3d0dff6 to 35764e3 Compare November 13, 2026 20:48

This branch has not been deployed

No deployments
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