check: during an uncommitted merge, ratchets blame main's new code on the branch (diff base ignores MERGE_HEAD)

オープン
#537 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
git, typescript
領域
devtools

調査の方向性

Start with scripts/lib/base.ts and trace how it selects the diff base during an in-progress merge or rebase. Add coverage using a temporary Git repository with an uncommitted merge, then run the relevant i18n:check tests or command. Done when upstream strings are excluded while strings added on the branch are still reported.

索引モデルが issue の本文から書いたものです。

説明

area: ci type: bug

What

bun run i18n:check run in the middle of a merge (conflicts resolved, merge not yet committed) reports main's own new strings as "new in this change". Seen on #526 after merging origin/main (which had #534 and #532): 2 hardcoded-text errors in GitSettings.svelte and 3 writing-lint errors in docs/contributing.md, in files identical to origin/main. After git commit the same check is clean.

Why

scripts/lib/base.ts resolves the diff base as merge-base(HEAD, origin/main). During an uncommitted merge HEAD is still the pre-merge branch tip, so the base is the old fork point while the working tree already holds main's changes.

Fix

When .git/MERGE_HEAD exists (or git rev-parse -q --verify MERGE_HEAD succeeds), use merge-base(MERGE_HEAD, origin/main) together with the branch side, i.e. the base is the newer of the two fork points: with MERGE_HEAD == origin/main that is origin/main itself. Same for a rebase in progress (REBASE_HEAD/.git/rebase-merge/onto). Test with a real repo: main adds a hardcoded string, branch merges main without committing, the ratchet reports nothing; the branch's own new string is still reported.

Agents resolve merges constantly; this sends them chasing errors in code they never touched.

主要言語
Rust
スター
3
フォーク
1
平均マージ
9時間 51分
マージ済み PR(30日)
310

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeatlasdev/atlas のほかの issue

codeatlasdev/atlas の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。