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
Extends the user-facing docs that lagged behind 1304885 with --fast-dirty
coverage in execution-modes.md (5-mode table, mermaid diagram, dedicated
section with use cases, clean-tree semantics, untracked handling, mutual
exclusion and composition with FEAT-1/FEAT-3), the three CLI command
pages (flow, flows, job), the configuration pages that list valid
values (hooks, jobs, flows), and the README execution-modes
bullet and flags table.
Closes the last open checkbox of FEAT-13.
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@ return [
187
187
***Hooks** map git events (`pre-commit`, `pre-push`, etc.) to flows and jobs. Supports conditional execution by branch (`only-on` / `exclude-on`) and staged file patterns (`only-files` / `exclude-files`).
188
188
***Flows** are named groups of jobs with shared options (`fail-fast`, `processes`, `time-budget`, `memory-budget`, `reports`). Reusable across hooks and directly executable from CLI. Meta-flows (`flows.<X>.flows`) compose other flows in a single run.
189
189
***Jobs** are individual QA tasks. Each declares a `type` and its arguments. Jobs can inherit from other jobs with `extends`. When `executable-path` is omitted, GitHooks auto-detects the binary in `vendor/bin/`. Per-job thresholds (`warn-after`, `fail-after`, `memory`, `cores`) cap regressions.
190
-
***Execution modes**: `full` (default), `--fast` (only staged files), `--fast-branch` (only files changed vs base branch), `--files` / `--files-from` (explicit list).
190
+
***Execution modes**: `full` (default), `--fast` (only staged files), `--fast-branch` (only files changed vs base branch), `--fast-dirty` (unified working tree: dirty vs `HEAD` ∪ untracked — ideal for AI agentic hooks), `--files` / `--files-from` (explicit list).
191
191
192
192
See the [documentation site](https://wtyd.github.io/githooks/) for the full configuration reference.
193
193
@@ -233,7 +233,7 @@ Two ways to run non-PHP tools:
233
233
234
234
| Flag | Purpose |
235
235
|---|---|
236
-
|`--mode=full\|fast\|fast-branch` / `--fast` / `--fast-branch`| Select execution mode. `fast` filters to staged files, `fast-branch` to files changed vs base branch. |
236
+
|`--mode=full\|fast\|fast-branch\|fast-dirty` / `--fast` / `--fast-branch`/ `--fast-dirty`| Select execution mode. `fast` filters to staged files, `fast-branch` to files changed vs base branch, `fast-dirty` to the unified working tree (dirty vs `HEAD` ∪ untracked). |
237
237
|`--files=a,b,c` / `--files-from=PATH` / `--exclude-pattern=glob`| Run against an explicit list of files (CSV, manifest, or with exclusion patterns). |
238
238
|`--processes=N`, `--fail-fast`, `--only-jobs=a,b`, `--exclude-jobs=a,b`, `--dry-run`| Control parallelism, fail-fast behaviour, and job selection. |
239
239
|`--format=text\|json\|junit\|sarif\|codeclimate`| Output format on stdout. JSON v2 schema is stable. |
Copy file name to clipboardExpand all lines: docs/cli/flow.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,8 @@ githooks flow <name> [options]
23
23
|`--no-reports`| Ignore the `reports` section from config (CLI `--report-*` flags still apply). PHPUnit `--no-coverage` style. |
24
24
|`--fast`| Fast mode — accelerable jobs analyze only staged files. See [Execution Modes](../execution-modes.md). |
25
25
|`--fast-branch`| Fast-branch mode — analyze files that differ from the main branch. The branch name comes from the [`main-branch` option](../configuration/options.md#available-options); see [Execution Modes](../execution-modes.md) and [Fast-branch fallback](../execution-modes.md#fast-branch-fallback). |
26
-
|`--files=a,b,c`| Files mode — accelerable jobs analyze only the explicit list (CSV). Mutually exclusive with `--files-from`. Wins over `--fast`/`--fast-branch`. See [How-To: --files / --files-from](../how-to/files-flag.md). |
26
+
|`--fast-dirty`| Fast-dirty mode — analyze the unified working tree: tracked files modified vs `HEAD` (staged or unstaged) ∪ non-ignored untracked. Ideal for AI agentic hooks and mid-review checks. Clean tree → all accelerable jobs skipped, exit 0 (no fallback to `full`). Mutually exclusive with `--fast`, `--fast-branch`, `--files`, `--files-from`. See [Fast-dirty mode](../execution-modes.md#fast-dirty-mode-fast-dirty). |
27
+
|`--files=a,b,c`| Files mode — accelerable jobs analyze only the explicit list (CSV). Mutually exclusive with `--files-from`, `--fast`, `--fast-branch`, `--fast-dirty`. See [How-To: --files / --files-from](../how-to/files-flag.md). |
27
28
|`--files-from=PATH`| Files mode — read the list of paths from `PATH` (one per line; `#` comments and blanks ignored; UTF-8 + CRLF tolerated). Use this when the list exceeds the shell `ARG_MAX` or comes from `git diff --name-only`. |
28
29
|`--exclude-pattern=glob1,glob2`| Drop input paths that match any glob (`*`, `**`, `?`). Requires `--files` or `--files-from`. See [How-To: --files / --files-from](../how-to/files-flag.md#-exclude-pattern). |
29
30
|`--monitor`| Show thread usage report after execution. See [Options: Thread budget](../configuration/options.md#thread-budget). |
-**`--format=json`** emits JSON v2: top-level `version`, `executionMode` (reflects the actual `--fast`/`--fast-branch` flag), `passed`, `failed`, `skipped`, and a `jobs` array with `type`, `exitCode`, `paths`, `skipped`, `skipReason`, `fixApplied`, `command` and `output`. Jobs cancelled by `--fail-fast` appear with `skipped: true` and `skipReason: "skipped by fail-fast"`.
74
+
-**`--format=json`** emits JSON v2: top-level `version`, `executionMode` (reflects the actual `--fast`/`--fast-branch`/`--fast-dirty` flag), `passed`, `failed`, `skipped`, and a `jobs` array with `type`, `exitCode`, `paths`, `skipped`, `skipReason`, `fixApplied`, `command` and `output`. Jobs cancelled by `--fail-fast` appear with `skipped: true` and `skipReason: "skipped by fail-fast"`.
73
75
-**`--format=junit`** emits JUnit XML compatible with `mikepenz/action-junit-report` and similar. Skipped jobs emit `<skipped>` elements.
74
76
-**`--format=codeclimate`** emits a GitLab Code Quality JSON array. `location.path` is relative to the CWD.
75
77
-**`--format=sarif`** emits a SARIF 2.1.0 report for GitHub Code Scanning. `artifactLocation.uri` is relative to the CWD.
Copy file name to clipboardExpand all lines: docs/cli/flows.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Single-flow degenerate runs (`flows qa` with `qa` a normal flow) produce **the s
32
32
33
33
## Options
34
34
35
-
The same flag set as [`flow`](flow.md): `--fail-fast`, `--processes`, `--exclude-jobs`, `--only-jobs`, `--format`, `--output`, `--report-*`, `--no-reports`, `--fast`, `--fast-branch`, `--fast-branch-fallback`, `--files`, `--files-from`, `--exclude-pattern`, `--monitor`, `--no-ci`, `--show-progress`, `--config`, `--dry-run`. Only the positional argument changes (variadic instead of single).
35
+
The same flag set as [`flow`](flow.md): `--fail-fast`, `--processes`, `--exclude-jobs`, `--only-jobs`, `--format`, `--output`, `--report-*`, `--no-reports`, `--fast`, `--fast-branch`, `--fast-dirty`, `--fast-branch-fallback`, `--files`, `--files-from`, `--exclude-pattern`, `--monitor`, `--no-ci`, `--show-progress`, `--config`, `--dry-run`. Only the positional argument changes (variadic instead of single).
36
36
37
37
`--exclude-jobs` and `--only-jobs` apply to the **merged deduplicated list** of jobs after meta-flow expansion, not per source flow. `--files` / `--files-from` build a **single**`ExecutionContext` shared by every job.
Copy file name to clipboardExpand all lines: docs/cli/job.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,8 @@ githooks job <name> [options]
21
21
|`--no-reports`| Ignore the `reports` section from config (CLI `--report-*` flags still apply). |
22
22
|`--fast`| Fast mode — analyze only staged files. See [Execution Modes](../execution-modes.md). |
23
23
|`--fast-branch`| Fast-branch mode — analyze branch diff files. The branch name comes from the [`main-branch` option](../configuration/options.md#available-options); see [Execution Modes](../execution-modes.md) and [Fast-branch fallback](../execution-modes.md#fast-branch-fallback). |
24
-
|`--files=a,b,c`| Files mode — explicit list (CSV). Mutually exclusive with `--files-from`. Wins over `--fast`/`--fast-branch`. See [How-To: --files / --files-from](../how-to/files-flag.md). |
24
+
|`--fast-dirty`| Fast-dirty mode — analyze the unified working tree (tracked files modified vs `HEAD`, staged or unstaged, ∪ non-ignored untracked). Clean tree → job skipped, exit 0 (no fallback to `full`). Mutually exclusive with `--fast`, `--fast-branch`, `--files`, `--files-from`. See [Fast-dirty mode](../execution-modes.md#fast-dirty-mode-fast-dirty). |
25
+
|`--files=a,b,c`| Files mode — explicit list (CSV). Mutually exclusive with `--files-from`, `--fast`, `--fast-branch`, `--fast-dirty`. See [How-To: --files / --files-from](../how-to/files-flag.md). |
25
26
|`--files-from=PATH`| Files mode — read paths from a manifest file (one per line). |
26
27
|`--exclude-pattern=glob1,glob2`| Drop input paths that match any glob. Requires `--files` or `--files-from`. |
27
28
|`--no-ci`| Disable auto-detection of CI annotations. See [CI Annotations](../how-to/ci-cd.md#ci-annotations). |
Copy file name to clipboardExpand all lines: docs/configuration/flows.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ Each entry in `flows.<X>.jobs` can be either a plain string (job name) **or** an
97
97
],
98
98
```
99
99
100
-
When the flow runs in `--fast` / `--fast-branch`, each entry's rules are evaluated against the change set:
100
+
When the flow runs in `--fast`, `--fast-branch` or `--fast-dirty`, each entry's rules are evaluated against the change set:
101
101
102
102
- A file `F`**admits** the job when `match(only-files, F) AND NOT match(exclude-files, F)`.
103
103
- The job **runs** if at least one file admits it; otherwise it appears in the output as `skipped: true` with a clear `skipReason` (consistent with JSON / SARIF / JUnit reporting).
@@ -180,7 +180,7 @@ In `master` the mode is `full` (FEAT-1's `only-files` rules become no-op). In a
180
180
181
181
The effective mode is decided in this order (first that produces a value wins):
2. `flows.<X>.on` matched against the current branch.
185
185
3. `flows.<X>.execution`.
186
186
4. `flows.options.execution` (global default).
@@ -230,7 +230,7 @@ Same semantics as FEAT-1's `only-files` / `exclude-files`:
230
230
231
231
### Scope and caveats
232
232
233
-
- **Per-flow only.** Multi-flow runs (`githooks flows X Y`) ignore per-flow `on` (matches the existing CON-001/002 for flow-level options). The mode comes from `--fast/--fast-branch` or `flows.options.execution`.
233
+
- **Per-flow only.** Multi-flow runs (`githooks flows X Y`) ignore per-flow `on` (matches the existing CON-001/002 for flow-level options). The mode comes from `--fast`/`--fast-branch`/`--fast-dirty` or `flows.options.execution`.
234
234
- **`execution` is the only supported attribute today.** The object shape leaves room for `time-budget` / `fail-fast` to be added later without breaking the surface.
235
235
- **`PHP collapses duplicate map keys.** `'master' => …, 'master' => …` cannot be detected — PHP keeps only the last entry.
236
236
@@ -308,7 +308,7 @@ When there is no JS in the change set, both skip by `only-files` (FEAT-1) — co
308
308
309
309
### Composition with `on` (FEAT-2)
310
310
311
-
The execution mode chosen by `on` does not affect `needs`. Dependencies are structural — they hold in `full`, `fast`, and `fast-branch` alike.
311
+
The execution mode chosen by `on` does not affect `needs`. Dependencies are structural — they hold in `full`, `fast`, `fast-branch`, and `fast-dirty` alike.
Copy file name to clipboardExpand all lines: docs/configuration/hooks.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ Hook refs can include conditions that control when a flow/job is executed:
71
71
|`exclude-on`| Array of branch names or glob patterns. The ref is skipped if the current branch matches any pattern. **Always prevails over `only-on`**. Can be used alone. |
72
72
|`only-files`| Array of file glob patterns. The ref is skipped if no staged files match any pattern. |
73
73
|`exclude-files`| Array of file glob patterns. Staged files matching any pattern are excluded from triggering execution. **Always prevails over `only-files`**. Can be used alone. |
|`executable-prefix`| String | Per-job prefix override. Set to `null` or `''` to opt out of the global prefix. |
50
50
|`cores`| Integer | Reserve N cores in the [thread budget](options.md#thread-budget). See [Reserving cores explicitly](#reserving-cores-cores-or-the-tools-native-flag) below. |
51
51
|`memory`| Integer or Object | Per-job memory threshold (MB) — and 2D allocator reservation when given as a short integer. See [Per-job memory threshold](#per-job-memory-threshold-memory) below. |
0 commit comments