Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
When remote candidates exist, local main/master fallback may add an invalid GitHub base branch.
Review effort: Lite
Findings: None
What changed in this PR
Adds base-branch selection to :FudeCreatePR, propagating the selection to PR creation, title generation, and the UI.
Changes:
- Added remote branch picker with default-branch handling.
- Added
--basesupport to draft PR creation. - Updated picker logic, tests, documentation, and architecture notes.
| File | Description |
|---|---|
tests/fude/pr_spec.lua |
PR creation flow and picker tests |
tests/fude/gh_spec.lua |
--base argument tests |
tests/fude/diff_spec.lua |
Remote branch parsing tests |
README.md |
Feature documentation updates |
lua/fude/pr.lua |
Base selection, picker flow, title, and footer integration |
lua/fude/gh.lua |
Added --base argument support |
lua/fude/diff.lua |
Remote branch retrieval and parsing |
doc/fude.txt |
:FudeCreatePR help updates |
CLAUDE.md |
Architecture documentation updates |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the synchronous branch-distance calculation and ensure remote selections are used for title generation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address Git performance, error propagation, remote-ref consistency, and Telescope coverage concerns.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 3
Open (3)
eb99a59 to
44b86d9
Compare
| if default_branch and default_branch ~= "" and not seen[default_branch] then | ||
| table.insert(entries, { display = default_branch .. " (default)", value = default_branch, is_default = true }) | ||
| seen[default_branch] = true |
44b86d9 to
370d338
Compare
370d338 to
6a8c7ec
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Three moderate issues remain regarding ancestor ordering, default-branch validation, and remote-based title generation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Resolved since last review (1)
| "--topo-order", | ||
| "--format=%D", | ||
| "--decorate-refs=refs/remotes/origin/", | ||
| "--decorate-refs-exclude=refs/remotes/origin/HEAD", | ||
| default_ref .. "..HEAD", |


概要
:FudeCreatePRでPRの向き先(base branch)を選べるようにする。default branchを先頭に置いたpickerを開くので、そのまま<CR>を押せばdefault branchが選ばれ、別のbranchにしたいときは絞り込んで選べる。変更内容
(default)付きで先頭に置く。Telescopeは先頭のentryを初期選択するため、何も操作せずに<CR>を押せばdefaultが選ばれる(stack parent))は.git/gh-stackを直接読んで求める。gh stack viewはPRの状態をネットワーク越しに更新するため使わないgit log上の基点branch((ancestor))は、tipがHEADの祖先でありdefault branchの祖先ではないoriginのbranchとし、HEADとのコミット数が少ない順に並べる。default branchにmerge済みのbranchは除外するdiff.get_default_branch()がローカルのmain/masterから解決したdefault branchは候補に入れる。候補が1つも無いときだけpickerを出さず、従来どおりghにbaseを任せる。pickerをキャンセルするとコマンド全体を中断するgh stack link <向き先のPR URL> <新しいPR URL>で向き先PRのstackに積む。ローカルのgh-stackで管理していないbranchでもstackにできるよう、自動判定はせずユーザーに確認する形にした(stack parent)を選んだときはYesを先頭に、それ以外はNoを先頭に置くgh stack linkがそのbranchをpushし、PRが無ければ作成してしまうためgh pr create --baseに渡す(gh.create_draft_prにbase引数を追加した)<CR> create draft → main | q cancel)。pickerで選んだ内容をsubmit前に確認できるようにするためvim.ui.selectの切り替えをselect_templateと共通のmodule-local関数pick_entryにまとめた。2つのpickerで同じ実装を重複させないためテスト計画
make all)tests/fude/pr_spec.lua,tests/fude/gh_spec.lua,tests/fude/diff_spec.lua:FudeCreatePRを実行し、<CR>でdefault branchが選ばれること、絞り込みで選んだbranchがfooterと作成されたPRのbaseに反映されることを確認する(Telescopeを使う経路はテスト環境で動かせないため)備考
git fetchした時点のremote-tracking refsから作るため、fetchしていない新しいbranchは表示されないGenerated with Claude Code