You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"git add" has no hook that lets users inspect what is about to be
staged. Users who want to reject certain paths or content must
wrap the command in a shell alias or wait for pre-commit, which
fires too late to prevent staging.
Introduce a "pre-add" hook so that users can inspect or reject
proposed index updates at staging time.
$1 -- index path used by this invocation (may not exist yet)
$2 -- lockfile path containing proposed staged index state
Hook authors can inspect the result with ordinary Git commands:
GIT_INDEX_FILE="$2" git diff --cached --name-only HEAD
Both files should be treated as read-only. Exiting with non-zero
status rejects the update and leaves the index unchanged.
The hook accepts or rejects the entire proposed update. Per-path
filtering is not supported.
The hook is bypassed with "--no-verify" and is not invoked for
--interactive, --patch, --edit, or --dry-run, nor by "git commit -a"
which stages through its own code path.
Signed-off-by: Chandra Kethi-Reddy <chandrakr@pm.me>
0 commit comments