sync

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package sync implements git-based team plan sharing and merging. It pushes .cloop/state.json and .cloop/plan-history/ to a configured git remote branch and pulls/merges remote state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pull

func Pull(workDir, remote, branch string) (*pm.Plan, error)

Pull fetches the remote branch and performs a three-way merge of the remote plan with the local plan:

  • Local in_progress tasks are preserved unchanged.
  • Remote done/failed status is accepted for tasks that exist locally.
  • Pending tasks that exist only on the remote are unioned in.

Returns the merged plan (the caller must persist it). Returns nil, nil if the remote branch has no state.

func Push

func Push(workDir, remote, branch string) error

Push commits .cloop/state.json and .cloop/plan-history/ to the configured git remote branch. The commit message includes a UTC timestamp. The push uses a git worktree so it does not disturb the main working tree.

Types

type Config

type Config struct {
	Remote string
	Branch string
}

Config holds git sync configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns Config with sensible defaults.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL