forked from withfig/autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.js
More file actions
1178 lines (1147 loc) · 48.3 KB
/
git.js
File metadata and controls
1178 lines (1147 loc) · 48.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
var generators = {
// Commit history
commits: {
script: "git log --oneline",
postProcess: function(out) {
if (out.startsWith("fatal:")) {
return []
}
return out.split('\n').map((line) => {
return {
name: line.substring(0, 7),
icon: "fig://icon?type=node",
description: line.substring(7)
}
})
}
},
// Saved stashes
// TODO: maybe only print names of stashes
stashes: {
script: "git stash list",
postProcess: function(out) {
if (out.startsWith("fatal:")) {
return []
}
return out.split('\n').map((file) => {
return {
name: file.split(":")[2],
insertValue: file.split(":")[0],
icon: `fig://icon?type=node`,
}
})
}
},
// Tree-ish
// This needs to be fleshed out properly....
// e.g. what is difference to commit-ish?
// Refer to this:https://stackoverflow.com/questions/23303549/what-are-commit-ish-and-tree-ish-in-git/40910185
// https://mirrors.edge.kernel.org/pub/software/scm/git/docs/#_identifier_terminology
treeish: {
script: "git diff --cached --name-only",
postProcess: function(out) {
if (out.startsWith("fatal:")) {
return []
}
return out.split('\n').map((file) => {
return {
name: file,
insertValue: "-- " + file,
icon: `fig://icon?type=file`,
description: "staged file"
}
})
}
},
// All branches
branches: {
script: "git branch --no-color",
postProcess: function(out) {
if (out.startsWith("fatal:")) {
return []
}
return out.split('\n').map((elm) => {
return { name: elm.replace("*", "").trim(), description: "branch", icon: "fig://icon?type=git" }
})
}
},
remotes: {
script: "git remote",
postProcess: function(out) {
return out.split('\n').map(remote => {
return { name: remote, description: "remote" }
})
}
},
tags: {
script: "git tag --list",
splitOn: "\n"
},
// Files for staging
files_for_staging: {
script: "git status --short",
postProcess: function(out) {
if (out.startsWith("fatal:")) {
return []
}
// out = out + " "
var items = out.split('\n').map((file) => {
file = file.trim()
var arr = file.split(" ")
return { working: arr[0], file: arr.slice(1).join(" ") }
})
return items.map(item => {
let file = item.file
var ext = ""
try {
ext = file.split('.').slice(-1)[0]
} catch (e) {}
if (file.endsWith('/')) {
ext = "folder"
}
return {
name: file,
insertValue: file.includes(' ') ? `'${file}'` : file,
icon: `fig://icon?type=${ext}&color=ff0000&badge=${item.working}`,
description: "Changed file",
priority: 100
}
})
}
},
}
let head = {
name: "HEAD",
icon: "🔻",
description: "Reset multiple commits",
}
var completionSpec = {
name: "git",
description: "the stupid content tracker",
options: [{
name: "--version",
description: "Output version"
},
{
name: "--help",
description: "Output help"
},
{
name: "-C",
insertValue: "-C ",
args: {
name: "path",
template: "folders"
},
description: "Run as if git was started in <path>"
},
{
name: "-c name=value",
insertValue: "-c ",
description: "Pass a config parameter to the command"
},
{
name: "--exec-path[=<path>]",
insertValue: "--exec-path",
args: {
name: "path",
isOptional: true,
template: "folders",
},
description: "Get or set GIT_EXEC_PATH for core Git programs"
},
{
name: "--html-path",
description: "Print Git’s HTML documentation path"
},
{
name: "--man-path",
description: "Print the manpath for this version of Git"
},
{
name: "--info-path",
description: "Print the info path documenting this version of Git"
},
{
name: ["-p", "--paginate"],
description: "Pipe output into `less` or custom $PAGER"
},
{
name: "--no-pager",
description: "Do not pipe Git output into a pager"
},
{
name: "--no-replace-objects",
description: "Do not use replacement refs"
},
{
name: "--bare",
description: "Treat the repository as a bare repository"
},
{
name: "--git-dir=<path>",
insertValue: "--git-dir=",
args: {
name: "path",
template: "folders"
},
description: "Set the path to the repository dir (`.git`)"
},
{
name: "--work-tree=<path>",
insertValue: "--work-tree=",
args: {
name: "path",
template: "folders"
},
description: "Set working tree path"
},
{
name: "--namespace=<name>",
insertValue: "--namespace=",
args: {
name: "name",
},
description: "Set the Git namespace"
},
],
subcommands: [{
name: "commit",
description: "Record changes to the repository",
insertValue: "commit",
options: [{
name: ["-m", "--message"],
insertValue: "-m '{cursor}'",
description: "use the given message as the commit message",
args: {
name: "message"
},
},
{
name: ["-a", "--all"],
description: "stage all modified and deleted paths",
},
{
name: "-am",
insertValue: "-am '{cursor}'",
description: "stage all and use given text as commit message",
args: {
name: "message"
}
},
{
name: ["-v", "--verbose"],
description: "show unified diff of all file changes",
},
]
},
{
name: "config",
description: "set author",
options: [{
name: "--local",
description: "Default: write to the repository .git/config file",
args: {
variadic: true,
suggestions: [{
name: "user.name",
description: "set config for username",
insertValue: "user.name '{cursor}'",
},
{
name: "user.email",
description: "set config for email",
insertValue: "user.email '{cursor}'",
}
],
},
},
{
name: "--global",
insertValue: "--global {cursor}",
description: "For writing options: write to global ~/.gitconfig file rather than the repository .git/config",
args: {
variadic: true,
suggestions: [{
name: "user.name",
description: "set config for username",
insertValue: "user.name '{cursor}'",
},
{
name: "user.email",
description: "set config for email",
insertValue: "user.email '{cursor}'",
}
],
},
}
],
},
{
name: "rebase",
description: "Reapply commits on top of another base tip",
insertValue: "rebase",
options: [
{ name: ["--continue"], description: "continue the rebasing after conflict resolution" },
{ name: ["--abort"], description: "stop rebase" },
{ name: ["--skip"], description: "skips a commit" },
{
name: ["-i"],
description: "interactive"
}
],
args: {
suggestions: [],
generators: generators.commits,
},
},
{
name: "add",
description: "Add file contents to the index",
options: [{
name: ["-A", "--all", "--no-ignore-removal"],
description: "Add, modify, and remove index entries to match the working tree"
},
{
name: ["-f", "--force"],
description: "Allow adding otherwise ignored files"
},
{
name: ["-i", "--interactive"],
description: "Add modified contents in the working tree interactively to the index"
},
{
name: ["-n", "--dry-run"],
description: "Don't actually add the files(s), just show if they exist and/or will be ignored"
},
{
name: ["-p", "--patch"],
description: "Interactively choose hunks of patch between the index and the work tree and add them to the index"
},
],
args: {
variadic: true,
// We have a special setting for dot in the vuejs app
// suggestions: [
// {
// name: ".",
// description: "current directory",
// insertValue: ".",
// icon: "fig://icon?type=folder"
// }
// ],
generators: generators.files_for_staging
},
},
{
name: "status",
description: "Show the working tree status",
options: [{
name: ["-v", "--verbose"],
description: "be verbose"
},
{
name: ["-b", "--branch"],
description: "show branch information",
},
{
name: "--show-stash",
description: "show stash information"
},
{
name: "--ahead-behind",
description: "compute full ahead/behind values"
},
{
name: "--long",
description: "show status in long format (default)"
},
{
name: ["-z", "--null"],
description: "terminate entries with NUL",
},
{
name: ["-u", "--untracked-files"],
description: "show untracked files",
args: {
suggestions: [{
name: "all",
description: "(Default)"
},
{
name: "normal",
},
{
name: "no",
}
]
}
},
{
name: "--ignored",
description: "show ignored files",
args: {
suggestions: [{
name: "traditional",
description: "(Default)"
},
{
name: "matching",
},
{
name: "no",
}
]
}
},
{
name: "--no-renames",
description: "do not detect renames"
},
]
},
{
name: "push",
description: "Update remote refs",
options: [{
name: "-all",
description: "Push all branches to remote"
},
// { name: "--repo", description: "repository" },
// { name: "--all", description: "push all refs" },
// { name: "--mirror", description: "mirror all refs" },
{ name: ["-d", "--delete"], description: "delete refs" },
{ name: "--tags", description: "push tags (can't be used with --all or --mirror)" },
// { name: ["-n", "--dry-run"], description: "dry run" },
],
args: [{
name: "remote",
isOptional: true,
generators: generators.remotes
},
{
name: "branch",
isOptional: true,
generators: generators.branches
}
]
},
{
name: "pull",
description: "Integrate with another repository",
args: [{
name: "remote",
isOptional: true,
generators: generators.remotes
},
{
name: "branch",
isOptional: true,
generators: generators.branches
}
]
},
{
name: "diff",
description: "Show changes between commits, commit and working tree, etc",
options: [{
name: "--staged",
insertValue: "--staged",
description: "Show difference between the files in the staging area and the latest version",
}]
},
{
name: "reset",
description: "Reset current HEAD to the specified state",
options: [{
name: "--keep",
insertValue: "--keep {cursor}",
description: "Safe: files which are different between the current HEAD and the given commit. Will abort if there are uncommitted changes",
args: {
variadic: true,
suggestions: [
head
],
generators: generators.commits
}
},
{
name: "--soft",
insertValue: "--soft {cursor}",
description: "remove the last commit from the current branch, but the file changes will stay in your working tree",
args: {
suggestions: [
head
],
generators: generators.commits
}
},
{
name: "--hard",
insertValue: "--hard {cursor}",
description: "⚠️WARNING: you will lose all uncommitted changes in addition to the changes introduced in the last commit",
args: {
variadic: true,
suggestions: [{
name: "HEAD~<N>",
description: "Reset back to any number of commits",
insertValue: "HEAD~",
}],
generators: generators.commits,
}
},
{
name: "--mixed",
insertValue: "--mixed {cursor}",
description: "keep the changes in your working tree but not on the index",
args: {
variadic: true,
suggestions: [{
name: "HEAD~[insert # of commits]",
description: "Reset back any number of commits",
insertValue: "HEAD~",
}],
generators: generators.commits,
}
},
{
name: "--merge",
insertValue: "--merge {cursor}",
description: "Resets the index and updates the files in the working tree that are different" +
" between 'commit' and HEAD",
args: {
variadic: true,
suggestions: [
head
],
generators: generators.commits,
}
}
],
args: {
isOptional: true,
variadic: true,
suggestions: [],
generators: generators.treeish,
},
},
{
name: "log",
description: "Show commit logs",
insertValue: "log",
options: [{
name: "--follow",
description: "Show history of given file",
args: {
name: "file",
template: "filepaths"
}
},
{
name: ["-q", "--quiet"],
description: "suppress diff output"
},
{
name: "--source",
description: "show source"
},
{
name: "--oneline",
description: "show each commit as a single line "
}
]
},
{
name: "remote",
description: "Manage remote repository",
insertValue: "remote {cursor}",
subcommands: [{
name: "add",
insertValue: "add {cursor}",
description: "add repo ",
},
{
name: "set-head",
insertValue: "set-head",
description: "Sets or deletes the default branch",
},
{
name: "rm",
insertValue: "rm",
description: "Removes given remote [name]",
},
{
name: "get-url",
insertValue: "get-url",
description: "Retrieves the URLs for a remote",
},
{
name: "set-url",
insertValue: "set-url {cursor}",
description: "Changes the URLs for the remote",
},
{
name: "show",
description: "Gives some information about the remote [name]"
},
{
name: "prune",
description: "Equivalent to git fetch --prune [name], except that no new references will be fetched"
}
],
options: [{
name: "-f",
insertValue: "-f",
description: "Fetch after remote info is added",
},
{
name: "--tags",
insertValue: "--tags",
description: "Import tags from remote",
}
]
},
{
name: "fetch",
description: "Download objects and refs from another repository",
args: [
{
name: "remote",
isOptional: true,
generators: generators.remotes
},
{
name: "branch",
isOptional: true,
generators: generators.branches
},
{
name: "refspec",
isOptional: true,
},
],
options: [
{
name: "--all",
insertValue: "--all",
description: "Fetch all remotes",
},
{
name: ["-a", "--append"],
description: "Append ref names and object names of fetched refs to the existing contents of .git/FETCH_HEAD",
},
{
name: ["--atomic"],
description: "Use an atomic transaction to update local refs. Either all refs are updated, or on error, no refs are updated.",
},
{
name: ["--depth"],
insertValue: "--depth {cursor}",
args: {
name: 'depth',
},
description: "Limit fetching to the specified number of commits from the tip of each remote branch history",
},
{
name: ["--deepen"],
insertValue: "--deepen {cursor}",
args: {
name: 'depth',
},
description: "Similar to --depth, except it specifies the number of commits from the current shallow boundary instead of from the tip of each remote branch history",
},
{
name: ["--shallow-since"],
insertValue: "--shallow-since {cursor}",
args: {
name: 'date',
},
description: "Deepen or shorten the history of a shallow repository to include all reachable commits after <date>",
},
{
name: ["--shallow-exclude"],
insertValue: "--shallow-exclude {cursor}",
args: {
name: 'revision',
},
description: "Deepen or shorten the history of a shallow repository to exclude commits reachable from a specified remote branch or tag. This option can be specified multiple times",
},
{
name: ["--unshallow"],
description: "If the source repository is shallow, fetch as much as possible so that the current repository has the same history as the source repository",
},
{
name: ["--update-shallow"],
description: "By default when fetching from a shallow repository, git fetch refuses refs that require updating .git/shallow",
},
{
name: ["--negotiation-tip"],
insertValue: "--negotiation-tip ",
args: {
name: 'commit|glob',
generators: generators.commits,
},
description: "By default, Git will report, to the server, commits reachable from all local refs to find common commits in an attempt to reduce the size of the to-be-received packfile",
},
{
name: ["--dry-run"],
description: "Show what would be done, without making any changes.",
},
{
name: ["--write-fetch-head"],
description: "Write the list of remote refs fetched in the FETCH_HEAD file directly under $GIT_DIR. This is the default",
},
{
name: ["--no-write-fetch-head"],
description: "tells Git not to write the file",
},
{
name: ["-f", "--force"],
description: "This option overrides that check",
},
{
name: ["-k", "--keep"],
description: "Keep downloaded pack.",
},
{
name: ["--multiple"],
description: "Allow several <repository> and <group> arguments to be specified. No <refspec>s may be specified.",
},
{
name: ["--auto-maintenance", "--auto-gc"],
description: "Run git maintenance run --auto at the end to perform automatic repository maintenance if",
},
{
name: ["--no-auto-maintenance", "--no-auto-gc"],
description: "Don't run git maintenance run --auto at the end to perform automatic repository maintenance",
},
{
name: ["--write-commit-graph"],
description: "Write a commit-graph after fetching. This overrides the config setting fetch.writeCommitGraph",
},
{
name: ["--no-write-commit-graph"],
description: "Don't write a commit-graph after fetching. This overrides the config setting fetch.writeCommitGraph",
},
{
name: ["-p", "--prune"],
description: "Before fetching, remove any remote-tracking references that no longer exist on the remote",
},
{
name: ["-P", "--prune-tags"],
description: "Before fetching, remove any local tags that no longer exist on the remote if --prune is enabled",
},
{
name: ["-n", "--no-tags"],
description: "By default, tags that point at objects that are downloaded from the remote repository are fetched and stored locally. This option disables this automatic tag following",
},
{
name: ["--refmap"],
insertValue: "--refmap {cursor}",
args: {
name: 'refspec',
},
description: "When fetching refs listed on the command line, use the specified refspec (can be given more than once) to map the refs to remote-tracking branches, instead of the values of remote.*.fetch configuration variables for the remote repository",
},
{
name: ["-t", "--tags"],
description: "By default, tags that point at objects that are downloaded from the remote repository are fetched and stored locally. This option disables this automatic tag following",
},
// TODO: fig needs to accept '=' as delimiter for args/options
// {
// name: ["--recurse-submodules"],
// insertValue: "--recurse-submodules={cursor}",
// args: {
// name: 'mode',
// suggestions: [
// 'yes', 'on-demand', 'no',
// ],
// },
// description: "When fetching refs listed on the command line, use the specified refspec (can be given more than once) to map the refs to remote-tracking branches, instead of the values of remote.*.fetch configuration variables for the remote repository",
// },
{
name: ["-j", "--jobs"],
args: {
name: 'n',
},
description: "Number of parallel children to be used for all forms of fetching.",
},
{
name: ["--no-recurse-submodules"],
description: "Disable recursive fetching of submodules (this has the same effect as using the --recurse-submodules=no option).",
},
{
name: ["--set-upstream"],
description: "If the remote is fetched successfully, add upstream (tracking) reference, used by argument-less git-pull[1] and other commands.",
},
{
name: ["--submodule-prefix"],
insertValue: "--submodule-prefix {cursor}",
args: {
name: 'path',
},
description: "Prepend <path> to paths printed in informative messages such as \”Fetching submodule foo\". This option is used internally when recursing over submodules.",
},
// TODO: fig needs to accept '=' as delimiter for args/options
// {
// name: ["--recurse-submodules-default"],
// insertValue: "--recurse-submodules-default={cursor}",
// args: {
// name: 'mode',
// suggestions: [
// 'yes', 'on-demand',
// ],
// },
// description: "This option is used internally to temporarily provide a non-negative default value for the --recurse-submodules option",
// },
{
name: ["-u", "--update-head-ok"],
description: "By default git fetch refuses to update the head which corresponds to the current branch. This flag disables the check. This is purely for the internal use for git pull to communicate with git fetch, and unless you are implementing your own Porcelain you are not supposed to use it.",
},
{
name: ["--upload-pack"],
insertValue: "--upload-pack {cursor}",
args: {
name: 'upload-pack',
},
description: "When given, and the repository to fetch from is handled by git fetch-pack, --exec=<upload-pack> is passed to the command to specify non-default path for the command run on the other end.",
},
{
name: ["-q", "--quiet"],
description: "Pass --quiet to git-fetch-pack and silence any other internally used git commands. Progress is not reported to the standard error stream.",
},
{
name: ["-v", "--verbose"],
description: "Be verbose.",
},
{
name: ["--progress"],
description: "Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified.",
},
{
name: ["-o", "--server-option"],
args: {
name: 'option',
},
description: "Transmit the given string to the server when communicating using protocol version 2. The given string must not contain a NUL or LF character. ",
},
{
name: ["--show-forced-updates"],
description: "By default, git checks if a branch is force-updated during fetch. This can be disabled through fetch.showForcedUpdates, but the --show-forced-updates option guarantees this check occurs",
},
{
name: ["--no-show-forced-updates"],
description: "By default, git checks if a branch is force-updated during fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates to false to skip this check for performance reasons.",
},
{
name: ["-4", "--ipv4"],
description: "Use IPv4 addresses only, ignoring IPv6 addresses.",
},
{
name: ["-6", "--ipv6"],
description: "Use IPv6 addresses only, ignoring IPv4 addresses.",
},
{
name: "--stdin",
description: "Read refspecs, one per line, from stdin in addition to those provided as arguments. The \"tag <name>\" format is not supported",
},
]
},
{
name: "stash",
description: "temporarily stores all the modified tracked files",
subcommands: [{
name: "push", // TODO: support for no subcommand is missing
description: "Save your local modifications to a new stash entry and roll them back to HEAD.",
insertValue: "push {cursor}",
options: [
{ name: ["-p", "--patch"], description: "Interactively select hunks from the diff between HEAD and the working tree to be stashed." },
{ name: ["-k", "--keep-index"], description: "All changed already added to the index are left intact." },
{ name: ["-u", "--include-untracked"], description: "All untracked files are also stashed and then cleaned up." },
{ name: ["-a", "--all"], description: "All ignored and untracked files are also stashed." },
{ name: ["-q", "--quiet"], description: "Quiet, suppress feedback messages." },
{
name: ["-m", "--message"],
insertValue: "-m {cursor}",
description: "Use the given <msg> as the stash message.",
args: {
name: "message"
},
},
{ name: "--pathspec-from-file=", description: "" }, // TODO: pathspec file nul and add description
{ name: "--", description: "Separates pathsec from options for disambiguation purposes." },
// TODO: pathspec
]
},
{
name: "show",
description: "Show the changes recorded in the stash entry as a diff.",
insertValue: "show {cursor}",
options: [
// TODO: All log options can be options from list. Needs to be added.
],
args: [{
name: "stash",
isOptional: true,
generators: generators.stashes
}]
},
{
name: "save",
description: "Temporarily stores all the modified tracked files",
insertValue: "save {cursor}",
options: [
{ name: ["-p", "--patch"], description: "Interactively select hunks from the diff between HEAD and the working tree to be stashed." },
{ name: ["-k", "--keep-index"], description: "All changed already added to the index are left intact." },
{ name: ["-u", "--include-untracked"], description: "All untracked files are also stashed and then cleaned up." },
{ name: ["-a", "--all"], description: "All ignored and untracked files are also stashed." },
{ name: ["-q", "--quiet"], description: "Quiet, suppress feedback messages." },
],
args: {
name: "message",
isOptional: true
},
},
{
name: "pop",
description: "Restores the most recently stashed files",
insertValue: "pop {cursor}",
options: [
{ name: "--index", description: "Tries to reinstate not only the working tree's changes, but also the index's ones." },
{ name: ["-q", "--quiet"], description: "Quiet, suppress feedback messages." }
],
args: [{
name: "stash",
isOptional: true,
generators: generators.stashes
}]
},
{
name: "list",
description: "Lists all stashed changesets",
insertValue: "list {cursor}",
options: [
// TODO: All log options can be options from list. Needs to be added.
]
},
{
name: "drop",
description: "Discards the most recently stashed changeset",
insertValue: "drop {cursor}",
options: [
{ name: ["-q", "--quiet"], description: "Quiet, suppress feedback messages." }
],
args: [{
name: "stash",
isOptional: true,
generators: generators.stashes
}]
},
{
name: "clear",
description: " Remove all the stash entries.",
insertValue: "clear"
},
{
name: "apply",
description: "Like pop, but do not remove the state from the stash list.",
insertValue: "apply {cursor}",
options: [
{ name: "--index", description: "Tries to reinstate not only the working tree's changes, but also the index's ones." },
{ name: ["-q", "--quiet"], description: "Quiet, suppress feedback messages." }
],
args: [{
name: "stash",
isOptional: true,
generators: generators.stashes
}]
},
{
name: "branch",
description: "Creates and checks out a new branch named ",
insertValue: "branch {cursor}",
args: [{
name: "branch",
generators: generators.branches
},
{
name: "stash",
isOptional: true,