gitflash 0.5.1 → 0.6.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +44 -1
- data/bin/gitflash +10 -0
- data/command_descriptions.yml +23 -0
- data/lib/gitflash/branch.rb +7 -0
- data/lib/gitflash/cli.rb +35 -21
- data/lib/gitflash/command_runner.rb +23 -0
- data/lib/gitflash/commands/base.rb +9 -0
- data/lib/gitflash/commands/checkout.rb +2 -1
- data/lib/gitflash/commands/delete.rb +6 -3
- data/lib/gitflash/commands/gc.rb +41 -0
- data/lib/gitflash/commands/hook_install.rb +69 -0
- data/lib/gitflash/commands/hook_status.rb +62 -0
- data/lib/gitflash/commands/reset.rb +7 -1
- data/lib/gitflash/commands/snapshot_create.rb +30 -0
- data/lib/gitflash/commands/snapshot_list.rb +20 -0
- data/lib/gitflash/commands/undo.rb +99 -0
- data/lib/gitflash/git/bash_command.rb +5 -4
- data/lib/gitflash/hook/claude.rb +106 -0
- data/lib/gitflash/hook/command_parser.rb +101 -0
- data/lib/gitflash/hook/rules.rb +108 -0
- data/lib/gitflash/hook/settings.rb +60 -0
- data/lib/gitflash/hook_cli.rb +69 -0
- data/lib/gitflash/repo.rb +10 -0
- data/lib/gitflash/restore.rb +140 -0
- data/lib/gitflash/snapshot.rb +47 -0
- data/lib/gitflash/snapshots.rb +70 -0
- data/lib/gitflash/state_capture.rb +129 -0
- data/lib/gitflash/ui.rb +7 -5
- data/lib/gitflash/version.rb +1 -1
- data/schema/v1.json +804 -69
- metadata +17 -1
data/schema/v1.json
CHANGED
|
@@ -4,168 +4,903 @@
|
|
|
4
4
|
"title": "gitflash --json output, schema version 1",
|
|
5
5
|
"description": "Every gitflash command run with --json prints exactly one object in this envelope. `ok` is true for the statuses done, planned, noop and cancelled. Fields may be added in later releases of version 1; existing fields keep their meaning.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"required": [
|
|
7
|
+
"required": [
|
|
8
|
+
"schema",
|
|
9
|
+
"command",
|
|
10
|
+
"ok",
|
|
11
|
+
"status",
|
|
12
|
+
"dry_run"
|
|
13
|
+
],
|
|
8
14
|
"properties": {
|
|
9
|
-
"schema": {
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
"schema": {
|
|
16
|
+
"const": 1
|
|
17
|
+
},
|
|
18
|
+
"command": {
|
|
19
|
+
"enum": [
|
|
20
|
+
"branches",
|
|
21
|
+
"checkout",
|
|
22
|
+
"delete",
|
|
23
|
+
"reset",
|
|
24
|
+
"undo",
|
|
25
|
+
"snapshots",
|
|
26
|
+
"snapshot",
|
|
27
|
+
"gc",
|
|
28
|
+
"hook install",
|
|
29
|
+
"hook status"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"ok": {
|
|
33
|
+
"type": "boolean"
|
|
34
|
+
},
|
|
12
35
|
"status": {
|
|
13
36
|
"description": "done: the change was made. planned: --dry-run, nothing changed. noop: nothing to do. cancelled: the user declined. failed: git refused part of the change. confirmation_required: re-run with --yes after reviewing `plan`. error: invalid input or environment.",
|
|
14
|
-
"enum": [
|
|
37
|
+
"enum": [
|
|
38
|
+
"done",
|
|
39
|
+
"planned",
|
|
40
|
+
"noop",
|
|
41
|
+
"cancelled",
|
|
42
|
+
"failed",
|
|
43
|
+
"confirmation_required",
|
|
44
|
+
"error"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"dry_run": {
|
|
48
|
+
"type": "boolean"
|
|
15
49
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
50
|
+
"plan": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"description": "The change that will be, would be or was made."
|
|
53
|
+
},
|
|
54
|
+
"result": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"description": "What happened, including what is needed to revert it."
|
|
57
|
+
},
|
|
58
|
+
"error": {
|
|
59
|
+
"$ref": "#/$defs/error"
|
|
60
|
+
},
|
|
61
|
+
"undo": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"description": "The snapshot saved before the change. Run `command` to revert it.",
|
|
64
|
+
"required": [
|
|
65
|
+
"snapshot",
|
|
66
|
+
"command"
|
|
67
|
+
],
|
|
68
|
+
"properties": {
|
|
69
|
+
"snapshot": {
|
|
70
|
+
"type": "string"
|
|
71
|
+
},
|
|
72
|
+
"command": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
20
77
|
},
|
|
21
78
|
"allOf": [
|
|
22
79
|
{
|
|
23
|
-
"if": {
|
|
24
|
-
|
|
25
|
-
|
|
80
|
+
"if": {
|
|
81
|
+
"properties": {
|
|
82
|
+
"status": {
|
|
83
|
+
"enum": [
|
|
84
|
+
"done",
|
|
85
|
+
"planned",
|
|
86
|
+
"noop",
|
|
87
|
+
"cancelled"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"then": {
|
|
93
|
+
"properties": {
|
|
94
|
+
"ok": {
|
|
95
|
+
"const": true
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"not": {
|
|
99
|
+
"required": [
|
|
100
|
+
"error"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"else": {
|
|
105
|
+
"properties": {
|
|
106
|
+
"ok": {
|
|
107
|
+
"const": false
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"required": [
|
|
111
|
+
"error"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"if": {
|
|
117
|
+
"properties": {
|
|
118
|
+
"status": {
|
|
119
|
+
"const": "confirmation_required"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"then": {
|
|
124
|
+
"required": [
|
|
125
|
+
"plan"
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"if": {
|
|
131
|
+
"properties": {
|
|
132
|
+
"command": {
|
|
133
|
+
"const": "branches"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"then": {
|
|
138
|
+
"properties": {
|
|
139
|
+
"result": {
|
|
140
|
+
"$ref": "#/$defs/branches_result"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"if": {
|
|
147
|
+
"properties": {
|
|
148
|
+
"command": {
|
|
149
|
+
"const": "checkout"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"then": {
|
|
154
|
+
"properties": {
|
|
155
|
+
"plan": {
|
|
156
|
+
"$ref": "#/$defs/checkout_plan"
|
|
157
|
+
},
|
|
158
|
+
"result": {
|
|
159
|
+
"$ref": "#/$defs/checkout_result"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"if": {
|
|
166
|
+
"properties": {
|
|
167
|
+
"command": {
|
|
168
|
+
"const": "delete"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"then": {
|
|
173
|
+
"properties": {
|
|
174
|
+
"plan": {
|
|
175
|
+
"$ref": "#/$defs/delete_plan"
|
|
176
|
+
},
|
|
177
|
+
"result": {
|
|
178
|
+
"$ref": "#/$defs/delete_result"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"if": {
|
|
185
|
+
"properties": {
|
|
186
|
+
"command": {
|
|
187
|
+
"const": "reset"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"then": {
|
|
192
|
+
"properties": {
|
|
193
|
+
"plan": {
|
|
194
|
+
"$ref": "#/$defs/reset_plan"
|
|
195
|
+
},
|
|
196
|
+
"result": {
|
|
197
|
+
"$ref": "#/$defs/reset_result"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"if": {
|
|
204
|
+
"properties": {
|
|
205
|
+
"command": {
|
|
206
|
+
"const": "undo"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"then": {
|
|
211
|
+
"properties": {
|
|
212
|
+
"plan": {
|
|
213
|
+
"$ref": "#/$defs/undo_plan"
|
|
214
|
+
},
|
|
215
|
+
"result": {
|
|
216
|
+
"$ref": "#/$defs/undo_result"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
26
220
|
},
|
|
27
221
|
{
|
|
28
|
-
"if": {
|
|
29
|
-
|
|
222
|
+
"if": {
|
|
223
|
+
"properties": {
|
|
224
|
+
"command": {
|
|
225
|
+
"const": "snapshots"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"then": {
|
|
230
|
+
"properties": {
|
|
231
|
+
"result": {
|
|
232
|
+
"$ref": "#/$defs/snapshots_result"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
30
236
|
},
|
|
31
237
|
{
|
|
32
|
-
"if": {
|
|
33
|
-
|
|
238
|
+
"if": {
|
|
239
|
+
"properties": {
|
|
240
|
+
"command": {
|
|
241
|
+
"const": "snapshot"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"then": {
|
|
246
|
+
"properties": {
|
|
247
|
+
"result": {
|
|
248
|
+
"$ref": "#/$defs/snapshot_result"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
34
252
|
},
|
|
35
253
|
{
|
|
36
|
-
"if": {
|
|
254
|
+
"if": {
|
|
255
|
+
"properties": {
|
|
256
|
+
"command": {
|
|
257
|
+
"const": "gc"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
},
|
|
37
261
|
"then": {
|
|
38
262
|
"properties": {
|
|
39
|
-
"plan": {
|
|
40
|
-
|
|
263
|
+
"plan": {
|
|
264
|
+
"$ref": "#/$defs/gc_plan"
|
|
265
|
+
},
|
|
266
|
+
"result": {
|
|
267
|
+
"$ref": "#/$defs/gc_result"
|
|
268
|
+
}
|
|
41
269
|
}
|
|
42
270
|
}
|
|
43
271
|
},
|
|
44
272
|
{
|
|
45
|
-
"if": {
|
|
273
|
+
"if": {
|
|
274
|
+
"properties": {
|
|
275
|
+
"command": {
|
|
276
|
+
"const": "hook install"
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
46
280
|
"then": {
|
|
47
281
|
"properties": {
|
|
48
|
-
"plan": {
|
|
49
|
-
|
|
282
|
+
"plan": {
|
|
283
|
+
"$ref": "#/$defs/hook_install"
|
|
284
|
+
},
|
|
285
|
+
"result": {
|
|
286
|
+
"$ref": "#/$defs/hook_install"
|
|
287
|
+
}
|
|
50
288
|
}
|
|
51
289
|
}
|
|
52
290
|
},
|
|
53
291
|
{
|
|
54
|
-
"if": {
|
|
292
|
+
"if": {
|
|
293
|
+
"properties": {
|
|
294
|
+
"command": {
|
|
295
|
+
"const": "hook status"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
},
|
|
55
299
|
"then": {
|
|
56
300
|
"properties": {
|
|
57
|
-
"
|
|
58
|
-
|
|
301
|
+
"result": {
|
|
302
|
+
"$ref": "#/$defs/hook_status"
|
|
303
|
+
}
|
|
59
304
|
}
|
|
60
305
|
}
|
|
61
306
|
}
|
|
62
307
|
],
|
|
63
308
|
"$defs": {
|
|
64
|
-
"sha": {
|
|
309
|
+
"sha": {
|
|
310
|
+
"type": "string",
|
|
311
|
+
"pattern": "^[0-9a-f]{4,64}$"
|
|
312
|
+
},
|
|
65
313
|
"error": {
|
|
66
314
|
"type": "object",
|
|
67
|
-
"required": [
|
|
315
|
+
"required": [
|
|
316
|
+
"code",
|
|
317
|
+
"message",
|
|
318
|
+
"exit_code"
|
|
319
|
+
],
|
|
68
320
|
"properties": {
|
|
69
321
|
"code": {
|
|
70
322
|
"description": "Stable identifier to branch on; the message is for humans.",
|
|
71
323
|
"enum": [
|
|
72
|
-
"not_a_repository",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
324
|
+
"not_a_repository",
|
|
325
|
+
"input_required",
|
|
326
|
+
"invalid_usage",
|
|
327
|
+
"invalid_options",
|
|
328
|
+
"unknown_branch",
|
|
329
|
+
"unknown_commit",
|
|
330
|
+
"protected_branch",
|
|
331
|
+
"confirmation_required",
|
|
332
|
+
"git_failed",
|
|
333
|
+
"failed",
|
|
334
|
+
"unknown_snapshot",
|
|
335
|
+
"wrong_worktree",
|
|
336
|
+
"invalid_settings"
|
|
75
337
|
]
|
|
76
338
|
},
|
|
77
|
-
"message": {
|
|
78
|
-
|
|
339
|
+
"message": {
|
|
340
|
+
"type": "string"
|
|
341
|
+
},
|
|
342
|
+
"exit_code": {
|
|
343
|
+
"enum": [
|
|
344
|
+
1,
|
|
345
|
+
2
|
|
346
|
+
]
|
|
347
|
+
}
|
|
79
348
|
}
|
|
80
349
|
},
|
|
81
350
|
"branch": {
|
|
82
351
|
"type": "object",
|
|
83
352
|
"required": [
|
|
84
|
-
"name",
|
|
85
|
-
"
|
|
353
|
+
"name",
|
|
354
|
+
"sha",
|
|
355
|
+
"current",
|
|
356
|
+
"default",
|
|
357
|
+
"upstream",
|
|
358
|
+
"upstream_gone",
|
|
359
|
+
"ahead",
|
|
360
|
+
"behind",
|
|
361
|
+
"merged",
|
|
362
|
+
"last_commit_at",
|
|
363
|
+
"last_commit_author",
|
|
364
|
+
"last_commit_subject"
|
|
86
365
|
],
|
|
87
366
|
"properties": {
|
|
88
|
-
"name": {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
367
|
+
"name": {
|
|
368
|
+
"type": "string"
|
|
369
|
+
},
|
|
370
|
+
"sha": {
|
|
371
|
+
"$ref": "#/$defs/sha"
|
|
372
|
+
},
|
|
373
|
+
"current": {
|
|
374
|
+
"type": "boolean"
|
|
375
|
+
},
|
|
376
|
+
"default": {
|
|
377
|
+
"type": "boolean",
|
|
378
|
+
"description": "The branch origin/HEAD points to, else main or master."
|
|
379
|
+
},
|
|
380
|
+
"upstream": {
|
|
381
|
+
"type": [
|
|
382
|
+
"string",
|
|
383
|
+
"null"
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
"upstream_gone": {
|
|
387
|
+
"type": "boolean",
|
|
388
|
+
"description": "The upstream branch was deleted on the remote."
|
|
389
|
+
},
|
|
390
|
+
"ahead": {
|
|
391
|
+
"type": "integer",
|
|
392
|
+
"minimum": 0
|
|
393
|
+
},
|
|
394
|
+
"behind": {
|
|
395
|
+
"type": "integer",
|
|
396
|
+
"minimum": 0
|
|
397
|
+
},
|
|
398
|
+
"merged": {
|
|
399
|
+
"type": [
|
|
400
|
+
"boolean",
|
|
401
|
+
"null"
|
|
402
|
+
],
|
|
403
|
+
"description": "Merged into the default branch; null when there is no default branch."
|
|
404
|
+
},
|
|
405
|
+
"last_commit_at": {
|
|
406
|
+
"type": "string",
|
|
407
|
+
"format": "date-time"
|
|
408
|
+
},
|
|
409
|
+
"last_commit_author": {
|
|
410
|
+
"type": "string"
|
|
411
|
+
},
|
|
412
|
+
"last_commit_subject": {
|
|
413
|
+
"type": "string"
|
|
414
|
+
}
|
|
100
415
|
}
|
|
101
416
|
},
|
|
102
417
|
"branches_result": {
|
|
103
418
|
"type": "object",
|
|
104
|
-
"required": [
|
|
419
|
+
"required": [
|
|
420
|
+
"default_branch",
|
|
421
|
+
"branches"
|
|
422
|
+
],
|
|
105
423
|
"properties": {
|
|
106
|
-
"default_branch": {
|
|
107
|
-
|
|
424
|
+
"default_branch": {
|
|
425
|
+
"type": [
|
|
426
|
+
"string",
|
|
427
|
+
"null"
|
|
428
|
+
]
|
|
429
|
+
},
|
|
430
|
+
"branches": {
|
|
431
|
+
"type": "array",
|
|
432
|
+
"items": {
|
|
433
|
+
"$ref": "#/$defs/branch"
|
|
434
|
+
}
|
|
435
|
+
}
|
|
108
436
|
}
|
|
109
437
|
},
|
|
110
438
|
"checkout_plan": {
|
|
111
439
|
"type": "object",
|
|
112
|
-
"required": [
|
|
113
|
-
|
|
440
|
+
"required": [
|
|
441
|
+
"branch"
|
|
442
|
+
],
|
|
443
|
+
"properties": {
|
|
444
|
+
"branch": {
|
|
445
|
+
"type": "string"
|
|
446
|
+
}
|
|
447
|
+
}
|
|
114
448
|
},
|
|
115
449
|
"checkout_result": {
|
|
116
450
|
"type": "object",
|
|
117
|
-
"required": [
|
|
451
|
+
"required": [
|
|
452
|
+
"branch",
|
|
453
|
+
"previous_branch"
|
|
454
|
+
],
|
|
118
455
|
"properties": {
|
|
119
|
-
"branch": {
|
|
120
|
-
|
|
456
|
+
"branch": {
|
|
457
|
+
"type": [
|
|
458
|
+
"string",
|
|
459
|
+
"null"
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
"previous_branch": {
|
|
463
|
+
"type": [
|
|
464
|
+
"string",
|
|
465
|
+
"null"
|
|
466
|
+
],
|
|
467
|
+
"description": "Check this out to go back; null on a detached HEAD."
|
|
468
|
+
}
|
|
121
469
|
}
|
|
122
470
|
},
|
|
123
471
|
"delete_plan": {
|
|
124
472
|
"type": "object",
|
|
125
|
-
"required": [
|
|
473
|
+
"required": [
|
|
474
|
+
"branches",
|
|
475
|
+
"force"
|
|
476
|
+
],
|
|
126
477
|
"properties": {
|
|
127
|
-
"branches": {
|
|
128
|
-
|
|
478
|
+
"branches": {
|
|
479
|
+
"type": "array",
|
|
480
|
+
"items": {
|
|
481
|
+
"type": "string"
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
"force": {
|
|
485
|
+
"type": "boolean"
|
|
486
|
+
}
|
|
129
487
|
}
|
|
130
488
|
},
|
|
131
489
|
"delete_result": {
|
|
132
490
|
"type": "object",
|
|
133
|
-
"required": [
|
|
491
|
+
"required": [
|
|
492
|
+
"deleted",
|
|
493
|
+
"failed"
|
|
494
|
+
],
|
|
134
495
|
"properties": {
|
|
135
496
|
"deleted": {
|
|
136
497
|
"type": "array",
|
|
137
498
|
"description": "Recreate a branch with: git branch NAME SHA",
|
|
138
499
|
"items": {
|
|
139
500
|
"type": "object",
|
|
140
|
-
"required": [
|
|
141
|
-
|
|
501
|
+
"required": [
|
|
502
|
+
"branch",
|
|
503
|
+
"sha"
|
|
504
|
+
],
|
|
505
|
+
"properties": {
|
|
506
|
+
"branch": {
|
|
507
|
+
"type": "string"
|
|
508
|
+
},
|
|
509
|
+
"sha": {
|
|
510
|
+
"$ref": "#/$defs/sha"
|
|
511
|
+
}
|
|
512
|
+
}
|
|
142
513
|
}
|
|
143
514
|
},
|
|
144
515
|
"failed": {
|
|
145
516
|
"type": "array",
|
|
146
517
|
"items": {
|
|
147
518
|
"type": "object",
|
|
148
|
-
"required": [
|
|
149
|
-
|
|
519
|
+
"required": [
|
|
520
|
+
"branch",
|
|
521
|
+
"error"
|
|
522
|
+
],
|
|
523
|
+
"properties": {
|
|
524
|
+
"branch": {
|
|
525
|
+
"type": "string"
|
|
526
|
+
},
|
|
527
|
+
"error": {
|
|
528
|
+
"type": "string"
|
|
529
|
+
}
|
|
530
|
+
}
|
|
150
531
|
}
|
|
151
532
|
}
|
|
152
533
|
}
|
|
153
534
|
},
|
|
154
535
|
"reset_plan": {
|
|
155
536
|
"type": "object",
|
|
156
|
-
"required": [
|
|
537
|
+
"required": [
|
|
538
|
+
"commit",
|
|
539
|
+
"mode"
|
|
540
|
+
],
|
|
157
541
|
"properties": {
|
|
158
|
-
"commit": {
|
|
159
|
-
|
|
542
|
+
"commit": {
|
|
543
|
+
"$ref": "#/$defs/sha"
|
|
544
|
+
},
|
|
545
|
+
"mode": {
|
|
546
|
+
"enum": [
|
|
547
|
+
"soft",
|
|
548
|
+
"mixed",
|
|
549
|
+
"hard"
|
|
550
|
+
]
|
|
551
|
+
}
|
|
160
552
|
}
|
|
161
553
|
},
|
|
162
554
|
"reset_result": {
|
|
163
555
|
"type": "object",
|
|
164
|
-
"required": [
|
|
556
|
+
"required": [
|
|
557
|
+
"commit",
|
|
558
|
+
"mode",
|
|
559
|
+
"previous_commit"
|
|
560
|
+
],
|
|
561
|
+
"properties": {
|
|
562
|
+
"commit": {
|
|
563
|
+
"$ref": "#/$defs/sha"
|
|
564
|
+
},
|
|
565
|
+
"mode": {
|
|
566
|
+
"enum": [
|
|
567
|
+
"soft",
|
|
568
|
+
"mixed",
|
|
569
|
+
"hard"
|
|
570
|
+
]
|
|
571
|
+
},
|
|
572
|
+
"previous_commit": {
|
|
573
|
+
"$ref": "#/$defs/sha",
|
|
574
|
+
"description": "Reset to this commit to go back. Uncommitted changes lost by a hard reset cannot be restored this way."
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
"snapshot": {
|
|
579
|
+
"type": "object",
|
|
580
|
+
"required": [
|
|
581
|
+
"id",
|
|
582
|
+
"created_at",
|
|
583
|
+
"reason",
|
|
584
|
+
"scope",
|
|
585
|
+
"worktree_path",
|
|
586
|
+
"head",
|
|
587
|
+
"branches",
|
|
588
|
+
"stashes",
|
|
589
|
+
"index",
|
|
590
|
+
"worktree",
|
|
591
|
+
"skipped_files"
|
|
592
|
+
],
|
|
593
|
+
"properties": {
|
|
594
|
+
"id": {
|
|
595
|
+
"type": "string"
|
|
596
|
+
},
|
|
597
|
+
"created_at": {
|
|
598
|
+
"type": "string",
|
|
599
|
+
"format": "date-time"
|
|
600
|
+
},
|
|
601
|
+
"reason": {
|
|
602
|
+
"type": "string"
|
|
603
|
+
},
|
|
604
|
+
"scope": {
|
|
605
|
+
"type": "array",
|
|
606
|
+
"items": {
|
|
607
|
+
"enum": [
|
|
608
|
+
"branches",
|
|
609
|
+
"head",
|
|
610
|
+
"worktree",
|
|
611
|
+
"stashes"
|
|
612
|
+
]
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
"worktree_path": {
|
|
616
|
+
"type": "string"
|
|
617
|
+
},
|
|
618
|
+
"head": {
|
|
619
|
+
"type": "object",
|
|
620
|
+
"required": [
|
|
621
|
+
"branch",
|
|
622
|
+
"sha"
|
|
623
|
+
],
|
|
624
|
+
"properties": {
|
|
625
|
+
"branch": {
|
|
626
|
+
"type": [
|
|
627
|
+
"string",
|
|
628
|
+
"null"
|
|
629
|
+
]
|
|
630
|
+
},
|
|
631
|
+
"sha": {
|
|
632
|
+
"type": [
|
|
633
|
+
"string",
|
|
634
|
+
"null"
|
|
635
|
+
],
|
|
636
|
+
"pattern": "^[0-9a-f]{4,64}$"
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
"branches": {
|
|
641
|
+
"type": "object",
|
|
642
|
+
"additionalProperties": {
|
|
643
|
+
"$ref": "#/$defs/sha"
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
"stashes": {
|
|
647
|
+
"type": "array",
|
|
648
|
+
"items": {
|
|
649
|
+
"$ref": "#/$defs/sha"
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
"index": {
|
|
653
|
+
"type": [
|
|
654
|
+
"string",
|
|
655
|
+
"null"
|
|
656
|
+
],
|
|
657
|
+
"pattern": "^[0-9a-f]{4,64}$"
|
|
658
|
+
},
|
|
659
|
+
"worktree": {
|
|
660
|
+
"type": [
|
|
661
|
+
"string",
|
|
662
|
+
"null"
|
|
663
|
+
],
|
|
664
|
+
"pattern": "^[0-9a-f]{4,64}$"
|
|
665
|
+
},
|
|
666
|
+
"skipped_files": {
|
|
667
|
+
"type": "array",
|
|
668
|
+
"items": {
|
|
669
|
+
"type": "string"
|
|
670
|
+
},
|
|
671
|
+
"description": "Untracked files not saved because they are larger than 50 MB."
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
"undo_plan": {
|
|
676
|
+
"type": "object",
|
|
677
|
+
"required": [
|
|
678
|
+
"snapshot",
|
|
679
|
+
"branches",
|
|
680
|
+
"head",
|
|
681
|
+
"worktree",
|
|
682
|
+
"stashes"
|
|
683
|
+
],
|
|
684
|
+
"properties": {
|
|
685
|
+
"snapshot": {
|
|
686
|
+
"type": "string"
|
|
687
|
+
},
|
|
688
|
+
"branches": {
|
|
689
|
+
"type": "array",
|
|
690
|
+
"items": {
|
|
691
|
+
"type": "object",
|
|
692
|
+
"required": [
|
|
693
|
+
"branch",
|
|
694
|
+
"from",
|
|
695
|
+
"to"
|
|
696
|
+
],
|
|
697
|
+
"properties": {
|
|
698
|
+
"branch": {
|
|
699
|
+
"type": "string"
|
|
700
|
+
},
|
|
701
|
+
"from": {
|
|
702
|
+
"type": [
|
|
703
|
+
"string",
|
|
704
|
+
"null"
|
|
705
|
+
],
|
|
706
|
+
"pattern": "^[0-9a-f]{4,64}$"
|
|
707
|
+
},
|
|
708
|
+
"to": {
|
|
709
|
+
"$ref": "#/$defs/sha"
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
"head": {
|
|
715
|
+
"type": [
|
|
716
|
+
"object",
|
|
717
|
+
"null"
|
|
718
|
+
],
|
|
719
|
+
"required": [
|
|
720
|
+
"from",
|
|
721
|
+
"to"
|
|
722
|
+
],
|
|
723
|
+
"properties": {
|
|
724
|
+
"from": {
|
|
725
|
+
"type": [
|
|
726
|
+
"string",
|
|
727
|
+
"null"
|
|
728
|
+
]
|
|
729
|
+
},
|
|
730
|
+
"to": {
|
|
731
|
+
"type": [
|
|
732
|
+
"string",
|
|
733
|
+
"null"
|
|
734
|
+
]
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
"worktree": {
|
|
739
|
+
"type": "boolean",
|
|
740
|
+
"description": "Tracked, staged and untracked files are restored."
|
|
741
|
+
},
|
|
742
|
+
"stashes": {
|
|
743
|
+
"type": "array",
|
|
744
|
+
"items": {
|
|
745
|
+
"$ref": "#/$defs/sha"
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"undo_result": {
|
|
751
|
+
"type": "object",
|
|
752
|
+
"required": [
|
|
753
|
+
"snapshot"
|
|
754
|
+
],
|
|
755
|
+
"properties": {
|
|
756
|
+
"snapshot": {
|
|
757
|
+
"type": [
|
|
758
|
+
"string",
|
|
759
|
+
"null"
|
|
760
|
+
]
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
"snapshots_result": {
|
|
765
|
+
"type": "object",
|
|
766
|
+
"required": [
|
|
767
|
+
"snapshots"
|
|
768
|
+
],
|
|
769
|
+
"properties": {
|
|
770
|
+
"snapshots": {
|
|
771
|
+
"type": "array",
|
|
772
|
+
"items": {
|
|
773
|
+
"$ref": "#/$defs/snapshot"
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
"snapshot_result": {
|
|
779
|
+
"type": "object",
|
|
780
|
+
"required": [
|
|
781
|
+
"snapshot"
|
|
782
|
+
],
|
|
783
|
+
"properties": {
|
|
784
|
+
"snapshot": {
|
|
785
|
+
"$ref": "#/$defs/snapshot"
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
"gc_plan": {
|
|
790
|
+
"type": "object",
|
|
791
|
+
"required": [
|
|
792
|
+
"older_than_days",
|
|
793
|
+
"snapshots"
|
|
794
|
+
],
|
|
795
|
+
"properties": {
|
|
796
|
+
"older_than_days": {
|
|
797
|
+
"type": "number"
|
|
798
|
+
},
|
|
799
|
+
"snapshots": {
|
|
800
|
+
"type": "array",
|
|
801
|
+
"items": {
|
|
802
|
+
"type": "string"
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
"gc_result": {
|
|
808
|
+
"type": "object",
|
|
809
|
+
"required": [
|
|
810
|
+
"deleted"
|
|
811
|
+
],
|
|
165
812
|
"properties": {
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
|
|
813
|
+
"deleted": {
|
|
814
|
+
"type": "array",
|
|
815
|
+
"items": {
|
|
816
|
+
"type": "string"
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
"hook_install": {
|
|
822
|
+
"type": "object",
|
|
823
|
+
"required": [
|
|
824
|
+
"scope",
|
|
825
|
+
"file",
|
|
826
|
+
"command",
|
|
827
|
+
"applies_to"
|
|
828
|
+
],
|
|
829
|
+
"properties": {
|
|
830
|
+
"scope": {
|
|
831
|
+
"enum": [
|
|
832
|
+
"local",
|
|
833
|
+
"project",
|
|
834
|
+
"user"
|
|
835
|
+
]
|
|
836
|
+
},
|
|
837
|
+
"file": {
|
|
838
|
+
"type": "string"
|
|
839
|
+
},
|
|
840
|
+
"command": {
|
|
841
|
+
"type": "string"
|
|
842
|
+
},
|
|
843
|
+
"applies_to": {
|
|
844
|
+
"type": "string",
|
|
845
|
+
"description": "Which Claude Code sessions read this file. Running sessions reload it."
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
"hook_status": {
|
|
850
|
+
"type": "object",
|
|
851
|
+
"required": [
|
|
852
|
+
"active",
|
|
853
|
+
"executable",
|
|
854
|
+
"files"
|
|
855
|
+
],
|
|
856
|
+
"properties": {
|
|
857
|
+
"active": {
|
|
858
|
+
"type": "boolean",
|
|
859
|
+
"description": "The hook is in at least one settings file that applies here and the gitflash executable is on PATH."
|
|
860
|
+
},
|
|
861
|
+
"executable": {
|
|
862
|
+
"type": [
|
|
863
|
+
"string",
|
|
864
|
+
"null"
|
|
865
|
+
]
|
|
866
|
+
},
|
|
867
|
+
"files": {
|
|
868
|
+
"type": "array",
|
|
869
|
+
"items": {
|
|
870
|
+
"type": "object",
|
|
871
|
+
"required": [
|
|
872
|
+
"scope",
|
|
873
|
+
"file",
|
|
874
|
+
"installed",
|
|
875
|
+
"command",
|
|
876
|
+
"applies_to"
|
|
877
|
+
],
|
|
878
|
+
"properties": {
|
|
879
|
+
"scope": {
|
|
880
|
+
"enum": [
|
|
881
|
+
"local",
|
|
882
|
+
"project",
|
|
883
|
+
"user"
|
|
884
|
+
]
|
|
885
|
+
},
|
|
886
|
+
"file": {
|
|
887
|
+
"type": "string"
|
|
888
|
+
},
|
|
889
|
+
"installed": {
|
|
890
|
+
"type": "boolean"
|
|
891
|
+
},
|
|
892
|
+
"command": {
|
|
893
|
+
"type": [
|
|
894
|
+
"string",
|
|
895
|
+
"null"
|
|
896
|
+
]
|
|
897
|
+
},
|
|
898
|
+
"applies_to": {
|
|
899
|
+
"type": "string"
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
169
904
|
}
|
|
170
905
|
}
|
|
171
906
|
}
|