patchy-cli 0.0.6-pr.169.e7f21e2 → 0.0.6-pr.170.4d2f4e4

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 +31 -14
  2. package/package.json +6 -6
  3. package/schema.json +3 -0
package/README.md CHANGED
@@ -74,6 +74,7 @@ echo "new file" > clones/spoon-knife/path/to/newFile.txt
74
74
 
75
75
  To generate the patches for the changes run `patchy generate`:
76
76
 
77
+ Patchy will prompt you to create your first **patch set**, let's name it: 'first-patch-set'
77
78
 
78
79
  ```
79
80
  ./
@@ -82,10 +83,12 @@ To generate the patches for the changes run `patchy generate`:
82
83
  │ ├── path/to/existingFile.txt
83
84
  │ └── path/to/newFile.txt
84
85
  ├── patches/
85
- ├── path/to/existingFile.txt.diff
86
- └── path/to/newFile.txt
86
+ └── 001-first-patch-set/
87
+ ├── path/to/existingFile.txt.diff
88
+ │ └── path/to/newFile.txt
87
89
  └── patchy.json
88
90
  ```
91
+
89
92
  - **Edits** are stored as `.diff` files e.g. `existingFile.txt.diff`.
90
93
  - **New files** are copied as regular files e.g. `newFile.txt` (easier to inspect and edit directly).
91
94
 
@@ -99,8 +102,9 @@ Reset the current upstream repo `patchy repo reset main`, which will reset every
99
102
  │ └── spoon-knife/ <<< reset
100
103
  │ ├── path/to/existingFile.txt
101
104
  ├── patches/
102
- ├── path/to/existingFile.txt.diff
103
- └── path/to/newFile.txt
105
+ └── 001-first-patch-set/
106
+ ├── path/to/existingFile.txt.diff
107
+ │ └── path/to/newFile.txt
104
108
  └── patchy.json
105
109
  ```
106
110
 
@@ -113,8 +117,9 @@ Apply the patches back to the cloned repo with: `patchy apply`
113
117
  │ ├── path/to/existingFile.txt (modified)
114
118
  │ └── path/to/newFile.txt (added)
115
119
  ├── patches/
116
- ├── path/to/existingFile.txt.diff
117
- └── path/to/newFile.txt
120
+ └── 001-first-patch-set/
121
+ ├── path/to/existingFile.txt.diff
122
+ │ └── path/to/newFile.txt
118
123
  └── patchy.json
119
124
  ```
120
125
 
@@ -166,6 +171,9 @@ patchy init
166
171
  // Can be relative to clones_dir: <clones_dir>/<target_repo> or absolute.
167
172
  "target_repo": "repo", // Override: --target-repo | env: PATCHY_TARGET_REPO
168
173
 
174
+ // Patch set to generate into (subdirectory of patches_dir).
175
+ // If not set, prompts interactively or errors in non-interactive mode.
176
+ "patch_set": "001-security-fixes", // Override: --patch-set | env: PATCHY_PATCH_SET
169
177
 
170
178
  // Git ref to checkout (branch, tag, SHA).
171
179
  "ref": "main" // Override: --ref | env: PATCHY_REF
@@ -182,41 +190,50 @@ The `patches/` directory (customizable via [`patches_dir`](#patchyjson-reference
182
190
  ```
183
191
  ./
184
192
  ├── patches/
185
- ├── path/to/existingFile.txt.diff
186
- └── path/to/newFile.txt
193
+ └── 001-first-patch-set/
194
+ ├── path/to/existingFile.txt.diff
195
+ │ └── path/to/newFile.txt
187
196
  ├── clones/
188
197
  │ └── repo-clone-1/
189
198
  │ ├── path/to/existingFile.txt (modified)
190
199
  │ └── path/to/newFile.txt (added)
191
200
  └── patchy.json
192
201
  ```
202
+ Patches are grouped into **patch sets** for organizing related changes. Patch sets apply in alphabetical order. Use numeric prefixes (e.g., `001-auth`, `002-ui`).
193
203
 
194
204
  **Two types of patch files:**
195
205
  - **`.diff` files** — For modified existing files (generated via `git diff HEAD`)
196
206
  - **Plain files** — For newly added files (copied verbatim for easier inspection and editing)
197
207
 
198
- `patchy generate` automatically removes stale files in `patches/` that no longer correspond to changes in `target_repo`.
208
+ `patchy generate` automatically removes stale files in `patches/<patch-set>` that no longer correspond to changes in `target_repo`.
199
209
 
200
210
  ## Commands
201
211
 
202
212
  ### `patchy generate`
203
213
 
204
- Generate `.diff` files and new files into `./patches/` based on current `git diff` in `target_repo`.
214
+ Generate `.diff` files and new files into `./patches/<patch-set>/` based on current `git diff` in `target_repo`.
205
215
 
206
216
  ```sh
207
- patchy generate [--target-repo] [--patches-dir] [--dry-run]
217
+ patchy generate [--patch-set <name>] [--target-repo] [--patches-dir] [--dry-run]
208
218
  ```
209
219
 
210
- Note: `patchy generate` is destructive and will remove any unneeded files in your `./patches/` folder.
220
+ If `--patch-set` is not provided (and not set via env/config), prompts to select an existing patch set or create a new one.
221
+
222
+ Note: `patchy generate` is destructive and will remove any unneeded files in the patch set directory.
211
223
 
212
224
  ### `patchy apply`
213
225
 
214
- Apply patch files from `patches/` into `target_repo`.
226
+ Apply patch files from `patches/` into `target_repo`. Patch sets are applied in alphabetical order.
215
227
 
216
228
  ```sh
217
- patchy apply [--target-repo] [--patches-dir] [--dry-run]
229
+ patchy apply [--only <patch-set>] [--until <patch-set>] [--target-repo] [--patches-dir] [--dry-run]
218
230
  ```
219
231
 
232
+ | Flag | Description |
233
+ |------|-------------|
234
+ | `--only <name>` | Apply only the specified patch set |
235
+ | `--until <name>` | Apply patch sets up to and including the specified one |
236
+
220
237
  ### `patchy repo reset`
221
238
 
222
239
  Hard reset the Git working tree of `target_repo`. Discards local changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchy-cli",
3
- "version": "0.0.6-pr.169.e7f21e2",
3
+ "version": "0.0.6-pr.170.4d2f4e4",
4
4
  "description": "A CLI tool for managing Git patch workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -62,11 +62,11 @@
62
62
  "url": "https://github.com/richardgill/patchy"
63
63
  },
64
64
  "optionalDependencies": {
65
- "patchy-cli-linux-x64": "0.0.6-pr.169.e7f21e2",
66
- "patchy-cli-linux-arm64": "0.0.6-pr.169.e7f21e2",
67
- "patchy-cli-darwin-x64": "0.0.6-pr.169.e7f21e2",
68
- "patchy-cli-darwin-arm64": "0.0.6-pr.169.e7f21e2",
69
- "patchy-cli-windows-x64": "0.0.6-pr.169.e7f21e2"
65
+ "patchy-cli-linux-x64": "0.0.6-pr.170.4d2f4e4",
66
+ "patchy-cli-linux-arm64": "0.0.6-pr.170.4d2f4e4",
67
+ "patchy-cli-darwin-x64": "0.0.6-pr.170.4d2f4e4",
68
+ "patchy-cli-darwin-arm64": "0.0.6-pr.170.4d2f4e4",
69
+ "patchy-cli-windows-x64": "0.0.6-pr.170.4d2f4e4"
70
70
  },
71
71
  "publishConfig": {
72
72
  "access": "public"
package/schema.json CHANGED
@@ -16,6 +16,9 @@
16
16
  "patches_dir": {
17
17
  "type": "string"
18
18
  },
19
+ "patch_set": {
20
+ "type": "string"
21
+ },
19
22
  "ref": {
20
23
  "type": "string"
21
24
  },