Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions .github/workflows/sync-upstream.yml

This file was deleted.

11 changes: 6 additions & 5 deletions DIVERGENCES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Divergences from upstream

Every deliberate change to an upstream file is listed here. When a `sync-upstream` merge
conflicts, this table tells you what the conflict is about and how to resolve it. If you
edit an upstream file and it is not in this table, add it β€” an unlisted divergence is a bug.
Every deliberate change to an upstream file is listed here. When an upstream sync patch
(see README β†’ Syncing with upstream) conflicts, this table tells you what the conflict is
about and how to resolve it. If you edit an upstream file and it is not in this table,
add it β€” an unlisted divergence is a bug.

New files that upstream does not have (this file, `NOTICE`, `.github/workflows/sync-upstream.yml`,
future `packages/codev-*`) never conflict and are not tracked here.
New files that upstream does not have (this file, `NOTICE`, future `packages/codev-*`)
never conflict and are not tracked here.

## Changed upstream files

Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,27 @@ Notes:

## Syncing with upstream

A scheduled GitHub Action ([`sync-upstream.yml`](.github/workflows/sync-upstream.yml)) merges upstream `dev` into `main` weekly and opens a PR. It can also be run on demand (Actions β†’ sync-upstream β†’ Run workflow) against any upstream branch or tag.

One-time repo setup for the action to open PRs: **Settings β†’ Actions β†’ General β†’ Allow GitHub Actions to create and approve pull requests**.

Manual sync:
Syncing is manual and local β€” there is no CI workflow. `main` carries fork commits only
(history was truncated; it shares no ancestry with upstream), so `git merge upstream/...`
does not work. Instead, apply upstream's changes as a 3-way patch between release tags.
The tag the fork is currently on is the `version` in `packages/opencode/package.json`.

```sh
git fetch upstream --tags
git fetch upstream --tags # also brings in the blobs `git apply -3` needs
git checkout -b sync-upstream main
git merge upstream/dev
# FROM = current version in packages/opencode/package.json; TO = target release
git diff v<FROM> v<TO> --binary -- . ':(exclude)bun.lock' | git apply -3 --index
# Conflicts in our own files: see DIVERGENCES.md for each file's resolution strategy.
# Conflicts in bun.lock or generated code: regenerate (bun install / bun run generate), never hand-merge.
# Files we deleted (locales, README translations): if the patch re-adds them, delete them again.
bun install # regenerate bun.lock, never patch it
bun turbo typecheck
git commit -m "chore: sync upstream v<TO>"
```

`git apply -3` leaves ordinary conflict markers where our divergences overlap upstream
changes β€” the same conflict surface the old merge had. If a hunk fails outright, it is
usually against a file we deleted or renamed; check DIVERGENCES.md before forcing it.

## Divergence policy

Features go, in order of preference:
Expand Down
Loading