@statewalker/vcs-commands 0.5.0 → 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.
Files changed (546) hide show
  1. package/README.md +123 -8
  2. package/dist/commands/add-command.d.ts +265 -34
  3. package/dist/commands/add-command.d.ts.map +1 -1
  4. package/dist/commands/add-patch/add-interactive.d.ts +46 -0
  5. package/dist/commands/add-patch/add-interactive.d.ts.map +1 -0
  6. package/dist/commands/add-patch/add-patch.d.ts +139 -0
  7. package/dist/commands/add-patch/add-patch.d.ts.map +1 -0
  8. package/dist/commands/add-patch/index.d.ts +6 -0
  9. package/dist/commands/add-patch/index.d.ts.map +1 -0
  10. package/dist/commands/add-patch/patch-backend.d.ts +80 -0
  11. package/dist/commands/add-patch/patch-backend.d.ts.map +1 -0
  12. package/dist/commands/add-patch/patch-modes.d.ts +71 -0
  13. package/dist/commands/add-patch/patch-modes.d.ts.map +1 -0
  14. package/dist/commands/add-patch/patch-session.d.ts +49 -0
  15. package/dist/commands/add-patch/patch-session.d.ts.map +1 -0
  16. package/dist/commands/am/am-command.d.ts +175 -0
  17. package/dist/commands/am/am-command.d.ts.map +1 -0
  18. package/dist/commands/am/index.d.ts +3 -0
  19. package/dist/commands/am/index.d.ts.map +1 -0
  20. package/dist/commands/am/mailinfo.d.ts +58 -0
  21. package/dist/commands/am/mailinfo.d.ts.map +1 -0
  22. package/dist/commands/am/patch-format.d.ts +24 -0
  23. package/dist/commands/am/patch-format.d.ts.map +1 -0
  24. package/dist/commands/apply/apply-command.d.ts +153 -0
  25. package/dist/commands/apply/apply-command.d.ts.map +1 -0
  26. package/dist/commands/apply/apply-engine.d.ts +195 -0
  27. package/dist/commands/apply/apply-engine.d.ts.map +1 -0
  28. package/dist/commands/apply/apply-parse.d.ts +86 -0
  29. package/dist/commands/apply/apply-parse.d.ts.map +1 -0
  30. package/dist/commands/apply/apply-types.d.ts +70 -0
  31. package/dist/commands/apply/apply-types.d.ts.map +1 -0
  32. package/dist/commands/apply/index.d.ts +6 -0
  33. package/dist/commands/apply/index.d.ts.map +1 -0
  34. package/dist/commands/apply/latin1.d.ts +32 -0
  35. package/dist/commands/apply/latin1.d.ts.map +1 -0
  36. package/dist/commands/apply/whitespace.d.ts +58 -0
  37. package/dist/commands/apply/whitespace.d.ts.map +1 -0
  38. package/dist/commands/attributes-source.d.ts +26 -0
  39. package/dist/commands/attributes-source.d.ts.map +1 -0
  40. package/dist/commands/backfill-command.d.ts +110 -0
  41. package/dist/commands/backfill-command.d.ts.map +1 -0
  42. package/dist/commands/bisect/bisect-checkout.d.ts +64 -0
  43. package/dist/commands/bisect/bisect-checkout.d.ts.map +1 -0
  44. package/dist/commands/bisect/bisect-command.d.ts +201 -0
  45. package/dist/commands/bisect/bisect-command.d.ts.map +1 -0
  46. package/dist/commands/bisect/bisect-engine.d.ts +219 -0
  47. package/dist/commands/bisect/bisect-engine.d.ts.map +1 -0
  48. package/dist/commands/bisect/bisect-graph.d.ts +127 -0
  49. package/dist/commands/bisect/bisect-graph.d.ts.map +1 -0
  50. package/dist/commands/bisect/bisect-quote.d.ts +27 -0
  51. package/dist/commands/bisect/bisect-quote.d.ts.map +1 -0
  52. package/dist/commands/bisect/index.d.ts +5 -0
  53. package/dist/commands/bisect/index.d.ts.map +1 -0
  54. package/dist/commands/blame-command.d.ts +122 -131
  55. package/dist/commands/blame-command.d.ts.map +1 -1
  56. package/dist/commands/branch-command.d.ts +52 -2
  57. package/dist/commands/branch-command.d.ts.map +1 -1
  58. package/dist/commands/branch-tracking.d.ts +98 -0
  59. package/dist/commands/branch-tracking.d.ts.map +1 -0
  60. package/dist/commands/checkout-command.d.ts +300 -18
  61. package/dist/commands/checkout-command.d.ts.map +1 -1
  62. package/dist/commands/checkout-paths.d.ts +124 -0
  63. package/dist/commands/checkout-paths.d.ts.map +1 -0
  64. package/dist/commands/cherry-pick-command.d.ts +50 -42
  65. package/dist/commands/cherry-pick-command.d.ts.map +1 -1
  66. package/dist/commands/clean-command.d.ts +49 -16
  67. package/dist/commands/clean-command.d.ts.map +1 -1
  68. package/dist/commands/clone-command.d.ts +117 -0
  69. package/dist/commands/clone-command.d.ts.map +1 -1
  70. package/dist/commands/commit-command.d.ts +311 -17
  71. package/dist/commands/commit-command.d.ts.map +1 -1
  72. package/dist/commands/core-config.d.ts +78 -1
  73. package/dist/commands/core-config.d.ts.map +1 -1
  74. package/dist/commands/date-format.d.ts +58 -0
  75. package/dist/commands/date-format.d.ts.map +1 -0
  76. package/dist/commands/describe-command.d.ts.map +1 -1
  77. package/dist/commands/diff-command.d.ts +377 -30
  78. package/dist/commands/diff-command.d.ts.map +1 -1
  79. package/dist/commands/diff-textconv.d.ts +40 -0
  80. package/dist/commands/diff-textconv.d.ts.map +1 -0
  81. package/dist/commands/fetch-command.d.ts +149 -10
  82. package/dist/commands/fetch-command.d.ts.map +1 -1
  83. package/dist/commands/format-patch-command.d.ts +164 -0
  84. package/dist/commands/format-patch-command.d.ts.map +1 -0
  85. package/dist/commands/fsck/fetch-fsck.d.ts +60 -0
  86. package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -0
  87. package/dist/commands/fsck/fsck-command.d.ts +225 -0
  88. package/dist/commands/fsck/fsck-command.d.ts.map +1 -0
  89. package/dist/commands/fsck/fsck-loose.d.ts +68 -0
  90. package/dist/commands/fsck/fsck-loose.d.ts.map +1 -0
  91. package/dist/commands/fsck/fsck-msg-ids.d.ts +122 -0
  92. package/dist/commands/fsck/fsck-msg-ids.d.ts.map +1 -0
  93. package/dist/commands/fsck/fsck-object-checks.d.ts +148 -0
  94. package/dist/commands/fsck/fsck-object-checks.d.ts.map +1 -0
  95. package/dist/commands/fsck/fsck-object-table.d.ts +132 -0
  96. package/dist/commands/fsck/fsck-object-table.d.ts.map +1 -0
  97. package/dist/commands/fsck/fsck-pack.d.ts +115 -0
  98. package/dist/commands/fsck/fsck-pack.d.ts.map +1 -0
  99. package/dist/commands/fsck/index.d.ts +6 -0
  100. package/dist/commands/fsck/index.d.ts.map +1 -0
  101. package/dist/commands/fsck/verify-pack-command.d.ts +81 -0
  102. package/dist/commands/fsck/verify-pack-command.d.ts.map +1 -0
  103. package/dist/commands/gc-command.d.ts +43 -0
  104. package/dist/commands/gc-command.d.ts.map +1 -1
  105. package/dist/commands/git-date.d.ts +66 -0
  106. package/dist/commands/git-date.d.ts.map +1 -0
  107. package/dist/commands/git-describe.d.ts +67 -0
  108. package/dist/commands/git-describe.d.ts.map +1 -0
  109. package/dist/commands/git-hooks.d.ts +416 -0
  110. package/dist/commands/git-hooks.d.ts.map +1 -0
  111. package/dist/commands/git-ident.d.ts +128 -0
  112. package/dist/commands/git-ident.d.ts.map +1 -0
  113. package/dist/commands/hook-command.d.ts +96 -0
  114. package/dist/commands/hook-command.d.ts.map +1 -0
  115. package/dist/commands/index-adder.d.ts +231 -0
  116. package/dist/commands/index-adder.d.ts.map +1 -0
  117. package/dist/commands/index-host.d.ts +86 -0
  118. package/dist/commands/index-host.d.ts.map +1 -0
  119. package/dist/commands/index.d.ts +54 -0
  120. package/dist/commands/index.d.ts.map +1 -1
  121. package/dist/commands/index.js +3 -2
  122. package/dist/commands/init-command.d.ts +12 -1
  123. package/dist/commands/init-command.d.ts.map +1 -1
  124. package/dist/commands/local-clone.d.ts +60 -0
  125. package/dist/commands/local-clone.d.ts.map +1 -0
  126. package/dist/commands/local-transport.d.ts +117 -0
  127. package/dist/commands/local-transport.d.ts.map +1 -0
  128. package/dist/commands/log-command.d.ts +216 -24
  129. package/dist/commands/log-command.d.ts.map +1 -1
  130. package/dist/commands/log-graph.d.ts +120 -0
  131. package/dist/commands/log-graph.d.ts.map +1 -0
  132. package/dist/commands/log-output.d.ts +323 -0
  133. package/dist/commands/log-output.d.ts.map +1 -0
  134. package/dist/commands/ls-remote-command.d.ts +23 -7
  135. package/dist/commands/ls-remote-command.d.ts.map +1 -1
  136. package/dist/commands/mailmap.d.ts +31 -0
  137. package/dist/commands/mailmap.d.ts.map +1 -0
  138. package/dist/commands/merge-bases.d.ts +85 -0
  139. package/dist/commands/merge-bases.d.ts.map +1 -0
  140. package/dist/commands/merge-command.d.ts +209 -74
  141. package/dist/commands/merge-command.d.ts.map +1 -1
  142. package/dist/commands/merge-config.d.ts +13 -0
  143. package/dist/commands/merge-config.d.ts.map +1 -0
  144. package/dist/commands/merge-drivers.d.ts +130 -0
  145. package/dist/commands/merge-drivers.d.ts.map +1 -0
  146. package/dist/commands/merge-support.d.ts +252 -0
  147. package/dist/commands/merge-support.d.ts.map +1 -0
  148. package/dist/commands/message-cleanup.d.ts +86 -0
  149. package/dist/commands/message-cleanup.d.ts.map +1 -0
  150. package/dist/commands/mv-command.d.ts +94 -0
  151. package/dist/commands/mv-command.d.ts.map +1 -0
  152. package/dist/commands/notes-command.d.ts +256 -0
  153. package/dist/commands/notes-command.d.ts.map +1 -0
  154. package/dist/commands/notes-commands.d.ts +41 -0
  155. package/dist/commands/notes-commands.d.ts.map +1 -0
  156. package/dist/commands/notes-merge-command.d.ts +105 -0
  157. package/dist/commands/notes-merge-command.d.ts.map +1 -0
  158. package/dist/commands/notes-support.d.ts +125 -0
  159. package/dist/commands/notes-support.d.ts.map +1 -0
  160. package/dist/commands/notes-tree.d.ts +106 -0
  161. package/dist/commands/notes-tree.d.ts.map +1 -0
  162. package/dist/commands/object-id-input.d.ts +20 -0
  163. package/dist/commands/object-id-input.d.ts.map +1 -0
  164. package/dist/commands/octopus-merge.d.ts +59 -0
  165. package/dist/commands/octopus-merge.d.ts.map +1 -0
  166. package/dist/commands/ort-merge.d.ts +126 -0
  167. package/dist/commands/ort-merge.d.ts.map +1 -0
  168. package/dist/commands/ort-recursive.d.ts +53 -0
  169. package/dist/commands/ort-recursive.d.ts.map +1 -0
  170. package/dist/commands/pack-refs-command.d.ts +20 -0
  171. package/dist/commands/pack-refs-command.d.ts.map +1 -1
  172. package/dist/commands/patch-id.d.ts +41 -0
  173. package/dist/commands/patch-id.d.ts.map +1 -0
  174. package/dist/commands/pathspec-attributes.d.ts +64 -0
  175. package/dist/commands/pathspec-attributes.d.ts.map +1 -0
  176. package/dist/commands/pathspec.d.ts +324 -0
  177. package/dist/commands/pathspec.d.ts.map +1 -0
  178. package/dist/commands/post-index-change.d.ts +33 -0
  179. package/dist/commands/post-index-change.d.ts.map +1 -0
  180. package/dist/commands/pretty-format.d.ts +222 -0
  181. package/dist/commands/pretty-format.d.ts.map +1 -0
  182. package/dist/commands/promisor-remote.d.ts +80 -0
  183. package/dist/commands/promisor-remote.d.ts.map +1 -0
  184. package/dist/commands/pull-command.d.ts +41 -8
  185. package/dist/commands/pull-command.d.ts.map +1 -1
  186. package/dist/commands/push-command.d.ts +24 -8
  187. package/dist/commands/push-command.d.ts.map +1 -1
  188. package/dist/commands/read-tree-command.d.ts +112 -0
  189. package/dist/commands/read-tree-command.d.ts.map +1 -0
  190. package/dist/commands/rebase-command.d.ts +507 -75
  191. package/dist/commands/rebase-command.d.ts.map +1 -1
  192. package/dist/commands/rebase-todo.d.ts +130 -0
  193. package/dist/commands/rebase-todo.d.ts.map +1 -0
  194. package/dist/commands/ref-decoration-filter.d.ts +53 -0
  195. package/dist/commands/ref-decoration-filter.d.ts.map +1 -0
  196. package/dist/commands/reflog-messages.d.ts +98 -0
  197. package/dist/commands/reflog-messages.d.ts.map +1 -0
  198. package/dist/commands/remote-command.d.ts +31 -0
  199. package/dist/commands/remote-command.d.ts.map +1 -1
  200. package/dist/commands/remote-transport.d.ts +120 -0
  201. package/dist/commands/remote-transport.d.ts.map +1 -0
  202. package/dist/commands/reset-command.d.ts +161 -7
  203. package/dist/commands/reset-command.d.ts.map +1 -1
  204. package/dist/commands/restore-command.d.ts +103 -0
  205. package/dist/commands/restore-command.d.ts.map +1 -0
  206. package/dist/commands/rev-list-command.d.ts +78 -0
  207. package/dist/commands/rev-list-command.d.ts.map +1 -0
  208. package/dist/commands/rev-parse-command.d.ts +80 -0
  209. package/dist/commands/rev-parse-command.d.ts.map +1 -0
  210. package/dist/commands/revert-command.d.ts +46 -38
  211. package/dist/commands/revert-command.d.ts.map +1 -1
  212. package/dist/commands/revision-filenames.d.ts +95 -0
  213. package/dist/commands/revision-filenames.d.ts.map +1 -0
  214. package/dist/commands/revision-range.d.ts +67 -0
  215. package/dist/commands/revision-range.d.ts.map +1 -0
  216. package/dist/commands/revision-resolver.d.ts +321 -0
  217. package/dist/commands/revision-resolver.d.ts.map +1 -0
  218. package/dist/commands/rm-command.d.ts +69 -7
  219. package/dist/commands/rm-command.d.ts.map +1 -1
  220. package/dist/commands/sequencer-pick.d.ts +191 -0
  221. package/dist/commands/sequencer-pick.d.ts.map +1 -0
  222. package/dist/commands/sequencer-support.d.ts +125 -0
  223. package/dist/commands/sequencer-support.d.ts.map +1 -0
  224. package/dist/commands/serve-repository.d.ts +52 -0
  225. package/dist/commands/serve-repository.d.ts.map +1 -0
  226. package/dist/commands/sparse-checkout-command.d.ts +190 -0
  227. package/dist/commands/sparse-checkout-command.d.ts.map +1 -0
  228. package/dist/commands/sparse-checkout-support.d.ts +268 -0
  229. package/dist/commands/sparse-checkout-support.d.ts.map +1 -0
  230. package/dist/commands/stash-apply-command.d.ts +42 -8
  231. package/dist/commands/stash-apply-command.d.ts.map +1 -1
  232. package/dist/commands/stash-create-command.d.ts +155 -1
  233. package/dist/commands/stash-create-command.d.ts.map +1 -1
  234. package/dist/commands/stash-drop-command.d.ts +2 -0
  235. package/dist/commands/stash-drop-command.d.ts.map +1 -1
  236. package/dist/commands/stash-working-tree.d.ts +23 -0
  237. package/dist/commands/stash-working-tree.d.ts.map +1 -1
  238. package/dist/commands/status-command.d.ts +300 -15
  239. package/dist/commands/status-command.d.ts.map +1 -1
  240. package/dist/commands/status-format.d.ts +155 -0
  241. package/dist/commands/status-format.d.ts.map +1 -0
  242. package/dist/commands/status-header.d.ts +64 -0
  243. package/dist/commands/status-header.d.ts.map +1 -0
  244. package/dist/commands/strerror.d.ts +7 -0
  245. package/dist/commands/strerror.d.ts.map +1 -0
  246. package/dist/commands/submodule-config.d.ts +38 -0
  247. package/dist/commands/submodule-config.d.ts.map +1 -0
  248. package/dist/commands/submodule-summary-command.d.ts +80 -0
  249. package/dist/commands/submodule-summary-command.d.ts.map +1 -0
  250. package/dist/commands/submodule-summary.d.ts +150 -0
  251. package/dist/commands/submodule-summary.d.ts.map +1 -0
  252. package/dist/commands/switch-command.d.ts +132 -0
  253. package/dist/commands/switch-command.d.ts.map +1 -0
  254. package/dist/commands/tag-command.d.ts +23 -2
  255. package/dist/commands/tag-command.d.ts.map +1 -1
  256. package/dist/commands/tracking-info.d.ts +64 -0
  257. package/dist/commands/tracking-info.d.ts.map +1 -0
  258. package/dist/commands/trailers.d.ts +73 -0
  259. package/dist/commands/trailers.d.ts.map +1 -0
  260. package/dist/commands/tree-restore.d.ts +85 -1
  261. package/dist/commands/tree-restore.d.ts.map +1 -1
  262. package/dist/commands/untracked-cache-support.d.ts +53 -0
  263. package/dist/commands/untracked-cache-support.d.ts.map +1 -0
  264. package/dist/commands/worktree-add-command.d.ts +108 -0
  265. package/dist/commands/worktree-add-command.d.ts.map +1 -0
  266. package/dist/commands/worktree-list-command.d.ts +69 -0
  267. package/dist/commands/worktree-list-command.d.ts.map +1 -0
  268. package/dist/commands/worktree-lock-command.d.ts +44 -0
  269. package/dist/commands/worktree-lock-command.d.ts.map +1 -0
  270. package/dist/commands/worktree-overwrite-checks.d.ts +146 -6
  271. package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
  272. package/dist/commands/worktree-prune-command.d.ts +48 -0
  273. package/dist/commands/worktree-prune-command.d.ts.map +1 -0
  274. package/dist/commands/worktree-remove-command.d.ts +59 -0
  275. package/dist/commands/worktree-remove-command.d.ts.map +1 -0
  276. package/dist/commands/worktree-repair-command.d.ts +35 -0
  277. package/dist/commands/worktree-repair-command.d.ts.map +1 -0
  278. package/dist/commands/worktree-support.d.ts +64 -0
  279. package/dist/commands/worktree-support.d.ts.map +1 -0
  280. package/dist/commands-DnmlfwGV.js +61620 -0
  281. package/dist/core-commands/add.command.impl.d.ts.map +1 -1
  282. package/dist/errors/add-errors.d.ts +55 -0
  283. package/dist/errors/add-errors.d.ts.map +1 -1
  284. package/dist/errors/checkout-errors.d.ts +16 -0
  285. package/dist/errors/checkout-errors.d.ts.map +1 -1
  286. package/dist/errors/command-errors.d.ts +77 -0
  287. package/dist/errors/command-errors.d.ts.map +1 -1
  288. package/dist/errors/commit-errors.d.ts +9 -0
  289. package/dist/errors/commit-errors.d.ts.map +1 -1
  290. package/dist/errors/git-api-error.d.ts +59 -2
  291. package/dist/errors/git-api-error.d.ts.map +1 -1
  292. package/dist/errors/index.d.ts +1 -0
  293. package/dist/errors/index.d.ts.map +1 -1
  294. package/dist/errors/index.js +354 -19
  295. package/dist/errors/rebase-errors.d.ts +9 -0
  296. package/dist/errors/rebase-errors.d.ts.map +1 -1
  297. package/dist/errors/ref-errors.d.ts +32 -0
  298. package/dist/errors/ref-errors.d.ts.map +1 -1
  299. package/dist/errors/transport-errors.d.ts +12 -2
  300. package/dist/errors/transport-errors.d.ts.map +1 -1
  301. package/dist/errors/worktree-errors.d.ts +35 -0
  302. package/dist/errors/worktree-errors.d.ts.map +1 -0
  303. package/dist/git-command-DxvwPrPB.js +7612 -0
  304. package/dist/git-command.d.ts +413 -32
  305. package/dist/git-command.d.ts.map +1 -1
  306. package/dist/git.d.ts +306 -3
  307. package/dist/git.d.ts.map +1 -1
  308. package/dist/index.d.ts +1 -1
  309. package/dist/index.d.ts.map +1 -1
  310. package/dist/index.js +5 -5
  311. package/dist/remote-config/remote-config-store.d.ts +105 -3
  312. package/dist/remote-config/remote-config-store.d.ts.map +1 -1
  313. package/dist/remote-config/remote-refs.d.ts +7 -3
  314. package/dist/remote-config/remote-refs.d.ts.map +1 -1
  315. package/dist/rename/detect-renames.d.ts +148 -0
  316. package/dist/rename/detect-renames.d.ts.map +1 -0
  317. package/dist/rename/git-similarity.d.ts +44 -0
  318. package/dist/rename/git-similarity.d.ts.map +1 -0
  319. package/dist/rename/index.d.ts +2 -0
  320. package/dist/rename/index.d.ts.map +1 -1
  321. package/dist/results/binary-patch.d.ts +11 -0
  322. package/dist/results/binary-patch.d.ts.map +1 -0
  323. package/dist/results/blame-format.d.ts +55 -0
  324. package/dist/results/blame-format.d.ts.map +1 -0
  325. package/dist/results/cherry-pick-result.d.ts +10 -0
  326. package/dist/results/cherry-pick-result.d.ts.map +1 -1
  327. package/dist/results/clone-result.d.ts +10 -0
  328. package/dist/results/clone-result.d.ts.map +1 -1
  329. package/dist/results/combined-diff.d.ts +77 -0
  330. package/dist/results/combined-diff.d.ts.map +1 -0
  331. package/dist/results/diff-entry.d.ts +32 -0
  332. package/dist/results/diff-entry.d.ts.map +1 -1
  333. package/dist/results/diff-formatter.d.ts +34 -60
  334. package/dist/results/diff-formatter.d.ts.map +1 -1
  335. package/dist/results/diff-order.d.ts +25 -0
  336. package/dist/results/diff-order.d.ts.map +1 -0
  337. package/dist/results/diff-output.d.ts +249 -0
  338. package/dist/results/diff-output.d.ts.map +1 -0
  339. package/dist/results/fetch-result.d.ts +15 -0
  340. package/dist/results/fetch-result.d.ts.map +1 -1
  341. package/dist/results/index.d.ts +5 -0
  342. package/dist/results/index.d.ts.map +1 -1
  343. package/dist/results/index.js +2 -252
  344. package/dist/results/merge-result.d.ts +15 -1
  345. package/dist/results/merge-result.d.ts.map +1 -1
  346. package/dist/results/pull-result.d.ts +12 -3
  347. package/dist/results/pull-result.d.ts.map +1 -1
  348. package/dist/results/push-result.d.ts +42 -0
  349. package/dist/results/push-result.d.ts.map +1 -1
  350. package/dist/results/quote-path.d.ts +27 -0
  351. package/dist/results/quote-path.d.ts.map +1 -0
  352. package/dist/results/rebase-result.d.ts +28 -1
  353. package/dist/results/rebase-result.d.ts.map +1 -1
  354. package/dist/results/revert-result.d.ts +10 -0
  355. package/dist/results/revert-result.d.ts.map +1 -1
  356. package/dist/results/stash-result.d.ts +5 -0
  357. package/dist/results/stash-result.d.ts.map +1 -1
  358. package/dist/results/status-result.d.ts +60 -6
  359. package/dist/results/status-result.d.ts.map +1 -1
  360. package/dist/results-BZGa2Z3I.js +2934 -0
  361. package/dist/transport-command.d.ts +44 -1
  362. package/dist/transport-command.d.ts.map +1 -1
  363. package/package.json +15 -11
  364. package/src/commands/add-command.ts +1291 -226
  365. package/src/commands/add-patch/add-interactive.ts +941 -0
  366. package/src/commands/add-patch/add-patch.ts +1169 -0
  367. package/src/commands/add-patch/index.ts +5 -0
  368. package/src/commands/add-patch/patch-backend.ts +239 -0
  369. package/src/commands/add-patch/patch-modes.ts +249 -0
  370. package/src/commands/add-patch/patch-session.ts +159 -0
  371. package/src/commands/am/am-command.ts +1111 -0
  372. package/src/commands/am/index.ts +2 -0
  373. package/src/commands/am/mailinfo.ts +1015 -0
  374. package/src/commands/am/patch-format.ts +121 -0
  375. package/src/commands/apply/apply-command.ts +832 -0
  376. package/src/commands/apply/apply-engine.ts +1603 -0
  377. package/src/commands/apply/apply-parse.ts +1209 -0
  378. package/src/commands/apply/apply-types.ts +112 -0
  379. package/src/commands/apply/index.ts +5 -0
  380. package/src/commands/apply/latin1.ts +171 -0
  381. package/src/commands/apply/whitespace.ts +260 -0
  382. package/src/commands/attributes-source.ts +96 -0
  383. package/src/commands/backfill-command.ts +694 -0
  384. package/src/commands/bisect/bisect-checkout.ts +217 -0
  385. package/src/commands/bisect/bisect-command.ts +788 -0
  386. package/src/commands/bisect/bisect-engine.ts +1079 -0
  387. package/src/commands/bisect/bisect-graph.ts +595 -0
  388. package/src/commands/bisect/bisect-quote.ts +92 -0
  389. package/src/commands/bisect/index.ts +4 -0
  390. package/src/commands/blame-command.ts +711 -986
  391. package/src/commands/branch-command.ts +354 -32
  392. package/src/commands/branch-tracking.ts +331 -0
  393. package/src/commands/checkout-command.ts +1290 -243
  394. package/src/commands/checkout-paths.ts +784 -0
  395. package/src/commands/cherry-pick-command.ts +156 -396
  396. package/src/commands/clean-command.ts +504 -156
  397. package/src/commands/clone-command.ts +634 -67
  398. package/src/commands/commit-command.ts +1781 -166
  399. package/src/commands/core-config.ts +161 -6
  400. package/src/commands/date-format.ts +668 -0
  401. package/src/commands/describe-command.ts +2 -0
  402. package/src/commands/diff-command.ts +1898 -110
  403. package/src/commands/diff-textconv.ts +50 -0
  404. package/src/commands/fetch-command.ts +606 -66
  405. package/src/commands/format-patch-command.ts +969 -0
  406. package/src/commands/fsck/fetch-fsck.ts +229 -0
  407. package/src/commands/fsck/fsck-command.ts +3347 -0
  408. package/src/commands/fsck/fsck-loose.ts +287 -0
  409. package/src/commands/fsck/fsck-msg-ids.ts +176 -0
  410. package/src/commands/fsck/fsck-object-checks.ts +1044 -0
  411. package/src/commands/fsck/fsck-object-table.ts +363 -0
  412. package/src/commands/fsck/fsck-pack.ts +604 -0
  413. package/src/commands/fsck/index.ts +5 -0
  414. package/src/commands/fsck/verify-pack-command.ts +249 -0
  415. package/src/commands/gc-command.ts +147 -1
  416. package/src/commands/git-date.ts +895 -0
  417. package/src/commands/git-describe.ts +316 -0
  418. package/src/commands/git-hooks.ts +1472 -0
  419. package/src/commands/git-ident.ts +344 -0
  420. package/src/commands/hook-command.ts +247 -0
  421. package/src/commands/index-adder.ts +706 -0
  422. package/src/commands/index-host.ts +291 -0
  423. package/src/commands/index.ts +82 -0
  424. package/src/commands/init-command.ts +28 -4
  425. package/src/commands/local-clone.ts +183 -0
  426. package/src/commands/local-transport.ts +762 -0
  427. package/src/commands/log-command.ts +1915 -170
  428. package/src/commands/log-graph.ts +671 -0
  429. package/src/commands/log-output.ts +1359 -0
  430. package/src/commands/ls-remote-command.ts +101 -58
  431. package/src/commands/mailmap.ts +129 -0
  432. package/src/commands/merge-bases.ts +296 -0
  433. package/src/commands/merge-command.ts +1386 -491
  434. package/src/commands/merge-config.ts +25 -0
  435. package/src/commands/merge-drivers.ts +306 -0
  436. package/src/commands/merge-support.ts +1198 -0
  437. package/src/commands/message-cleanup.ts +275 -0
  438. package/src/commands/mv-command.ts +976 -0
  439. package/src/commands/notes-command.ts +890 -0
  440. package/src/commands/notes-commands.ts +87 -0
  441. package/src/commands/notes-merge-command.ts +768 -0
  442. package/src/commands/notes-support.ts +402 -0
  443. package/src/commands/notes-tree.ts +602 -0
  444. package/src/commands/object-id-input.ts +27 -0
  445. package/src/commands/octopus-merge.ts +377 -0
  446. package/src/commands/ort-merge.ts +1660 -0
  447. package/src/commands/ort-recursive.ts +160 -0
  448. package/src/commands/pack-refs-command.ts +39 -22
  449. package/src/commands/patch-id.ts +196 -0
  450. package/src/commands/pathspec-attributes.ts +162 -0
  451. package/src/commands/pathspec.ts +1199 -0
  452. package/src/commands/post-index-change.ts +62 -0
  453. package/src/commands/pretty-format.ts +1431 -0
  454. package/src/commands/promisor-remote.ts +298 -0
  455. package/src/commands/pull-command.ts +207 -22
  456. package/src/commands/push-command.ts +236 -23
  457. package/src/commands/read-tree-command.ts +857 -0
  458. package/src/commands/rebase-command.ts +3808 -371
  459. package/src/commands/rebase-todo.ts +584 -0
  460. package/src/commands/ref-decoration-filter.ts +118 -0
  461. package/src/commands/reflog-messages.ts +177 -0
  462. package/src/commands/remote-command.ts +93 -22
  463. package/src/commands/remote-transport.ts +383 -0
  464. package/src/commands/reset-command.ts +827 -103
  465. package/src/commands/restore-command.ts +350 -0
  466. package/src/commands/rev-list-command.ts +167 -0
  467. package/src/commands/rev-parse-command.ts +277 -0
  468. package/src/commands/revert-command.ts +152 -399
  469. package/src/commands/revision-filenames.ts +254 -0
  470. package/src/commands/revision-range.ts +222 -0
  471. package/src/commands/revision-resolver.ts +1379 -0
  472. package/src/commands/rm-command.ts +613 -67
  473. package/src/commands/sequencer-pick.ts +869 -0
  474. package/src/commands/sequencer-support.ts +869 -0
  475. package/src/commands/serve-repository.ts +125 -0
  476. package/src/commands/sparse-checkout-command.ts +1389 -0
  477. package/src/commands/sparse-checkout-support.ts +793 -0
  478. package/src/commands/stash-apply-command.ts +376 -343
  479. package/src/commands/stash-create-command.ts +625 -42
  480. package/src/commands/stash-drop-command.ts +15 -2
  481. package/src/commands/stash-working-tree.ts +168 -24
  482. package/src/commands/status-command.ts +1328 -105
  483. package/src/commands/status-format.ts +775 -0
  484. package/src/commands/status-header.ts +330 -0
  485. package/src/commands/strerror.ts +29 -0
  486. package/src/commands/submodule-config.ts +94 -0
  487. package/src/commands/submodule-summary-command.ts +334 -0
  488. package/src/commands/submodule-summary.ts +446 -0
  489. package/src/commands/switch-command.ts +402 -0
  490. package/src/commands/tag-command.ts +129 -41
  491. package/src/commands/tracking-info.ts +201 -0
  492. package/src/commands/trailers.ts +417 -0
  493. package/src/commands/tree-restore.ts +204 -4
  494. package/src/commands/untracked-cache-support.ts +194 -0
  495. package/src/commands/worktree-add-command.ts +458 -0
  496. package/src/commands/worktree-list-command.ts +208 -0
  497. package/src/commands/worktree-lock-command.ts +96 -0
  498. package/src/commands/worktree-overwrite-checks.ts +452 -26
  499. package/src/commands/worktree-prune-command.ts +99 -0
  500. package/src/commands/worktree-remove-command.ts +186 -0
  501. package/src/commands/worktree-repair-command.ts +59 -0
  502. package/src/commands/worktree-support.ts +214 -0
  503. package/src/core-commands/add.command.impl.ts +7 -1
  504. package/src/errors/add-errors.ts +45 -0
  505. package/src/errors/checkout-errors.ts +26 -2
  506. package/src/errors/command-errors.ts +101 -1
  507. package/src/errors/commit-errors.ts +18 -2
  508. package/src/errors/git-api-error.ts +82 -2
  509. package/src/errors/index.ts +1 -0
  510. package/src/errors/merge-errors.ts +2 -2
  511. package/src/errors/rebase-errors.ts +12 -0
  512. package/src/errors/ref-errors.ts +56 -2
  513. package/src/errors/remote-errors.ts +2 -2
  514. package/src/errors/stash-errors.ts +1 -1
  515. package/src/errors/transport-errors.ts +20 -4
  516. package/src/errors/worktree-errors.ts +49 -0
  517. package/src/git-command.ts +1177 -118
  518. package/src/git.ts +523 -10
  519. package/src/index.ts +1 -1
  520. package/src/remote-config/remote-config-store.ts +242 -8
  521. package/src/remote-config/remote-refs.ts +22 -6
  522. package/src/rename/detect-renames.ts +711 -0
  523. package/src/rename/git-similarity.ts +116 -0
  524. package/src/rename/index.ts +2 -0
  525. package/src/results/binary-patch.ts +401 -0
  526. package/src/results/blame-format.ts +239 -0
  527. package/src/results/cherry-pick-result.ts +10 -0
  528. package/src/results/clone-result.ts +12 -0
  529. package/src/results/combined-diff.ts +585 -0
  530. package/src/results/diff-entry.ts +35 -0
  531. package/src/results/diff-formatter.ts +152 -288
  532. package/src/results/diff-order.ts +64 -0
  533. package/src/results/diff-output.ts +1051 -0
  534. package/src/results/fetch-result.ts +15 -0
  535. package/src/results/index.ts +5 -0
  536. package/src/results/merge-result.ts +15 -1
  537. package/src/results/pull-result.ts +12 -3
  538. package/src/results/push-result.ts +43 -0
  539. package/src/results/quote-path.ts +103 -0
  540. package/src/results/rebase-result.ts +37 -0
  541. package/src/results/revert-result.ts +10 -0
  542. package/src/results/stash-result.ts +6 -0
  543. package/src/results/status-result.ts +123 -45
  544. package/src/transport-command.ts +121 -2
  545. package/dist/commands-CsLNyvZ1.js +0 -12587
  546. package/dist/status-result-BpyUK1Sg.js +0 -519
@@ -1,6 +1,8 @@
1
- import type { Commit, ObjectId, PersonIdent } from "@statewalker/vcs-core";
2
- import type { Worktree } from "@statewalker/vcs-working-tree";
1
+ import { type Commit, type ObjectId, type PersonIdent } from "@statewalker/vcs-core";
2
+ import { type Worktree } from "@statewalker/vcs-working-tree";
3
3
  import { GitCommand } from "../git-command.js";
4
+ import { CleanupMode } from "./message-cleanup.js";
5
+ import { type StatusTextResult, type UntrackedFilesMode } from "./status-command.js";
4
6
  /**
5
7
  * Result of a commit operation.
6
8
  *
@@ -61,18 +63,66 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
61
63
  private message?;
62
64
  private author?;
63
65
  private committer?;
66
+ /** `--author=<name> <email>`: dated when the commit is made */
67
+ private authorName?;
68
+ /** A committer named without a date, dated when the commit is made */
69
+ private committerName?;
70
+ private resetAuthor;
64
71
  private amend;
72
+ private noPostRewrite;
73
+ private noVerify;
65
74
  private allowEmpty;
66
75
  private parents;
67
76
  private onlyPaths;
68
77
  private all;
78
+ private include;
79
+ private includePaths;
69
80
  private worktreeIterator;
81
+ private cleanupMode?;
82
+ private allowEmptyMessage;
83
+ private editor?;
84
+ private edit?;
85
+ private includeStatus?;
86
+ private verbose?;
87
+ private untrackedMode?;
88
+ private statusFormat?;
89
+ private showBranch?;
90
+ private nullTermination;
91
+ private aheadBehind?;
92
+ private templateFile?;
70
93
  /**
71
- * Set the commit message.
94
+ * Set the commit message, as git's `commit -m` takes it: its last line is ended and it is
95
+ * cleaned up (`whitespace` by default, see {@link setCleanupMode}), so `"Fix"` is stored
96
+ * as `"Fix\n"` and the commit gets native git's id.
72
97
  *
73
98
  * @param message Commit message
74
99
  */
75
100
  setMessage(message: string): this;
101
+ /**
102
+ * Add a paragraph to the message, as each further `-m` of `git commit` does: the
103
+ * message so far gets its last line ended and a blank line, then this one (`-m a -m b`
104
+ * is `"a\n\nb\n"`). The first call is {@link setMessage}.
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * await git.commit().addMessage("Subject").addMessage("Body paragraph.").call();
109
+ * ```
110
+ *
111
+ * @param message One paragraph of the commit message
112
+ */
113
+ addMessage(message: string): this;
114
+ /**
115
+ * How the message is cleaned up (git's `--cleanup=<mode>`; default `commit.cleanup`, else
116
+ * `default`, which without an editor is `whitespace`: trailing whitespace and surrounding
117
+ * blank lines dropped, blank runs collapsed). `strip` also drops comment lines;
118
+ * `verbatim` keeps the message as given (with its last line ended, as `-m` does).
119
+ */
120
+ setCleanupMode(mode: CleanupMode): this;
121
+ /**
122
+ * Allow a message that is empty after its cleanup (git's `--allow-empty-message`);
123
+ * without it such a commit is refused: `Aborting commit due to empty commit message.`
124
+ */
125
+ setAllowEmptyMessage(allow: boolean): this;
76
126
  /**
77
127
  * Set the author identity.
78
128
  *
@@ -99,6 +149,24 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
99
149
  * @param committer Committer identity
100
150
  */
101
151
  setCommitterIdent(committer: PersonIdent): this;
152
+ /**
153
+ * `--reset-author`: an amended commit, or the commit that concludes a cherry-pick, is
154
+ * authored as a new one (the author resolved as git resolves it, dated now) instead of
155
+ * keeping the earlier commit's author.
156
+ *
157
+ * @param reset Whether to reset the author
158
+ */
159
+ setResetAuthor(reset: boolean): this;
160
+ /**
161
+ * `--no-post-rewrite`: an amend does not carry the amended commit's notes over to the new
162
+ * one (`notes.rewriteRef`, `notes.rewrite.amend`), as git skips its post-rewrite step.
163
+ */
164
+ setNoPostRewrite(noPostRewrite: boolean): this;
165
+ /**
166
+ * `-n` / `--no-verify`: the `pre-commit` and `commit-msg` hooks do not run
167
+ * (`prepare-commit-msg` and `post-commit` still do, as in git).
168
+ */
169
+ setNoVerify(noVerify: boolean): this;
102
170
  /**
103
171
  * Set whether to amend the previous commit.
104
172
  *
@@ -121,11 +189,25 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
121
189
  */
122
190
  setParentIds(...parents: ObjectId[]): this;
123
191
  /**
124
- * Set paths to commit (--only mode).
192
+ * Set paths to commit (`git commit --only <paths>`, git's partial commit).
125
193
  *
126
- * When set, only the specified paths are taken from the staging area.
127
- * All other paths are taken from the parent commit's tree. This allows
128
- * partial commits without affecting unstaged changes to other files.
194
+ * The paths are a pathspec, as git reads it (`d/`, `*.md`, `:(glob)d/**`, `:!d/x`,
195
+ * `./a`). As git's `prepare_index`: the index entries (any stage) and HEAD's files the
196
+ * pathspec matches are listed (`list_paths`); an element that matches none of them fails
197
+ * with git's "error: pathspec '<path>' did not match any file(s) known to git". The index
198
+ * lock is then held until HEAD has moved. Each listed path is taken from the worktree
199
+ * literally (`add_remove_files`): a file (ignored or not) is staged as `git add` stages it
200
+ * (cleaned by the content filters; an intent-to-add entry gets the content, a conflicted
201
+ * path is resolved to the file, the entries it clashes with as a file or a directory
202
+ * replaced), a path gone is removed, a submodule takes the commit checked out in it, and a
203
+ * path that is now a directory holding no commit refuses the commit before anything
204
+ * changes ("'<path>' does not have a commit checked out"). The index is
205
+ * written into the lock with the paths updated, and the commit records HEAD's tree with
206
+ * only these paths changed, whatever else is staged. The lock is renamed over the index
207
+ * once the commit is made; on any failure it is removed and the index (and this instance's
208
+ * staging, unwritten edits included) stays as it was. A skip-worktree path keeps its HEAD
209
+ * version. A partial commit during a merge, a cherry-pick or a rebase is refused; other
210
+ * unmerged paths do not stop it (they stay unmerged in the index).
129
211
  *
130
212
  * Cannot be combined with setAll().
131
213
  *
@@ -137,7 +219,9 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
137
219
  * Set whether to auto-stage modified tracked files before committing.
138
220
  *
139
221
  * If true, stages all modified and deleted tracked files before
140
- * creating the commit. Requires a working tree iterator.
222
+ * creating the commit. Requires a working tree iterator. As git's: the index lock is held
223
+ * from before the files are staged until HEAD has moved, and the index is left as it was
224
+ * when the commit fails.
141
225
  *
142
226
  * Cannot be combined with setOnly().
143
227
  *
@@ -148,6 +232,27 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
148
232
  * @throws Error if combined with --only paths
149
233
  */
150
234
  setAll(all: boolean): this;
235
+ /**
236
+ * Commit the index with the tracked files `paths` names staged first (`git commit -i
237
+ * <paths>` / `--include`, git's `prepare_index` "non partial, non as-is commit"): the index
238
+ * lock is taken, the tracked paths the pathspec matches are staged from the worktree as
239
+ * `git add -u <paths>` stages them (`add_files_to_cache`; untracked files are not added),
240
+ * an element that matches no index entry fails with git's "error: pathspec '<path>' did
241
+ * not match any file(s) known to git" (git 2.5x; 2.43 commits what is staged), and the
242
+ * whole index, written into the lock, is committed; the lock is renamed over the index
243
+ * once HEAD has moved, or removed on failure (the index stays as it was).
244
+ *
245
+ * As git: refused with {@link setOnly} paths ("options '-i/--include' and '-o/--only'
246
+ * cannot be used together"), with {@link setAll} ("options '-i/--include' and
247
+ * '-a/--all' cannot be used together"), and without paths ("No paths with
248
+ * --include/--only does not make sense."), when the commit runs.
249
+ *
250
+ * @example
251
+ * ```typescript
252
+ * await git.commit().setInclude("src/a.ts").setMessage("Fix a").call();
253
+ * ```
254
+ */
255
+ setInclude(...paths: string[]): this;
151
256
  /**
152
257
  * Whether --all mode is enabled.
153
258
  */
@@ -161,6 +266,101 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
161
266
  * @param iterator Custom working tree iterator
162
267
  * @returns this for chaining
163
268
  */
269
+ /**
270
+ * The editor of the commit message (git's `core.editor` / `GIT_EDITOR`, which a library
271
+ * cannot launch): called with the path of `COMMIT_EDITMSG` in the git directory and the
272
+ * text written there, the template git prepares (the message so far, then, unless
273
+ * {@link setIncludeStatus} is false, the commented help and status, and with
274
+ * {@link setVerbose} the diff below the scissors line). It returns the edited text, or
275
+ * nothing once it changed the file itself; the result is cleaned up as git cleans up an
276
+ * edited message (`default` strips comments, `scissors` cuts at the scissors line). It is
277
+ * used when no message is given, or with {@link setEdit}.
278
+ *
279
+ * @example
280
+ * ```typescript
281
+ * await git.commit().setEditor(async (_path, template) => `Subject\n\n${template}`).call();
282
+ * ```
283
+ */
284
+ setEditor(editor: CommitEditor): this;
285
+ /**
286
+ * `-t <file>` / `--template=<file>`: the editor starts from this file's text (default
287
+ * `commit.template`) when no message is given and nothing is in progress; a message the
288
+ * editor leaves as the template was is refused (`Aborting commit; you did not edit the
289
+ * message.`). A relative path is read from the worktree's top, through the host.
290
+ *
291
+ * @example
292
+ * ```typescript
293
+ * await git.commit().setTemplate("/home/me/.gitmessage").setEditor(edit).call();
294
+ * ```
295
+ */
296
+ setTemplate(path: string): this;
297
+ /** `-e` / `--no-edit`: edit a given message too, or never edit (default: edit when none is given). */
298
+ setEdit(edit: boolean): this;
299
+ /** `--status` / `--no-status`: the status in the editor's template (default `commit.status`, true). */
300
+ setIncludeStatus(include: boolean): this;
301
+ /**
302
+ * `-v` (1) / `-vv` (2): the staged diff below the template's scissors line (and the
303
+ * unstaged one), or in {@link callDryRun}'s output (default `commit.verbose`)
304
+ */
305
+ setVerbose(level: number): this;
306
+ /** `-u<mode>` / `--untracked-files=<mode>` of the template and the dry run */
307
+ setUntrackedFiles(mode: UntrackedFilesMode): this;
308
+ /** `--short`, `--porcelain`, `--long`: the format of {@link callDryRun} (git's commit has no v2) */
309
+ setStatusFormat(format: "long" | "short" | "porcelain"): this;
310
+ /** `--branch`: the branch header of the short and porcelain dry runs (default `status.branch`) */
311
+ setShowBranch(show: boolean): this;
312
+ /** `-z`: NUL-terminated dry-run output (porcelain unless another format is set) */
313
+ setNullTermination(z: boolean): this;
314
+ /** `--[no-]ahead-behind` of the dry run (default `status.aheadBehind` for the human formats) */
315
+ setAheadBehind(full: boolean): this;
316
+ /**
317
+ * `git commit --dry-run` (and `--short`, `--porcelain`, `--long`, `-z`, which imply it):
318
+ * the status of what would be committed, in the format set, with git's exit code (0
319
+ * when there is something to commit, else 1). The index is prepared as the commit would
320
+ * prepare it (`-a` stages the tracked changes, {@link setInclude} the named tracked paths,
321
+ * {@link setOnly} builds the index of HEAD with the named paths), then left as it was
322
+ * (rollback_index_files).
323
+ *
324
+ * @example
325
+ * ```typescript
326
+ * const { text, exitCode } = await git.commit().setAll(true).callDryRun();
327
+ * ```
328
+ */
329
+ callDryRun(): Promise<CommitDryRunResult>;
330
+ /** git's use_editor: an editor is set, and no message is given or `-e` asks for it. */
331
+ private usesEditor;
332
+ /**
333
+ * prepare_to_commit with an editor: COMMIT_EDITMSG written with the message so far and
334
+ * (`commit.status`) the commented help, identities and status of the template, the
335
+ * editor run over it, and what it left cleaned up as the commit message.
336
+ */
337
+ private editMessage;
338
+ /**
339
+ * The commit template (`-t`, else `commit.template`, `~/` expanded) read through the host,
340
+ * undefined when none is set; one that cannot be read fails as git's `die_errno`.
341
+ */
342
+ private readTemplate;
343
+ /** committer_ident_sufficiently_given: a name and an email named, not guessed. */
344
+ private committerIdentGiven;
345
+ /** parse_and_validate_options' checks of `--amend`. */
346
+ private checkAmend;
347
+ /** `-v` as given, else `commit.verbose` (a boolean or a level), else 0. */
348
+ private verboseLevel;
349
+ /**
350
+ * run_status for the commit: the status of the prepared index against HEAD (HEAD^1 for
351
+ * `--amend`), its stats not written back (the commit holds the index).
352
+ */
353
+ private commitStatus;
354
+ /** {@link withFalseIndex} with the files of `tree` (a partial commit's stored tree). */
355
+ private withIndexOfTree;
356
+ /**
357
+ * Runs `fn` while the staging holds the entries `flat` names (a partial commit's false
358
+ * index: HEAD with the named paths), each with the stat of the staging's same entry,
359
+ * then puts the staging back exactly as it was: the same entry objects, so the ones kept
360
+ * as read are still checked for racy-git smudging when the index is written
361
+ * (`saveState`; a staging without it gets its entries rebuilt).
362
+ */
363
+ private withFalseIndex;
164
364
  setWorktree(iterator: Worktree): this;
165
365
  /**
166
366
  * Execute the commit.
@@ -172,18 +372,101 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
172
372
  */
173
373
  call(): Promise<CommitResult>;
174
374
  /**
175
- * Build tree for --only mode.
176
- *
177
- * Combines parent tree with specified paths from staging area.
178
- *
179
- * @param parentCommitId Parent commit ID
180
- * @returns Tree ObjectId
375
+ * `-i <paths>` (git's prepare_index for `also`): the option checks of
376
+ * parse_and_validate_options and prepare_index, then the index lock held from before the
377
+ * tracked paths are staged until HEAD has moved.
378
+ */
379
+ private commitIncluded;
380
+ /** `-i <paths>`: parse_and_validate_options' and prepare_index's refusals. */
381
+ private checkIncludeOptions;
382
+ /**
383
+ * The commit, once `-a` staged the tracked changes (`index`: the index lock it holds).
384
+ * A partial commit takes the lock itself.
385
+ */
386
+ private commitWith;
387
+ /**
388
+ * A partial commit's false index written as git's `prepare_index` writes it for the hooks
389
+ * (`$GIT_DIR/next-index-<pid>.lock`): HEAD's tree with the named paths taken, each entry
390
+ * the index has unchanged keeping its stat data (create_base_index's one-way merge), the
391
+ * others none. Undefined where the repository's files cannot hold it.
392
+ */
393
+ private writeFalseIndexFile;
394
+ /** The commit made from the index (or the partial commit's tree), after the index is ready. */
395
+ private commitPrepared;
396
+ /**
397
+ * prepare_to_commit's refusal of a commit with nothing to commit: the tree is its first
398
+ * parent's (HEAD's, HEAD^1's when amending), or empty without a first parent, unless a merge is concluded, empty commits are
399
+ * allowed, or a merge commit is amended.
400
+ */
401
+ private refuseNothingToCommit;
402
+ /** The commit of `treeId` made, HEAD moved to it, and what was in progress ended. */
403
+ private finishCommit;
404
+ /**
405
+ * The variables of the commit hooks (git's `run_commit_hook`): `GIT_INDEX_FILE` names the
406
+ * index the commit records (the lock `-a` and a partial commit write; git's false index of
407
+ * a partial commit is not kept as a file here), and `GIT_EDITOR=:` tells a hook that no
408
+ * editor runs.
181
409
  */
182
- private buildOnlyTree;
410
+ private commitHookEnv;
411
+ /** Runs a hook that can refuse the commit; whether it ran. */
412
+ private runCommitHook;
183
413
  /**
184
- * Recursively walk tree and add entries to builder, excluding specified paths.
414
+ * The arguments of prepare-commit-msg after the message file (prepare_to_commit's
415
+ * hook_arg1 and hook_arg2): where the message came from.
185
416
  */
186
- private addTreeFiltered;
417
+ private prepareMessageHookArgs;
418
+ /**
419
+ * prepare-commit-msg, the editor (when one runs) and commit-msg (not with --no-verify)
420
+ * over COMMIT_EDITMSG, in prepare_to_commit's order; whether any hook ran (the file is then
421
+ * to be read back). A non-zero commit-msg refuses the commit, as does prepare-commit-msg.
422
+ */
423
+ private runMessageHooks;
424
+ /** The commits MERGE_HEAD names (one per line), none without a merge in progress. */
425
+ private mergeHeads;
426
+ /** The heads none of the others reaches (git's reduce_heads), in their order. */
427
+ private reduceHeads;
428
+ /**
429
+ * After the commit: the merge state removed (MERGE_HEAD, MERGE_MSG, MERGE_MODE,
430
+ * SQUASH_MSG, AUTO_MERGE), a stopped cherry-pick or revert ended (its sequencer state
431
+ * too once it was the last pick), and MERGE_AUTOSTASH applied back, as `git commit`.
432
+ */
433
+ private cleanupAfterCommit;
434
+ /**
435
+ * The index held for a commit that changes it (git's `repo_hold_locked_index`): the
436
+ * index lock taken now (a staging with an index file), released on failure with the
437
+ * staging as it was before (read again, or its unwritten edits put back).
438
+ */
439
+ private holdIndex;
440
+ /**
441
+ * The paths a partial commit takes (git's `list_paths`): those of the index (any stage)
442
+ * and of HEAD's tree the pathspec matches (`ce_path_match`, magic and globs as git's), in
443
+ * git's order, each with whether its index entry is skip-worktree. Refused during a
444
+ * merge, a cherry-pick or a rebase (git's whence), and when an element of the pathspec
445
+ * matches nothing (`report_path_error`).
446
+ */
447
+ private listPartialPaths;
448
+ /** The files (and gitlinks) of a tree, in the directories `mayMatch` lets in. */
449
+ private collectTreeFiles;
450
+ /**
451
+ * git's partial commit (`prepare_index`, `add_remove_files`): each listed path (but the
452
+ * skip-worktree ones) as git's `add_remove_files` takes it, literally: a file (ignored or
453
+ * not) hashed and staged, a path gone removed, a submodule staged at the commit checked
454
+ * out in it, a directory without one refused before anything changes ("'<path>' does not
455
+ * have a commit checked out"); the index then gets its
456
+ * cache-tree (none while it holds conflicts) and is written into the lock. The tree
457
+ * committed is HEAD's with the same paths taken (git's false index), returned as HEAD's
458
+ * tree and those edits: stored by {@link storeFalseIndex}, never by a dry run.
459
+ */
460
+ private preparePartialCommit;
461
+ /** The tree of a partial commit's false index, stored (with the directories it changes). */
462
+ private storeFalseIndex;
463
+ /** The files of a partial commit's false index, without storing a tree. */
464
+ private falseIndexFiles;
465
+ /**
466
+ * A tree with the given files set (or removed, for null), only the directories on their
467
+ * paths stored again; undefined when nothing is left in it.
468
+ */
469
+ private editTree;
187
470
  /**
188
471
  * Stage all modified/deleted tracked files.
189
472
  *
@@ -196,4 +479,15 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
196
479
  */
197
480
  private getWorktreeIterator;
198
481
  }
482
+ /**
483
+ * The editor of a commit message (`CommitCommand.setEditor`): the path of the message file
484
+ * within the git directory (`COMMIT_EDITMSG`) and its text; it returns the edited text, or
485
+ * nothing (anything but a string) when it edited the file in place.
486
+ */
487
+ export type CommitEditor = (path: string, text: string) => Promise<unknown>;
488
+ /** What `CommitCommand.callDryRun` gives: the status text and git's exit code. */
489
+ export interface CommitDryRunResult extends StatusTextResult {
490
+ /** 0 when there is something to commit, 1 when not (dry_run_commit) */
491
+ exitCode: number;
492
+ }
199
493
  //# sourceMappingURL=commit-command.d.ts.map
@@ -1 +1 @@
1
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;YACW,cAAc;IAY5B,8EAA8E;IAC9E,OAAO,CAAC,mBAAmB;IAsB3B;;;OAGG;YACW,UAAU;IAyExB;;;;;OAKG;YACW,mBAAmB;IAkDjC,+FAA+F;YACjF,cAAc;IAiO5B;;;;OAIG;YACW,qBAAqB;IAmBnC,qFAAqF;YACvE,YAAY;IA0F1B;;;;;OAKG;YACW,aAAa;IAe3B,8DAA8D;YAChD,aAAa;IAiB3B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAkB9B;;;;OAIG;YACW,eAAe;IAgB7B,qFAAqF;YACvE,UAAU;IAYxB,iFAAiF;YACnE,WAAW;IAgBzB;;;;OAIG;YACW,kBAAkB;IA0ChC;;;;OAIG;YACW,SAAS;IAsDvB;;;;;;OAMG;YACW,gBAAgB;IAqF9B,iFAAiF;YACnE,gBAAgB;IAgB9B;;;;;;;;;OASG;YACW,oBAAoB;IA6DlC,4FAA4F;YAC9E,eAAe;IAI7B,2EAA2E;YAC7D,eAAe;IAoB7B;;;OAGG;YACW,QAAQ;IAiCtB;;;;;OAKG;YACW,mBAAmB;IAyBjC;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAQ5B;AAyHD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE5E,kFAAkF;AAClF,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -5,12 +5,89 @@
5
5
  * global and system configuration files, so a `core.symlinks` set only in `~/.gitconfig`
6
6
  * is not seen (native git would honour it).
7
7
  */
8
+ import { type ObjectId } from "@statewalker/vcs-core";
8
9
  import type { WorkingCopy, Worktree, WorktreeModeTrust } from "@statewalker/vcs-working-tree";
9
- /** A git boolean (`true`/`yes`/`on`/`1`, `false`/`no`/`off`/`0`), else `fallback`. */
10
+ /**
11
+ * A git boolean (`git_config_bool`: a key with no `=` is true, an empty value false), else
12
+ * `fallback`.
13
+ */
10
14
  export declare function coreBool(workingCopy: WorkingCopy, name: string, fallback: boolean): boolean;
11
15
  /**
12
16
  * Whether the worktree's executable bits and symbolic links are real: the worktree can
13
17
  * represent them and `core.filemode` / `core.symlinks` are not false.
14
18
  */
15
19
  export declare function worktreeModeTrust(workingCopy: WorkingCopy, worktree: Worktree): WorktreeModeTrust;
20
+ /** The values git's `core.disambiguate` takes (`set_disambiguate_hint_config`). */
21
+ export declare const DISAMBIGUATE_HINTS: readonly string[];
22
+ /**
23
+ * What git dies with on loading its configuration (`git_default_core_config`, which every
24
+ * command runs before it does anything, `status` included), else undefined: a
25
+ * `core.disambiguate` it does not know, the first bad value in the configuration's order
26
+ * (`error: unknown hint type for 'core.disambiguate': foo`, or for a variable without `=`
27
+ * `error: missing value for 'core.disambiguate'`, then `fatal: bad config variable
28
+ * 'core.disambiguate' in file '<file>' at line <n>`). A value with no file (set in memory)
29
+ * fails as git's command-line config does.
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * const message = configLoadError(workingCopy);
34
+ * if (message) throw new InvalidConfigError("core.disambiguate", message);
35
+ * ```
36
+ */
37
+ export declare function configLoadError(workingCopy: WorkingCopy): {
38
+ key: string;
39
+ message: string;
40
+ } | undefined;
41
+ /**
42
+ * `id` abbreviated as git prints it (`repo_find_unique_abbrev(id, DEFAULT_ABBREV)`): to
43
+ * `core.abbrev` digits (auto: from the approximate object count, at least 7), lengthened until
44
+ * no other stored object shares them. Each call counts the objects again for the automatic
45
+ * length; a command that abbreviates several ids uses one {@link createIdAbbreviator} (the
46
+ * command's `abbreviateObjectId`) instead.
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * output.push(`Created autostash: ${await abbreviateId(workingCopy, stashId)}`);
51
+ * ```
52
+ */
53
+ export declare function abbreviateId(workingCopy: WorkingCopy, id: ObjectId): Promise<string>;
54
+ /**
55
+ * The lengths git abbreviates `ids` to (`repo_find_unique_abbrev` with `DEFAULT_ABBREV`):
56
+ * from `minLength`, else `core.abbrev` (auto: from the approximate object count), lengthened
57
+ * until unique among the stored objects. Without an object store, the start length (7 for
58
+ * auto).
59
+ */
60
+ export declare function abbrevLengths(workingCopy: WorkingCopy, ids: Iterable<ObjectId>, minLength?: number): Promise<Map<ObjectId, number>>;
61
+ /** Options of {@link createIdAbbreviator} */
62
+ export interface IdAbbreviatorOptions {
63
+ /**
64
+ * Keep the store's listings for the abbreviator's life (each loose fan-out directory read
65
+ * once, as git's `odb_loose_cache`): for commands that write no objects while they
66
+ * abbreviate, such as `log` and `diff`.
67
+ */
68
+ cacheListings?: boolean;
69
+ }
70
+ /** Abbreviates ids for one command or operation; see {@link createIdAbbreviator}. */
71
+ export interface IdAbbreviator {
72
+ /** `id` abbreviated as git prints it (see {@link abbreviateId}) */
73
+ abbreviate(id: ObjectId): Promise<string>;
74
+ /** The lengths of `ids` (see {@link abbrevLengths}) */
75
+ lengths(ids: Iterable<ObjectId>, minLength?: number): Promise<Map<ObjectId, number>>;
76
+ }
77
+ /**
78
+ * An abbreviator that counts the objects once, for the automatic length (`core.abbrev`
79
+ * unset or "auto"), however many ids it abbreviates: git computes its approximate object
80
+ * count once per process and keeps it (`approximate_object_count_valid`), and so does this
81
+ * for its lifetime. Counting lists every object on stores without a cheap count (key-value,
82
+ * SQL, memory), so a command abbreviating several ids (merge's `Updating a..b`, rebase's
83
+ * todo backup) pays for one scan, not one per id. Objects written meanwhile are not
84
+ * counted again, as in git; prefix uniqueness is still checked against the store each time.
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * const abbrev = createIdAbbreviator(workingCopy);
89
+ * output.push(`Updating ${await abbrev.abbreviate(head)}..${await abbrev.abbreviate(src)}`);
90
+ * ```
91
+ */
92
+ export declare function createIdAbbreviator(workingCopy: WorkingCopy, options?: IdAbbreviatorOptions): IdAbbreviator;
16
93
  //# sourceMappingURL=core-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-config.d.ts","sourceRoot":"","sources":["../../src/commands/core-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAI9F,sFAAsF;AACtF,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAM3F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAG,iBAAiB,CAejG"}
1
+ {"version":3,"file":"core-config.d.ts","sourceRoot":"","sources":["../../src/commands/core-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAI9F;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAE3F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAG,iBAAiB,CAejG;AAED,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAO/C,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,WAAW,GACvB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAe9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1F;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACvB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAEhC;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,qFAAqF;AACrF,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,uDAAuD;IACvD,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;CACtF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE,oBAAyB,GACjC,aAAa,CA2Bf"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * git's date modes (`--date=<mode>`, `log.date`): date.c's parse_date_format and show_date.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * const mode = parseDateMode("iso");
7
+ * showDate(1112911993, "+0200", mode); // "2005-04-08 00:13:13 +0200"
8
+ * showDate(1112911993, "+0200", parseDateMode("format:%Y/%m/%d")); // "2005/04/08"
9
+ * showDate(1112911993, "+0200", parseDateMode("relative"), { now }); // "19 years ago"
10
+ * ```
11
+ *
12
+ * The modes: `default` (`Thu Apr 7 22:13:13 2005 +0200`), `relative`, `local` (default in
13
+ * the local zone, without it), `iso`/`iso8601`, `iso-strict`/`iso8601-strict`, `rfc`/`rfc2822`,
14
+ * `short`, `raw`, `unix`, `human` and `format:<strftime>` (the C locale's names); each but
15
+ * `relative`, `raw`... may end in `-local` to be shown in the local zone. `auto:<mode>` is the
16
+ * default mode, as git without a terminal takes it.
17
+ *
18
+ * @module
19
+ */
20
+ /** A parsed date mode (date.c's struct date_mode). */
21
+ export interface DateMode {
22
+ type: "normal" | "relative" | "short" | "iso8601" | "iso8601-strict" | "rfc2822" | "strftime" | "raw" | "unix" | "human";
23
+ /** Shown in the local zone (`-local`, `local`) */
24
+ local: boolean;
25
+ /** The strftime format of `format:` */
26
+ strftime?: string;
27
+ }
28
+ /** What {@link showDate} reads besides the date. */
29
+ export interface ShowDateContext {
30
+ /** Now, in seconds (`relative`, `human`); default the clock */
31
+ now?: number;
32
+ /** The local zone's offset east of UTC in minutes at a time (default the host's) */
33
+ localTzOffset?: (time: number) => number;
34
+ /**
35
+ * The local zone's name at a time, as `%Z` of a `format-local:` date shows it (default
36
+ * {@link hostZoneName})
37
+ */
38
+ localTzName?: (time: number) => string;
39
+ }
40
+ /** An error git reports for a date mode it does not know (`fatal: unknown date format`). */
41
+ export declare class DateModeError extends Error {
42
+ }
43
+ /** date.c's parse_date_format. */
44
+ export declare function parseDateMode(spec: string): DateMode;
45
+ /** The default date mode. */
46
+ export declare const DEFAULT_DATE_MODE: DateMode;
47
+ /**
48
+ * The host's name for the local zone at a time (strftime's `%Z` of a local date): the
49
+ * abbreviation `Intl` knows (`PST`, `CEST`), else, for a zone tzdata only names by its offset
50
+ * (`Asia/Kathmandu`), the offset as glibc prints it (`+0545`).
51
+ */
52
+ export declare function hostZoneName(time: number, localTz: (time: number) => number): string;
53
+ /**
54
+ * date.c's show_date: `time` (seconds) in its zone `tzOffset` (`+HHMM`, read as git reads
55
+ * it: `+0060` stays `+0060`) as the mode shows it.
56
+ */
57
+ export declare function showDate(time: number, tzOffset: string, mode: DateMode, context?: ShowDateContext): string;
58
+ //# sourceMappingURL=date-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-format.d.ts","sourceRoot":"","sources":["../../src/commands/date-format.ts"],"names":[],"mappings":"AAAA;;;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