Repository navigation
fix: renameしたファイルをFudeReviewDiffで旧パスと比較する - #233
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
ローカルモードのGitコマンドがコピー検出を有効化しておらず、文書化されたcopy対応が機能しません。
1 open finding
ローカルモードでコピー元パス比較が機能しない · New
What changed in this PR
rename/copy 後のファイルを旧パスの内容と比較できるよう、変更ファイル情報と diff preview を拡張するPRです。
Changes:
previous_pathを GitHub/local の変更ファイル情報へ追加- preview で旧パスを優先し、新パスへフォールバック
- テストと利用者・開発者向けドキュメントを更新
| File | Description |
|---|---|
lua/fude/gh.lua |
GitHub APIレスポンスの変換処理を共通化 |
lua/fude/init.lua |
共通の変更ファイル変換処理を使用 |
lua/fude/scope.lua |
scope切替時にも共通変換処理を使用 |
lua/fude/local/session.lua |
rename/copy元パスを保持 |
lua/fude/preview.lua |
旧パスからbase内容を取得 |
tests/fude/gh_spec.lua |
API変換処理を検証 |
tests/fude/local_session_spec.lua |
ローカルパス解析を検証 |
tests/fude/preview_spec.lua |
baseパス選択を検証 |
tests/fude/preview_integration_spec.lua |
preview取得とフォールバックを検証 |
README.md |
rename時のdiff動作を追記 |
doc/fude.txt |
rename/copy時の仕様を追記 |
CLAUDE.md |
アーキテクチャ説明を更新 |
🧠 Review effort: Balanced
💡 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.

概要
fileをrenameしつつ内容を書き換えると、
:FudeReviewDiffのbase側に「New file」と表示され、内容の差分が見られなかった。lazygitと同じく、旧パスのbase内容と比較するようにする。Closes #217
変更内容
git show <base>:<新パス>だけを試しており、新パスはbaseに存在しないため新規ファイル扱いになっていたchanged_filesのエントリに旧パス(previous_path)を持たせたpulls/{pr}/files・commits/{sha}のprevious_filenameを、local modeはgit diff --name-status -MのR行の旧パスを使うchanged_filesへ変換する処理がinit.luaとscope.luaの6箇所にコピペされていたので、gh.build_changed_filesに集約した。集約しないと6箇所すべてに同じ変更を入れる必要があったテスト計画
make all(lint、format-check、test)が全件パスtests/fude/gh_spec.lua、tests/fude/preview_spec.lua、tests/fude/preview_integration_spec.lua、tests/fude/local_session_spec.lua備考
merge_base_shaではなくstate.base_refから読む既存挙動は変えていないGenerated with Claude Code