Bypasses the PR step and force-pushes the subrepo's state directly onto
the monorepo branch. Also skips the skip-dirty guard. Only valid with
--reverse. Returns status "forced".
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When cherry-pick -m 1 fails because the merge's changes were already
applied by a prior cherry-pick (empty result, clean working tree),
skip the commit instead of trying git-apply which also fails. Only
use the diff-from-first-parent fallback for real conflicts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The fallback for failed cherry-picks used `git diff HEAD $sha` which
computes the diff between the linearize branch and the commit's full
tree. This captures ALL tree differences, not just the changes the
commit introduced — causing unrelated file deletions.
Fix: diff from the commit's own parent (`${sha}^` for regular commits,
`${sha}^1` for merge commits). Also detect and skip empty merges
(where cherry-pick -m 1 produces nothing because the changes were
already applied by a prior cherry-pick).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Suppress git stdout/stderr noise from cherry-pick, checkout, and
commit during linearization. Add delimiters and consistent indented
log lines so the output is easy to scan.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
--ancestry-path returns empty when mono-filtered/main has advanced
past the last forward sync (any monorepo commit causes josh to create
a new filtered SHA not in the subrepo's ancestry). Use git merge-base
to find the last connected point instead.
Also return skip-dirty (not skip) when trees differ but no human
commits found, preventing state from being updated on false skips
which would permanently lose unsynced commits.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When josh-proxy rejects a reverse sync push due to unmappable merge
commits, fall back to linearizing: cherry-pick regular commits
individually, squash only the merge commits via cherry-pick -m 1.
Also adds a recommended Git workflow section to the guide explaining
where cross-branch merges should happen (monorepo) vs feature work
(subrepo), and expands troubleshooting for the "josh rejected push"
error with root cause analysis and prevention advice.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add v1.1.0 and v1.2.0 changelog entries
- Add exclude field to config reference and example config
- Add ADRs documenting all major design decisions
- Fix step numbering in reverse_sync()
- Fix action.yml to copy VERSION file
- Add dist/ and .env to .gitignore
- Use refs/tags/ format for Nix flake tag refs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bash double-quoted strings don't interpret \n as newlines.
Use actual newlines in the pr_body strings instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Swap parent order in reconcile_filter_change(): josh-filtered must
be first parent so josh can follow first-parent traversal to map
history back to the monorepo. Old subrepo history on parent 2.
- Add tree comparison in reverse_sync() before commit detection:
if subrepo tree matches josh-filtered tree, skip immediately.
Prevents false positive PRs after reconciliation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add --ancestry-path to git log in reverse_sync() to prevent old
subrepo history from leaking through reconciliation merge parents.
Without this, every old subrepo commit appears as a "human commit"
triggering a spurious 0-commit PR on the monorepo.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three bugs found during first CI run after enabling :exclude:
- Derive old filter (:/subfolder) when state has no josh_filter stored
(pre-v1.2 upgrade path)
- Detect unrelated histories in forward_sync() and fall back to
reconcile_filter_change() instead of creating a useless conflict PR
- Skip state update on conflict result (prevents storing wrong filter
and mono SHA that blocks retries)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the exclude list changes, josh-proxy recomputes filtered history
with new SHAs, breaking common ancestry with the subrepo. Instead of
requiring a manual reset (force-push), forward sync now detects the
filter change and creates a reconciliation merge commit that connects
the old and new histories — no force-push, no re-clone needed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
initial_import() now accepts an optional clone URL override parameter.
onboard_flow() passes the archived repo URL so content is cloned from
the right source.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- SC2015: Wrap A && B || C patterns in brace groups for directive scope
- SC2064: Suppress for intentional early trap expansion (local vars)
- SC2164: Add || exit to cd commands in subshells
- SC2001: Suppress for sed URL injection (clearer than parameter expansion)
- SC1083: Handle {tree} git syntax (quote or suppress)
- SC1091: Suppress for runtime-resolved source paths
- SC2034: Remove unused exit codes (E_OK, E_CONFIG, E_AUTH)
- SC2116: Eliminate useless echo in mono_auth_url construction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>