@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,77 @@
1
+ /**
2
+ * git's combined diff (`combine-diff.c`), dense form (`diff --cc`): one result compared with
3
+ * several parents at once, as `git diff` shows a conflicted path, the worktree file against
4
+ * stages 2 ("ours") and 3 ("theirs").
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * writeCombinedDiff(sink, {
9
+ * path: "f.txt",
10
+ * parents: [ours, theirs], // { id, mode, content }
11
+ * result: { id: NULL_ID, mode: 0o100644, content: worktreeBytes },
12
+ * }, options);
13
+ * // diff --cc f.txt
14
+ * // index 1a2b3c4,5d6e7f8..0000000
15
+ * // ...
16
+ * // @@@ -1,5 -1,5 +1,9 @@@
17
+ * // 1
18
+ * // ++<<<<<<< HEAD
19
+ * ```
20
+ *
21
+ * Each parent is diffed with the result without context (the same xdiff options as the
22
+ * patch); the lines a parent lost hang on the result line after them, merged across parents
23
+ * by their longest common subsequence. A hunk shows only where the result differs from more
24
+ * than one version (dense: a change taken from one parent alone is left out). Function lines
25
+ * of the hunk headers are the last line above the hunk starting with a letter, `_` or `$`,
26
+ * cut at 40 bytes, without its last non-blank byte (as git prints them).
27
+ *
28
+ * @module
29
+ */
30
+ import { type ByteSink, type UnifiedDiffOptions } from "@statewalker/vcs-utils";
31
+ /** One version of a combined diff: a parent or the result */
32
+ export interface CombinedSide {
33
+ /** Object id (the null id for a worktree file) */
34
+ id: string;
35
+ /** git file mode; 0 for a result that is deleted */
36
+ mode: number;
37
+ /** The content (a symbolic link: its target) */
38
+ content: Uint8Array;
39
+ }
40
+ /** A path of a combined diff */
41
+ export interface CombinedPath {
42
+ path: string;
43
+ parents: CombinedSide[];
44
+ result: CombinedSide;
45
+ }
46
+ /** Options of {@link writeCombinedDiff} */
47
+ export interface CombinedDiffOptions extends Pick<UnifiedDiffOptions, "algorithm" | "indentHeuristic" | "histogramRediff" | "legacyMinimal" | "ignoreWhitespace" | "ignoreWhitespaceChange" | "ignoreWhitespaceAtEol" | "ignoreCrAtEol" | "ignoreBlankLines"> {
48
+ /** Lines of context (`-U`, default 3) */
49
+ context?: number;
50
+ /** `core.quotePath` (default true) */
51
+ quotePath?: boolean;
52
+ /** Treat the files as binary (a `diff` attribute) or text, regardless of content */
53
+ binary?: boolean;
54
+ /** Prefix of old paths (default "a/") */
55
+ srcPrefix?: string;
56
+ /** Prefix of new paths (default "b/") */
57
+ dstPrefix?: string;
58
+ /** The abbreviation of an id in the `index` line (default its first 7 digits) */
59
+ abbreviate?: (id: string) => string;
60
+ /**
61
+ * `--cc` (default) or `-c` (false): dense hunks leave out what came from one parent alone,
62
+ * and the header reads `diff --cc` rather than `diff --combined`
63
+ */
64
+ dense?: boolean;
65
+ /**
66
+ * The result is a worktree file (default true, `git diff` of a conflict): the path is
67
+ * printed even when no hunk is left; false (`git log --cc` of a merge's trees) prints it
68
+ * only with a hunk or a mode change
69
+ */
70
+ workingTreeFile?: boolean;
71
+ }
72
+ /**
73
+ * The dense combined diff of a path whose result is a worktree file (`show_patch_diff` with
74
+ * `working_tree_file`): always printed, with its header, even when no hunk is left.
75
+ */
76
+ export declare function writeCombinedDiff(sink: ByteSink, elem: CombinedPath, options?: CombinedDiffOptions): void;
77
+ //# sourceMappingURL=combined-diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combined-diff.d.ts","sourceRoot":"","sources":["../../src/results/combined-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAOxB,MAAM,wBAAwB,CAAC;AAIhC,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,gCAAgC;AAChC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,2CAA2C;AAC3C,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,kBAAkB,EAChB,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,kBAAkB,GAClB,wBAAwB,GACxB,uBAAuB,GACvB,eAAe,GACf,kBAAkB,CACrB;IACD,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oFAAoF;IACpF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAoaD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE,mBAAwB,GAChC,IAAI,CAkDN"}
@@ -53,6 +53,38 @@ export interface DiffEntry {
53
53
  newMode?: FileModeValue;
54
54
  /** Similarity score for RENAME/COPY (0-100) */
55
55
  score?: number;
56
+ /**
57
+ * Reads the old content when it is not the stored blob `oldId` (a file outside the
58
+ * repository in a `--no-index` diff)
59
+ */
60
+ readOld?: () => Promise<Uint8Array>;
61
+ /**
62
+ * Reads the new content when it is not the stored blob `newId`: a worktree file, cleaned as
63
+ * `git add` would store it (`newId` is then the id of that content)
64
+ */
65
+ readNew?: () => Promise<Uint8Array>;
66
+ /** An unmerged path (index stages 1-3), printed as "* Unmerged path <path>" */
67
+ unmerged?: boolean;
68
+ /**
69
+ * The new side is a submodule with changes of its own in the worktree: `readNew` gives
70
+ * "Subproject commit <id>-dirty", `newId` is its commit as git knows it
71
+ */
72
+ newDirtySubmodule?: boolean;
73
+ /**
74
+ * What the new side's submodule holds of its own in the worktree, as `--submodule=log`
75
+ * reports it ("contains modified content", "contains untracked content")
76
+ */
77
+ newSubmoduleDirt?: {
78
+ modified?: boolean;
79
+ untracked?: boolean;
80
+ };
81
+ /**
82
+ * The new side is a worktree submodule checked out at another commit than its index entry
83
+ * (a comparison of a tree with the worktree): git gives it the null id, which it fills from
84
+ * the submodule's HEAD (`newId`) only to print a patch. Such an entry is reported even
85
+ * when that commit is the old side's, and no rename pairs with it.
86
+ */
87
+ newIdUnknown?: boolean;
56
88
  }
57
89
  /**
58
90
  * Create a DiffEntry for an added file.
@@ -1 +1 @@
1
- {"version":3,"file":"diff-entry.d.ts","sourceRoot":"","sources":["../../src/results/diff-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAErE;;GAEG;AACH,oBAAY,UAAU;IACpB,qBAAqB;IACrB,GAAG,QAAQ;IAEX,wBAAwB;IACxB,MAAM,WAAW;IAEjB,uBAAuB;IACvB,MAAM,WAAW;IAEjB,uBAAuB;IACvB,MAAM,WAAW;IAEjB,sBAAsB;IACtB,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,SAAS;IACxB,qBAAqB;IACrB,UAAU,EAAE,UAAU,CAAC;IAEvB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,QAAQ,CAAC;IAEjB,kDAAkD;IAClD,KAAK,CAAC,EAAE,QAAQ,CAAC;IAEjB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB,kDAAkD;IAClD,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EA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B,SAAS,CAUX;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,MAAM,GACZ,SAAS,CAWX;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,MAAM,GACZ,SAAS,CAWX"}
@@ -1,16 +1,16 @@
1
1
  /**
2
- * Formatter for generating unified diff output from DiffEntry objects.
3
- *
4
- * Based on JGit's DiffFormatter class.
2
+ * Formatter for unified diffs of DiffEntry objects, byte for byte as `git diff` prints them
3
+ * (see {@link formatPatch} for the rules).
5
4
  */
6
5
  import { type Blobs } from "@statewalker/vcs-core";
7
- import { type SupportedAlgorithm } from "@statewalker/vcs-utils";
6
+ import { type SupportedAlgorithm, type XdiffAlgorithm } from "@statewalker/vcs-utils";
8
7
  import { type DiffEntry } from "./diff-entry.js";
8
+ import { type DiffFilePair, type DiffOutputOptions } from "./diff-output.js";
9
9
  /**
10
10
  * Options for diff formatting.
11
11
  */
12
- export interface DiffFormatterOptions {
13
- /** Number of context lines around changes (default: 3) */
12
+ export interface DiffFormatterOptions extends Omit<DiffOutputOptions, "algorithm"> {
13
+ /** Number of context lines around changes (default: 3; same as `context`) */
14
14
  contextLines?: number;
15
15
  /** Whether to include file headers (default: true) */
16
16
  includeHeaders?: boolean;
@@ -18,8 +18,8 @@ export interface DiffFormatterOptions {
18
18
  abbreviateIds?: boolean;
19
19
  /** Length of abbreviated object IDs (default: 7) */
20
20
  abbreviationLength?: number;
21
- /** Diff algorithm to use (default: histogram) */
22
- algorithm?: SupportedAlgorithm;
21
+ /** Diff algorithm (default: myers, as git's `diff.algorithm`) */
22
+ algorithm?: XdiffAlgorithm | SupportedAlgorithm;
23
23
  /**
24
24
  * Files larger than this are binary: they show as "Binary files differ" and are
25
25
  * never loaded (git's `core.bigFileThreshold`). Default 50 MiB.
@@ -30,15 +30,20 @@ export interface DiffFormatterOptions {
30
30
  * A hunk in unified diff format.
31
31
  */
32
32
  export interface DiffHunk {
33
- /** Starting line in old file (1-based) */
33
+ /** Starting line in old file, as printed (1-based; the line before for an empty range) */
34
34
  oldStart: number;
35
35
  /** Number of lines from old file */
36
36
  oldCount: number;
37
- /** Starting line in new file (1-based) */
37
+ /** Starting line in new file, as printed */
38
38
  newStart: number;
39
39
  /** Number of lines from new file */
40
40
  newCount: number;
41
- /** Lines in the hunk (prefixed with ' ', '+', or '-') */
41
+ /** The function line of the hunk header ("" when none) */
42
+ functionName?: string;
43
+ /**
44
+ * Lines in the hunk (prefixed with ' ', '+', or '-', without line terminator), with
45
+ * "" after a line without one
46
+ */
42
47
  lines: string[];
43
48
  }
44
49
  /**
@@ -51,21 +56,27 @@ export interface FileContentDiff {
51
56
  isBinary: boolean;
52
57
  /** File header line (e.g., "diff --git a/path b/path") */
53
58
  header: string;
54
- /** Old file header (e.g., "--- a/path") */
59
+ /** Old file header (e.g., "--- a/path"), when hunks follow */
55
60
  oldFileHeader?: string;
56
- /** New file header (e.g., "+++ b/path") */
61
+ /** New file header (e.g., "+++ b/path"), when hunks follow */
57
62
  newFileHeader?: string;
58
63
  /** Index line (e.g., "index abc123..def456 100644") */
59
64
  indexLine?: string;
65
+ /** Lines between the `diff --git` line and the file headers, each with its LF */
66
+ extendedHeaders?: string;
60
67
  /** Hunks of changes */
61
68
  hunks: DiffHunk[];
62
69
  /** Raw old content of a text file (binary files are not loaded) */
63
70
  oldContent?: Uint8Array;
64
71
  /** Raw new content of a text file (binary files are not loaded) */
65
72
  newContent?: Uint8Array;
73
+ /** The file's part of `git diff` output, exactly (empty when git prints nothing for it) */
74
+ patch: Uint8Array;
66
75
  }
76
+ /** The file pair of a diff entry: blob sides, or the content the entry reads */
77
+ export declare function diffEntryToPair(entry: DiffEntry, blobs: Blobs): DiffFilePair;
67
78
  /**
68
- * Format DiffEntry objects into unified diff format.
79
+ * Format DiffEntry objects into unified diff format, as `git diff` prints them.
69
80
  *
70
81
  * @example
71
82
  * ```typescript
@@ -75,20 +86,13 @@ export interface FileContentDiff {
75
86
  * const entries = await git.diff().setOldTree(commitA).setNewTree(commitB).call();
76
87
  *
77
88
  * // Format as unified diff
78
- * for (const entry of entries) {
79
- * const diff = await formatter.format(entry);
80
- * console.log(formatter.toString(diff));
81
- * }
89
+ * process.stdout.write(await formatter.formatAll(entries));
82
90
  * ```
83
91
  */
84
92
  export declare class DiffFormatter {
85
93
  private readonly blobs;
86
- private contextLines;
87
- private includeHeaders;
88
- private abbreviateIds;
89
- private abbreviationLength;
90
- private diffAlgorithm;
91
- private bigFileThreshold;
94
+ private readonly includeHeaders;
95
+ private readonly output;
92
96
  constructor(blobs: Blobs, options?: DiffFormatterOptions);
93
97
  /**
94
98
  * Format a DiffEntry into a content diff.
@@ -103,54 +107,24 @@ export declare class DiffFormatter {
103
107
  */
104
108
  format(entry: DiffEntry): Promise<FileContentDiff>;
105
109
  /**
106
- * Convert a FileContentDiff to string format.
110
+ * The file's part of the diff as text: exactly git's output (LF-terminated lines), or
111
+ * without the file headers when `includeHeaders` is false. Bytes that are no UTF-8 decode
112
+ * as paths do (`decodeGitPath`), so `encodeGitPath` of the text gives the bytes back.
107
113
  *
108
114
  * @param diff The content diff to stringify
109
115
  * @returns Unified diff string
110
116
  */
111
117
  toString(diff: FileContentDiff): string;
112
118
  /**
113
- * Format all diff entries to a single string.
119
+ * Format all diff entries to a single string, as `git diff` prints them.
114
120
  *
115
121
  * @param entries Array of diff entries
116
122
  * @returns Complete unified diff output
117
123
  */
118
124
  formatAll(entries: DiffEntry[]): Promise<string>;
119
125
  /**
120
- * Build the diff header line.
121
- */
122
- private buildHeader;
123
- /**
124
- * Build the index line.
125
- */
126
- private buildIndexLine;
127
- /**
128
- * Build the old file header line.
129
- */
130
- private buildOldFileHeader;
131
- /**
132
- * Build the new file header line.
133
- */
134
- private buildNewFileHeader;
135
- /**
136
- * Abbreviate an object ID.
137
- */
138
- private abbreviateId;
139
- /**
140
- * Format the hunk header.
141
- */
142
- private formatHunkHeader;
143
- /**
144
- * Format edits into hunks.
145
- */
146
- private formatEdits;
147
- /**
148
- * Combine edits that are within context range of each other.
149
- */
150
- private combineEdits;
151
- /**
152
- * Create a hunk from a group of edits.
126
+ * All diff entries as the bytes `git diff` prints (content that is not UTF-8 kept as it is).
153
127
  */
154
- private createHunk;
128
+ formatBytes(entries: DiffEntry[]): Promise<Uint8Array>;
155
129
  }
156
130
  //# sourceMappingURL=diff-formatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diff-formatter.d.ts","sourceRoot":"","sources":["../../src/results/diff-formatter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAyC,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iDAAiD;IACjD,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM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;IACG,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAyCvD;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAKtC;IAED;;;;;OAKG;IACG,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAIrD;IAED;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAI3D;CACF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * git's `diffcore-order.c` (`-O<orderfile>`, `diff.orderFile`): file pairs reordered by the
3
+ * glob patterns of an order file.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * const patterns = parseOrderFile(new TextEncoder().encode("*.h\n# headers first\n*.c\n"));
8
+ * orderByPatterns(["b.c", "a.h", "README"], patterns, (p) => p);
9
+ * // ["a.h", "b.c", "README"]
10
+ * ```
11
+ *
12
+ * Each line of the file is a pattern, taken as it is (no trimming); empty lines and lines
13
+ * starting with `#` are skipped. A path's rank is the first pattern that matches it or one
14
+ * of its leading directories (wildmatch without `WM_PATHNAME`, so `*` also matches `/`);
15
+ * paths no pattern matches come last, and paths of the same rank keep their order.
16
+ *
17
+ * @module
18
+ */
19
+ /** The patterns of an order file (git's `prepare_order`) */
20
+ export declare function parseOrderFile(content: Uint8Array): string[];
21
+ /** The rank of `path`: the first pattern matching it or a leading directory (`match_order`) */
22
+ export declare function orderRank(patterns: readonly string[], path: string): number;
23
+ /** The items ordered by the rank of their paths, stably (`order_objects`) */
24
+ export declare function orderByPatterns<T>(items: readonly T[], patterns: readonly string[], pathOf: (item: T) => string): T[];
25
+ //# sourceMappingURL=diff-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-order.d.ts","sourceRoot":"","sources":["../../src/results/diff-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,CAc5D;AAED,+FAA+F;AAC/F,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAW3E;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAC1B,CAAC,EAAE,CAKL"}
@@ -0,0 +1,249 @@
1
+ /**
2
+ * git's diff output (`diff.c`) over file pairs: the patch (`git diff`), `--stat`,
3
+ * `--numstat`, `--shortstat`, `--name-only` and `--name-status`, byte for byte as git prints
4
+ * them.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const pairs: DiffFilePair[] = [{ status: "M", old: blobSide(...), new: blobSide(...) }];
9
+ * const patch = await formatPatch(pairs, { context: 3, indentHeuristic: true });
10
+ * const stat = formatStat(await computeDiffstat(pairs), { width: 80 });
11
+ * ```
12
+ *
13
+ * A pair has an old and a new side; a side that does not exist (an added file's old side,
14
+ * a deleted file's new side) is left out. Each file is shown as git's `builtin_diff` shows
15
+ * it: the `diff --git` header with mode, rename and `index` lines, then "Binary files ...
16
+ * differ" or the hunks of the text diff ({@link unifiedDiffHunks}). A pair between a file
17
+ * and a symbolic link is shown as a deletion and an addition. The header of a file whose
18
+ * diff comes out empty (only whitespace changes under `-w`) is printed only when it
19
+ * carries news of its own (mode change, rename, new or deleted file).
20
+ *
21
+ * @module
22
+ */
23
+ import { type Blobs } from "@statewalker/vcs-core";
24
+ import { ByteSink, type FindFunction, type UnifiedDiffOptions, type UnifiedDiffResult, type XdiffAlgorithm } from "@statewalker/vcs-utils";
25
+ /** One side of a file pair */
26
+ export interface DiffSideSpec {
27
+ path: string;
28
+ /** git file mode, e.g. `0o100644` */
29
+ mode: number;
30
+ /** Object id of the content (a worktree file: the id of its cleaned content) */
31
+ id: string;
32
+ /** The content (a symbolic link: its target; a submodule: "Subproject commit <id>\n") */
33
+ read(): Promise<Uint8Array>;
34
+ /**
35
+ * The bytes a textconv command reads, as git's `prepare_temp_file` writes them: a stored
36
+ * blob as checkout would write it (smudged), a worktree file as it is (not cleaned);
37
+ * default {@link read}
38
+ */
39
+ readTextconvInput?(): Promise<Uint8Array>;
40
+ /**
41
+ * Whether `id` is known as git knows a stored object's (default true); false for content
42
+ * hashed here, a worktree file or a file outside the repository (git's `oid_valid` unset):
43
+ * the diffstat then compares the contents even when the ids are equal
44
+ */
45
+ idValid?: boolean;
46
+ /**
47
+ * Size and binary probe without reading everything (big files): when absent, the content
48
+ * is read
49
+ */
50
+ probe?(bigFileThreshold: number): Promise<{
51
+ size: number;
52
+ binary: boolean;
53
+ }>;
54
+ /**
55
+ * A submodule's own changes in the worktree (git's `dirty_submodule`): tracked changes
56
+ * (`modified`) and untracked files (`untracked`) inside it
57
+ */
58
+ submoduleDirt?: {
59
+ modified?: boolean;
60
+ untracked?: boolean;
61
+ };
62
+ }
63
+ /** git's status letters of a file pair */
64
+ export type DiffStatus = "A" | "D" | "M" | "R" | "C" | "T";
65
+ /** A file pair as git's diff queue holds it */
66
+ export interface DiffFilePair {
67
+ status: DiffStatus;
68
+ /** The old side; absent for an added file */
69
+ old?: DiffSideSpec;
70
+ /** The new side; absent for a deleted file */
71
+ new?: DiffSideSpec;
72
+ /** Similarity percentage of a rename or copy */
73
+ score?: number;
74
+ }
75
+ /** What a diff driver (`diff=<name>` attribute) changes */
76
+ export interface DiffDriver {
77
+ /** Binary (`-diff`, `diff.<name>.binary`) or text (`diff`) regardless of content */
78
+ binary?: boolean;
79
+ /** Hunk header function lines (`diff.<name>.xfuncname`, builtin drivers) */
80
+ findFunction?: FindFunction;
81
+ /** `diff.<name>.algorithm` */
82
+ algorithm?: XdiffAlgorithm;
83
+ /** The driver's name (`diff=<name>`) */
84
+ name?: string;
85
+ /** `diff.<name>.textconv`: the command git would run to turn the content into text */
86
+ textconvCommand?: string;
87
+ /** `diff.<name>.cachetextconv` (output is the same with or without the cache) */
88
+ cacheTextconv?: boolean;
89
+ /**
90
+ * Turns a side's content into the text the patch compares (git's `fill_textconv`): set
91
+ * when textconv is allowed and the host can run `textconvCommand`. A side converted this
92
+ * way is never binary.
93
+ */
94
+ textconv?: TextconvFunction;
95
+ }
96
+ /** A textconv conversion: the text of `content`, the content of the file `path` */
97
+ export type TextconvFunction = (content: Uint8Array, path: string) => Promise<Uint8Array>;
98
+ /** Options of the diff output */
99
+ export interface DiffOutputOptions extends Omit<UnifiedDiffOptions, "findFunction" | "indentHeuristic"> {
100
+ /** Slide changes as the indentation suggests (`diff.indentHeuristic`, default true) */
101
+ indentHeuristic?: boolean;
102
+ /** Length of abbreviated object ids in `index` lines (default 7) */
103
+ abbrev?: number;
104
+ /**
105
+ * The length of each id in `index` lines, as git abbreviates them (`DiffCommand` finds
106
+ * them from `core.abbrev`, the repository's size and the other objects); ids not in it
107
+ * take `abbrev`
108
+ */
109
+ abbrevLengths?: ReadonlyMap<string, number>;
110
+ /** Full object ids in `index` lines (`--full-index`) */
111
+ fullIndex?: boolean;
112
+ /**
113
+ * `--submodule=log` / `--submodule=diff`: writes a pair whose sides are submodules (or
114
+ * absent) in place of its patch (builtin_diff's submodule branch); unset, a submodule's
115
+ * change is a `Subproject commit` patch (`--submodule=short`)
116
+ */
117
+ submodulePatch?: (sink: ByteSink, pair: DiffFilePair, options: DiffOutputOptions) => Promise<void>;
118
+ /**
119
+ * `--binary`: binary files as "GIT binary patch" hunks `git apply` can apply (their `index`
120
+ * lines with full ids), instead of "Binary files ... differ"
121
+ */
122
+ binaryPatch?: boolean;
123
+ /** `core.quotePath` (default true): bytes above 0x7f in paths are escaped */
124
+ quotePath?: boolean;
125
+ /** Larger files are binary (`core.bigFileThreshold`, default 512 MiB as git's diff) */
126
+ bigFileThreshold?: number;
127
+ /** Treat every file as text (`-a`, `--text`) */
128
+ text?: boolean;
129
+ /** Prefix of old paths (default "a/"; `--src-prefix`, `--no-prefix`) */
130
+ srcPrefix?: string;
131
+ /** Prefix of new paths (default "b/") */
132
+ dstPrefix?: string;
133
+ /** The diff driver of a path (from its `diff` attribute), if any */
134
+ driver?: (path: string) => Promise<DiffDriver | undefined> | DiffDriver | undefined;
135
+ }
136
+ /**
137
+ * The driver of a `diff` attribute value (git's `userdiff_find_by_path`): set means text,
138
+ * unset means binary, a name means `diff.<name>.*` from `config` or a builtin driver.
139
+ */
140
+ export declare function diffDriverOf(attribute: true | false | string | undefined | null, config?: (key: string) => string | undefined): DiffDriver | undefined;
141
+ /**
142
+ * The patch of the pairs, as `git diff` prints it.
143
+ */
144
+ export declare function formatPatch(pairs: DiffFilePair[], options?: DiffOutputOptions): Promise<Uint8Array>;
145
+ /** What {@link writePairPatch} found for a pair (the last part, for a split pair) */
146
+ export interface PairPatchReport {
147
+ /** "Binary files ... differ" (or binary and equal) */
148
+ binary: boolean;
149
+ /** The `diff --git` line, without its LF */
150
+ gitLine: string;
151
+ /** The lines between `diff --git` and `---` (mode, rename, index lines), each with LF */
152
+ extended: string;
153
+ /** The `---` and `+++` lines, without LF, when hunks were printed */
154
+ oldLabel?: string;
155
+ newLabel?: string;
156
+ /** The text diff, for a text pair */
157
+ result?: UnifiedDiffResult;
158
+ }
159
+ /** Writes one pair as `run_diff` does: a file/symlink change as deletion and addition */
160
+ export declare function writePairPatch(sink: ByteSink, pair: DiffFilePair, options?: DiffOutputOptions, report?: PairPatchReport): Promise<void>;
161
+ /** One file of a diffstat (`struct diffstat_file`) */
162
+ export interface DiffstatFile {
163
+ /** The old name of a renamed (or differently named) pair */
164
+ fromName?: string;
165
+ name: string;
166
+ isRenamed: boolean;
167
+ isBinary: boolean;
168
+ isUnmerged?: boolean;
169
+ /** Lines added (binary: new size in bytes) */
170
+ added: number;
171
+ /** Lines deleted (binary: old size in bytes) */
172
+ deleted: number;
173
+ }
174
+ /** The diffstat of the pairs (`builtin_diffstat` for each) */
175
+ export declare function computeDiffstat(pairs: DiffFilePair[], options?: DiffOutputOptions): Promise<DiffstatFile[]>;
176
+ /** Options of {@link formatStat} (`--stat=<width>[,<name-width>[,<count>]]`) */
177
+ export interface DiffstatOptions {
178
+ /** Total width (`COLUMNS`, default 80) */
179
+ width?: number;
180
+ /** Width of the name part (`--stat-name-width`, `diff.statNameWidth`) */
181
+ nameWidth?: number;
182
+ /** Width of the graph part (`--stat-graph-width`, `diff.statGraphWidth`) */
183
+ graphWidth?: number;
184
+ /** Files shown (`--stat-count`) */
185
+ count?: number;
186
+ /** `core.quotePath` (default true) */
187
+ quotePath?: boolean;
188
+ }
189
+ /** git's `pprint_rename`: `a/{b => c}/d` */
190
+ export declare function pprintRename(a: string, b: string, quote?: boolean): string;
191
+ /**
192
+ * Display width of a name, as git's utf8_strwidth measures it (git 2.56's character widths:
193
+ * wide East Asian characters and emoji two columns, combining marks none; a name that is not
194
+ * valid UTF-8 its byte count)
195
+ */
196
+ export declare function displayWidth(s: string): number;
197
+ /** git's `print_stat_summary_inserts_deletes` */
198
+ export declare function statSummary(files: number, insertions: number, deletions: number): string;
199
+ /** `--stat`, as git's `show_stats` prints it */
200
+ export declare function formatStat(files: DiffstatFile[], options?: DiffstatOptions): string;
201
+ /** `--shortstat` (git's `show_shortstats`) */
202
+ export declare function formatShortstat(files: DiffstatFile[]): string;
203
+ /** `--numstat` (git's `show_numstat`) */
204
+ export declare function formatNumstat(files: DiffstatFile[], options?: {
205
+ quotePath?: boolean;
206
+ }): string;
207
+ /** `--name-only`: the new path of each pair */
208
+ export declare function formatNameOnly(pairs: DiffFilePair[], options?: {
209
+ quotePath?: boolean;
210
+ }): string;
211
+ /** `--name-status` (git's `diff_flush_raw` with `DIFF_FORMAT_NAME_STATUS`) */
212
+ export declare function formatNameStatus(pairs: DiffFilePair[], options?: {
213
+ quotePath?: boolean;
214
+ }): string;
215
+ /**
216
+ * `--summary` (diff.c's diff_summary for each pair): ` create mode 100644 <path>`, ` delete
217
+ * mode ...`, ` rename <a => b> (<n>%)` and ` copy ...` (then their mode change), ` mode change
218
+ * 100644 => 100755 <path>`; empty when nothing is to be said (git's is_summary_empty).
219
+ */
220
+ export declare function formatSummary(pairs: DiffFilePair[], quote?: boolean): string;
221
+ /**
222
+ * A side whose content is a stored blob (a submodule's: "Subproject commit <id>\n", as git
223
+ * shows a gitlink). The probe reads a text blob once and keeps it for {@link DiffSideSpec.read}.
224
+ */
225
+ export declare function blobSide(blobs: Blobs, path: string, mode: number, id: string): DiffSideSpec;
226
+ /** A side whose content comes from elsewhere (a worktree file, a file outside a repository) */
227
+ export declare function contentSide(path: string, mode: number, id: string, read: () => Promise<Uint8Array>, idValid?: boolean): DiffSideSpec;
228
+ /**
229
+ * Bytes for a string (diff output pieces are UTF-8; a path's escaped bytes, unquoted with
230
+ * `core.quotePath=false`, are written as the bytes they stand for)
231
+ */
232
+ export declare function utf8(s: string): Uint8Array;
233
+ /** A file of a `--no-index` diff: its path as given, content, and mode (default 100644) */
234
+ export interface NoIndexFile {
235
+ path: string;
236
+ /** Undefined for a side that does not exist (`/dev/null`) */
237
+ content?: Uint8Array;
238
+ mode?: number;
239
+ }
240
+ /** The blob id of `content` (as `hash-object` computes it) */
241
+ export declare function blobIdOf(content: Uint8Array): string;
242
+ /**
243
+ * The pair `diff --no-index a b` compares for two files: a modification between two names
244
+ * (no rename detection), or an addition or deletion against `/dev/null`.
245
+ */
246
+ export declare function noIndexPair(a: NoIndexFile, b: NoIndexFile): DiffFilePair | undefined;
247
+ /** `diff --no-index a b` for two files, as git prints it */
248
+ export declare function formatNoIndexDiff(a: NoIndexFile, b: NoIndexFile, options?: DiffOutputOptions): Promise<Uint8Array>;
249
+ //# sourceMappingURL=diff-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-output.d.ts","sourceRoot":"","sources":["../../src/results/diff-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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,GAAE,iBAAsB,GAC9B,OAAO,CAAC,UAAU,CAAC,CAGrB"}
@@ -74,6 +74,16 @@ export interface FetchResult {
74
74
  * the symbolic refs a prune left dangling
75
75
  */
76
76
  messages: string[];
77
+ /**
78
+ * The ref lines git prints on stderr (`From <url>`, ` * [new branch] main -> origin/main`,
79
+ * ` 1a2b3c4..5d6e7f8 dev -> origin/dev`, ` - [deleted] (none) -> origin/gone`), ids
80
+ * abbreviated as git's find_unique_abbrev under `core.abbrev`, the columns as wide as git
81
+ * makes them; empty when no ref changed. With `setVerbose(true)` (`-v`) the refs already up
82
+ * to date have their ` = [up to date]` lines too; with `fetch.output=compact` a shared tail
83
+ * of the names is `*`; with `setPorcelain(true)` (`--porcelain`, on stdout) these are
84
+ * `<flag> <old-id> <new-id> <local-ref>` lines without the `From` line.
85
+ */
86
+ display?: string[];
77
87
  /**
78
88
  * What failed without stopping the fetch (a refused prune), where git reports an error
79
89
  * and exits 1; absent when nothing failed
@@ -81,6 +91,11 @@ export interface FetchResult {
81
91
  errors?: string[];
82
92
  /** Submodule fetch results (if any) */
83
93
  submodules?: Map<string, FetchResult>;
94
+ /**
95
+ * The layer hashes of the commit-graph chain the fetch wrote (`fetch.writeCommitGraph`,
96
+ * `--write-commit-graph`), base first; absent when it wrote none
97
+ */
98
+ commitGraph?: string[];
84
99
  }
85
100
  /**
86
101
  * Check if fetch result has any updates.
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-result.d.ts","sourceRoot":"","sources":["../../src/results/fetch-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,mCAAmC;IACnC,WAAW,EAAE,QAAQ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