Skip to content

[github-graph] Synced files from github-config. - #4

Merged
SgtSwagrid merged 1 commit into
mainfrom
sync/SgtSwagrid/github-config_main_.--.;
Apr 19, 2026
Merged

SgtSwagrid merged 1 commit into
mainfrom
sync/SgtSwagrid/github-config_main_.--.;

Conversation

@SgtSwagrid

Copy link
Copy Markdown
Owner

Synced files from github-config.

Applied automatic synchronisation of updated files from SgtSwagrid/github-config.

Trigger

This pull request was initially triggered by 2bb9a02633c39731d945203b18891243ea2743d0.
Note however that subsequent commits to main may also be incorporated.

Warning

This change is potentially destructive, as files with matching names will be overwritten.
Please review carefully.

Explanation

GitHub Graoh is a tool for duplicating files across repositories.
The responsible configuration can be found here.

@SgtSwagrid
SgtSwagrid force-pushed the sync/SgtSwagrid/github-config_main_.--.; branch 4 times, most recently from 6dd76aa to 61e32d6 Compare April 19, 2026 12:46
@SgtSwagrid
SgtSwagrid force-pushed the sync/SgtSwagrid/github-config_main_.--.; branch from 61e32d6 to 9ff1b39 Compare April 19, 2026 14:02
@SgtSwagrid
SgtSwagrid merged commit dea84d5 into main Apr 19, 2026
4 of 5 checks passed
@SgtSwagrid
SgtSwagrid deleted the sync/SgtSwagrid/github-config_main_.--.; branch April 19, 2026 17:23
SgtSwagrid added a commit that referenced this pull request Sep 27, 2026
## Sync deletions, but only of files which came from the source.

Files deleted from a source were never deleted downstream (e.g.
`claude-code-review.yml`, which had to be removed from this repo by hand
in b042a53).

### Why it never worked

The sync workflow checks out the source with `actions/checkout`'s
default `fetch-depth: 1`. In a single-commit shallow clone, `git log
--diff-filter=D` sees nothing, so the deletion step always found zero
files. Had it found any, it would have deleted **any** target file with
a matching name, whether or not it came from the source.

### What's changed

- Both repositories are checked out with full history.
- A file deleted from the source is only deleted from the target if all
of the following hold:
1. **It originated from the source.** When it was last added to the
target, it matched a version the source once had. This protects files
the target had before a sync overwrote them.
2. **It wasn't re-added after the deletion.** It was last added to the
target before it was deleted from the source. This protects files
restored downstream, even with identical content.
3. **It wasn't modified downstream.** Its current content matches a
version the source once had.
- Each file kept for one of these reasons is logged with the reason,
e.g. `Kept: F (re-added after being deleted from the source)`.
- Timestamps come from `--first-parent` history, so they reflect when a
change *landed* on each branch rather than when it was committed on a
feature branch.
- Renames are treated as delete + add (`--no-renames`). Previously a
rename showed up as `R` and was missed even with full history.
- New `syncDeletions` option, **on by default**. Per-child or global,
and an explicit `false` is respected (plain `//=` would have overwritten
it).
- If either checkout is shallow, deletions are skipped with a workflow
warning, never guessed.

### Testing

**Scenarios:** 46 checks across 21 synthetic source/target histories,
including: plain deletion, an unrelated same-name file, identical and
different re-adds, downstream modification, a target-original file
overwritten by sync, a graph restructured through a new intermediate
repo, ignored files, `source.root`/`target.root` mapping, renames,
deletion via merge commit, sync via merge commit, delete/re-add cycles,
stale versions, glob and unicode filenames, a directory at the path, and
a shallow clone. The previous script fails 20 of them; dropping
`--first-parent` fails 2.

**Real graph (dry run, nothing pushed):** replayed every edge reachable
from `github-config` against current `main`s:

| Edge | Result |
|---|---|
| `github-config` β†’ `github-graph` @ #4 | deletes
`claude-code-review.yml` (matches b042a53) |
| `scala-library-config` β†’ 7 libraries, template, 3Γ— Themis | deletes
`linter.yml` (deleted upstream in scala-config#38) |
| `scala-website-config` β†’ template, fairmap, Themis, Kairos | deletes
`linter.yml` and the now-unreferenced `deploy/Caddyfile` |
| `Themis` β†’ `Iris` | deletes `ModelTier.scala` (moved out in
Themis#138) |
| everything else | no change |

`parse-config.sh` wasn't executed locally (no `jq` available); the
change there is a single `if . == null` default.

### Note

Merging enables this for every caller of `sync.yml@main`. The next sync
from each source above will open or refresh PRs containing the deletions
listed.

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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