Git panel shows empty diffs and Discard fails when the project is a subfolder of a repository
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 64/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- git, typescript
調査の方向性
Start in src/main/panels/git.ts and trace how diff, discard, ownPath, and countLines handle paths from git status --porcelain. Check the existing tests and add coverage for a project in a repository subfolder, including tracked and untracked files. Done means diffs, discard, line counts, and commit scope work correctly for that project without including sibling-package files.
索引モデルが issue の本文から書いたものです。
説明
Found in the 2026-10-07 code review and confirmed with git in a scratch repository.
Problem
git status --porcelain paths are relative to the repository root. src/main/panels/git.ts (diff, discard, ownPath, countLines) treats them as relative to the project folder. isRepo() accepts an enclosing repository, and #132 supports projects inside another repo on purpose. In repo/pkg, status lists pkg/f.txt. git diff HEAD -- :(literal)pkg/f.txt prints nothing, and git checkout HEAD -- :(literal)pkg/f.txt fails with "pathspec did not match".
Impact
In a monorepo package:
- Selecting a file shows "No textual changes".
- Discard fails for tracked files, and silently does nothing for untracked ones (it resolves
pkg/pkg/new.txt). - Discard All aborts partway through.
- Untracked files get no line counts.
- Files from sibling packages are listed, and Commit includes them.
Fix
Run path operations with -C <toplevel> and :(top,literal) pathspecs, mapping paths through git rev-parse --show-prefix. Or limit status to the project (git status -- .). Add tests that use a project in a subfolder of a repo.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 2
- 平均マージ
- 6時間 27分
- マージ済み PR(30日)
- 37
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PierrunoYT/patch のほかの issue
-
難易度 4/5 1〜2日 初心者へのやさしさ 52/100
PierrunoYT/patch#329 ·
メンテナーはふだん 1 日以内に返信
-
performance priority: low severity: low
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
PierrunoYT/patch#324 ·
メンテナーはふだん 1 日以内に返信
-
performance priority: low severity: low
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
PierrunoYT/patch#306 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 36/100
PierrunoYT/patch#272 ·
メンテナーはふだん 1 日以内に返信
-
enhancement priority: low security severity: low
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
PierrunoYT/patch#271 ·
メンテナーはふだん 1 日以内に返信
PierrunoYT/patch の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
メンテナーはふだん 1 日以内に返信
-
RpcTest.makeClient: accept disableFatalDefects対応中かも @effect-bot が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Effect-TS/effect#9893 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
farion1231/cc-switch#8829 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverオープンdoc-audit enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100