Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

annotate shows the launch directory's repo, not the file's

オープン 初心者向け
#2,290 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

packages/server/repo.ts を読み、getRepoInfo() が process.cwd() にフォールバックする仕組みを確認してから、packages/server/annotate.ts と apps/pi-extension/server/serverAnnotate.ts にある呼び出し箇所を調べてください。対象パスとして、単一ファイルの場合はそのファイルのディレクトリ、フォルダの場合はそのフォルダ、複数ファイルの場合はバンドルの共通ルートを渡してください。URL と annotate-last の場合は起動ディレクトリのままにします。対象が起動ディレクトリのリポジトリの外にあるケースのテストを追加し、リポジトリチップ、ブランチチップ、タブのサフィックスが対象のリポジトリを表示することを確認してください。

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

説明

plannotator annotate takes the repo and branch it shows from the directory the command runs
in, not from the repo that holds the file. When an agent launches a review from a different
directory than the document's, the repo chip, the branch chip and the tab title's repo suffix
(#2061) all name the wrong repository.

Repro

Two repos, one nested in the other (a docs repo holding a code checkout, git-ignored):

~/work/payments-docs/          # repo acme/payments-docs, branch main
~/work/payments-docs/payments/ # repo acme/payments, branch feat/refunds
cd ~/work/payments-docs/payments
plannotator annotate ../specs/refunds.md
  • Expected: acme/payments-docs and main, the repo and branch of refunds.md.
  • Actual: acme/payments and feat/refunds. The tab reads refunds.md · acme/payments.

Nesting isn't required. Any launch from outside the file's repo shows the launch directory's repo,
and a file outside any repo gets the launch directory's repo too.

Cause

packages/server/annotate.ts calls getRepoInfo() with no argument, so it falls back to
process.cwd() (packages/server/repo.ts). The Pi extension does the same in
apps/pi-extension/server/serverAnnotate.ts. Code review already passes its git context's
cwd, so it isn't affected.

Suggestion

Resolve the repo from the target when there is one on disk:

  • One file: the file's directory.
  • A folder: the folder.
  • Several files: the common root the bundle already computes.
  • A URL or annotate-last: keep the launch directory, as today.

The change is one argument at each call site, plus a test with the target outside the launch
directory's repo. Happy to send the PR.

主要言語
TypeScript
スター
8.7k
フォーク
649
平均マージ
11時間 16分
マージ済み PR(30日)
585

環境構築

はじめの一歩

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

backnotprop/plannotator のほかの issue

backnotprop/plannotator の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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