@statewalker/vcs-commands 0.7.0 → 0.9.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 (568) hide show
  1. package/dist/commands/add-command.d.ts +70 -0
  2. package/dist/commands/add-command.d.ts.map +1 -1
  3. package/dist/commands/add-patch/add-patch.d.ts +7 -0
  4. package/dist/commands/add-patch/add-patch.d.ts.map +1 -1
  5. package/dist/commands/add-patch/patch-backend.d.ts.map +1 -1
  6. package/dist/commands/am/am-command.d.ts +102 -1
  7. package/dist/commands/am/am-command.d.ts.map +1 -1
  8. package/dist/commands/am/index.d.ts +1 -0
  9. package/dist/commands/am/index.d.ts.map +1 -1
  10. package/dist/commands/am/mailsplit.d.ts +88 -0
  11. package/dist/commands/am/mailsplit.d.ts.map +1 -0
  12. package/dist/commands/apply/apply-command.d.ts +2 -0
  13. package/dist/commands/apply/apply-command.d.ts.map +1 -1
  14. package/dist/commands/apply/apply-engine.d.ts.map +1 -1
  15. package/dist/commands/apply/apply-parse.d.ts +7 -0
  16. package/dist/commands/apply/apply-parse.d.ts.map +1 -1
  17. package/dist/commands/apply/index.d.ts +1 -1
  18. package/dist/commands/apply/index.d.ts.map +1 -1
  19. package/dist/commands/bisect/bisect-command.d.ts +2 -0
  20. package/dist/commands/bisect/bisect-command.d.ts.map +1 -1
  21. package/dist/commands/blame-command.d.ts +303 -8
  22. package/dist/commands/blame-command.d.ts.map +1 -1
  23. package/dist/commands/blame-ignore.d.ts +48 -0
  24. package/dist/commands/blame-ignore.d.ts.map +1 -0
  25. package/dist/commands/branch-command.d.ts +148 -18
  26. package/dist/commands/branch-command.d.ts.map +1 -1
  27. package/dist/commands/branch-info-command.d.ts +55 -0
  28. package/dist/commands/branch-info-command.d.ts.map +1 -0
  29. package/dist/commands/branch-tracking.d.ts +106 -17
  30. package/dist/commands/branch-tracking.d.ts.map +1 -1
  31. package/dist/commands/branch-upstream-command.d.ts +83 -0
  32. package/dist/commands/branch-upstream-command.d.ts.map +1 -0
  33. package/dist/commands/check-mailmap-command.d.ts +49 -0
  34. package/dist/commands/check-mailmap-command.d.ts.map +1 -0
  35. package/dist/commands/checkout-command.d.ts +26 -3
  36. package/dist/commands/checkout-command.d.ts.map +1 -1
  37. package/dist/commands/checkout-paths.d.ts +4 -0
  38. package/dist/commands/checkout-paths.d.ts.map +1 -1
  39. package/dist/commands/cherry-command.d.ts +61 -0
  40. package/dist/commands/cherry-command.d.ts.map +1 -0
  41. package/dist/commands/cherry-pick-command.d.ts +82 -1
  42. package/dist/commands/cherry-pick-command.d.ts.map +1 -1
  43. package/dist/commands/clean-command.d.ts +44 -0
  44. package/dist/commands/clean-command.d.ts.map +1 -1
  45. package/dist/commands/clean-interactive.d.ts +56 -0
  46. package/dist/commands/clean-interactive.d.ts.map +1 -0
  47. package/dist/commands/clone-command.d.ts +116 -2
  48. package/dist/commands/clone-command.d.ts.map +1 -1
  49. package/dist/commands/commit-command.d.ts +239 -5
  50. package/dist/commands/commit-command.d.ts.map +1 -1
  51. package/dist/commands/commit-reuse.d.ts +33 -0
  52. package/dist/commands/commit-reuse.d.ts.map +1 -0
  53. package/dist/commands/config-command.d.ts +236 -0
  54. package/dist/commands/config-command.d.ts.map +1 -0
  55. package/dist/commands/config-value-types.d.ts +91 -0
  56. package/dist/commands/config-value-types.d.ts.map +1 -0
  57. package/dist/commands/core-config.d.ts +20 -0
  58. package/dist/commands/core-config.d.ts.map +1 -1
  59. package/dist/commands/describe-command.d.ts +71 -64
  60. package/dist/commands/describe-command.d.ts.map +1 -1
  61. package/dist/commands/diff-color-config.d.ts +73 -0
  62. package/dist/commands/diff-color-config.d.ts.map +1 -0
  63. package/dist/commands/diff-command.d.ts +369 -10
  64. package/dist/commands/diff-command.d.ts.map +1 -1
  65. package/dist/commands/fetch-command.d.ts +80 -0
  66. package/dist/commands/fetch-command.d.ts.map +1 -1
  67. package/dist/commands/fetch-multiple-command.d.ts +193 -0
  68. package/dist/commands/fetch-multiple-command.d.ts.map +1 -0
  69. package/dist/commands/fmt-merge-msg-command.d.ts +124 -0
  70. package/dist/commands/fmt-merge-msg-command.d.ts.map +1 -0
  71. package/dist/commands/fork-point.d.ts +38 -0
  72. package/dist/commands/fork-point.d.ts.map +1 -0
  73. package/dist/commands/format-patch-command.d.ts +69 -3
  74. package/dist/commands/format-patch-command.d.ts.map +1 -1
  75. package/dist/commands/fsck/fetch-fsck.d.ts +51 -0
  76. package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -1
  77. package/dist/commands/gc-command.d.ts +8 -0
  78. package/dist/commands/gc-command.d.ts.map +1 -1
  79. package/dist/commands/git-describe.d.ts +81 -4
  80. package/dist/commands/git-describe.d.ts.map +1 -1
  81. package/dist/commands/git-hooks.d.ts +50 -1
  82. package/dist/commands/git-hooks.d.ts.map +1 -1
  83. package/dist/commands/grep/grep-command.d.ts +210 -0
  84. package/dist/commands/grep/grep-command.d.ts.map +1 -0
  85. package/dist/commands/grep/grep-engine.d.ts +218 -0
  86. package/dist/commands/grep/grep-engine.d.ts.map +1 -0
  87. package/dist/commands/grep/index.d.ts +3 -0
  88. package/dist/commands/grep/index.d.ts.map +1 -0
  89. package/dist/commands/index-adder.d.ts +13 -2
  90. package/dist/commands/index-adder.d.ts.map +1 -1
  91. package/dist/commands/index.d.ts +38 -0
  92. package/dist/commands/index.d.ts.map +1 -1
  93. package/dist/commands/index.js +5 -3
  94. package/dist/commands/init-command.d.ts +89 -0
  95. package/dist/commands/init-command.d.ts.map +1 -1
  96. package/dist/commands/interpret-trailers-command.d.ts +90 -0
  97. package/dist/commands/interpret-trailers-command.d.ts.map +1 -0
  98. package/dist/commands/line-log.d.ts +161 -0
  99. package/dist/commands/line-log.d.ts.map +1 -0
  100. package/dist/commands/local-transport.d.ts +36 -5
  101. package/dist/commands/local-transport.d.ts.map +1 -1
  102. package/dist/commands/log-command.d.ts +527 -13
  103. package/dist/commands/log-command.d.ts.map +1 -1
  104. package/dist/commands/log-graph.d.ts +30 -3
  105. package/dist/commands/log-graph.d.ts.map +1 -1
  106. package/dist/commands/log-output.d.ts +199 -6
  107. package/dist/commands/log-output.d.ts.map +1 -1
  108. package/dist/commands/ls-remote-command.d.ts +2 -0
  109. package/dist/commands/ls-remote-command.d.ts.map +1 -1
  110. package/dist/commands/mailmap.d.ts +53 -0
  111. package/dist/commands/mailmap.d.ts.map +1 -1
  112. package/dist/commands/merge-base-command.d.ts +60 -0
  113. package/dist/commands/merge-base-command.d.ts.map +1 -0
  114. package/dist/commands/merge-bases.d.ts +23 -0
  115. package/dist/commands/merge-bases.d.ts.map +1 -1
  116. package/dist/commands/merge-command.d.ts +147 -10
  117. package/dist/commands/merge-command.d.ts.map +1 -1
  118. package/dist/commands/merge-drivers.d.ts +2 -0
  119. package/dist/commands/merge-drivers.d.ts.map +1 -1
  120. package/dist/commands/merge-strategy-options.d.ts +69 -0
  121. package/dist/commands/merge-strategy-options.d.ts.map +1 -0
  122. package/dist/commands/merge-support.d.ts +10 -0
  123. package/dist/commands/merge-support.d.ts.map +1 -1
  124. package/dist/commands/message-cleanup.d.ts +2 -0
  125. package/dist/commands/message-cleanup.d.ts.map +1 -1
  126. package/dist/commands/mv-command.d.ts +4 -0
  127. package/dist/commands/mv-command.d.ts.map +1 -1
  128. package/dist/commands/name-rev-command.d.ts +65 -0
  129. package/dist/commands/name-rev-command.d.ts.map +1 -0
  130. package/dist/commands/name-rev.d.ts +136 -0
  131. package/dist/commands/name-rev.d.ts.map +1 -0
  132. package/dist/commands/notes-command.d.ts.map +1 -1
  133. package/dist/commands/octopus-merge.d.ts +26 -1
  134. package/dist/commands/octopus-merge.d.ts.map +1 -1
  135. package/dist/commands/ort-merge.d.ts +16 -0
  136. package/dist/commands/ort-merge.d.ts.map +1 -1
  137. package/dist/commands/ort-recursive.d.ts.map +1 -1
  138. package/dist/commands/patch-id.d.ts +58 -0
  139. package/dist/commands/patch-id.d.ts.map +1 -1
  140. package/dist/commands/pathspec-file.d.ts +39 -0
  141. package/dist/commands/pathspec-file.d.ts.map +1 -0
  142. package/dist/commands/pathspec.d.ts +3 -0
  143. package/dist/commands/pathspec.d.ts.map +1 -1
  144. package/dist/commands/pretty-format.d.ts +43 -3
  145. package/dist/commands/pretty-format.d.ts.map +1 -1
  146. package/dist/commands/promisor-remote.d.ts.map +1 -1
  147. package/dist/commands/pull-command.d.ts +186 -32
  148. package/dist/commands/pull-command.d.ts.map +1 -1
  149. package/dist/commands/push-command.d.ts +225 -9
  150. package/dist/commands/push-command.d.ts.map +1 -1
  151. package/dist/commands/range-diff/index.d.ts +4 -0
  152. package/dist/commands/range-diff/index.d.ts.map +1 -0
  153. package/dist/commands/range-diff/linear-assignment.d.ts +27 -0
  154. package/dist/commands/range-diff/linear-assignment.d.ts.map +1 -0
  155. package/dist/commands/range-diff/range-diff-command.d.ts +121 -0
  156. package/dist/commands/range-diff/range-diff-command.d.ts.map +1 -0
  157. package/dist/commands/range-diff/range-diff.d.ts +106 -0
  158. package/dist/commands/range-diff/range-diff.d.ts.map +1 -0
  159. package/dist/commands/read-tree-command.d.ts +20 -0
  160. package/dist/commands/read-tree-command.d.ts.map +1 -1
  161. package/dist/commands/rebase-command.d.ts +189 -8
  162. package/dist/commands/rebase-command.d.ts.map +1 -1
  163. package/dist/commands/ref-filter/for-each-ref-command.d.ts +121 -0
  164. package/dist/commands/ref-filter/for-each-ref-command.d.ts.map +1 -0
  165. package/dist/commands/ref-filter/index.d.ts +8 -0
  166. package/dist/commands/ref-filter/index.d.ts.map +1 -0
  167. package/dist/commands/ref-filter/ref-atoms.d.ts +88 -0
  168. package/dist/commands/ref-filter/ref-atoms.d.ts.map +1 -0
  169. package/dist/commands/ref-filter/ref-filter.d.ts +178 -0
  170. package/dist/commands/ref-filter/ref-filter.d.ts.map +1 -0
  171. package/dist/commands/ref-filter/ref-format.d.ts +222 -0
  172. package/dist/commands/ref-filter/ref-format.d.ts.map +1 -0
  173. package/dist/commands/ref-filter/ref-listing-command.d.ts +56 -0
  174. package/dist/commands/ref-filter/ref-listing-command.d.ts.map +1 -0
  175. package/dist/commands/ref-filter/ref-quote.d.ts +20 -0
  176. package/dist/commands/ref-filter/ref-quote.d.ts.map +1 -0
  177. package/dist/commands/ref-filter/version-compare.d.ts +20 -0
  178. package/dist/commands/ref-filter/version-compare.d.ts.map +1 -0
  179. package/dist/commands/reflog-command.d.ts +120 -0
  180. package/dist/commands/reflog-command.d.ts.map +1 -1
  181. package/dist/commands/reflog-walk.d.ts +72 -0
  182. package/dist/commands/reflog-walk.d.ts.map +1 -0
  183. package/dist/commands/remerge-diff.d.ts +59 -0
  184. package/dist/commands/remerge-diff.d.ts.map +1 -0
  185. package/dist/commands/remote-command.d.ts +179 -29
  186. package/dist/commands/remote-command.d.ts.map +1 -1
  187. package/dist/commands/remote-show-command.d.ts +204 -0
  188. package/dist/commands/remote-show-command.d.ts.map +1 -0
  189. package/dist/commands/remote-transport.d.ts +7 -1
  190. package/dist/commands/remote-transport.d.ts.map +1 -1
  191. package/dist/commands/reset-command.d.ts +21 -4
  192. package/dist/commands/reset-command.d.ts.map +1 -1
  193. package/dist/commands/restore-command.d.ts +9 -3
  194. package/dist/commands/restore-command.d.ts.map +1 -1
  195. package/dist/commands/rev-filter/commit-filter.d.ts +95 -0
  196. package/dist/commands/rev-filter/commit-filter.d.ts.map +1 -0
  197. package/dist/commands/rev-filter/commit-grep.d.ts +91 -0
  198. package/dist/commands/rev-filter/commit-grep.d.ts.map +1 -0
  199. package/dist/commands/rev-filter/index.d.ts +3 -0
  200. package/dist/commands/rev-filter/index.d.ts.map +1 -0
  201. package/dist/commands/rev-list-command.d.ts +226 -2
  202. package/dist/commands/rev-list-command.d.ts.map +1 -1
  203. package/dist/commands/revert-command.d.ts +54 -1
  204. package/dist/commands/revert-command.d.ts.map +1 -1
  205. package/dist/commands/revision-range.d.ts +34 -1
  206. package/dist/commands/revision-range.d.ts.map +1 -1
  207. package/dist/commands/revision-resolver.d.ts +15 -0
  208. package/dist/commands/revision-resolver.d.ts.map +1 -1
  209. package/dist/commands/rm-command.d.ts +70 -2
  210. package/dist/commands/rm-command.d.ts.map +1 -1
  211. package/dist/commands/sequencer-pick.d.ts +186 -5
  212. package/dist/commands/sequencer-pick.d.ts.map +1 -1
  213. package/dist/commands/sequencer-support.d.ts +12 -1
  214. package/dist/commands/sequencer-support.d.ts.map +1 -1
  215. package/dist/commands/serve-repository.d.ts +7 -0
  216. package/dist/commands/serve-repository.d.ts.map +1 -1
  217. package/dist/commands/shortlog-command.d.ts +109 -0
  218. package/dist/commands/shortlog-command.d.ts.map +1 -0
  219. package/dist/commands/shortlog.d.ts +151 -0
  220. package/dist/commands/shortlog.d.ts.map +1 -0
  221. package/dist/commands/show-command.d.ts +130 -0
  222. package/dist/commands/show-command.d.ts.map +1 -0
  223. package/dist/commands/show-commit.d.ts +11 -0
  224. package/dist/commands/show-commit.d.ts.map +1 -0
  225. package/dist/commands/signature-check.d.ts +164 -0
  226. package/dist/commands/signature-check.d.ts.map +1 -0
  227. package/dist/commands/signing.d.ts +160 -0
  228. package/dist/commands/signing.d.ts.map +1 -0
  229. package/dist/commands/sparse-checkout-command.d.ts.map +1 -1
  230. package/dist/commands/sparse-index-view.d.ts +45 -0
  231. package/dist/commands/sparse-index-view.d.ts.map +1 -0
  232. package/dist/commands/ssh-signer.d.ts +29 -0
  233. package/dist/commands/ssh-signer.d.ts.map +1 -0
  234. package/dist/commands/ssh-verifier.d.ts +42 -0
  235. package/dist/commands/ssh-verifier.d.ts.map +1 -0
  236. package/dist/commands/stash-apply-command.d.ts +5 -0
  237. package/dist/commands/stash-apply-command.d.ts.map +1 -1
  238. package/dist/commands/stash-branch-command.d.ts +34 -0
  239. package/dist/commands/stash-branch-command.d.ts.map +1 -0
  240. package/dist/commands/stash-create-command.d.ts +17 -0
  241. package/dist/commands/stash-create-command.d.ts.map +1 -1
  242. package/dist/commands/stash-info.d.ts +93 -0
  243. package/dist/commands/stash-info.d.ts.map +1 -0
  244. package/dist/commands/stash-list-command.d.ts +16 -0
  245. package/dist/commands/stash-list-command.d.ts.map +1 -1
  246. package/dist/commands/stash-pop-command.d.ts +39 -0
  247. package/dist/commands/stash-pop-command.d.ts.map +1 -0
  248. package/dist/commands/stash-show-command.d.ts +48 -0
  249. package/dist/commands/stash-show-command.d.ts.map +1 -0
  250. package/dist/commands/stash-store-command.d.ts +29 -0
  251. package/dist/commands/stash-store-command.d.ts.map +1 -0
  252. package/dist/commands/stash-working-tree.d.ts.map +1 -1
  253. package/dist/commands/status-command.d.ts +31 -2
  254. package/dist/commands/status-command.d.ts.map +1 -1
  255. package/dist/commands/status-header.d.ts +5 -0
  256. package/dist/commands/status-header.d.ts.map +1 -1
  257. package/dist/commands/submodule-add-command.d.ts +89 -0
  258. package/dist/commands/submodule-add-command.d.ts.map +1 -0
  259. package/dist/commands/submodule-auth.d.ts +90 -0
  260. package/dist/commands/submodule-auth.d.ts.map +1 -0
  261. package/dist/commands/submodule-commands.d.ts +463 -0
  262. package/dist/commands/submodule-commands.d.ts.map +1 -0
  263. package/dist/commands/submodule-fetch.d.ts +149 -0
  264. package/dist/commands/submodule-fetch.d.ts.map +1 -0
  265. package/dist/commands/submodule-model.d.ts +296 -0
  266. package/dist/commands/submodule-model.d.ts.map +1 -0
  267. package/dist/commands/submodule-unpack.d.ts +120 -0
  268. package/dist/commands/submodule-unpack.d.ts.map +1 -0
  269. package/dist/commands/submodule-update-command.d.ts +206 -0
  270. package/dist/commands/submodule-update-command.d.ts.map +1 -0
  271. package/dist/commands/subtree-shift.d.ts +27 -0
  272. package/dist/commands/subtree-shift.d.ts.map +1 -0
  273. package/dist/commands/switch-command.d.ts +3 -0
  274. package/dist/commands/switch-command.d.ts.map +1 -1
  275. package/dist/commands/tag-command.d.ts +259 -10
  276. package/dist/commands/tag-command.d.ts.map +1 -1
  277. package/dist/commands/trailers.d.ts +218 -17
  278. package/dist/commands/trailers.d.ts.map +1 -1
  279. package/dist/commands/tree-restore.d.ts +7 -0
  280. package/dist/commands/tree-restore.d.ts.map +1 -1
  281. package/dist/commands/verify-command.d.ts +92 -0
  282. package/dist/commands/verify-command.d.ts.map +1 -0
  283. package/dist/commands/worktree-add-command.d.ts +79 -7
  284. package/dist/commands/worktree-add-command.d.ts.map +1 -1
  285. package/dist/commands/worktree-overwrite-checks.d.ts +2 -0
  286. package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
  287. package/dist/commands/worktree-path-rules.d.ts +66 -0
  288. package/dist/commands/worktree-path-rules.d.ts.map +1 -0
  289. package/dist/commands/worktree-remove-command.d.ts +10 -3
  290. package/dist/commands/worktree-remove-command.d.ts.map +1 -1
  291. package/dist/commands/worktree-repair-command.d.ts +15 -2
  292. package/dist/commands/worktree-repair-command.d.ts.map +1 -1
  293. package/dist/commands/worktree-support.d.ts +5 -0
  294. package/dist/commands/worktree-support.d.ts.map +1 -1
  295. package/dist/{commands-DIJ91NnD.js → commands-CNvli5bl.js} +49442 -54941
  296. package/dist/errors/checkout-errors.d.ts +19 -0
  297. package/dist/errors/checkout-errors.d.ts.map +1 -1
  298. package/dist/errors/command-errors.d.ts +25 -0
  299. package/dist/errors/command-errors.d.ts.map +1 -1
  300. package/dist/errors/index.js +85 -3
  301. package/dist/errors/ref-errors.d.ts +19 -0
  302. package/dist/errors/ref-errors.d.ts.map +1 -1
  303. package/dist/errors/worktree-errors.d.ts +6 -1
  304. package/dist/errors/worktree-errors.d.ts.map +1 -1
  305. package/dist/fsck-CPeDh9fh.js +5138 -0
  306. package/dist/git-command.d.ts +58 -2
  307. package/dist/git-command.d.ts.map +1 -1
  308. package/dist/git.d.ts +363 -1
  309. package/dist/git.d.ts.map +1 -1
  310. package/dist/guarded-transport-command.d.ts +82 -0
  311. package/dist/guarded-transport-command.d.ts.map +1 -0
  312. package/dist/index.d.ts +1 -0
  313. package/dist/index.d.ts.map +1 -1
  314. package/dist/index.js +6 -5
  315. package/dist/remote-config/index.d.ts +1 -1
  316. package/dist/remote-config/index.d.ts.map +1 -1
  317. package/dist/remote-config/remote-config-store.d.ts +55 -0
  318. package/dist/remote-config/remote-config-store.d.ts.map +1 -1
  319. package/dist/remote-transport-CCmBadm-.js +1606 -0
  320. package/dist/rename/detect-renames.d.ts +20 -0
  321. package/dist/rename/detect-renames.d.ts.map +1 -1
  322. package/dist/rename/diffcore-break.d.ts +51 -0
  323. package/dist/rename/diffcore-break.d.ts.map +1 -0
  324. package/dist/rename/index.d.ts +1 -0
  325. package/dist/rename/index.d.ts.map +1 -1
  326. package/dist/results/blame-format.d.ts +62 -1
  327. package/dist/results/blame-format.d.ts.map +1 -1
  328. package/dist/results/clone-result.d.ts +9 -0
  329. package/dist/results/clone-result.d.ts.map +1 -1
  330. package/dist/results/combined-diff.d.ts +3 -0
  331. package/dist/results/combined-diff.d.ts.map +1 -1
  332. package/dist/results/diff-check.d.ts +38 -0
  333. package/dist/results/diff-check.d.ts.map +1 -0
  334. package/dist/results/diff-color.d.ts +135 -0
  335. package/dist/results/diff-color.d.ts.map +1 -0
  336. package/dist/results/diff-dirstat.d.ts +36 -0
  337. package/dist/results/diff-dirstat.d.ts.map +1 -0
  338. package/dist/results/diff-entry.d.ts +10 -0
  339. package/dist/results/diff-entry.d.ts.map +1 -1
  340. package/dist/results/diff-formatter.d.ts.map +1 -1
  341. package/dist/results/diff-output.d.ts +103 -1
  342. package/dist/results/diff-output.d.ts.map +1 -1
  343. package/dist/results/diff-pickaxe.d.ts +67 -0
  344. package/dist/results/diff-pickaxe.d.ts.map +1 -0
  345. package/dist/results/diff-words.d.ts +55 -0
  346. package/dist/results/diff-words.d.ts.map +1 -0
  347. package/dist/results/fetch-result.d.ts +12 -1
  348. package/dist/results/fetch-result.d.ts.map +1 -1
  349. package/dist/results/index.d.ts +6 -0
  350. package/dist/results/index.d.ts.map +1 -1
  351. package/dist/results/index.js +2 -2
  352. package/dist/results/init-result.d.ts +8 -1
  353. package/dist/results/init-result.d.ts.map +1 -1
  354. package/dist/results/line-range-hunks.d.ts +27 -0
  355. package/dist/results/line-range-hunks.d.ts.map +1 -0
  356. package/dist/results/merge-result.d.ts +8 -1
  357. package/dist/results/merge-result.d.ts.map +1 -1
  358. package/dist/results/pull-result.d.ts +11 -0
  359. package/dist/results/pull-result.d.ts.map +1 -1
  360. package/dist/results/push-result.d.ts +12 -0
  361. package/dist/results/push-result.d.ts.map +1 -1
  362. package/dist/results/rebase-result.d.ts +2 -0
  363. package/dist/results/rebase-result.d.ts.map +1 -1
  364. package/dist/results/stash-result.d.ts +6 -0
  365. package/dist/results/stash-result.d.ts.map +1 -1
  366. package/dist/results/status-result.d.ts +1 -1
  367. package/dist/results/status-result.d.ts.map +1 -1
  368. package/dist/results-BDuEgdLU.js +46847 -0
  369. package/dist/transport-command.d.ts +14 -0
  370. package/dist/transport-command.d.ts.map +1 -1
  371. package/dist/whitespace/index.d.ts +2 -0
  372. package/dist/whitespace/index.d.ts.map +1 -0
  373. package/dist/whitespace/whitespace-rule.d.ts +94 -0
  374. package/dist/whitespace/whitespace-rule.d.ts.map +1 -0
  375. package/package.json +12 -12
  376. package/src/commands/add-command.ts +293 -17
  377. package/src/commands/add-patch/add-patch.ts +8 -0
  378. package/src/commands/add-patch/patch-backend.ts +20 -2
  379. package/src/commands/am/am-command.ts +400 -46
  380. package/src/commands/am/index.ts +1 -0
  381. package/src/commands/am/mailsplit.ts +326 -0
  382. package/src/commands/apply/apply-command.ts +58 -15
  383. package/src/commands/apply/apply-engine.ts +1 -1
  384. package/src/commands/apply/apply-parse.ts +17 -8
  385. package/src/commands/apply/index.ts +8 -1
  386. package/src/commands/bisect/bisect-command.ts +18 -5
  387. package/src/commands/blame-command.ts +1450 -51
  388. package/src/commands/blame-ignore.ts +307 -0
  389. package/src/commands/branch-command.ts +528 -53
  390. package/src/commands/branch-info-command.ts +150 -0
  391. package/src/commands/branch-tracking.ts +335 -60
  392. package/src/commands/branch-upstream-command.ts +218 -0
  393. package/src/commands/check-mailmap-command.ts +129 -0
  394. package/src/commands/checkout-command.ts +166 -55
  395. package/src/commands/checkout-paths.ts +28 -0
  396. package/src/commands/cherry-command.ts +187 -0
  397. package/src/commands/cherry-pick-command.ts +185 -1
  398. package/src/commands/clean-command.ts +126 -15
  399. package/src/commands/clean-interactive.ts +522 -0
  400. package/src/commands/clone-command.ts +598 -45
  401. package/src/commands/commit-command.ts +925 -74
  402. package/src/commands/commit-reuse.ts +94 -0
  403. package/src/commands/config-command.ts +1256 -0
  404. package/src/commands/config-value-types.ts +358 -0
  405. package/src/commands/core-config.ts +40 -0
  406. package/src/commands/describe-command.ts +341 -254
  407. package/src/commands/diff-color-config.ts +274 -0
  408. package/src/commands/diff-command.ts +1619 -99
  409. package/src/commands/fetch-command.ts +495 -14
  410. package/src/commands/fetch-multiple-command.ts +665 -0
  411. package/src/commands/fmt-merge-msg-command.ts +715 -0
  412. package/src/commands/fork-point.ts +63 -0
  413. package/src/commands/format-patch-command.ts +496 -116
  414. package/src/commands/fsck/fetch-fsck.ts +172 -18
  415. package/src/commands/gc-command.ts +31 -1
  416. package/src/commands/git-describe.ts +460 -201
  417. package/src/commands/git-hooks.ts +123 -3
  418. package/src/commands/grep/grep-command.ts +1077 -0
  419. package/src/commands/grep/grep-engine.ts +1024 -0
  420. package/src/commands/grep/index.ts +2 -0
  421. package/src/commands/index-adder.ts +46 -7
  422. package/src/commands/index.ts +43 -0
  423. package/src/commands/init-command.ts +603 -49
  424. package/src/commands/interpret-trailers-command.ts +256 -0
  425. package/src/commands/line-log.ts +931 -0
  426. package/src/commands/local-transport.ts +109 -10
  427. package/src/commands/log-command.ts +2599 -326
  428. package/src/commands/log-graph.ts +129 -29
  429. package/src/commands/log-output.ts +449 -27
  430. package/src/commands/ls-remote-command.ts +5 -0
  431. package/src/commands/mailmap.ts +155 -0
  432. package/src/commands/merge-base-command.ts +170 -0
  433. package/src/commands/merge-bases.ts +63 -8
  434. package/src/commands/merge-command.ts +601 -95
  435. package/src/commands/merge-drivers.ts +3 -0
  436. package/src/commands/merge-strategy-options.ts +224 -0
  437. package/src/commands/merge-support.ts +115 -22
  438. package/src/commands/message-cleanup.ts +1 -1
  439. package/src/commands/mv-command.ts +6 -3
  440. package/src/commands/name-rev-command.ts +184 -0
  441. package/src/commands/name-rev.ts +762 -0
  442. package/src/commands/notes-command.ts +11 -1
  443. package/src/commands/octopus-merge.ts +35 -11
  444. package/src/commands/ort-merge.ts +41 -7
  445. package/src/commands/ort-recursive.ts +40 -2
  446. package/src/commands/patch-id.ts +109 -0
  447. package/src/commands/pathspec-file.ts +72 -0
  448. package/src/commands/pathspec.ts +14 -2
  449. package/src/commands/pretty-format.ts +103 -19
  450. package/src/commands/promisor-remote.ts +10 -1
  451. package/src/commands/pull-command.ts +734 -221
  452. package/src/commands/push-command.ts +1035 -68
  453. package/src/commands/range-diff/index.ts +3 -0
  454. package/src/commands/range-diff/linear-assignment.ts +203 -0
  455. package/src/commands/range-diff/range-diff-command.ts +433 -0
  456. package/src/commands/range-diff/range-diff.ts +617 -0
  457. package/src/commands/read-tree-command.ts +102 -4
  458. package/src/commands/rebase-command.ts +1074 -194
  459. package/src/commands/ref-filter/for-each-ref-command.ts +298 -0
  460. package/src/commands/ref-filter/index.ts +7 -0
  461. package/src/commands/ref-filter/ref-atoms.ts +581 -0
  462. package/src/commands/ref-filter/ref-filter.ts +651 -0
  463. package/src/commands/ref-filter/ref-format.ts +1070 -0
  464. package/src/commands/ref-filter/ref-listing-command.ts +421 -0
  465. package/src/commands/ref-filter/ref-quote.ts +69 -0
  466. package/src/commands/ref-filter/version-compare.ts +177 -0
  467. package/src/commands/reflog-command.ts +492 -2
  468. package/src/commands/reflog-walk.ts +234 -0
  469. package/src/commands/remerge-diff.ts +241 -0
  470. package/src/commands/remote-command.ts +537 -69
  471. package/src/commands/remote-show-command.ts +836 -0
  472. package/src/commands/remote-transport.ts +9 -1
  473. package/src/commands/reset-command.ts +114 -34
  474. package/src/commands/restore-command.ts +27 -41
  475. package/src/commands/rev-filter/commit-filter.ts +159 -0
  476. package/src/commands/rev-filter/commit-grep.ts +444 -0
  477. package/src/commands/rev-filter/index.ts +2 -0
  478. package/src/commands/rev-list-command.ts +578 -15
  479. package/src/commands/revert-command.ts +123 -1
  480. package/src/commands/revision-range.ts +207 -5
  481. package/src/commands/revision-resolver.ts +23 -8
  482. package/src/commands/rm-command.ts +282 -21
  483. package/src/commands/sequencer-pick.ts +818 -111
  484. package/src/commands/sequencer-support.ts +184 -4
  485. package/src/commands/serve-repository.ts +18 -3
  486. package/src/commands/shortlog-command.ts +354 -0
  487. package/src/commands/shortlog.ts +361 -0
  488. package/src/commands/show-command.ts +491 -0
  489. package/src/commands/show-commit.ts +24 -0
  490. package/src/commands/signature-check.ts +657 -0
  491. package/src/commands/signing.ts +385 -0
  492. package/src/commands/sparse-checkout-command.ts +2 -9
  493. package/src/commands/sparse-checkout-support.ts +2 -2
  494. package/src/commands/sparse-index-view.ts +135 -0
  495. package/src/commands/ssh-signer.ts +199 -0
  496. package/src/commands/ssh-verifier.ts +523 -0
  497. package/src/commands/stash-apply-command.ts +16 -4
  498. package/src/commands/stash-branch-command.ts +88 -0
  499. package/src/commands/stash-create-command.ts +28 -0
  500. package/src/commands/stash-info.ts +243 -0
  501. package/src/commands/stash-list-command.ts +33 -0
  502. package/src/commands/stash-pop-command.ts +83 -0
  503. package/src/commands/stash-show-command.ts +141 -0
  504. package/src/commands/stash-store-command.ts +82 -0
  505. package/src/commands/stash-working-tree.ts +2 -2
  506. package/src/commands/status-command.ts +120 -27
  507. package/src/commands/status-format.ts +1 -1
  508. package/src/commands/status-header.ts +41 -7
  509. package/src/commands/submodule-add-command.ts +509 -0
  510. package/src/commands/submodule-auth.ts +276 -0
  511. package/src/commands/submodule-commands.ts +1835 -0
  512. package/src/commands/submodule-fetch.ts +789 -0
  513. package/src/commands/submodule-model.ts +938 -0
  514. package/src/commands/submodule-unpack.ts +265 -0
  515. package/src/commands/submodule-update-command.ts +1126 -0
  516. package/src/commands/subtree-shift.ts +215 -0
  517. package/src/commands/switch-command.ts +12 -1
  518. package/src/commands/tag-command.ts +876 -64
  519. package/src/commands/trailers.ts +837 -100
  520. package/src/commands/tree-restore.ts +44 -11
  521. package/src/commands/verify-command.ts +235 -0
  522. package/src/commands/worktree-add-command.ts +268 -24
  523. package/src/commands/worktree-overwrite-checks.ts +5 -0
  524. package/src/commands/worktree-path-rules.ts +183 -0
  525. package/src/commands/worktree-remove-command.ts +39 -5
  526. package/src/commands/worktree-repair-command.ts +52 -5
  527. package/src/commands/worktree-support.ts +22 -1
  528. package/src/errors/checkout-errors.ts +29 -0
  529. package/src/errors/command-errors.ts +37 -1
  530. package/src/errors/ref-errors.ts +23 -0
  531. package/src/errors/worktree-errors.ts +8 -1
  532. package/src/git-command.ts +153 -2
  533. package/src/git.ts +550 -1
  534. package/src/guarded-transport-command.ts +171 -0
  535. package/src/index.ts +1 -0
  536. package/src/remote-config/index.ts +2 -0
  537. package/src/remote-config/remote-config-store.ts +101 -0
  538. package/src/rename/detect-renames.ts +42 -8
  539. package/src/rename/diffcore-break.ts +166 -0
  540. package/src/rename/index.ts +1 -0
  541. package/src/results/blame-format.ts +268 -43
  542. package/src/results/clone-result.ts +6 -0
  543. package/src/results/combined-diff.ts +38 -18
  544. package/src/results/diff-check.ts +185 -0
  545. package/src/results/diff-color.ts +868 -0
  546. package/src/results/diff-dirstat.ts +117 -0
  547. package/src/results/diff-entry.ts +12 -0
  548. package/src/results/diff-formatter.ts +1 -0
  549. package/src/results/diff-output.ts +322 -32
  550. package/src/results/diff-pickaxe.ts +304 -0
  551. package/src/results/diff-words.ts +395 -0
  552. package/src/results/fetch-result.ts +12 -1
  553. package/src/results/index.ts +6 -0
  554. package/src/results/init-result.ts +10 -1
  555. package/src/results/line-range-hunks.ts +126 -0
  556. package/src/results/merge-result.ts +9 -0
  557. package/src/results/pull-result.ts +7 -0
  558. package/src/results/push-result.ts +12 -0
  559. package/src/results/rebase-result.ts +3 -0
  560. package/src/results/stash-result.ts +7 -0
  561. package/src/results/status-result.ts +2 -2
  562. package/src/transport-command.ts +34 -3
  563. package/src/whitespace/index.ts +1 -0
  564. package/src/{commands/apply/whitespace.ts → whitespace/whitespace-rule.ts} +173 -23
  565. package/dist/commands/apply/whitespace.d.ts +0 -58
  566. package/dist/commands/apply/whitespace.d.ts.map +0 -1
  567. package/dist/git-command-BGiOJ8Zk.js +0 -7246
  568. package/dist/results-WVlBhVb1.js +0 -2935
@@ -92,8 +92,19 @@ export interface FetchResult {
92
92
  * and exits 1; absent when nothing failed
93
93
  */
94
94
  errors?: string[];
95
- /** Submodule fetch results (if any) */
95
+ /**
96
+ * The submodules' fetch results (`--recurse-submodules`), by submodule path; absent when
97
+ * no submodule was fetched
98
+ */
96
99
  submodules?: Map<string, FetchResult>;
100
+ /**
101
+ * What the submodule recursion printed on stderr after the superproject's lines, as git
102
+ * prints it: `Fetching submodule <path>`, each submodule's fetch output, `Errors during
103
+ * submodule fetch:` and the failed submodules' names
104
+ */
105
+ submoduleOutput?: string;
106
+ /** A submodule's fetch failed (or one could not be accessed): git exits 1 */
107
+ submodulesFailed?: boolean;
97
108
  /**
98
109
  * The layer hashes of the commit-graph chain the fetch wrote (`fetch.writeCommitGraph`,
99
110
  * `--write-commit-graph`), base first; absent when it wrote none
@@ -2,12 +2,18 @@ export * from "./blame-format.js";
2
2
  export * from "./cherry-pick-result.js";
3
3
  export * from "./clone-result.js";
4
4
  export * from "./combined-diff.js";
5
+ export * from "./diff-check.js";
6
+ export * from "./diff-color.js";
7
+ export * from "./diff-dirstat.js";
5
8
  export * from "./diff-entry.js";
6
9
  export * from "./diff-formatter.js";
7
10
  export * from "./diff-order.js";
8
11
  export * from "./diff-output.js";
12
+ export * from "./diff-pickaxe.js";
13
+ export * from "./diff-words.js";
9
14
  export * from "./fetch-result.js";
10
15
  export * from "./init-result.js";
16
+ export * from "./line-range-hunks.js";
11
17
  export * from "./merge-result.js";
12
18
  export * from "./pull-result.js";
13
19
  export * from "./push-result.js";
@@ -33,6 +33,15 @@ export interface InitResult {
33
33
  /** Whether this is a bare repository */
34
34
  bare: boolean;
35
35
 
36
- /** Path to the .git directory */
36
+ /** Path to the .git directory (with `--separate-git-dir`, where the repository is) */
37
37
  gitDir: string;
38
+
39
+ /** Whether an existing repository was re-initialised (git's "Reinitialized existing") */
40
+ reinitialized?: boolean;
41
+
42
+ /**
43
+ * `core.sharedRepository` as the repository got it (git_config_perm: 0 not shared,
44
+ * `0o660` group, `0o664` everybody, a negated octal mode): git's "shared" in its message
45
+ */
46
+ shared?: number;
38
47
  }
@@ -0,0 +1,126 @@
1
+ /**
2
+ * The hunks of a patch cut to line ranges of its new side, as git 2.5x's `git log -L` prints a
3
+ * commit's diff (diff.c's `line_range_hunk_fn`, `line_range_line_fn` and `flush_rhunk`).
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * // the diff made with at least the widest range's span as context, then cut
8
+ * const hunks = cutToLineRanges(result.hunks, [{ start: 5, end: 9 }]);
9
+ * // one hunk per range that holds a change, headed `@@ -6,4 +6,4 @@`
10
+ * ```
11
+ *
12
+ * The patch is diffed with its context widened to the widest range, so the changes of one
13
+ * range fall into one hunk; each line is then placed by its new-side line number. Context and
14
+ * added lines inside a range are kept, removed lines only when the next context or added line
15
+ * is inside it (they have no new-side line of their own). A range's lines make one hunk,
16
+ * dropped when it holds no change; its header always prints both counts, with the function
17
+ * line of the last hunk the diff gave.
18
+ *
19
+ * @module
20
+ */
21
+
22
+ import type { EmittedHunk, EmittedLine } from "@statewalker/vcs-utils";
23
+ import type { LineRange } from "./diff-entry.js";
24
+
25
+ /** The widest span of `ranges`: the context a patch cut to them is diffed with (at least) */
26
+ export function lineRangesSpan(ranges: readonly LineRange[]): number {
27
+ let span = 0;
28
+ for (const r of ranges) span = Math.max(span, r.end - r.start);
29
+ return span;
30
+ }
31
+
32
+ /** `hunks` cut to the new-side lines of `ranges` (0-based, end exclusive, sorted) */
33
+ export function cutToLineRanges(
34
+ hunks: readonly EmittedHunk[],
35
+ ranges: readonly LineRange[],
36
+ ): EmittedHunk[] {
37
+ const out: EmittedHunk[] = [];
38
+ let cur = 0;
39
+ let lnoPost = 0;
40
+ let lnoPre = 0;
41
+ let func: Uint8Array = new Uint8Array(0);
42
+ let rhunk: EmittedLine[] = [];
43
+ let active = false;
44
+ let hasChanges = false;
45
+ let oldBegin = 0;
46
+ let oldCount = 0;
47
+ let newBegin = 0;
48
+ let newCount = 0;
49
+ let pending: EmittedLine[] = [];
50
+ let pendingPreBegin = 0;
51
+
52
+ const flush = () => {
53
+ if (!active) return;
54
+ if (pending.length > 0) {
55
+ rhunk.push(...pending);
56
+ oldCount += pending.length;
57
+ hasChanges = true;
58
+ pending = [];
59
+ }
60
+ active = false;
61
+ if (hasChanges) {
62
+ out.push({
63
+ oldStart: oldBegin,
64
+ oldCount,
65
+ newStart: newBegin,
66
+ newCount,
67
+ func,
68
+ lines: rhunk,
69
+ countsAlways: true,
70
+ });
71
+ }
72
+ rhunk = [];
73
+ };
74
+
75
+ for (const hunk of hunks) {
76
+ lnoPost = hunk.newStart;
77
+ lnoPre = hunk.oldStart;
78
+ func = hunk.func;
79
+ for (const line of hunk.lines) {
80
+ if (line.kind === "-") {
81
+ if (pending.length === 0) pendingPreBegin = lnoPre;
82
+ lnoPre++;
83
+ pending.push(line);
84
+ continue;
85
+ }
86
+ const lno = lnoPost - 1;
87
+ const curPre = lnoPre;
88
+ lnoPost++;
89
+ if (line.kind === " ") lnoPre++;
90
+ while (cur < ranges.length && lno >= (ranges[cur] as LineRange).end) {
91
+ flush();
92
+ pending = [];
93
+ cur++;
94
+ }
95
+ if (cur >= ranges.length) {
96
+ pending = [];
97
+ continue;
98
+ }
99
+ if (lno < (ranges[cur] as LineRange).start) {
100
+ pending = [];
101
+ continue;
102
+ }
103
+ if (!active) {
104
+ active = true;
105
+ hasChanges = false;
106
+ newBegin = lno + 1;
107
+ oldBegin = pending.length > 0 ? pendingPreBegin : curPre;
108
+ oldCount = 0;
109
+ newCount = 0;
110
+ rhunk = [];
111
+ }
112
+ if (pending.length > 0) {
113
+ rhunk.push(...pending);
114
+ oldCount += pending.length;
115
+ hasChanges = true;
116
+ pending = [];
117
+ }
118
+ rhunk.push(line);
119
+ newCount++;
120
+ if (line.kind === "+") hasChanges = true;
121
+ else oldCount++;
122
+ }
123
+ }
124
+ flush();
125
+ return out;
126
+ }
@@ -71,6 +71,9 @@ export enum MergeStrategy {
71
71
  */
72
72
  RECURSIVE = "recursive",
73
73
 
74
+ /** git's merge-ort by its own name (`-s ort`): as RECURSIVE */
75
+ ORT = "ort",
76
+
74
77
  /**
75
78
  * Always take our side.
76
79
  *
@@ -96,6 +99,12 @@ export enum MergeStrategy {
96
99
  * Uses a single merge base.
97
100
  */
98
101
  RESOLVE = "resolve",
102
+
103
+ /**
104
+ * git's subtree strategy: merge-ort with the other side (and the base) shifted to match
105
+ * ours' tree shape (`match-trees.c`'s shift_tree); never a fast-forward.
106
+ */
107
+ SUBTREE = "subtree",
99
108
  }
100
109
 
101
110
  /**
@@ -13,6 +13,8 @@ export interface PullResult {
13
13
  * fetching (`rebaseResult` then holds git's refusal, `UNCOMMITTED_CHANGES`)
14
14
  */
15
15
  fetchResult?: FetchResult;
16
+ /** Every remote's fetch of a `--all` pull over several remotes (`fetchResult` is the last) */
17
+ fetchResults?: FetchResult[];
16
18
  /** Result of the merge phase (if applicable; also the fast-forward of a rebasing pull) */
17
19
  mergeResult?: MergeResult;
18
20
  /**
@@ -22,6 +24,11 @@ export interface PullResult {
22
24
  rebaseResult?: RebaseResult;
23
25
  /** Whether rebase was used instead of merge */
24
26
  rebaseUsed: boolean;
27
+ /**
28
+ * `--recurse-submodules` / `submodule.recurse`: what the submodules' `git submodule update
29
+ * --recursive --checkout|--rebase` printed and its exit status (the pull's, when it failed)
30
+ */
31
+ submodules?: { stdout: string; stderr: string; exitCode: number };
25
32
  /** Whether pull was successful */
26
33
  successful: boolean;
27
34
  /** Fetch-from remote */
@@ -111,6 +111,18 @@ export interface PushResult {
111
111
  * '<ref>': ...`); the push itself succeeded (git exits 0)
112
112
  */
113
113
  errors?: string[];
114
+ /**
115
+ * What `-u` printed on stdout (transport.c's `set_upstreams`): `branch '<b>' set up to
116
+ * track '<remote>/<branch>'.` per branch whose upstream was set (`... by rebasing.` under
117
+ * `branch.autoSetupRebase`), or in a dry run `Would set upstream of '<b>' to '<branch>' of
118
+ * '<remote>'`; absent when none. Under `--porcelain` git prints them before `Done`.
119
+ */
120
+ upstreamMessages?: string[];
121
+ /**
122
+ * `--recurse-submodules`: what the submodules' pushes printed on stderr before this push's
123
+ * report (`Pushing submodule '<path>'`, each push's report), git's order
124
+ */
125
+ submoduleOutput?: string;
114
126
  /**
115
127
  * The push failed although every ref's status says otherwise: the server's report broke
116
128
  * git's rules (an `option` line without its `ok`; git exits 1, its porcelain output has no
@@ -163,6 +163,9 @@ export interface RebaseResult {
163
163
 
164
164
  /** Uncommitted changes that prevented rebase */
165
165
  readonly uncommittedChanges?: string[];
166
+
167
+ /** What `--show-current-patch` prints on stdout (`git show REBASE_HEAD`) */
168
+ readonly currentPatch?: string;
166
169
  }
167
170
 
168
171
  /**
@@ -58,6 +58,13 @@ export interface StashApplyResult {
58
58
  /** List of conflicting paths */
59
59
  readonly conflicts?: string[];
60
60
 
61
+ /**
62
+ * What the merge printed on stdout (merge-ort's `Auto-merging x`, `CONFLICT (...)` lines,
63
+ * or `Already up to date.`), line by line, as `git stash apply` prints them before its
64
+ * status.
65
+ */
66
+ readonly messages?: string[];
67
+
61
68
  /**
62
69
  * What the apply printed on stderr while applying the sparse checkout's patterns, line
63
70
  * by line; absent when there was nothing to say.
@@ -9,7 +9,7 @@ import { quoteCStyleBody } from "./quote-path.js";
9
9
  * worktree against the index). `" "` unchanged, `M` modified, `T` type changed, `A` added,
10
10
  * `D` deleted, `R` renamed, `U` unmerged, `?` untracked, `!` ignored.
11
11
  */
12
- export type StatusCode = " " | "M" | "T" | "A" | "D" | "R" | "U" | "?" | "!";
12
+ export type StatusCode = " " | "M" | "T" | "A" | "D" | "R" | "C" | "U" | "?" | "!";
13
13
 
14
14
  /** A side of a path: its mode and object id. */
15
15
  export interface StatusSide {
@@ -282,7 +282,7 @@ export function formatStatusPorcelain(
282
282
  octal(e.worktreeMode),
283
283
  e.head?.id ?? ZERO_ID,
284
284
  e.staged?.id ?? ZERO_ID,
285
- `R${e.renameScore ?? 100}`,
285
+ `${e.index === "C" || e.worktree === "C" ? "C" : "R"}${e.renameScore ?? 100}`,
286
286
  `${path}${z ? "\0" : "\t"}${from}`,
287
287
  ].join(" "),
288
288
  );
@@ -84,9 +84,7 @@ export abstract class TransportCommand<T> extends GitCommand<T> {
84
84
  if (!promisor) return undefined;
85
85
  const previous = promisor.fetcher;
86
86
  const fetcher = createPromisorFetcher(this._workingCopy, {
87
- ...(this.transportRegistry ? { transports: this.transportRegistry } : {}),
88
- ...(this.credentials ? { credentials: this.credentials } : {}),
89
- ...(this.headers ? { headers: this.headers } : {}),
87
+ ...this.promisorFetcherAuth(),
90
88
  ...(this.timeout !== undefined ? { timeout: this.timeout } : {}),
91
89
  });
92
90
  promisor.setFetcher(fetcher);
@@ -96,6 +94,22 @@ export abstract class TransportCommand<T> extends GitCommand<T> {
96
94
  });
97
95
  }
98
96
 
97
+ /**
98
+ * What a lazy fetch during the call reaches the promisor remote with: this command's
99
+ * transports, credentials and headers.
100
+ */
101
+ protected promisorFetcherAuth(): {
102
+ transports?: GitTransportRegistry;
103
+ credentials?: Credentials;
104
+ headers?: Record<string, string>;
105
+ } {
106
+ return {
107
+ ...(this.transportRegistry ? { transports: this.transportRegistry } : {}),
108
+ ...(this.credentials ? { credentials: this.credentials } : {}),
109
+ ...(this.headers ? { headers: this.headers } : {}),
110
+ };
111
+ }
112
+
99
113
  /**
100
114
  * Set the transports non-local remotes are reached through: the registry's connector for a
101
115
  * URL opens the session (default `createDefaultTransports()`: smart HTTP over the global
@@ -246,6 +260,23 @@ export abstract class TransportCommand<T> extends GitCommand<T> {
246
260
  return store.value(`remote.${remote}.${key}`);
247
261
  }
248
262
 
263
+ /**
264
+ * Gives a command this one runs (git's child `git fetch`) this command's transports,
265
+ * credentials, headers, timeout, progress callbacks and hook session.
266
+ */
267
+ protected configureChild<C extends TransportCommand<unknown>>(child: C): C {
268
+ child.shareHooksOf(this);
269
+ child.setTransports(this.getTransports());
270
+ if (this.credentials) child.setCredentials(this.credentials);
271
+ if (this.headers) child.setHeaders(this.headers);
272
+ if (this.timeout) child.setTimeout(this.timeout);
273
+ if (this.gzipRequests !== undefined) child.setGzipRequests(this.gzipRequests);
274
+ if (this.progressCallback) child.setProgressMonitor(this.progressCallback);
275
+ if (this.progressMessageCallback)
276
+ child.setProgressMessageCallback(this.progressMessageCallback);
277
+ return child;
278
+ }
279
+
249
280
  /**
250
281
  * Get transport options for passing to transport operations.
251
282
  */
@@ -0,0 +1 @@
1
+ export * from "./whitespace-rule.js";
@@ -3,8 +3,9 @@
3
3
  * check `git apply` and `git diff --check` run on added lines, and the fix
4
4
  * `--whitespace=fix` applies.
5
5
  *
6
- * Lines are "binary strings": one character per byte (latin1), so a line's length is its
7
- * byte count and any encoding passes through unchanged.
6
+ * `git apply` reads lines as "binary strings" (one character per byte, latin1), the diff
7
+ * output as bytes; the checks take either, so apply, `--check` and the colored diff share one
8
+ * implementation of each rule.
8
9
  *
9
10
  * @example
10
11
  * ```typescript
@@ -24,6 +25,8 @@ export const WS_INCOMPLETE_LINE = 1 << 12;
24
25
  export const WS_TRAILING_SPACE = WS_BLANK_AT_EOL | WS_BLANK_AT_EOF;
25
26
  export const WS_DEFAULT_RULE = WS_TRAILING_SPACE | WS_SPACE_BEFORE_TAB | 8;
26
27
  export const WS_TAB_WIDTH_MASK = (1 << 6) - 1;
28
+ /** The bits a rule may hold (`WS_RULE_MASK`) */
29
+ export const WS_RULE_MASK = (1 << 16) - 1;
27
30
 
28
31
  /** The tab width a rule carries (`ws_tab_width`). */
29
32
  export function wsTabWidth(rule: number): number {
@@ -54,12 +57,28 @@ export function isGitSpace(ch: number): boolean {
54
57
  /** An invalid rule combination (git dies). */
55
58
  export class WhitespaceRuleError extends Error {}
56
59
 
60
+ /** Which git's rule names {@link parseWhitespaceRule} knows */
61
+ export interface WhitespaceRuleOptions {
62
+ /** git 2.43 knows no `incomplete-line` rule: its name (and any prefix of it) names nothing */
63
+ compatibility?: "2.43" | "2.56";
64
+ }
65
+
57
66
  /**
58
67
  * Parses a `core.whitespace` value (or a `whitespace=<rules>` attribute) as
59
- * `parse_whitespace_rule` does: comma-separated names, `-name` to turn one off,
60
- * `tabwidth=<n>`.
68
+ * `parse_whitespace_rule` does: comma-separated names (or a prefix of one), `-name` to turn
69
+ * one off, `tabwidth=<n>`.
70
+ *
71
+ * @throws WhitespaceRuleError for `tab-in-indent` with `indent-with-non-tab` (git dies)
61
72
  */
62
- export function parseWhitespaceRule(value: string, warn?: (message: string) => void): number {
73
+ export function parseWhitespaceRule(
74
+ value: string,
75
+ warn?: (message: string) => void,
76
+ options: WhitespaceRuleOptions = {},
77
+ ): number {
78
+ const names =
79
+ options.compatibility === "2.43"
80
+ ? RULE_NAMES.filter((r) => r.bits !== WS_INCOMPLETE_LINE)
81
+ : RULE_NAMES;
63
82
  let rule = WS_DEFAULT_RULE;
64
83
  let at = 0;
65
84
  while (at <= value.length) {
@@ -76,7 +95,7 @@ export function parseWhitespaceRule(value: string, warn?: (message: string) => v
76
95
  }
77
96
  if (len <= 0) break;
78
97
  const word = value.slice(start, start + len);
79
- for (const r of RULE_NAMES) {
98
+ for (const r of names) {
80
99
  // strncmp(rule_name, string, len): a prefix of a name selects it
81
100
  if (r.name.slice(0, len) !== word || (len > r.name.length && word !== r.name)) continue;
82
101
  if (negated) rule &= ~r.bits;
@@ -135,49 +154,180 @@ export function whitespaceErrorString(ws: number): string {
135
154
  return parts.join(", ");
136
155
  }
137
156
 
138
- /** The whitespace errors of one line (with or without its LF), as `ws_check` finds them. */
139
- export function wsCheck(line: string, rule: number): number {
157
+ /** A line as the checks read it: a binary string (one character per byte) or bytes */
158
+ export type WsLine = string | Uint8Array;
159
+
160
+ /** Where {@link wsCheckEmit} writes a checked line */
161
+ export interface WsEmitTarget {
162
+ /** A color (or any text) */
163
+ str(s: string): void;
164
+ /** Bytes of the line */
165
+ bytes(b: Uint8Array): void;
166
+ }
167
+
168
+ const codeAt = (line: WsLine, i: number): number =>
169
+ typeof line === "string" ? line.charCodeAt(i) : (line[i] as number);
170
+
171
+ /**
172
+ * ws.c's `ws_check_emit_1`: the errors of `rule` in `line` (its LF included, if any),
173
+ * writing the line to `out` with the errors in `ws` and the rest in `set` when given.
174
+ */
175
+ function wsCheckEmit1(
176
+ line: WsLine,
177
+ rule: number,
178
+ emit?: { out: WsEmitTarget; set: string; reset: string; ws: string },
179
+ ): number {
140
180
  let result = 0;
141
- let len = line.length;
181
+ let written = 0;
182
+ let trailingWhitespace = -1;
142
183
  let trailingNewline = false;
143
- if (len > 0 && line.charCodeAt(len - 1) === 0x0a) {
184
+ let trailingCarriageReturn = false;
185
+ let len = line.length;
186
+ const out = emit?.out;
187
+ const part = (from: number, to: number) => {
188
+ if (!out || to <= from) return;
189
+ if (typeof line === "string") {
190
+ const bytes = new Uint8Array(to - from);
191
+ for (let i = from; i < to; i++) bytes[i - from] = line.charCodeAt(i) & 0xff;
192
+ out.bytes(bytes);
193
+ } else out.bytes(line.subarray(from, to));
194
+ };
195
+ if (len > 0 && codeAt(line, len - 1) === 0x0a) {
144
196
  trailingNewline = true;
145
197
  len--;
146
198
  }
147
- if (rule & WS_CR_AT_EOL && len > 0 && line.charCodeAt(len - 1) === 0x0d) len--;
148
- let trailing = -1;
199
+ if (rule & WS_CR_AT_EOL && len > 0 && codeAt(line, len - 1) === 0x0d) {
200
+ trailingCarriageReturn = true;
201
+ len--;
202
+ }
149
203
  if (rule & WS_BLANK_AT_EOL) {
150
204
  for (let i = len - 1; i >= 0; i--) {
151
- if (isGitSpace(line.charCodeAt(i))) {
152
- trailing = i;
205
+ if (isGitSpace(codeAt(line, i))) {
206
+ trailingWhitespace = i;
153
207
  result |= WS_BLANK_AT_EOL;
154
208
  } else break;
155
209
  }
156
210
  }
157
- if (trailing === -1) trailing = len;
211
+ if (trailingWhitespace === -1) trailingWhitespace = len;
158
212
  if (!trailingNewline && rule & WS_INCOMPLETE_LINE) result |= WS_INCOMPLETE_LINE;
159
- let written = 0;
160
213
  let i = 0;
161
- for (; i < trailing; i++) {
162
- const ch = line.charCodeAt(i);
214
+ for (; i < trailingWhitespace; i++) {
215
+ const ch = codeAt(line, i);
163
216
  if (ch === 0x20) continue;
164
217
  if (ch !== 0x09) break;
165
- if (rule & WS_SPACE_BEFORE_TAB && written < i) result |= WS_SPACE_BEFORE_TAB;
166
- else if (rule & WS_TAB_IN_INDENT) result |= WS_TAB_IN_INDENT;
218
+ if (rule & WS_SPACE_BEFORE_TAB && written < i) {
219
+ result |= WS_SPACE_BEFORE_TAB;
220
+ if (emit) {
221
+ emit.out.str(emit.ws);
222
+ part(written, i);
223
+ emit.out.str(emit.reset);
224
+ part(i, i + 1);
225
+ }
226
+ } else if (rule & WS_TAB_IN_INDENT) {
227
+ result |= WS_TAB_IN_INDENT;
228
+ if (emit) {
229
+ part(written, i);
230
+ emit.out.str(emit.ws);
231
+ part(i, i + 1);
232
+ emit.out.str(emit.reset);
233
+ }
234
+ } else part(written, i + 1);
167
235
  written = i + 1;
168
236
  }
169
237
  if (rule & WS_INDENT_WITH_NON_TAB && i - written >= wsTabWidth(rule)) {
170
238
  result |= WS_INDENT_WITH_NON_TAB;
239
+ if (emit) {
240
+ emit.out.str(emit.ws);
241
+ part(written, i);
242
+ emit.out.str(emit.reset);
243
+ }
244
+ written = i;
245
+ }
246
+ if (emit) {
247
+ if (trailingWhitespace - written > 0) {
248
+ emit.out.str(emit.set);
249
+ part(written, trailingWhitespace);
250
+ emit.out.str(emit.reset);
251
+ }
252
+ if (trailingWhitespace !== len) {
253
+ emit.out.str(emit.ws);
254
+ part(trailingWhitespace, len);
255
+ emit.out.str(emit.reset);
256
+ }
257
+ if (trailingCarriageReturn) part(len, len + 1);
258
+ if (trailingNewline) part(line.length - 1, line.length);
171
259
  }
172
260
  return result;
173
261
  }
174
262
 
175
- /** Whether a line holds whitespace only (`ws_blank_line`). */
176
- export function wsBlankLine(line: string, start = 0, end = line.length): boolean {
177
- for (let i = start; i < end; i++) if (!isGitSpace(line.charCodeAt(i))) return false;
263
+ /** The whitespace errors of one line (with or without its LF), as `ws_check` finds them. */
264
+ export function wsCheck(line: WsLine, rule: number): number {
265
+ return wsCheckEmit1(line, rule);
266
+ }
267
+
268
+ /**
269
+ * ws.c's `ws_check_emit`: writes the line (its LF included, if any) to `out`, the errors of
270
+ * `rule` in the `ws` color and the rest in `set`; returns the errors.
271
+ */
272
+ export function wsCheckEmit(
273
+ line: Uint8Array,
274
+ rule: number,
275
+ out: WsEmitTarget,
276
+ set: string,
277
+ reset: string,
278
+ ws: string,
279
+ ): number {
280
+ return wsCheckEmit1(line, rule, { out, set, reset, ws });
281
+ }
282
+
283
+ /** Whether a line (or its part from `start` to `end`) holds whitespace only (`ws_blank_line`). */
284
+ export function wsBlankLine(line: WsLine, start = 0, end = line.length): boolean {
285
+ for (let i = start; i < end; i++) if (!isGitSpace(codeAt(line, i))) return false;
178
286
  return true;
179
287
  }
180
288
 
289
+ /** diff.c's `count_trailing_blank`: the blank lines at the end of a file */
290
+ export function countTrailingBlank(mf: Uint8Array): number {
291
+ let cnt = 0;
292
+ if (mf.length === 0) return 0;
293
+ let ptr = mf.length - 1;
294
+ if (mf[ptr] === 0x0a) ptr--;
295
+ while (0 < ptr) {
296
+ let prevEol = ptr;
297
+ for (; 0 <= prevEol; prevEol--) if (mf[prevEol] === 0x0a) break;
298
+ if (!wsBlankLine(mf, prevEol + 1, ptr + 1)) break;
299
+ cnt++;
300
+ ptr = prevEol - 1;
301
+ }
302
+ return cnt;
303
+ }
304
+
305
+ /** diff.c's `count_lines` */
306
+ export function countLines(data: Uint8Array): number {
307
+ if (data.length === 0) return 0;
308
+ let count = 0;
309
+ for (const c of data) if (c === 0x0a) count++;
310
+ if (data[data.length - 1] !== 0x0a) count++;
311
+ return count;
312
+ }
313
+
314
+ /**
315
+ * diff.c's `check_blank_at_eof`: where the blank lines a change adds at the end of the file
316
+ * start, in each image (1-based), or zeros when it adds none
317
+ */
318
+ export function checkBlankAtEof(
319
+ preimage: Uint8Array,
320
+ postimage: Uint8Array,
321
+ ): { preimage: number; postimage: number } {
322
+ const l1 = countTrailingBlank(preimage);
323
+ const l2 = countTrailingBlank(postimage);
324
+ if (l2 <= l1) return { preimage: 0, postimage: 0 };
325
+ return {
326
+ preimage: countLines(preimage) - l1 + 1,
327
+ postimage: countLines(postimage) - l2 + 1,
328
+ };
329
+ }
330
+
181
331
  /**
182
332
  * The line with its whitespace errors fixed (`ws_fix_copy`); `fixed` tells whether anything
183
333
  * changed.
@@ -1,58 +0,0 @@
1
- /**
2
- * git's whitespace rules (`ws.c`): the `core.whitespace` / `whitespace` attribute rules, the
3
- * check `git apply` and `git diff --check` run on added lines, and the fix
4
- * `--whitespace=fix` applies.
5
- *
6
- * Lines are "binary strings": one character per byte (latin1), so a line's length is its
7
- * byte count and any encoding passes through unchanged.
8
- *
9
- * @example
10
- * ```typescript
11
- * const rule = parseWhitespaceRule("trailing-space,-space-before-tab");
12
- * wsCheck("x \n", rule); // WS_BLANK_AT_EOL
13
- * wsFixCopy("x \n", rule).text; // "x\n"
14
- * ```
15
- */
16
- export declare const WS_BLANK_AT_EOL: number;
17
- export declare const WS_SPACE_BEFORE_TAB: number;
18
- export declare const WS_INDENT_WITH_NON_TAB: number;
19
- export declare const WS_CR_AT_EOL: number;
20
- export declare const WS_BLANK_AT_EOF: number;
21
- export declare const WS_TAB_IN_INDENT: number;
22
- export declare const WS_INCOMPLETE_LINE: number;
23
- export declare const WS_TRAILING_SPACE: number;
24
- export declare const WS_DEFAULT_RULE: number;
25
- export declare const WS_TAB_WIDTH_MASK: number;
26
- /** The tab width a rule carries (`ws_tab_width`). */
27
- export declare function wsTabWidth(rule: number): number;
28
- /** git's `isspace`: space, tab, LF and CR only (not VT or FF). */
29
- export declare function isGitSpace(ch: number): boolean;
30
- /** An invalid rule combination (git dies). */
31
- export declare class WhitespaceRuleError extends Error {
32
- }
33
- /**
34
- * Parses a `core.whitespace` value (or a `whitespace=<rules>` attribute) as
35
- * `parse_whitespace_rule` does: comma-separated names, `-name` to turn one off,
36
- * `tabwidth=<n>`.
37
- */
38
- export declare function parseWhitespaceRule(value: string, warn?: (message: string) => void): number;
39
- /**
40
- * The rule for one path (`whitespace_rule`): from its `whitespace` attribute (true, false,
41
- * unset or a rule list), `configRule` (`core.whitespace`) by default.
42
- */
43
- export declare function whitespaceRuleOf(attribute: boolean | string | undefined, configRule: number): number;
44
- /** The message naming the errors in `ws` (`whitespace_error_string`). */
45
- export declare function whitespaceErrorString(ws: number): string;
46
- /** The whitespace errors of one line (with or without its LF), as `ws_check` finds them. */
47
- export declare function wsCheck(line: string, rule: number): number;
48
- /** Whether a line holds whitespace only (`ws_blank_line`). */
49
- export declare function wsBlankLine(line: string, start?: number, end?: number): boolean;
50
- /**
51
- * The line with its whitespace errors fixed (`ws_fix_copy`); `fixed` tells whether anything
52
- * changed.
53
- */
54
- export declare function wsFixCopy(src: string, rule: number): {
55
- text: string;
56
- fixed: boolean;
57
- };
58
- //# sourceMappingURL=whitespace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whitespace.d.ts","sourceRoot":"","sources":["../../../src/commands/apply/whitespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,eAAe,QAAS,CAAC;AACtC,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAC1C,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,YAAY,QAAS,CAAC;AACnC,eAAO,MAAM,eAAe,QAAU,CAAC;AACvC,eAAO,MAAM,gBAAgB,QAAU,CAAC;AACxC,eAAO,MAAM,kBAAkB,QAAU,CAAC;AAC1C,eAAO,MAAM,iBAAiB,QAAoC,CAAC;AACnE,eAAO,MAAM,eAAe,QAA8C,CAAC;AAC3E,eAAO,MAAM,iBAAiB,QAAe,CAAC;AAE9C,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAkBD,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,8CAA8C;AAC9C,qBAAa,mBAAoB,SAAQ,KAAK;CAAG;AAEjD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,CAyC3F;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,GACjB,MAAM,CASR;AAED,yEAAyE;AACzE,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAYxD;AAED,4FAA4F;AAC5F,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAkC1D;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAI,EAAE,GAAG,SAAc,GAAG,OAAO,CAG/E;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CA2ErF"}