@statewalker/vcs-commands 0.5.0 → 0.7.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 (561) 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 +134 -0
  69. package/dist/commands/clone-command.d.ts.map +1 -1
  70. package/dist/commands/comment-char-config.d.ts +35 -0
  71. package/dist/commands/comment-char-config.d.ts.map +1 -0
  72. package/dist/commands/commit-command.d.ts +311 -17
  73. package/dist/commands/commit-command.d.ts.map +1 -1
  74. package/dist/commands/core-config.d.ts +78 -1
  75. package/dist/commands/core-config.d.ts.map +1 -1
  76. package/dist/commands/date-format.d.ts +58 -0
  77. package/dist/commands/date-format.d.ts.map +1 -0
  78. package/dist/commands/default-branch.d.ts +70 -0
  79. package/dist/commands/default-branch.d.ts.map +1 -0
  80. package/dist/commands/describe-command.d.ts.map +1 -1
  81. package/dist/commands/diff-command.d.ts +377 -30
  82. package/dist/commands/diff-command.d.ts.map +1 -1
  83. package/dist/commands/diff-textconv.d.ts +40 -0
  84. package/dist/commands/diff-textconv.d.ts.map +1 -0
  85. package/dist/commands/fetch-command.d.ts +149 -10
  86. package/dist/commands/fetch-command.d.ts.map +1 -1
  87. package/dist/commands/format-patch-command.d.ts +164 -0
  88. package/dist/commands/format-patch-command.d.ts.map +1 -0
  89. package/dist/commands/fsck/fetch-fsck.d.ts +60 -0
  90. package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -0
  91. package/dist/commands/fsck/fsck-command.d.ts +227 -0
  92. package/dist/commands/fsck/fsck-command.d.ts.map +1 -0
  93. package/dist/commands/fsck/fsck-loose.d.ts +71 -0
  94. package/dist/commands/fsck/fsck-loose.d.ts.map +1 -0
  95. package/dist/commands/fsck/fsck-msg-ids.d.ts +122 -0
  96. package/dist/commands/fsck/fsck-msg-ids.d.ts.map +1 -0
  97. package/dist/commands/fsck/fsck-object-checks.d.ts +159 -0
  98. package/dist/commands/fsck/fsck-object-checks.d.ts.map +1 -0
  99. package/dist/commands/fsck/fsck-object-table.d.ts +140 -0
  100. package/dist/commands/fsck/fsck-object-table.d.ts.map +1 -0
  101. package/dist/commands/fsck/fsck-pack.d.ts +122 -0
  102. package/dist/commands/fsck/fsck-pack.d.ts.map +1 -0
  103. package/dist/commands/fsck/index.d.ts +6 -0
  104. package/dist/commands/fsck/index.d.ts.map +1 -0
  105. package/dist/commands/fsck/verify-pack-command.d.ts +81 -0
  106. package/dist/commands/fsck/verify-pack-command.d.ts.map +1 -0
  107. package/dist/commands/gc-command.d.ts +106 -39
  108. package/dist/commands/gc-command.d.ts.map +1 -1
  109. package/dist/commands/git-date.d.ts +2 -0
  110. package/dist/commands/git-date.d.ts.map +1 -0
  111. package/dist/commands/git-describe.d.ts +67 -0
  112. package/dist/commands/git-describe.d.ts.map +1 -0
  113. package/dist/commands/git-hooks.d.ts +424 -0
  114. package/dist/commands/git-hooks.d.ts.map +1 -0
  115. package/dist/commands/git-ident.d.ts +128 -0
  116. package/dist/commands/git-ident.d.ts.map +1 -0
  117. package/dist/commands/hook-command.d.ts +96 -0
  118. package/dist/commands/hook-command.d.ts.map +1 -0
  119. package/dist/commands/index-adder.d.ts +233 -0
  120. package/dist/commands/index-adder.d.ts.map +1 -0
  121. package/dist/commands/index-host.d.ts +86 -0
  122. package/dist/commands/index-host.d.ts.map +1 -0
  123. package/dist/commands/index.d.ts +56 -0
  124. package/dist/commands/index.d.ts.map +1 -1
  125. package/dist/commands/index.js +3 -2
  126. package/dist/commands/init-command.d.ts +62 -4
  127. package/dist/commands/init-command.d.ts.map +1 -1
  128. package/dist/commands/legacy-remotes.d.ts +55 -0
  129. package/dist/commands/legacy-remotes.d.ts.map +1 -0
  130. package/dist/commands/local-clone.d.ts +60 -0
  131. package/dist/commands/local-clone.d.ts.map +1 -0
  132. package/dist/commands/local-transport.d.ts +117 -0
  133. package/dist/commands/local-transport.d.ts.map +1 -0
  134. package/dist/commands/log-command.d.ts +216 -24
  135. package/dist/commands/log-command.d.ts.map +1 -1
  136. package/dist/commands/log-graph.d.ts +120 -0
  137. package/dist/commands/log-graph.d.ts.map +1 -0
  138. package/dist/commands/log-output.d.ts +323 -0
  139. package/dist/commands/log-output.d.ts.map +1 -0
  140. package/dist/commands/ls-remote-command.d.ts +23 -7
  141. package/dist/commands/ls-remote-command.d.ts.map +1 -1
  142. package/dist/commands/mailmap.d.ts +31 -0
  143. package/dist/commands/mailmap.d.ts.map +1 -0
  144. package/dist/commands/merge-bases.d.ts +85 -0
  145. package/dist/commands/merge-bases.d.ts.map +1 -0
  146. package/dist/commands/merge-command.d.ts +221 -74
  147. package/dist/commands/merge-command.d.ts.map +1 -1
  148. package/dist/commands/merge-config.d.ts +13 -0
  149. package/dist/commands/merge-config.d.ts.map +1 -0
  150. package/dist/commands/merge-drivers.d.ts +130 -0
  151. package/dist/commands/merge-drivers.d.ts.map +1 -0
  152. package/dist/commands/merge-support.d.ts +260 -0
  153. package/dist/commands/merge-support.d.ts.map +1 -0
  154. package/dist/commands/message-cleanup.d.ts +86 -0
  155. package/dist/commands/message-cleanup.d.ts.map +1 -0
  156. package/dist/commands/mv-command.d.ts +94 -0
  157. package/dist/commands/mv-command.d.ts.map +1 -0
  158. package/dist/commands/notes-command.d.ts +256 -0
  159. package/dist/commands/notes-command.d.ts.map +1 -0
  160. package/dist/commands/notes-commands.d.ts +41 -0
  161. package/dist/commands/notes-commands.d.ts.map +1 -0
  162. package/dist/commands/notes-merge-command.d.ts +105 -0
  163. package/dist/commands/notes-merge-command.d.ts.map +1 -0
  164. package/dist/commands/notes-support.d.ts +125 -0
  165. package/dist/commands/notes-support.d.ts.map +1 -0
  166. package/dist/commands/notes-tree.d.ts +116 -0
  167. package/dist/commands/notes-tree.d.ts.map +1 -0
  168. package/dist/commands/object-id-input.d.ts +20 -0
  169. package/dist/commands/object-id-input.d.ts.map +1 -0
  170. package/dist/commands/octopus-merge.d.ts +59 -0
  171. package/dist/commands/octopus-merge.d.ts.map +1 -0
  172. package/dist/commands/ort-merge.d.ts +126 -0
  173. package/dist/commands/ort-merge.d.ts.map +1 -0
  174. package/dist/commands/ort-recursive.d.ts +53 -0
  175. package/dist/commands/ort-recursive.d.ts.map +1 -0
  176. package/dist/commands/pack-refs-command.d.ts +20 -0
  177. package/dist/commands/pack-refs-command.d.ts.map +1 -1
  178. package/dist/commands/patch-id.d.ts +44 -0
  179. package/dist/commands/patch-id.d.ts.map +1 -0
  180. package/dist/commands/pathspec-attributes.d.ts +64 -0
  181. package/dist/commands/pathspec-attributes.d.ts.map +1 -0
  182. package/dist/commands/pathspec.d.ts +324 -0
  183. package/dist/commands/pathspec.d.ts.map +1 -0
  184. package/dist/commands/post-index-change.d.ts +33 -0
  185. package/dist/commands/post-index-change.d.ts.map +1 -0
  186. package/dist/commands/pretty-format.d.ts +222 -0
  187. package/dist/commands/pretty-format.d.ts.map +1 -0
  188. package/dist/commands/promisor-remote.d.ts +80 -0
  189. package/dist/commands/promisor-remote.d.ts.map +1 -0
  190. package/dist/commands/pull-command.d.ts +59 -8
  191. package/dist/commands/pull-command.d.ts.map +1 -1
  192. package/dist/commands/push-command.d.ts +24 -8
  193. package/dist/commands/push-command.d.ts.map +1 -1
  194. package/dist/commands/read-tree-command.d.ts +112 -0
  195. package/dist/commands/read-tree-command.d.ts.map +1 -0
  196. package/dist/commands/rebase-command.d.ts +507 -75
  197. package/dist/commands/rebase-command.d.ts.map +1 -1
  198. package/dist/commands/rebase-todo.d.ts +130 -0
  199. package/dist/commands/rebase-todo.d.ts.map +1 -0
  200. package/dist/commands/ref-decoration-filter.d.ts +53 -0
  201. package/dist/commands/ref-decoration-filter.d.ts.map +1 -0
  202. package/dist/commands/reflog-messages.d.ts +98 -0
  203. package/dist/commands/reflog-messages.d.ts.map +1 -0
  204. package/dist/commands/remote-command.d.ts +31 -0
  205. package/dist/commands/remote-command.d.ts.map +1 -1
  206. package/dist/commands/remote-transport.d.ts +120 -0
  207. package/dist/commands/remote-transport.d.ts.map +1 -0
  208. package/dist/commands/reset-command.d.ts +161 -7
  209. package/dist/commands/reset-command.d.ts.map +1 -1
  210. package/dist/commands/restore-command.d.ts +103 -0
  211. package/dist/commands/restore-command.d.ts.map +1 -0
  212. package/dist/commands/rev-list-command.d.ts +78 -0
  213. package/dist/commands/rev-list-command.d.ts.map +1 -0
  214. package/dist/commands/rev-parse-command.d.ts +89 -0
  215. package/dist/commands/rev-parse-command.d.ts.map +1 -0
  216. package/dist/commands/revert-command.d.ts +46 -38
  217. package/dist/commands/revert-command.d.ts.map +1 -1
  218. package/dist/commands/revision-filenames.d.ts +95 -0
  219. package/dist/commands/revision-filenames.d.ts.map +1 -0
  220. package/dist/commands/revision-range.d.ts +67 -0
  221. package/dist/commands/revision-range.d.ts.map +1 -0
  222. package/dist/commands/revision-resolver.d.ts +325 -0
  223. package/dist/commands/revision-resolver.d.ts.map +1 -0
  224. package/dist/commands/rm-command.d.ts +69 -7
  225. package/dist/commands/rm-command.d.ts.map +1 -1
  226. package/dist/commands/sequencer-pick.d.ts +191 -0
  227. package/dist/commands/sequencer-pick.d.ts.map +1 -0
  228. package/dist/commands/sequencer-support.d.ts +125 -0
  229. package/dist/commands/sequencer-support.d.ts.map +1 -0
  230. package/dist/commands/serve-repository.d.ts +52 -0
  231. package/dist/commands/serve-repository.d.ts.map +1 -0
  232. package/dist/commands/sparse-checkout-command.d.ts +190 -0
  233. package/dist/commands/sparse-checkout-command.d.ts.map +1 -0
  234. package/dist/commands/sparse-checkout-support.d.ts +268 -0
  235. package/dist/commands/sparse-checkout-support.d.ts.map +1 -0
  236. package/dist/commands/stash-apply-command.d.ts +42 -8
  237. package/dist/commands/stash-apply-command.d.ts.map +1 -1
  238. package/dist/commands/stash-create-command.d.ts +156 -2
  239. package/dist/commands/stash-create-command.d.ts.map +1 -1
  240. package/dist/commands/stash-drop-command.d.ts +2 -0
  241. package/dist/commands/stash-drop-command.d.ts.map +1 -1
  242. package/dist/commands/stash-working-tree.d.ts +23 -0
  243. package/dist/commands/stash-working-tree.d.ts.map +1 -1
  244. package/dist/commands/status-command.d.ts +300 -15
  245. package/dist/commands/status-command.d.ts.map +1 -1
  246. package/dist/commands/status-format.d.ts +155 -0
  247. package/dist/commands/status-format.d.ts.map +1 -0
  248. package/dist/commands/status-header.d.ts +64 -0
  249. package/dist/commands/status-header.d.ts.map +1 -0
  250. package/dist/commands/strerror.d.ts +7 -0
  251. package/dist/commands/strerror.d.ts.map +1 -0
  252. package/dist/commands/submodule-config.d.ts +38 -0
  253. package/dist/commands/submodule-config.d.ts.map +1 -0
  254. package/dist/commands/submodule-summary-command.d.ts +80 -0
  255. package/dist/commands/submodule-summary-command.d.ts.map +1 -0
  256. package/dist/commands/submodule-summary.d.ts +150 -0
  257. package/dist/commands/submodule-summary.d.ts.map +1 -0
  258. package/dist/commands/switch-command.d.ts +132 -0
  259. package/dist/commands/switch-command.d.ts.map +1 -0
  260. package/dist/commands/tag-command.d.ts +23 -2
  261. package/dist/commands/tag-command.d.ts.map +1 -1
  262. package/dist/commands/tracking-info.d.ts +64 -0
  263. package/dist/commands/tracking-info.d.ts.map +1 -0
  264. package/dist/commands/trailers.d.ts +73 -0
  265. package/dist/commands/trailers.d.ts.map +1 -0
  266. package/dist/commands/tree-restore.d.ts +85 -1
  267. package/dist/commands/tree-restore.d.ts.map +1 -1
  268. package/dist/commands/untracked-cache-support.d.ts +54 -0
  269. package/dist/commands/untracked-cache-support.d.ts.map +1 -0
  270. package/dist/commands/worktree-add-command.d.ts +108 -0
  271. package/dist/commands/worktree-add-command.d.ts.map +1 -0
  272. package/dist/commands/worktree-list-command.d.ts +69 -0
  273. package/dist/commands/worktree-list-command.d.ts.map +1 -0
  274. package/dist/commands/worktree-lock-command.d.ts +44 -0
  275. package/dist/commands/worktree-lock-command.d.ts.map +1 -0
  276. package/dist/commands/worktree-overwrite-checks.d.ts +146 -6
  277. package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
  278. package/dist/commands/worktree-prune-command.d.ts +48 -0
  279. package/dist/commands/worktree-prune-command.d.ts.map +1 -0
  280. package/dist/commands/worktree-remove-command.d.ts +59 -0
  281. package/dist/commands/worktree-remove-command.d.ts.map +1 -0
  282. package/dist/commands/worktree-repair-command.d.ts +35 -0
  283. package/dist/commands/worktree-repair-command.d.ts.map +1 -0
  284. package/dist/commands/worktree-support.d.ts +64 -0
  285. package/dist/commands/worktree-support.d.ts.map +1 -0
  286. package/dist/commands-DIJ91NnD.js +62225 -0
  287. package/dist/core-commands/add.command.impl.d.ts.map +1 -1
  288. package/dist/errors/add-errors.d.ts +55 -0
  289. package/dist/errors/add-errors.d.ts.map +1 -1
  290. package/dist/errors/checkout-errors.d.ts +16 -0
  291. package/dist/errors/checkout-errors.d.ts.map +1 -1
  292. package/dist/errors/command-errors.d.ts +77 -0
  293. package/dist/errors/command-errors.d.ts.map +1 -1
  294. package/dist/errors/commit-errors.d.ts +9 -0
  295. package/dist/errors/commit-errors.d.ts.map +1 -1
  296. package/dist/errors/git-api-error.d.ts +59 -2
  297. package/dist/errors/git-api-error.d.ts.map +1 -1
  298. package/dist/errors/index.d.ts +1 -0
  299. package/dist/errors/index.d.ts.map +1 -1
  300. package/dist/errors/index.js +354 -19
  301. package/dist/errors/rebase-errors.d.ts +9 -0
  302. package/dist/errors/rebase-errors.d.ts.map +1 -1
  303. package/dist/errors/ref-errors.d.ts +32 -0
  304. package/dist/errors/ref-errors.d.ts.map +1 -1
  305. package/dist/errors/transport-errors.d.ts +12 -2
  306. package/dist/errors/transport-errors.d.ts.map +1 -1
  307. package/dist/errors/worktree-errors.d.ts +35 -0
  308. package/dist/errors/worktree-errors.d.ts.map +1 -0
  309. package/dist/git-command-BGiOJ8Zk.js +7246 -0
  310. package/dist/git-command.d.ts +428 -32
  311. package/dist/git-command.d.ts.map +1 -1
  312. package/dist/git.d.ts +315 -5
  313. package/dist/git.d.ts.map +1 -1
  314. package/dist/index.d.ts +1 -1
  315. package/dist/index.d.ts.map +1 -1
  316. package/dist/index.js +5 -5
  317. package/dist/remote-config/index.d.ts +1 -1
  318. package/dist/remote-config/index.d.ts.map +1 -1
  319. package/dist/remote-config/remote-config-store.d.ts +167 -6
  320. package/dist/remote-config/remote-config-store.d.ts.map +1 -1
  321. package/dist/remote-config/remote-refs.d.ts +7 -3
  322. package/dist/remote-config/remote-refs.d.ts.map +1 -1
  323. package/dist/rename/detect-renames.d.ts +148 -0
  324. package/dist/rename/detect-renames.d.ts.map +1 -0
  325. package/dist/rename/git-similarity.d.ts +44 -0
  326. package/dist/rename/git-similarity.d.ts.map +1 -0
  327. package/dist/rename/index.d.ts +2 -0
  328. package/dist/rename/index.d.ts.map +1 -1
  329. package/dist/results/binary-patch.d.ts +11 -0
  330. package/dist/results/binary-patch.d.ts.map +1 -0
  331. package/dist/results/blame-format.d.ts +55 -0
  332. package/dist/results/blame-format.d.ts.map +1 -0
  333. package/dist/results/cherry-pick-result.d.ts +10 -0
  334. package/dist/results/cherry-pick-result.d.ts.map +1 -1
  335. package/dist/results/clone-result.d.ts +18 -0
  336. package/dist/results/clone-result.d.ts.map +1 -1
  337. package/dist/results/combined-diff.d.ts +77 -0
  338. package/dist/results/combined-diff.d.ts.map +1 -0
  339. package/dist/results/diff-entry.d.ts +32 -0
  340. package/dist/results/diff-entry.d.ts.map +1 -1
  341. package/dist/results/diff-formatter.d.ts +34 -60
  342. package/dist/results/diff-formatter.d.ts.map +1 -1
  343. package/dist/results/diff-order.d.ts +25 -0
  344. package/dist/results/diff-order.d.ts.map +1 -0
  345. package/dist/results/diff-output.d.ts +249 -0
  346. package/dist/results/diff-output.d.ts.map +1 -0
  347. package/dist/results/fetch-result.d.ts +15 -0
  348. package/dist/results/fetch-result.d.ts.map +1 -1
  349. package/dist/results/index.d.ts +5 -0
  350. package/dist/results/index.d.ts.map +1 -1
  351. package/dist/results/index.js +2 -252
  352. package/dist/results/init-result.d.ts +7 -0
  353. package/dist/results/init-result.d.ts.map +1 -1
  354. package/dist/results/merge-result.d.ts +15 -1
  355. package/dist/results/merge-result.d.ts.map +1 -1
  356. package/dist/results/pull-result.d.ts +17 -3
  357. package/dist/results/pull-result.d.ts.map +1 -1
  358. package/dist/results/push-result.d.ts +47 -0
  359. package/dist/results/push-result.d.ts.map +1 -1
  360. package/dist/results/quote-path.d.ts +27 -0
  361. package/dist/results/quote-path.d.ts.map +1 -0
  362. package/dist/results/rebase-result.d.ts +28 -1
  363. package/dist/results/rebase-result.d.ts.map +1 -1
  364. package/dist/results/revert-result.d.ts +10 -0
  365. package/dist/results/revert-result.d.ts.map +1 -1
  366. package/dist/results/stash-result.d.ts +5 -0
  367. package/dist/results/stash-result.d.ts.map +1 -1
  368. package/dist/results/status-result.d.ts +60 -6
  369. package/dist/results/status-result.d.ts.map +1 -1
  370. package/dist/results-WVlBhVb1.js +2935 -0
  371. package/dist/transport-command.d.ts +44 -1
  372. package/dist/transport-command.d.ts.map +1 -1
  373. package/package.json +15 -11
  374. package/src/commands/add-command.ts +1291 -226
  375. package/src/commands/add-patch/add-interactive.ts +941 -0
  376. package/src/commands/add-patch/add-patch.ts +1169 -0
  377. package/src/commands/add-patch/index.ts +5 -0
  378. package/src/commands/add-patch/patch-backend.ts +239 -0
  379. package/src/commands/add-patch/patch-modes.ts +249 -0
  380. package/src/commands/add-patch/patch-session.ts +159 -0
  381. package/src/commands/am/am-command.ts +1111 -0
  382. package/src/commands/am/index.ts +2 -0
  383. package/src/commands/am/mailinfo.ts +1015 -0
  384. package/src/commands/am/patch-format.ts +121 -0
  385. package/src/commands/apply/apply-command.ts +842 -0
  386. package/src/commands/apply/apply-engine.ts +1602 -0
  387. package/src/commands/apply/apply-parse.ts +1210 -0
  388. package/src/commands/apply/apply-types.ts +112 -0
  389. package/src/commands/apply/index.ts +5 -0
  390. package/src/commands/apply/latin1.ts +171 -0
  391. package/src/commands/apply/whitespace.ts +260 -0
  392. package/src/commands/attributes-source.ts +96 -0
  393. package/src/commands/backfill-command.ts +694 -0
  394. package/src/commands/bisect/bisect-checkout.ts +217 -0
  395. package/src/commands/bisect/bisect-command.ts +788 -0
  396. package/src/commands/bisect/bisect-engine.ts +1080 -0
  397. package/src/commands/bisect/bisect-graph.ts +595 -0
  398. package/src/commands/bisect/bisect-quote.ts +92 -0
  399. package/src/commands/bisect/index.ts +4 -0
  400. package/src/commands/blame-command.ts +711 -986
  401. package/src/commands/branch-command.ts +354 -32
  402. package/src/commands/branch-tracking.ts +331 -0
  403. package/src/commands/checkout-command.ts +1290 -243
  404. package/src/commands/checkout-paths.ts +784 -0
  405. package/src/commands/cherry-pick-command.ts +156 -396
  406. package/src/commands/clean-command.ts +504 -156
  407. package/src/commands/clone-command.ts +748 -69
  408. package/src/commands/comment-char-config.ts +160 -0
  409. package/src/commands/commit-command.ts +1782 -166
  410. package/src/commands/core-config.ts +166 -6
  411. package/src/commands/date-format.ts +668 -0
  412. package/src/commands/default-branch.ts +196 -0
  413. package/src/commands/describe-command.ts +2 -0
  414. package/src/commands/diff-command.ts +1916 -110
  415. package/src/commands/diff-textconv.ts +50 -0
  416. package/src/commands/fetch-command.ts +622 -68
  417. package/src/commands/format-patch-command.ts +974 -0
  418. package/src/commands/fsck/fetch-fsck.ts +229 -0
  419. package/src/commands/fsck/fsck-command.ts +3464 -0
  420. package/src/commands/fsck/fsck-loose.ts +297 -0
  421. package/src/commands/fsck/fsck-msg-ids.ts +176 -0
  422. package/src/commands/fsck/fsck-object-checks.ts +1085 -0
  423. package/src/commands/fsck/fsck-object-table.ts +373 -0
  424. package/src/commands/fsck/fsck-pack.ts +634 -0
  425. package/src/commands/fsck/index.ts +5 -0
  426. package/src/commands/fsck/verify-pack-command.ts +252 -0
  427. package/src/commands/gc-command.ts +324 -77
  428. package/src/commands/git-date.ts +9 -0
  429. package/src/commands/git-describe.ts +316 -0
  430. package/src/commands/git-hooks.ts +1483 -0
  431. package/src/commands/git-ident.ts +344 -0
  432. package/src/commands/hook-command.ts +247 -0
  433. package/src/commands/index-adder.ts +711 -0
  434. package/src/commands/index-host.ts +291 -0
  435. package/src/commands/index.ts +84 -0
  436. package/src/commands/init-command.ts +194 -14
  437. package/src/commands/legacy-remotes.ts +224 -0
  438. package/src/commands/local-clone.ts +183 -0
  439. package/src/commands/local-transport.ts +762 -0
  440. package/src/commands/log-command.ts +1930 -170
  441. package/src/commands/log-graph.ts +671 -0
  442. package/src/commands/log-output.ts +1359 -0
  443. package/src/commands/ls-remote-command.ts +105 -58
  444. package/src/commands/mailmap.ts +129 -0
  445. package/src/commands/merge-bases.ts +296 -0
  446. package/src/commands/merge-command.ts +1416 -491
  447. package/src/commands/merge-config.ts +25 -0
  448. package/src/commands/merge-drivers.ts +306 -0
  449. package/src/commands/merge-support.ts +1219 -0
  450. package/src/commands/message-cleanup.ts +275 -0
  451. package/src/commands/mv-command.ts +976 -0
  452. package/src/commands/notes-command.ts +890 -0
  453. package/src/commands/notes-commands.ts +87 -0
  454. package/src/commands/notes-merge-command.ts +777 -0
  455. package/src/commands/notes-support.ts +402 -0
  456. package/src/commands/notes-tree.ts +617 -0
  457. package/src/commands/object-id-input.ts +27 -0
  458. package/src/commands/octopus-merge.ts +378 -0
  459. package/src/commands/ort-merge.ts +1660 -0
  460. package/src/commands/ort-recursive.ts +160 -0
  461. package/src/commands/pack-refs-command.ts +39 -22
  462. package/src/commands/patch-id.ts +204 -0
  463. package/src/commands/pathspec-attributes.ts +162 -0
  464. package/src/commands/pathspec.ts +1199 -0
  465. package/src/commands/post-index-change.ts +62 -0
  466. package/src/commands/pretty-format.ts +1432 -0
  467. package/src/commands/promisor-remote.ts +298 -0
  468. package/src/commands/pull-command.ts +326 -33
  469. package/src/commands/push-command.ts +257 -29
  470. package/src/commands/read-tree-command.ts +861 -0
  471. package/src/commands/rebase-command.ts +3820 -372
  472. package/src/commands/rebase-todo.ts +584 -0
  473. package/src/commands/ref-decoration-filter.ts +118 -0
  474. package/src/commands/reflog-messages.ts +177 -0
  475. package/src/commands/remote-command.ts +124 -23
  476. package/src/commands/remote-transport.ts +383 -0
  477. package/src/commands/reset-command.ts +821 -104
  478. package/src/commands/restore-command.ts +350 -0
  479. package/src/commands/rev-list-command.ts +167 -0
  480. package/src/commands/rev-parse-command.ts +299 -0
  481. package/src/commands/revert-command.ts +152 -399
  482. package/src/commands/revision-filenames.ts +254 -0
  483. package/src/commands/revision-range.ts +222 -0
  484. package/src/commands/revision-resolver.ts +1397 -0
  485. package/src/commands/rm-command.ts +613 -67
  486. package/src/commands/sequencer-pick.ts +874 -0
  487. package/src/commands/sequencer-support.ts +876 -0
  488. package/src/commands/serve-repository.ts +125 -0
  489. package/src/commands/sparse-checkout-command.ts +1389 -0
  490. package/src/commands/sparse-checkout-support.ts +793 -0
  491. package/src/commands/stash-apply-command.ts +376 -343
  492. package/src/commands/stash-create-command.ts +625 -42
  493. package/src/commands/stash-drop-command.ts +15 -2
  494. package/src/commands/stash-working-tree.ts +168 -24
  495. package/src/commands/status-command.ts +1326 -105
  496. package/src/commands/status-format.ts +775 -0
  497. package/src/commands/status-header.ts +332 -0
  498. package/src/commands/strerror.ts +29 -0
  499. package/src/commands/submodule-config.ts +94 -0
  500. package/src/commands/submodule-summary-command.ts +333 -0
  501. package/src/commands/submodule-summary.ts +446 -0
  502. package/src/commands/switch-command.ts +402 -0
  503. package/src/commands/tag-command.ts +129 -41
  504. package/src/commands/tracking-info.ts +201 -0
  505. package/src/commands/trailers.ts +417 -0
  506. package/src/commands/tree-restore.ts +204 -4
  507. package/src/commands/untracked-cache-support.ts +198 -0
  508. package/src/commands/worktree-add-command.ts +458 -0
  509. package/src/commands/worktree-list-command.ts +206 -0
  510. package/src/commands/worktree-lock-command.ts +96 -0
  511. package/src/commands/worktree-overwrite-checks.ts +452 -26
  512. package/src/commands/worktree-prune-command.ts +99 -0
  513. package/src/commands/worktree-remove-command.ts +186 -0
  514. package/src/commands/worktree-repair-command.ts +59 -0
  515. package/src/commands/worktree-support.ts +214 -0
  516. package/src/core-commands/add.command.impl.ts +8 -2
  517. package/src/errors/add-errors.ts +45 -0
  518. package/src/errors/checkout-errors.ts +26 -2
  519. package/src/errors/command-errors.ts +101 -1
  520. package/src/errors/commit-errors.ts +18 -2
  521. package/src/errors/git-api-error.ts +82 -2
  522. package/src/errors/index.ts +1 -0
  523. package/src/errors/merge-errors.ts +2 -2
  524. package/src/errors/rebase-errors.ts +12 -0
  525. package/src/errors/ref-errors.ts +56 -2
  526. package/src/errors/remote-errors.ts +2 -2
  527. package/src/errors/stash-errors.ts +1 -1
  528. package/src/errors/transport-errors.ts +20 -4
  529. package/src/errors/worktree-errors.ts +49 -0
  530. package/src/git-command.ts +1207 -118
  531. package/src/git.ts +538 -12
  532. package/src/index.ts +1 -1
  533. package/src/remote-config/index.ts +2 -0
  534. package/src/remote-config/remote-config-store.ts +378 -18
  535. package/src/remote-config/remote-refs.ts +22 -6
  536. package/src/rename/detect-renames.ts +715 -0
  537. package/src/rename/git-similarity.ts +116 -0
  538. package/src/rename/index.ts +2 -0
  539. package/src/results/binary-patch.ts +401 -0
  540. package/src/results/blame-format.ts +239 -0
  541. package/src/results/cherry-pick-result.ts +10 -0
  542. package/src/results/clone-result.ts +21 -0
  543. package/src/results/combined-diff.ts +585 -0
  544. package/src/results/diff-entry.ts +35 -0
  545. package/src/results/diff-formatter.ts +152 -288
  546. package/src/results/diff-order.ts +64 -0
  547. package/src/results/diff-output.ts +1053 -0
  548. package/src/results/fetch-result.ts +15 -0
  549. package/src/results/index.ts +5 -0
  550. package/src/results/init-result.ts +9 -0
  551. package/src/results/merge-result.ts +15 -1
  552. package/src/results/pull-result.ts +17 -3
  553. package/src/results/push-result.ts +48 -0
  554. package/src/results/quote-path.ts +103 -0
  555. package/src/results/rebase-result.ts +37 -0
  556. package/src/results/revert-result.ts +10 -0
  557. package/src/results/stash-result.ts +6 -0
  558. package/src/results/status-result.ts +127 -46
  559. package/src/transport-command.ts +121 -2
  560. package/dist/commands-CsLNyvZ1.js +0 -12587
  561. package/dist/status-result-BpyUK1Sg.js +0 -519
@@ -0,0 +1,139 @@
1
+ /**
2
+ * git's interactive hunk selection (add-patch.c) as a library: the per-file diff is split
3
+ * into git's hunks, a selector callback answers each prompt as a user would answer git on
4
+ * standard input, and the selected hunks are reassembled into a patch and applied. What git
5
+ * prints (the file headers, hunks, prompts, help and errors) is gathered as text, so a
6
+ * terminal host can show it exactly as git does.
7
+ *
8
+ * The diff and the patch are "binary strings" (one byte per character); the texts given to
9
+ * the selector and gathered in the output are decoded as paths are (`decodeGitPath`).
10
+ */
11
+ import type { PatchApplyArgs, PatchMode, PatchPromptKind } from "./patch-modes.js";
12
+ /** The git version whose prompts and behaviour are reproduced. */
13
+ export type PatchCompatibility = "2.43" | "2.56";
14
+ /** One read git makes from standard input (or its editor) while selecting hunks. */
15
+ export type PatchRequest = {
16
+ /** The prompt after a hunk: answered with git's commands (`y`, `n`, `s`, `g3`, `/re`...) */
17
+ type: "hunk";
18
+ mode: PatchMode["name"];
19
+ /** The file's path (the diff's `a/` side) */
20
+ path: string;
21
+ kind: PatchPromptKind;
22
+ /** Index of the hunk in the file (0-based) */
23
+ hunkIndex: number;
24
+ hunkCount: number;
25
+ /** The hunk as git shows it (the header hunk of a file without hunks: empty) */
26
+ hunk: string;
27
+ /** The prompt as git prints it, e.g. `(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? ` */
28
+ prompt: string;
29
+ /** The commands the prompt offers, in its order (`y`, `n`, `q`, `a`, `d`, ..., `?`) */
30
+ choices: string[];
31
+ /** The earlier decision on this hunk (2.5x shows it as " (was: y)") */
32
+ decision?: "y" | "n";
33
+ /** What git would have printed so far */
34
+ output: string;
35
+ } | {
36
+ /** The edit of a hunk (`e`): the buffer git hands its editor; answer the edited buffer */
37
+ type: "edit";
38
+ mode: PatchMode["name"];
39
+ path: string;
40
+ text: string;
41
+ } | {
42
+ /** A yes/no question ("Your edited hunk does not apply. Edit again ...", "Apply them to the worktree anyway? ") */
43
+ type: "yesno";
44
+ prompt: string;
45
+ } | {
46
+ /** `g` without a number: "go to which hunk? " */
47
+ type: "goto";
48
+ prompt: string;
49
+ } | {
50
+ /** `/` without a pattern: "search for regex? " */
51
+ type: "search";
52
+ prompt: string;
53
+ } | {
54
+ /**
55
+ * `git add -i`'s menus (add-interactive.c's `list_and_choose`): the main loop's
56
+ * "What now> " (one item), or a selection of files ("Update>> ", "Revert>> ", "Add
57
+ * untracked>> ", "Patch update>> ", "Review diff>> "), answered with numbers, ranges
58
+ * (`1-3`, `3-`), unique prefixes, `*`, `-` to deselect, `?` for help, an empty line to
59
+ * finish
60
+ */
61
+ type: "choose";
62
+ /** The prompt as git prints it (`What now> `, `Update>> `) */
63
+ prompt: string;
64
+ /** One item is chosen (the main menu), not several */
65
+ singleton: boolean;
66
+ /** The items listed, in their order (numbered from 1) */
67
+ items: string[];
68
+ /** What `git add -i` would have printed so far */
69
+ output: string;
70
+ };
71
+ /**
72
+ * Answers git's reads: the line typed (without its line end), or undefined for the end of
73
+ * input (EOF; for `edit`: the editor failed). An `edit` request is answered with the whole
74
+ * edited buffer.
75
+ */
76
+ export type PatchSelector = (request: PatchRequest) => string | undefined | Promise<string | undefined>;
77
+ /** What a patch selection printed and did. */
78
+ export interface PatchResult {
79
+ /** Standard output, as git prints it: headers, hunks, prompts, help and messages */
80
+ output: string;
81
+ /** Standard error: git apply's errors and add-patch's `error:` lines (2.43's messages too) */
82
+ errors: string;
83
+ /** Paths whose selected hunks were applied */
84
+ applied: string[];
85
+ /** Whether the selection ended with `q` (or the end of input) */
86
+ quit: boolean;
87
+ }
88
+ /** How the engine reaches the repository. */
89
+ export interface PatchBackend {
90
+ /** The diff to select from (`diff-files -p`, `diff-index -p ...`), as a binary string */
91
+ diff(): Promise<string>;
92
+ /**
93
+ * Runs `git apply` with the patch (a binary string); true when it applied (or, with
94
+ * `check`, would apply). Its standard error goes to `errors`.
95
+ */
96
+ apply(patch: string, args: PatchApplyArgs & {
97
+ check?: boolean;
98
+ }): Promise<{
99
+ ok: boolean;
100
+ errors: string;
101
+ }>;
102
+ /**
103
+ * `repo_refresh_and_write_index` of the index the selection works on: refreshed and
104
+ * written, what it prints on standard output (`<path>: needs merge`) handed back. None for
105
+ * an index whose refresh shows nothing (`stash -p`'s temporary one).
106
+ */
107
+ refresh?(): Promise<string>;
108
+ }
109
+ /** Options of {@link runAddPatch}. */
110
+ export interface AddPatchOptions {
111
+ mode: PatchMode;
112
+ backend: PatchBackend;
113
+ selector: PatchSelector;
114
+ /** Default 2.56 */
115
+ compatibility?: PatchCompatibility;
116
+ /** `--no-auto-advance` (2.5x): stay in a file until `q`, apply after the last file */
117
+ autoAdvance?: boolean;
118
+ /** `core.commentChar` / `core.commentString` (default `#`) */
119
+ commentString?: string;
120
+ /** `add -p` run from a command that disallows `e` (ADD_P_DISALLOW_EDIT) */
121
+ disallowEdit?: boolean;
122
+ }
123
+ /**
124
+ * Runs git's interactive hunk selection: the backend's diff is split into hunks, each
125
+ * prompt goes to the selector, and the selected hunks are applied through the backend.
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * const answers = ["y", "n", "s", "y", "q"];
130
+ * const result = await runAddPatch({
131
+ * mode: PATCH_MODES.stage,
132
+ * backend,
133
+ * selector: () => answers.shift(),
134
+ * });
135
+ * process.stdout.write(result.output);
136
+ * ```
137
+ */
138
+ export declare function runAddPatch(options: AddPatchOptions): Promise<PatchResult>;
139
+ //# sourceMappingURL=add-patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-patch.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/add-patch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnF,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjD,oFAAoF;AACpF,MAAM,MAAM,YAAY,GACpB;IACE,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,8CAA8C;IAC9C,SAAS,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ACf,8CAA8C;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iEAAiE;IACjE,IAAI,EAAE,OAAO,CAAC;CACf;AAED,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IAC3B,yFAAyF;IACzF,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB;;;OAGG;IACH,KAAK,CACH,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GACzC,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C;;;;OAIG;IACH,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,sCAAsC;AACtC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,aAAa,CAAC;IACxB,mBAAmB;IACnB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,sFAAsF;IACtF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAq/BD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAEhF"}
@@ -0,0 +1,6 @@
1
+ export * from "./add-interactive.js";
2
+ export * from "./add-patch.js";
3
+ export * from "./patch-backend.js";
4
+ export * from "./patch-modes.js";
5
+ export * from "./patch-session.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * The repository side of a patch selection: the diff add-patch.c asks git for (`diff-files
3
+ * -p`, `diff-index -p [--cached] [-R] <rev>`, with its options) and the `git apply` runs
4
+ * that apply the selected hunks, both in-process through `DiffCommand` and `ApplyCommand`.
5
+ */
6
+ import type { XdiffAlgorithm } from "@statewalker/vcs-utils";
7
+ import { type StagingEntry } from "@statewalker/vcs-working-tree";
8
+ import { GitCommand } from "../../git-command.js";
9
+ import type { WorkingCopy } from "../../types.js";
10
+ import type { PatchBackend } from "./add-patch.js";
11
+ import type { PatchMode } from "./patch-modes.js";
12
+ /** An entry of a {@link TemporaryIndex}. */
13
+ export interface TemporaryIndexEntry {
14
+ mode: number;
15
+ objectId: string;
16
+ /**
17
+ * What the entry took over from the repository's index besides its id: its stat data and
18
+ * flags (skip-worktree, assume-unchanged), kept while the entry holds the same id and mode
19
+ */
20
+ carried?: Omit<StagingEntry, "path" | "mode" | "objectId" | "stage">;
21
+ }
22
+ /** An index held in memory (`GIT_INDEX_FILE` pointing at a temporary index). */
23
+ export type TemporaryIndex = Map<string, TemporaryIndexEntry>;
24
+ /** Options of {@link createPatchBackend}. */
25
+ export interface PatchBackendOptions {
26
+ workingCopy: WorkingCopy;
27
+ mode: PatchMode;
28
+ /** The revision the diff compares with (`diff-index <rev>`); the empty tree for none */
29
+ revision?: string;
30
+ /** The pathspec elements */
31
+ paths?: string[];
32
+ /** `-U<n>` / `diff.context` (add-patch passes it on) */
33
+ context?: number;
34
+ /** `--inter-hunk-context` / `diff.interHunkContext` */
35
+ interHunkContext?: number;
36
+ /** `diff.algorithm` (add-patch passes it on as `--diff-algorithm`) */
37
+ algorithm?: XdiffAlgorithm;
38
+ /**
39
+ * `stash -p`'s temporary index (HEAD's tree): the diff shows only its paths, and the
40
+ * selected hunks are applied to it (`apply --cached` with `GIT_INDEX_FILE`)
41
+ */
42
+ temporaryIndex?: TemporaryIndex;
43
+ /**
44
+ * The command running the selection: the index refresh and `git apply` run their hooks
45
+ * (post-index-change) in its hook session, so its `getHookOutput()` gathers their output
46
+ */
47
+ hookSource?: GitCommand<unknown>;
48
+ }
49
+ /**
50
+ * The backend add-patch.c's child processes are: the diff as git prints it for patch mode
51
+ * (`--no-color --ignore-submodules=dirty -p`, no renames, plumbing's prefixes and no
52
+ * textconv), and `git apply` with the mode's arguments.
53
+ */
54
+ export declare function createPatchBackend(options: PatchBackendOptions): PatchBackend;
55
+ /**
56
+ * `repo_refresh_and_write_index(r, REFRESH_QUIET, ...)` as add-patch.c runs it: the stage-0
57
+ * entries whose files still hold their content take the files' stat, the index is written
58
+ * (racily clean entries smudged), and each unmerged path is reported as `<path>: needs
59
+ * merge` on standard output, which is what the call returns.
60
+ *
61
+ * @internal
62
+ */
63
+ export declare class IndexRefresh extends GitCommand<string> {
64
+ private gentle;
65
+ /**
66
+ * git's `gentle`: an index lock another process holds is no failure (the index refreshed
67
+ * in memory, nothing written, no message)
68
+ */
69
+ setGentle(gentle?: boolean): this;
70
+ call(): Promise<string>;
71
+ /**
72
+ * The refresh, telling whether `refresh_index` found errors (an unmerged entry remains:
73
+ * `has_errors`, which makes `repo_refresh_and_write_index` return 1).
74
+ */
75
+ refresh(): Promise<{
76
+ output: string;
77
+ hasErrors: boolean;
78
+ }>;
79
+ }
80
+ //# sourceMappingURL=patch-backend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-backend.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/patch-backend.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAIL,KAAK,YAAY,EAGlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,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AAM,CAAC,CAE5B;IAED;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAqD/D;CACF"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * The patch modes of git's interactive hunk selection (add-patch.c's `patch_mode_*`
3
+ * tables): which diff each mode shows, how the selected hunks are applied, and the texts
4
+ * git prints for them.
5
+ */
6
+ /** The patch mode git picks for a command (add-patch.c's `patch_mode_*`). */
7
+ export type PatchModeName =
8
+ /** `add -p` */
9
+ "stage"
10
+ /** `stash push -p` */
11
+ | "stash"
12
+ /** `reset -p [HEAD]`, `restore -p --staged` */
13
+ | "reset_head"
14
+ /** `reset -p <tree-ish>`, `restore -p --staged --source=<tree-ish>` */
15
+ | "reset_nothead"
16
+ /** `checkout -p`, `restore -p` (from the index) */
17
+ | "checkout_index"
18
+ /** `checkout -p HEAD`, `restore -p --staged --worktree` */
19
+ | "checkout_head"
20
+ /** `checkout -p <tree-ish>`, `restore -p -SW --source=<tree-ish>` */
21
+ | "checkout_nothead"
22
+ /** `restore -p --source=HEAD` */
23
+ | "worktree_head"
24
+ /** `restore -p --source=<tree-ish>` */
25
+ | "worktree_nothead";
26
+ /** The diff a mode shows (add-patch.c's `diff_cmd`). */
27
+ export type PatchDiffKind =
28
+ /** `diff-files`: the index against the worktree */
29
+ "files"
30
+ /** `diff-index <rev>`: the revision against the worktree */
31
+ | "index"
32
+ /** `diff-index --cached <rev>`: the revision against the index */
33
+ | "index-cached";
34
+ /** How `git apply` is run (`--cached`, `-R`). */
35
+ export interface PatchApplyArgs {
36
+ cached: boolean;
37
+ reverse: boolean;
38
+ }
39
+ /** A patch mode: its diff, how it applies, and its texts. */
40
+ export interface PatchMode {
41
+ readonly name: PatchModeName;
42
+ readonly diff: PatchDiffKind;
43
+ /** `-R` given to the diff */
44
+ readonly diffReverse: boolean;
45
+ /** `apply_args`; undefined for the checkout modes (`apply_for_checkout`) */
46
+ readonly applyArgs?: PatchApplyArgs;
47
+ /** `apply_check_args` */
48
+ readonly applyCheckArgs: PatchApplyArgs;
49
+ readonly isReverse: boolean;
50
+ readonly indexOnly: boolean;
51
+ readonly applyForCheckout: boolean;
52
+ /**
53
+ * The prompts (mode change, deletion, addition, hunk), with git's `%s` placeholders: 2.5x
54
+ * takes the earlier decision (" (was: y)") and then the choices, 2.43 only the choices
55
+ */
56
+ readonly promptMode: readonly [string, string, string, string];
57
+ readonly editHunkHint: string;
58
+ readonly helpPatchText: string;
59
+ }
60
+ /** The kind of a prompt (add-patch.c's `prompt_mode_type`). */
61
+ export type PatchPromptKind = "mode-change" | "deletion" | "addition" | "hunk";
62
+ /** The index of a prompt kind in {@link PatchMode.promptMode}. */
63
+ export declare function promptIndex(kind: PatchPromptKind): number;
64
+ /** add-patch.c's patch modes, by name. */
65
+ export declare const PATCH_MODES: Readonly<Record<PatchModeName, PatchMode>>;
66
+ /**
67
+ * The mode `run_add_p` picks: `stage` for add, `stash` for stash, and for reset, checkout
68
+ * and restore by the revision (none: from the index; `HEAD`; another one).
69
+ */
70
+ export declare function patchModeFor(command: "add" | "stash" | "reset" | "checkout" | "worktree", revision?: string): PatchMode;
71
+ //# sourceMappingURL=patch-modes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-modes.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/patch-modes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6EAA6E;AAC7E,MAAM,MAAM,aAAa;AACvB,eAAe;AACb,OAAO;AACT,sBAAsB;GACpB,OAAO;AACT,+CAA+C;GAC7C,YAAY;AACd,uEAAuE;GACrE,eAAe;AACjB,mDAAmD;GACjD,gBAAgB;AAClB,2DAA2D;GACzD,eAAe;AACjB,qEAAqE;GACnE,kBAAkB;AACpB,iCAAiC;GAC/B,eAAe;AACjB,uCAAuC;GACrC,kBAAkB,CAAC;AAEvB,wDAAwD;AACxD,MAAM,MAAM,aAAa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,EAC5D,QAAQ,CAAC,EAAE,MAAM,GAChB,SAAS,CAsBX"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * `run_add_p` for the commands: the configuration add-patch.c reads (`diff.context`,
3
+ * `diff.interHunkContext`, `diff.algorithm`, the comment character), the backend and the
4
+ * selection.
5
+ */
6
+ import type { GitCommand } from "../../git-command.js";
7
+ import type { WorkingCopy } from "../../types.js";
8
+ import { type PatchCompatibility, type PatchResult, type PatchSelector } from "./add-patch.js";
9
+ import { type TemporaryIndex } from "./patch-backend.js";
10
+ import { type PatchMode } from "./patch-modes.js";
11
+ /** The patch-mode options every `-p` command takes. */
12
+ export interface PatchOptions {
13
+ /** `-U<n>` / `--unified=<n>` (default `diff.context`) */
14
+ context?: number;
15
+ /** `--inter-hunk-context=<n>` (default `diff.interHunkContext`) */
16
+ interHunkContext?: number;
17
+ /** `--no-auto-advance` (git 2.5x): false stays in a file until `q` and applies at the end */
18
+ autoAdvance?: boolean;
19
+ }
20
+ /** What {@link runPatchSelection} needs besides the options. */
21
+ export interface PatchSelectionRequest extends PatchOptions {
22
+ mode: PatchMode;
23
+ selector: PatchSelector | undefined;
24
+ /** The revision the diff compares with (a tree-ish; the empty tree for an unborn HEAD) */
25
+ diffRevision?: string;
26
+ paths: string[];
27
+ compatibility?: PatchCompatibility;
28
+ temporaryIndex?: TemporaryIndex;
29
+ /** The command running the selection, whose hook session gathers the hooks' output */
30
+ hookSource?: GitCommand<unknown>;
31
+ }
32
+ /** Runs a patch selection as `run_add_p` does for a command. */
33
+ export declare function runPatchSelection(workingCopy: WorkingCopy, request: PatchSelectionRequest): Promise<PatchResult>;
34
+ /**
35
+ * The revision checkout's patch mode hands run_add_p, and the one its diff compares with:
36
+ * `HEAD` stays `HEAD` (the empty tree on an unborn branch), a commit becomes its full id
37
+ * (`<a>...<b>` included), a tree keeps its name.
38
+ */
39
+ export declare function patchRevisionOf(revision: string | undefined, access: {
40
+ headId: () => Promise<string | undefined>;
41
+ resolve: (name: string) => Promise<string>;
42
+ peelCommit: (id: string) => Promise<string | undefined>;
43
+ }): Promise<{
44
+ revision?: string;
45
+ diffRevision?: string;
46
+ }>;
47
+ /** The mode of a path checkout's `-p` by what it restores (builtin/checkout.c). */
48
+ export declare function pathPatchMode(index: boolean, worktree: boolean, revision?: string): PatchMode;
49
+ //# sourceMappingURL=patch-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-session.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/patch-session.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,aAAa,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,kBAAkB,CAAC;AAEhE,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6FAA6F;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,gEAAgE;AAChE,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,sFAAsF;IACtF,UAAU,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAClC;AAoBD,gEAAgE;AAChE,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,WAAW,CAAC,CAwDtB;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE;IACN,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC1C,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACzD,GACA,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAcvD;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAI7F"}
@@ -0,0 +1,175 @@
1
+ /**
2
+ * `git am`: applies a series of patches from mailboxes, committing each with the author,
3
+ * date and message of its mail, as git does: the state in `.git/rebase-apply/` (the split
4
+ * mails `0001`..., `next`, `last`, `info`, `msg`, `patch`, `final-commit`,
5
+ * `author-script`, the option files, `abort-safety`), `ORIG_HEAD`, the reflog lines
6
+ * (`am: <subject>`, `am --abort`), the output ("Applying: <subject>", "Patch failed at
7
+ * ...") and the advice, and `--continue`, `--skip`, `--abort`, `--quit`.
8
+ *
9
+ * Not run: the `applypatch-msg`, `pre-applypatch` and `post-applypatch` hooks, rerere,
10
+ * and the auto maintenance git starts at the end. Notes are not copied: plain `git am`
11
+ * copies none (only `rebase --apply` does, through `rewritten`).
12
+ */
13
+ import { GitCommand } from "../../git-command.js";
14
+ import { type AmPatchFormat } from "./patch-format.js";
15
+ /** What `git am` printed and how it ended. */
16
+ export interface AmResult {
17
+ /** 0 done, 128 stopped (a patch that does not apply, an error) */
18
+ exitCode: number;
19
+ output: string;
20
+ errors: string;
21
+ }
22
+ /** The options `git am` passes to `git apply` (kept in `apply-opt`). */
23
+ export interface AmApplyOptions {
24
+ /** `-C<n>` */
25
+ context?: number;
26
+ /** `-p<n>` */
27
+ strip?: number;
28
+ /** `--whitespace=<action>` */
29
+ whitespace?: string;
30
+ /** `--directory=<dir>` */
31
+ directory?: string;
32
+ /** `--exclude=<path>` */
33
+ exclude?: string[];
34
+ /** `--include=<path>` */
35
+ include?: string[];
36
+ /** `--reject` */
37
+ reject?: boolean;
38
+ /** `--ignore-whitespace` */
39
+ ignoreWhitespace?: boolean;
40
+ }
41
+ /**
42
+ * `git am`.
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * await git.am().addMbox(mboxBytes).setThreeWay(true).call();
47
+ * await git.am().setResume("continue").call();
48
+ * ```
49
+ */
50
+ export declare class AmCommand extends GitCommand<AmResult> {
51
+ private mboxes;
52
+ private patchFormat?;
53
+ private fixedClock?;
54
+ private resume?;
55
+ private threeWay?;
56
+ private signoff;
57
+ private keepCr?;
58
+ private keep;
59
+ private messageId?;
60
+ private scissors?;
61
+ private quiet;
62
+ private noVerify;
63
+ private utf8;
64
+ private ignoreDate;
65
+ private committerDateIsAuthorDate;
66
+ private mboxrd;
67
+ private emptyMode;
68
+ private applyOptions;
69
+ private legacyMessages;
70
+ private out;
71
+ private err;
72
+ /**
73
+ * A mailbox (mbox) to apply, in order. `name` is its file's name as git shows it in
74
+ * messages (the file argument); a named file's format is detected (from the first one)
75
+ * and it must not be empty, while one without a name reads as standard input (an mbox).
76
+ */
77
+ addMbox(mbox: Uint8Array | string, name?: string): this;
78
+ /**
79
+ * `--patch-format=<format>`: mbox, mboxrd, stgit or hg (Mercurial); detected from the
80
+ * first named mailbox when not given. An StGit series (`stgit-series`) names its patch
81
+ * files, which a command given contents cannot open: it is refused.
82
+ */
83
+ setPatchFormat(format: AmPatchFormat): this;
84
+ /**
85
+ * The clock (seconds since the epoch) for the dates git takes from it: the author date of
86
+ * `--ignore-date` or of a mail without a `Date:` header, the committer date and the reflog
87
+ * lines (default: the system clock).
88
+ */
89
+ setClock(seconds: number): this;
90
+ protected clock(): number;
91
+ /** `--continue`/`--resolved`, `--allow-empty`, `--skip`, `--abort`, `--quit`. */
92
+ setResume(mode: "continue" | "resolved" | "allow-empty" | "skip" | "abort" | "quit"): this;
93
+ /** `-3` / `--3way` (default `am.threeWay`). */
94
+ setThreeWay(value: boolean): this;
95
+ /** `-s` / `--signoff`. */
96
+ setSignoff(value: boolean): this;
97
+ /** `--keep-cr` (default `am.keepcr`). */
98
+ setKeepCr(value: boolean): this;
99
+ /** `-k` (true) / `--keep-non-patch` ("non-patch"). */
100
+ setKeep(value: boolean | "non-patch"): this;
101
+ /** `-m` / `--message-id` (default `am.messageid`). */
102
+ setMessageId(value: boolean): this;
103
+ /** `-c` / `--scissors`, `--no-scissors`. */
104
+ setScissors(value: boolean): this;
105
+ /** `--no-verify`: the applypatch-msg and pre-applypatch hooks do not run. */
106
+ setNoVerify(value: boolean): this;
107
+ /** `-q`. */
108
+ setQuiet(value: boolean): this;
109
+ /** `-u` (default) / `-n`. */
110
+ setUtf8(value: boolean): this;
111
+ /** `--ignore-date`. */
112
+ setIgnoreDate(value: boolean): this;
113
+ /** `--committer-date-is-author-date`. */
114
+ setCommitterDateIsAuthorDate(value: boolean): this;
115
+ /** `--patch-format=mboxrd`. */
116
+ setMboxrd(value: boolean): this;
117
+ /** `--empty=stop|drop|keep`. */
118
+ setEmpty(mode: "stop" | "drop" | "keep"): this;
119
+ /** The options passed through to `git apply`. */
120
+ setApplyOptions(options: AmApplyOptions): this;
121
+ /** git before 2.46 prints the resolve advice on stdout, not as hints. */
122
+ setLegacyMessages(value: boolean): this;
123
+ private state;
124
+ private say;
125
+ private result;
126
+ call(): Promise<AmResult>;
127
+ private fatal;
128
+ private read;
129
+ /** `write_file_buf`: the content as it is. */
130
+ private write;
131
+ /** `write_state_text` (`write_file`): the line completed. */
132
+ private writeText;
133
+ private headId;
134
+ private run;
135
+ private setup;
136
+ private applyArgs;
137
+ private load;
138
+ private next;
139
+ private firstLine;
140
+ private indexHasChanges;
141
+ /** `die_user_resolve`: the advice, then the stop. */
142
+ private dieUserResolve;
143
+ private patchIsEmpty;
144
+ private amRun;
145
+ private runApply;
146
+ /** `fall_back_threeway`: the patch applied to the blobs it names, merged into HEAD. */
147
+ private fallBackThreeway;
148
+ /** Runs an am hook, its output (git's stderr) added to the am's in order. */
149
+ private runAmHook;
150
+ private doCommit;
151
+ private resolve;
152
+ private abort;
153
+ /**
154
+ * git's `clean_index(head, remote)` (`am --skip`, `am --abort`): conflicted entries reset to
155
+ * HEAD (a two-way merge from HEAD to HEAD that leaves every other entry, staged changes and
156
+ * deletions included, as it is), then the index moved to `remote` (a two-way merge from
157
+ * the index's own tree, so a one-way reset with git's up-to-date and untracked checks),
158
+ * then a merge in progress forgotten (`remove_branch_state`). A refusal prints
159
+ * unpack-trees' error, then dies with "failed to clean index".
160
+ */
161
+ private cleanIndex;
162
+ private sequencerContext;
163
+ }
164
+ interface Fixed {
165
+ text: string;
166
+ changed: boolean;
167
+ }
168
+ /**
169
+ * commit.c's `ensure_utf8` of a binary string: each byte that starts no valid UTF-8
170
+ * sequence (`has_invalid_utf8`: overlong forms, surrogates and non-characters included)
171
+ * read as Latin-1.
172
+ */
173
+ export declare function ensureUtf8(text: string): Fixed;
174
+ export {};
175
+ //# sourceMappingURL=am-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"am-command.d.ts","sourceRoot":"","sources":["../../../src/commands/am/am-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAkClD,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,mBAAmB,CAAC;AAI3B,8CAA8C;AAC9C,MAAM,W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MappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/am/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * git's mail tools as `git am` runs them: `mailsplit` (an mbox, or mboxrd, cut into one
3
+ * file per message) and `mailinfo` (a message's author, date and subject, its commit
4
+ * message and its patch: RFC 2047 headers, charsets converted to UTF-8, quoted-printable
5
+ * and base64 bodies, in-body `From:`/`Subject:`/`Date:` headers, scissors lines, the
6
+ * `---` that starts the patch). Ports of builtin/mailsplit.c and mailinfo.c on binary
7
+ * strings (one character per byte).
8
+ */
9
+ /**
10
+ * `git mailsplit -b`: the messages of an mbox (binary string). Throws "corrupt mailbox"
11
+ * where git exits; an empty mbox gives none.
12
+ */
13
+ export declare function mailsplit(mbox: string, options?: {
14
+ keepCr?: boolean;
15
+ mboxrd?: boolean;
16
+ }): string[];
17
+ /** What mailinfo found in a message. */
18
+ export interface MailInfo {
19
+ /** The `info` file: `Author:`, `Email:`, `Subject:`, `Date:` lines and a blank line */
20
+ info: string;
21
+ /** The commit message (the body up to the patch) */
22
+ msg: string;
23
+ /** The patch */
24
+ patch: string;
25
+ /** Lines of the patch */
26
+ patchLines: number;
27
+ author: string;
28
+ email: string;
29
+ subject: string;
30
+ date: string;
31
+ /** Warnings and errors git prints */
32
+ errors: string;
33
+ formatFlowed: boolean;
34
+ failed: boolean;
35
+ }
36
+ /** Options of {@link mailinfo}. */
37
+ export interface MailInfoOptions {
38
+ /** `-k`: keep the subject as it is */
39
+ keepSubject?: boolean;
40
+ /** `-b`: keep brackets that do not hold "PATCH" */
41
+ keepNonPatchBrackets?: boolean;
42
+ /** `-m`: the Message-ID added to the message */
43
+ addMessageId?: boolean;
44
+ /** `--scissors` (true) / `--no-scissors` (false) */
45
+ useScissors?: boolean;
46
+ /** Convert to UTF-8 (`-u`, default); false keeps the bytes (`-n`) */
47
+ utf8?: boolean;
48
+ /**
49
+ * The charset `-u` converts to (git's `metainfo_charset`: am's commit output encoding,
50
+ * `i18n.commitEncoding`); UTF-8 by default
51
+ */
52
+ charset?: string;
53
+ /** `--quoted-cr=<action>` (default warn) */
54
+ quotedCr?: "nowarn" | "warn" | "strip";
55
+ }
56
+ /** git's `mailinfo` of one message (binary string). */
57
+ export declare function mailinfo(message: string, options?: MailInfoOptions): MailInfo;
58
+ //# sourceMappingURL=mailinfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailinfo.d.ts","sourceRoot":"","sources":["../../../src/commands/am/mailinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2CH;;;GAGG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,MAAM,EAAE,CAwBV;AAED,wCAAwC;AACxC,MAAM,WAAW,QAAQ;IACvB,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,mCAAmC;AACnC,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gDAAgD;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qEAAqE;IACrE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;CACxC;AAqXD,uDAAuD;AACvD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,QAAQ,CA8ajF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The patch formats `git am` reads besides mailboxes (builtin/am.c): the detection of a
3
+ * file's format (`detect_patch_format`) and the conversion of StGit and Mercurial patches
4
+ * to mails (`stgit_patch_to_mail`, `hg_patch_to_mail`). Contents are binary strings.
5
+ */
6
+ /** A patch format `git am` reads (`--patch-format`). */
7
+ export type AmPatchFormat = "mbox" | "mboxrd" | "stgit" | "stgit-series" | "hg";
8
+ /**
9
+ * `detect_patch_format` of a file's content: its format, undefined when it is none git
10
+ * recognises ("Patch format detection failed.").
11
+ */
12
+ export declare function detectPatchFormat(content: string): AmPatchFormat | undefined;
13
+ /** `stgit_patch_to_mail`: an StGit patch as a mail. */
14
+ export declare function stgitPatchToMail(patch: string): string;
15
+ /**
16
+ * `hg_patch_to_mail`: a Mercurial patch (`hg export`) as a mail; its error ("invalid Date
17
+ * line", ...) when the header does not parse.
18
+ */
19
+ export declare function hgPatchToMail(patch: string): {
20
+ mail: string;
21
+ } | {
22
+ error: string;
23
+ };
24
+ //# sourceMappingURL=patch-format.d.ts.map