Skip to content

fix(git-backup): configurable push target via git_backup.remote/branch#116

Merged
fdaviddpt merged 1 commit into
mainfrom
fix/configurable-git-backup-target
Jun 23, 2026
Merged

fix(git-backup): configurable push target via git_backup.remote/branch#116
fdaviddpt merged 1 commit into
mainfrom
fix/configurable-git-backup-target

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Closes #63.

The after_save git backup pushed with a bare git push, relying on the branch's upstream tracking — fine for the standard origin main setup, brittle for users with multiple remotes or non-standard tracking (memory could land on the wrong remote).

Changes

  • New git_backup.remote / git_backup.branch config keys. Both empty (the default) → bare push, preserving historical behavior.
  • All three push sites route through a single _push() helper.
  • Remote-URL change validation (Security: tighten trust boundary on config-driven exec and git push #67) now keys off the configured remote instead of hardcoded origin — guards the remote actually pushed to.
  • First push logs the resolved target: (remote 'X', branch 'Y').
  • README documents both keys.

Tests

  • New test_push_routes_to_configured_remote: proves the push lands on the configured remote and NOT origin; asserts state file + resolved-target log.
  • Full git-backup suite: 15 passed, 1 skipped (Windows).

…branch

Closes #63.

The after_save git backup pushed with a bare `git push`, relying on the
branch's upstream tracking. Fine for the standard `origin main` setup, but
brittle for users with multiple remotes or non-standard tracking — memory
could land on the wrong remote.

- New `git_backup.remote` / `git_backup.branch` config keys. Both empty (the
  default) preserves the historical bare-push behaviour.
- All three push sites route through a single `_push()` helper.
- Remote-URL change validation (#67) now keys off the configured remote
  instead of hardcoded `origin`, so it guards the remote actually pushed to.
- First push logs the resolved target: `(remote 'X', branch 'Y')`.
- README documents both keys.
- New test proves the push routes to the configured remote and not origin.

Co-Authored-By: Max <noreply>
@fdaviddpt fdaviddpt merged commit ad09286 into main Jun 23, 2026
12 checks passed
@fdaviddpt fdaviddpt deleted the fix/configurable-git-backup-target branch June 23, 2026 07:56
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.

Document or make explicit the git backup push target

1 participant