patchy-cli 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +30 -0
  2. package/package.json +6 -6
  3. package/schema.json +3 -0
package/README.md CHANGED
@@ -214,6 +214,36 @@ Within each patch set files follow the same folder structure as in the `source_r
214
214
 
215
215
  `patchy generate` automatically removes stale files in `patches/<patch-set>` that no longer correspond to changes in `target_repo`.
216
216
 
217
+ ## Hooks
218
+
219
+ Patch sets can include executable scripts that run before and after patches are applied:
220
+
221
+ ```
222
+ patches/
223
+ └── 001-add-feature/
224
+ ├── patchy-post-apply # runs after patches
225
+ ├── src/file.ts.diff
226
+ ├── src/new-file.ts
227
+ └── patchy-pre-apply # runs before patches
228
+ ```
229
+
230
+ ### Hook execution
231
+
232
+ - Hooks run with `cwd` set to `target_repo`
233
+ - Environment variables: `PATCHY_TARGET_REPO`, `PATCHY_PATCH_SET`, `PATCHY_PATCHES_DIR`, `PATCHY_PATCH_SET_DIR`, `PATCHY_BASE_REVISION`
234
+ - Non-zero exit aborts `patchy apply`
235
+ - Hooks must be executable (`chmod +x`)
236
+
237
+ ### Custom hook prefix
238
+
239
+ ```jsonc
240
+ {
241
+ "hook_prefix": "my-prefix-" // Override: --hook-prefix | env: PATCHY_HOOK_PREFIX
242
+ }
243
+ ```
244
+
245
+ With prefix `my-prefix-`, hooks are named `my-prefix-pre-apply` and `my-prefix-post-apply`.
246
+
217
247
  ## Commands
218
248
 
219
249
  ### `patchy generate`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchy-cli",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "A CLI tool for managing Git patch workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -64,11 +64,11 @@
64
64
  "url": "https://github.com/richardgill/patchy"
65
65
  },
66
66
  "optionalDependencies": {
67
- "patchy-cli-linux-x64": "0.0.15",
68
- "patchy-cli-linux-arm64": "0.0.15",
69
- "patchy-cli-darwin-x64": "0.0.15",
70
- "patchy-cli-darwin-arm64": "0.0.15",
71
- "patchy-cli-windows-x64": "0.0.15"
67
+ "patchy-cli-linux-x64": "0.0.16",
68
+ "patchy-cli-linux-arm64": "0.0.16",
69
+ "patchy-cli-darwin-x64": "0.0.16",
70
+ "patchy-cli-darwin-arm64": "0.0.16",
71
+ "patchy-cli-windows-x64": "0.0.16"
72
72
  },
73
73
  "publishConfig": {
74
74
  "access": "public"
package/schema.json CHANGED
@@ -25,6 +25,9 @@
25
25
  "upstream_branch": {
26
26
  "type": "string"
27
27
  },
28
+ "hook_prefix": {
29
+ "type": "string"
30
+ },
28
31
  "verbose": {
29
32
  "default": false,
30
33
  "type": "boolean"