Git.commit: CommitOptions.date only sets the author date, not the committer date
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- git, typescript
- 領域
- tooling
調査の方向性
src/util/git.ts を読み、Git.commit における options.date の処理箇所を特定する。次に、既存の commit 関連テストを見つけ、回帰ケースを追加する前に実行する。完了条件は、1つの日付を指定した commit が、%ai と %ci の両方で一致する author と committer のタイムスタンプを報告すること。
索引モデルが issue の本文から書いたものです。
説明
Observed behavior
Git.commit in src/util/git.ts forwards options.date as --date=<iso> to git:
if (date != null) {
args.push(`--date=${new Date(date).toISOString()}`);
}
Git's --date flag only sets the AUTHOR date. The committer date defaults to "now" unless GIT_COMMITTER_DATE is set. Because the API exposes a single date, callers will reasonably assume it sets the commit's timestamp, but only one of the two timestamps actually changes.
Expected behavior
A single date option should set both author and committer dates so the resulting commit is fully deterministic, or the option should be renamed/split to make the asymmetry explicit.
Minimal reproduction
const date = new Date('1970-01-01T00:00:00Z').getTime();
await git.commit('msg', {
committer: { name: 'X', email: 'x@y' },
date,
});
// git log -1 --format='AD=%ai CD=%ci'
// -> AD=1970-01-01 00:00:00 +0000 CD=2026-05-25 19:25:44 +0100
Verified with a standalone Node script that replicates the exact spawn arguments used by Git.commit.
Suggested fix
Set both timestamps via environment variables, which avoids relying on the asymmetric --date flag:
if (date != null) {
const iso = new Date(date).toISOString();
env['GIT_AUTHOR_DATE'] = iso;
env['GIT_COMMITTER_DATE'] = iso;
}
Add a regression test that commits with a date and asserts both %ai and %ci match.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
joewalker/loop-the-loop のほかの issue
-
bug S4
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal informationオープンbug S3
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
joewalker/loop-the-loop#83 ·
-
bug S4
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
joewalker/loop-the-loop#79 ·
-
bug S4
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
joewalker/loop-the-loop#78 ·
joewalker/loop-the-loop の issue をすべて見る
似ている issue
-
bug hacktoberfest help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
libredb/libredb-studio#1941 ·
メンテナーはふだん 1 日以内に返信
-
chore other
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
alastair-smith/card-games#308 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
paperclipai/paperclip#17379 ·
メンテナーはふだん 1 日以内に返信
-
[good first issue, hacktoberfest] 🏯 Hacktoberfest Task - Add new Anime Quote 626 (good-first-issue)オープンcommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
lingdojo/kana-dojo#33040 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
bug mobile ui
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信