Repository navigation
fix: FudeReviewDiffのbase paneをmerge-base基準にする - #238
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
実装、テスト、ドキュメントが変更目的と整合しており、未解決の問題は確認できませんでした。
0 open findings
What changed in this PR
:FudeReviewDiff のbase paneをmerge-base基準に統一する修正です。
Changes:
- full PR scopeでmerge-baseを参照
- 比較refの解決処理を純粋関数化
- 単体・統合テストとドキュメントを更新
| File | Description |
|---|---|
lua/fude/preview.lua |
merge-base基準のbase paneを実装 |
tests/fude/preview_spec.lua |
ref解決の分岐を検証 |
tests/fude/preview_integration_spec.lua |
previewへのref伝播と表示を検証 |
doc/fude.txt |
利用者向け仕様を更新 |
CLAUDE.md |
アーキテクチャ説明とstate依存を更新 |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
GitHubモードのfull PR scopeで、
:FudeReviewDiffの左ペイン(base側)がbase branchの先端を読んでいた。PR作成後にbase branchへ入ったcommitが、previewに逆向きの差分として混ざっていた。左ペインもPRの分岐点(merge-base)を読むようにし、GitHubのPR画面やgitsignsと同じ基準にそろえる。変更内容
state.merge_base_shaから読む(lua/fude/preview.lua)pulls/{pr}/files)とgitsigns(既存ファイル)はすでにmerge-base基準で、previewだけstate.base_ref(base branchの先端)をgit showしていたmerge_base_shaはfull PR scopeに入る経路(init.start、scope.apply_full_pr_scope)で計算済みのため、previewからは参照するだけにした。計算できなかった場合だけ従来どおりbase branchの先端を読むfind_base_ref(state, local_session)にまとめたcontent_ref、commit scope →<sha>^、full PR scope →merge_base_shaの順で、local reviewとcommit scopeの挙動は変えていないdoes not exist in main (merge-base abc1234)にしたテスト計画
make all)tests/fude/preview_spec.lua(find_base_refの各分岐)、tests/fude/preview_integration_spec.lua(merge-baseがget_base_contentに渡ること、新規ファイルの文言)備考
merged PRでは
merge-base(base branch, HEAD)自体がずれる(merge commit方式だとPRのheadがmainの祖先になり、差分がゼロになる)。この問題は、このPRの上にstackするPRで、base.shaを起点にmerge-baseを求める形で対応する。Generated with Claude Code