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

apply_patch: say where an ambiguous hunk matches and when to use an @@ anchor

クローズ 初心者向け
#313 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

関連するプルリクエストがすでにマージされています。

  • #317 @PierrunoYT による — マージ済み

評価

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

調査の方向性

src/main/tools/apply_patch.tsから始めて、曖昧なhunkのエラーがどこで構築されるかを調べてください。既存のユニットテストとツール説明のエントリーポイントを確認し、更新されたメッセージとガイダンスのテストを追加してください。エラーに一致する行番号がいくつか表示され、説明に@@アンカーまたはより多くのコンテキストをいつ使うかが記載され、ユニットテストが通れば完了です。

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

説明

apply_patch rejects a hunk that matches several places with "a hunk matches N places. Add more context lines or an @@ anchor." (src/main/tools/apply_patch.ts). That is the right refusal, but the message gives no line numbers, so the agent has to guess what to add. In recent chats 4 of 12 apply_patch calls failed this way (CSS: 107 matches; a TypeScript file: 5; a test file: 2; the changelog: 2), each costing a round trip. edit_file did not fail once.

Proposal: list the matching line numbers (first few) in the error, and add a sentence to the tool description that repetitive files (CSS, changelogs, tests) need an @@ anchor or more context. Add a unit test for the new message.

主要言語
TypeScript
スター
2
フォーク
2
平均マージ
6時間 27分
マージ済み PR(30日)
37

環境構築

はじめの一歩

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

PierrunoYT/patch のほかの issue

PierrunoYT/patch の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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