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

Git.commit: --author value is wrapped in literal double quotes, corrupting author names that contain a quote character

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

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

評価

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

調査の方向性

Git.commit の実装で --author 引数が組み立てられている箇所から始め、既存の commit 関連テストを確認します。二重引用符を含む committer 名で問題を再現し、引数を囲むリテラルの引用符を削除し、git log -1 --format='%an' が完全な名前を保持することを確認する回帰テストを追加します。

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

説明

bug S3

Observed behavior

Git.commit builds the --author argument with literal double quotes:

args.push(`--author="${committer.name} <${committer.email}>"`);

Because child_process.spawn is used without a shell, the literal " characters are part of the value passed to git. Git's "crud stripping" of identity strings hides the problem for ordinary names (leading/trailing quotes get filtered out), but the protection breaks down if committer.name itself contains a ".

Expected behavior

The literal quotes should not be in the value. The standard format that git documents is just --author=Name <email>, with no surrounding quotes.

Minimal reproduction

await git.commit('msg', {
  committer: { name: 'Joe \"Real\"', email: '[email protected]' },
});
// git log -1 --format='%an'
// -> Joe \"Real           (the trailing quote is silently lost)

Verified with a standalone Node script that replicates Git.commit's exact spawn arguments. Observed result:

AN=[Joe \"Real] AE=[[email protected]] CN=[Joe \"Real] CE=[[email protected]]

The trailing \" from the source name is gone.

Suggested fix

args.push(`--author=${committer.name} <${committer.email}>`);

A regression test that commits with committer.name = 'Joe \"Real\"' and asserts git log -1 --format='%an' returns Joe \"Real\" would catch this.

主要言語
TypeScript
スター
2
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

joewalker/loop-the-loop のほかの issue

joewalker/loop-the-loop の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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