Skip to content

Git-drive sync: push unpushed commits to their branch; auto pushes then pulls (1.54.0)#107

Merged
gmpassos merged 1 commit into
masterfrom
feat/git-push-current-branch
Jul 2, 2026
Merged

Git-drive sync: push unpushed commits to their branch; auto pushes then pulls (1.54.0)#107
gmpassos merged 1 commit into
masterfrom
feat/git-push-current-branch

Conversation

@gmpassos

@gmpassos gmpassos commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the agreed git-drive push behavior on top of omnydrive 1.11.0's pluggable GitPushPolicy.

  • Protected branchesmain/master and the branch the drive was mounted to track — still publish to a fresh feature branch (never moved by a push).
  • Any other branch (one the node created, or one not yet on the origin) is pushed to directly — created on the origin if absent; a diverged origin surfaces a conflict (never a force).
  • Auto sync (read-write) now pushes first, then pulls, so the node's unpushed commits reach the origin before reconciling.
  • Pushes use the drive's resolved (per-principal/global) credential — unchanged.

How

  • The node builds GitProvider(pushPolicy: DefaultGitPushPolicy(protectedBranches: {'main','master', <mounted branch>})).
  • The client threads the mounted branch (record.gitBranch) to the node via the git.sync RPC.
  • DriveManager._syncGit dispatches auto → push-then-pull for read-write mounts; explicit --push/--pull and read-only stay single-pass.

Test plan

  • dart analyze + dart format --set-exit-if-changed . — clean.
  • omnydrive 1.11.0 covers the policy mechanics (same-branch vs feature-branch, conflict on divergence).
  • omnyshell integration: git auto-sync on a read-write mount (protected default → feature branch) pushes then pulls without conflict; the git-mount test asserts currentBranch.
  • Full suite green (666 unit + integration). Depends on omnydrive: ^1.11.0.

🤖 Generated with Claude Code

…en pulls (1.54.0)

Adopt omnydrive 1.11.0's pluggable GitPushPolicy on the node: protect main/master
and the branch the drive was mounted to track (those still publish to a fresh
feature branch), while a node-created branch — or one not yet on the origin — is
pushed to directly. The client threads the mounted branch (record.gitBranch) to
the node so the policy can protect it.

A read-write auto sync now pushes first, then pulls, so the node's unpushed
commits reach the origin before reconciling. Pushes use the drive's resolved
credential (unchanged). Depends on omnydrive ^1.11.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gmpassos gmpassos merged commit f8950ce into master Jul 2, 2026
5 checks passed
@gmpassos gmpassos deleted the feat/git-push-current-branch branch July 2, 2026 05:17
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