Git checks: follow `cd <dir> &&` in chained commands

オープン
#23 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

Start with the hook code that splits a command on && and ; and runs Git checks using its cwd. Trace how a plain cd part is parsed, including relative paths and ~ expansion, and how an unresolvable target should fall back to the hook directory. Add regression tests for a blocked cd dir && git add -A and an allowed equivalent using only fake paths and values.

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

説明

enhancement

cd /path/proj && git add -A && git commit -m wip is probably the commonest way an agent stages files in another folder. The guard checks each && part on its own, but runs the Git checks against the hook's cwd, not the folder the cd moved to. A secrets file, or a settings file holding a secret, in /path/proj isn't caught.

Done when

  • In a chain of && / ; parts, a plain cd <dir> changes the folder used for the parts after it (relative to the current one, with ~ expanded).
  • If the folder can't be worked out (for example cd "$VAR"), the guard falls back to the hook's cwd and keeps today's behaviour.
  • Regression tests cover a blocked cd dir && git add -A and an allowed one, with fake values only.

Found while reviewing #19.


Generated by Claude Code

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

環境構築

はじめの一歩

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

JTHCode/secretguard のほかの issue

JTHCode/secretguard の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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