Skip to content

Git Sync (Push, Fetch + FF/Merge)#6

Merged
firu11 merged 8 commits into
mainfrom
git-sync
Jun 13, 2026
Merged

Git Sync (Push, Fetch + FF/Merge)#6
firu11 merged 8 commits into
mainfrom
git-sync

Conversation

@firu11

@firu11 firu11 commented Jun 10, 2026

Copy link
Copy Markdown
Member

This PR should implement a working Core.SyncAll() method, which will try to synchronize all calendars with its remotes.


SyncAll does for each calendar:

  1. Fetch from remote (if no remote -> skip)
  2. Compare "head commits"
  3. Merge
    a. Same hashes -> nothing to be done
    b. "Remote head" is ahead -> fast-forward merge aka. append changes to local
    c. Local head is ahead -> push new commits to remote
    d. History diverged -> custom merge strategy -> push merge commit

Merge conflict resolution strategy

Obvious

Base commit Local Remote Meaning Result
missing exists missing local added keep local
missing missing exists remote added write remote
exists missing missing both deleted keep deleted

Not so obvious

Base commit Local Remote Meaning Result
missing exists exists both added newer UpdatedAt wins
exists exists modified exists modified both edited newer UpdatedAt wins
exists missing exists unchanged local deleted keep local delete
exists exists unchanged missing remote deleted remove local
exists missing exists modified local deleted, remote edited delete wins
exists exists modified missing local edited, remote deleted delete wins

@firu11 firu11 marked this pull request as draft June 10, 2026 10:14
@firu11 firu11 self-assigned this Jun 10, 2026
@firu11 firu11 marked this pull request as ready for review June 12, 2026 23:47
@firu11 firu11 merged commit 80f0053 into main Jun 13, 2026
2 checks passed
@firu11 firu11 deleted the git-sync branch June 13, 2026 14:38
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