Replace log.md + merge=union with one file per entry #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
wiki/log.mdis a single append-only file kept mergeable bywiki/log.md merge=unionin
.gitattributes. That works locally, but it has two failure modes — one thatremoves most of the benefit in a PR-based flow, and one that silently reverts data.
I suggest replacing the single file with one file per log entry, which makes the
merge problem structurally impossible and needs no merge driver at all.
Failure mode 1 — GitHub ignores
.gitattributesmerge driversmerge=unionapplies to localgit mergeandgit rebase. It does not apply tothe mergeability GitHub computes for a pull request. So two branches that each append a
line still show "This branch has conflicts that must be resolved" on the PR page, and
the author has to merge the base branch locally and push to clear it.
The kit's promise — "auto-merges via
merge=union" inWIKI.md— is therefore onlytrue for local operations, which is not where most people meet the conflict.
Minimal repro (no
.gitattributes, i.e. what GitHub effectively does):With the
merge=unionattribute present the same merge is clean — which is preciselythe discrepancy: clean locally, conflicted on GitHub.
Failure mode 2 — union silently reverts deletions
Union's rule is "keep both sides", so a deletion on one side always loses to
retention on the other. A line removed on one branch comes back with no conflict and
no warning:
This is not hypothetical. In a downstream repo I renamed a wiki note and repointed its
log line to the new filename. A later rebase resurrected both superseded lines, still
pointing at the pre-rename path. No conflict, no warning, and the lint script cannot
catch it because log lines are plain text rather than markdown links — so a stale path
in the journal is invisible to every check the kit ships.
The counter-argument is fair:
WIKI.mdcalls the log append-only, and editing a linebreaks that convention. But renames happen, the convention is not machine-enforced, and
a mechanism whose failure mode is silent data resurrection is a sharp edge worth
removing rather than documenting.
Proposal — one file per entry
Each holds what one line holds today: date, verb, page, summary. The journal is the
directory; reading it is
cat wiki/log/*.mdorls wiki/log/, both naturally orderedby the date prefix.
What this buys:
on GitHub. The PR page stops disagreeing with git.
merge=unioncan be dropped entirely, and with it the deletion hazard.referenced page exists — which today it cannot do at all.
Costs, stated honestly:
cat wiki/log/*.mdrestores that, and alint or skill step could regenerate a concatenated view if the single-file reading
experience matters.
log.mdin place as the historical record and start thedirectory alongside it, rather than splitting old entries. That keeps the diff small
and loses nothing.
same trade
raw/andnotes/already make.Alternatives considered
new entry rather than repointing). Zero machinery, but leaves failure mode 1 entirely
and relies on a convention no check enforces.
several agent sessions running in parallel it means a conflict on nearly every branch.
log.mdaltogether and rely ongit log -- wiki/. Loses the curatedone-line summaries, which read better than commit subjects.
Happy to send a PR for the directory layout plus the
WIKI.mdand lint changes if thedirection looks right.
Direction confirmed — implemented in PR #2 (closes this issue on merge). Three review deltas from the proposal as filed: lint treats log/ entries as history (filename-format check only, no frontmatter/target checks — deleted pages would otherwise make old entries perpetually noisy), entries stay frontmatter-free one-liners so cat wiki/log/*.md reads like the old journal, and the installer seeds a dated init entry so fresh installs have a journal and the session-start hook a real last-update date. Also noted in the PR: the merge=union PR-conflict claim is verified for GitHub-hosted repos; Forgejo merges via real git and may honor the attribute — failure mode 2 (silent resurrection, which you hit) justifies the change regardless.