Skip to content

feat: add verify to check a nested repo against patches or diffs - #188

Merged
thorsten-klein merged 2 commits into
mainfrom
feat/verify
Nov 7, 2026
Merged

thorsten-klein merged 2 commits into
mainfrom
feat/verify

Conversation

@thorsten-klein

Copy link
Copy Markdown
Owner

What this changes

New command git nested verify. It checks that a nested repository is its
upstream commit from .gitnested plus a set of patch or diff files.

git nested verify ext/lib patches -- patches/lib/*.patch
git nested verify -o patches/lib ext/lib patches
git nested verify ext/lib diff lib.diff
git nested verify -o lib.diff ext/lib diff lib.diff
  • Applies the files in order with git apply in a temporary worktree
    (.git/tmp/verify/<subdir>). git apply, not git am, so plain diffs
    work too.
  • Fetches the upstream commit only if it is missing. Respects path,
    filter and exclude.
  • Compares with <subdir> in HEAD, without .gitnested files.
  • On a difference it fails and lists the changed files.
    • patches: writes the missing patch, numbered after the others, next to
      the last patch or into -o/--output, with a TODO title and description.
    • diff: with -o/--output, writes the whole diff to that file.
  • -k/--keep keeps the temporary worktree.
  • Does not touch the working tree or a nested/<subdir> branch.

Why

Fixes #187

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

🤖 Generated with Claude Code

`git nested verify <subdir> patches|diff [--] <file>...` applies the
files with `git apply` to the upstream commit in a temporary worktree
and compares the result with <subdir> in HEAD. It fails if they differ.
`patches` then writes the missing numbered patch; `diff` writes the
whole diff to --output.

Fixes #187

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              main      #188    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           45        46     +1     
  Lines         2122      2241   +119     
==========================================
+ Hits          2122      2241   +119     
Files with missing lines Coverage Δ
src/git_nested/checks.py 100.00% <100.00%> (ø)
src/git_nested/cli/location.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% <100.00%> (ø)
src/git_nested/commands/__init__.py 100.00% <ø> (ø)
src/git_nested/commands/verify.py 100.00% <100.00%> (ø)
src/git_nested/constants.py 100.00% <100.00%> (ø)
src/git_nested/models.py 100.00% <100.00%> (ø)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2026

Copy link
Copy Markdown

@thorsten-klein
thorsten-klein merged commit 81e96d0 into main Nov 7, 2026
24 checks passed
@thorsten-klein
thorsten-klein deleted the feat/verify branch November 7, 2026 18:55
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.

Add a command to check a nested repository against patch or diff files

1 participant