@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,116 @@
1
+ import type { Blobs, ObjectId } from "@statewalker/vcs-core";
2
+ import { type ObjectFormat } from "@statewalker/vcs-utils";
3
+ import type { CommandTrees } from "../git-command.js";
4
+ /** How a note added over an existing one combines with it (notes.h's combine_notes_fn). */
5
+ export type CombineNotes = (stores: NotesStores, cur: ObjectId, next: ObjectId) => Promise<ObjectId>;
6
+ /** The object stores a notes tree reads and writes. */
7
+ export interface NotesStores {
8
+ blobs: Blobs;
9
+ trees: CommandTrees;
10
+ /** The repository's object format (default: the blobs', else SHA-1) */
11
+ objectFormat?: ObjectFormat;
12
+ }
13
+ /** combine_notes_overwrite: the new note replaces the one there. */
14
+ export declare const combineNotesOverwrite: CombineNotes;
15
+ /** combine_notes_ignore: the note there stays. */
16
+ export declare const combineNotesIgnore: CombineNotes;
17
+ /**
18
+ * combine_notes_concatenate: the two notes joined by a blank line (the current one's final
19
+ * newline dropped); an empty or missing side gives the other.
20
+ */
21
+ export declare const combineNotesConcatenate: CombineNotes;
22
+ /**
23
+ * combine_notes_cat_sort_uniq: the lines of both notes, empty ones dropped, sorted (byte
24
+ * order) and unique, each ended by a newline.
25
+ */
26
+ export declare const combineNotesCatSortUniq: CombineNotes;
27
+ /** notes-utils.c's parse_combine_notes_fn (case-insensitive), undefined for another name. */
28
+ export declare function parseCombineNotes(name: string): CombineNotes | undefined;
29
+ /** for_each_note flags (notes.h). */
30
+ export declare const FOR_EACH_NOTE_DONT_UNPACK_SUBTREES = 1;
31
+ export declare const FOR_EACH_NOTE_YIELD_SUBTREES = 2;
32
+ /** A for_each_note callback: true stops the walk. */
33
+ export type EachNote = (object: string, note: ObjectId, path: string) => Promise<boolean | undefined>;
34
+ /** notes.c's in-memory notes tree (struct notes_tree). */
35
+ export declare class NotesTree {
36
+ private readonly stores;
37
+ /** The tree's combine function (t->combine_notes) */
38
+ readonly combine: CombineNotes;
39
+ private readonly root;
40
+ private readonly nonNotes;
41
+ /** A change was made since loading (t->dirty) */
42
+ dirty: boolean;
43
+ /** Raw id bytes of the repository's format (20 for SHA-1, 32 for SHA-256): notes' path lengths */
44
+ private readonly raw;
45
+ /** The repository's null id: adding it as a note removes one */
46
+ readonly nullId: ObjectId;
47
+ private constructor();
48
+ /**
49
+ * init_notes's load: the stored tree `treeId` as an unread subtree of the root (read
50
+ * one level now); an empty tree without `treeId`.
51
+ */
52
+ static load(stores: NotesStores, treeId: ObjectId | undefined, combine?: CombineNotes): Promise<NotesTree>;
53
+ /** get_note: the note of `object`, undefined when it has none. */
54
+ get(object: ObjectId): Promise<ObjectId | undefined>;
55
+ /** add_note: `note` for `object`, combined with one there (default: the tree's). */
56
+ add(object: ObjectId, note: ObjectId, combine?: CombineNotes): Promise<void>;
57
+ /** remove_note: whether `object` had a note (then removed). */
58
+ remove(object: ObjectId): Promise<boolean>;
59
+ /**
60
+ * copy_note: the note of `from` copied to `to` (`to`'s removed when `from` has none);
61
+ * false when `to` has one and `force` is not set.
62
+ */
63
+ copy(from: ObjectId, to: ObjectId, force: boolean, combine?: CombineNotes): Promise<boolean>;
64
+ /** for_each_note: the notes (and with the flags, subtrees) in id order. */
65
+ forEach(flags: number, fn: EachNote): Promise<boolean>;
66
+ /**
67
+ * write_notes_tree: the tree objects written, the root's id.
68
+ *
69
+ * The non-notes are woven in as git weaves them: after the last one written (nn_prev),
70
+ * those up to each note's path. A subtree the walk reads meanwhile (one deeper than the
71
+ * fanout) can bring a non-note that sorts before the last one written: git never goes
72
+ * back for it, so it is dropped from the tree written, here too.
73
+ *
74
+ * Known difference: git writes each tree's entries in the order it weaves them, and that
75
+ * order is not always git's tree order (`x` and `x-y` beside a directory `x`, or a
76
+ * non-note of a subtree read late that sorts before an entry already written); git then
77
+ * writes an unsorted tree. Trees here go through the tree store, which writes its entries
78
+ * sorted (there is no writer of raw entry order), so such a tree gets another id.
79
+ */
80
+ write(): Promise<ObjectId>;
81
+ /**
82
+ * prune_notes's walk: the objects whose notes `exists` refuses, in the order git lists them
83
+ * (the walk's, reversed).
84
+ */
85
+ unreachableObjects(exists: (id: ObjectId) => Promise<boolean>): Promise<ObjectId[]>;
86
+ /** note_tree_search: the slot for `key` (subtrees on the way read). */
87
+ private search;
88
+ /** note_tree_consolidate: an int_node of one note (or none) replaced by it. */
89
+ private consolidate;
90
+ /** note_tree_remove: the note of `key` removed, its value; undefined when none. */
91
+ private removeLeaf;
92
+ /** note_tree_insert */
93
+ private insert;
94
+ /** add_non_note: sorted by path, a path given again replacing the entry. */
95
+ private addNonNote;
96
+ /** load_subtree: the entries of a stored (sub)tree inserted at `node`, level `n`. */
97
+ private loadSubtree;
98
+ /** determine_fanout */
99
+ private determineFanout;
100
+ /** for_each_note_helper */
101
+ private forEachHelper;
102
+ /** tree_write_stack_finish_subtree */
103
+ private finishSubtree;
104
+ /** write_each_note_helper */
105
+ private writeEntry;
106
+ }
107
+ /** notes.c's GIT_NOTES_DEFAULT_REF */
108
+ export declare const NOTES_DEFAULT_REF = "refs/notes/commits";
109
+ /**
110
+ * SHA-1's null object id, which adding as a note removes one (any format's null id does: see
111
+ * `NotesTree.nullId` for the repository's own).
112
+ */
113
+ export declare const NOTES_NULL_ID: string;
114
+ /** Reads a note blob's bytes (undefined for a missing one). */
115
+ export declare function readNoteBytes(blobs: Blobs, id: ObjectId): Promise<Uint8Array | undefined>;
116
+ //# sourceMappingURL=notes-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes-tree.d.ts","sourceRoot":"","sources":["../../src/commands/notes-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAa,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAkB,KAAK,YAAY,EAAsB,MAAM,wBAAwB,CAAC;AAE/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiDtD,2FAA2F;AAC3F,MAAM,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,QAAQ,KACX,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;IACp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D,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAEzF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Object ids as the commands take them from callers.
3
+ *
4
+ * @module
5
+ */
6
+ /**
7
+ * A full hexadecimal object id in the form stores and refs hold it: lowercase, as git's
8
+ * `get_oid_hex` reads either case (`ABCD...` names the object `abcd...`). Anything else is
9
+ * returned as given.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * canonicalObjectId("D90F7D2AD59FC2F2D12C4A4BAEA96C445B5E625D"); // "d90f7d2a..."
14
+ * canonicalObjectId("main"); // "main"
15
+ * ```
16
+ */
17
+ export declare function canonicalObjectId<T extends string>(id: T): T;
18
+ /** Whether `id` is a full hexadecimal object id, in either case. */
19
+ export declare function isFullHexObjectId(id: string): boolean;
20
+ //# sourceMappingURL=object-id-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-id-input.d.ts","sourceRoot":"","sources":["../../src/commands/object-id-input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAE5D;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAErD"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * git's octopus strategy (`git merge A B C`, git-merge-octopus.sh): the heads merged one
3
+ * after the other into the running result, each first as a trivial merge
4
+ * (`read-tree -m --aggressive` against its merge bases), the paths that are not trivial
5
+ * then merged file by file (`merge-index -o git-merge-one-file -a`). Only the last head may
6
+ * leave conflicts to resolve by hand; a conflict with an earlier head makes the octopus give
7
+ * up ("Should not be doing an octopus."), as does a dirty index.
8
+ *
9
+ * Computed in memory: the caller writes the outcome (index, worktree, MERGE_HEAD) or, when
10
+ * the strategy gave up, leaves everything as it was (git's restore_state).
11
+ */
12
+ import { type Blobs, type ObjectId } from "@statewalker/vcs-core";
13
+ import { type ConflictStyle } from "@statewalker/vcs-utils";
14
+ import type { CommandCommits, CommandTrees } from "../git-command.js";
15
+ import { type OrtConflict } from "./ort-merge.js";
16
+ import type { CheckedEntry } from "./worktree-overwrite-checks.js";
17
+ /** A head to merge and the name git's messages give it (as the user named it). */
18
+ export interface OctopusHead {
19
+ id: ObjectId;
20
+ name: string;
21
+ }
22
+ /** What the octopus did. */
23
+ export interface OctopusOutcome {
24
+ /** git-merge-octopus's exit: 0 merged, 1 conflicts left (last head), 2 gave up */
25
+ status: 0 | 1 | 2;
26
+ /** What it printed on stdout */
27
+ output: string[];
28
+ /** What it printed on stderr */
29
+ errors: string[];
30
+ /** The index's stage-0 entries */
31
+ index: Map<string, CheckedEntry>;
32
+ /** The worktree where it differs from the index (files with conflict markers) */
33
+ worktree: Map<string, CheckedEntry>;
34
+ /** The conflicts left, staged 1-3 */
35
+ conflicts: OrtConflict[];
36
+ /**
37
+ * Per head merged (not already up to date): how much of `output` the script had printed
38
+ * once it went for that head, and the paths that head changed in the index or worktree.
39
+ * The script writes the worktree head by head, so a local change in the way stops it at
40
+ * the first head that touches it.
41
+ */
42
+ steps: {
43
+ output: number;
44
+ paths: Set<string>;
45
+ }[];
46
+ }
47
+ /** What the octopus needs. */
48
+ export interface OctopusContext {
49
+ commits: CommandCommits;
50
+ trees: CommandTrees;
51
+ blobs: Blobs;
52
+ style?: ConflictStyle;
53
+ }
54
+ /**
55
+ * Runs git-merge-octopus for `heads` on top of `headId` (the index matching HEAD's tree,
56
+ * `indexDiffers` listing the paths where it does not).
57
+ */
58
+ export declare function octopusMerge(ctx: OctopusContext, headId: ObjectId, heads: OctopusHead[], indexDiffers: string[]): Promise<OctopusOutcome>;
59
+ //# sourceMappingURL=octopus-merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"octopus-merge.d.ts","sourceRoot":"","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AAY,CAChC,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,WAAW,EAAE,EACpB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,cAAc,CAAC,CAuHzB"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * git's merge-ort on flat trees (path -> blob, link or gitlink): the merge `merge`,
3
+ * `cherry-pick`, `revert`, `rebase` and `stash apply` run, without writing anything but the
4
+ * blobs of content merges.
5
+ *
6
+ * A port of merge-ort.c's structure: every path (file or directory) of the three trees gets
7
+ * an entry with its three versions (`collect_merge_info`); renames are detected on each side
8
+ * (exact, by basename, then by similarity, for the paths the merge needs), directory renames
9
+ * derived from them move what the other side added into the new directory
10
+ * (`merge.directoryRenames`); then each entry is resolved (`process_entry`), children before
11
+ * their directory, so that a file meeting a directory moves aside only when the directory
12
+ * stays. The result is merge-ort's tree, the conflicted index entries and the messages,
13
+ * sorted by path as git prints them.
14
+ *
15
+ * With `callDepth` > 0 it is one of the inner merges of merge bases that build a virtual
16
+ * merge base (`merge_ort_internal`): longer conflict markers, no messages, conflicts
17
+ * resolved to the base's version where git does, no directory renames.
18
+ */
19
+ import { type Blobs, type ObjectId } from "@statewalker/vcs-core";
20
+ import type { ConflictStyle } from "@statewalker/vcs-utils";
21
+ import { type MergeAttributeValue, type MergeDriverRegistry } from "./merge-drivers.js";
22
+ import type { CheckedEntry } from "./worktree-overwrite-checks.js";
23
+ /** A path the merge could not resolve, as merge-ort leaves it in the index. */
24
+ export interface OrtConflict {
25
+ base?: CheckedEntry;
26
+ ours?: CheckedEntry;
27
+ theirs?: CheckedEntry;
28
+ /** Where the stages (and the worktree file) go: the path, or `<path>~<side>` */
29
+ stagePath: string;
30
+ /** The file with conflict markers, for a text conflict (unused: see `tree`) */
31
+ content?: Uint8Array;
32
+ /** What the worktree gets at `stagePath` where it differs from our side's version */
33
+ write?: CheckedEntry;
34
+ /** The path a file/directory or distinct-types conflict moves ours away from */
35
+ moveFrom?: string;
36
+ /** What merge-ort's result tree holds at `stagePath` (none: nothing there) */
37
+ tree?: CheckedEntry;
38
+ mode: number;
39
+ }
40
+ /** `merge.directoryRenames`: apply them, leave paths as they are, or apply with a conflict. */
41
+ export type DirectoryRenames = "true" | "false" | "conflict";
42
+ /** The attributes a content merge reads for a path (`merge`, `conflict-marker-size`). */
43
+ export interface MergeAttributes {
44
+ merge?: MergeAttributeValue;
45
+ conflictMarkerSize?: MergeAttributeValue;
46
+ }
47
+ /** Options of {@link ortMerge}. */
48
+ export interface OrtMergeOptions {
49
+ /** Our side's name in markers and messages (git's branch1, e.g. `HEAD`) */
50
+ oursLabel: string;
51
+ /** Their side's name (git's branch2: the branch, or `<abbrev> (<subject>)`) */
52
+ theirsLabel: string;
53
+ /** The base's name after `|||||||` (diff3, zdiff3) */
54
+ baseLabel?: string;
55
+ /** Names a file moved aside gets (`<path>~<name>`); default the labels */
56
+ oursName?: string;
57
+ theirsName?: string;
58
+ /** merge.conflictStyle */
59
+ style?: ConflictStyle;
60
+ /** `-X ours`, `-X theirs`: conflicting hunks (and binary files) resolved to a side */
61
+ favor?: "ours" | "theirs" | "union";
62
+ /** A case-folding worktree (core.ignorecase): names taken in another case are taken */
63
+ ignoreCase?: boolean;
64
+ /** Detect renames (default true) */
65
+ renames?: boolean;
66
+ /** merge.directoryRenames (default `conflict`, as git) */
67
+ directoryRenames?: DirectoryRenames;
68
+ /** merge.renameLimit (default 7000, as merge-ort) */
69
+ renameLimit?: number;
70
+ /** Files above this size are binary to the merge (core.bigFileThreshold) */
71
+ bigFileThreshold?: number;
72
+ /** The recursion level of a merge of merge bases (merge-ort's call_depth; default 0) */
73
+ callDepth?: number;
74
+ /** merge.renormalize / `-X renormalize`: content compared and merged as checked in afresh */
75
+ renormalize?: boolean;
76
+ /** The `merge` and `conflict-marker-size` attributes of a path (none: unspecified) */
77
+ attributes?: (path: string) => Promise<MergeAttributes>;
78
+ /** git's renormalize_buffer for a path (with `renormalize`) */
79
+ renormalizeContent?: (path: string, content: Uint8Array) => Promise<Uint8Array>;
80
+ /** Merge drivers by name (the `merge` attribute, `merge.default`) */
81
+ drivers?: MergeDriverRegistry;
82
+ /** merge.default: the driver of a path without a `merge` attribute */
83
+ defaultDriver?: string;
84
+ /** merge.<driver>.recursive: the driver used in merges of merge bases */
85
+ recursiveDriver?: (name: string) => string | undefined;
86
+ /**
87
+ * The trees given as {@link prunedFlatTrees} reads them (directories all three hold alike
88
+ * stand as one TREE entry): per tree (base, ours, theirs), the id of each directory, so a
89
+ * directory taken whole from a side is the side's tree, never read.
90
+ */
91
+ dirTrees?: Map<string, ObjectId>[];
92
+ }
93
+ /** What {@link ortMerge} found. */
94
+ export interface OrtMergeResult {
95
+ /** The cleanly merged entries */
96
+ result: Map<string, CheckedEntry>;
97
+ /** The conflicts, by the path they are staged at */
98
+ conflicts: Map<string, OrtConflict>;
99
+ /** Whether merge-ort calls the merge clean (no conflicts, no directory rename trouble) */
100
+ clean: boolean;
101
+ /** merge-ort's messages (`Auto-merging x`, `CONFLICT (...)`), in git's order */
102
+ messages: string[];
103
+ /** Whether directory renames were found (paths may move into any directory) */
104
+ directoryRenames?: boolean;
105
+ }
106
+ /** Reads a blob whole. */
107
+ export declare function readBlob(blobs: Blobs, id: ObjectId): Promise<Uint8Array>;
108
+ /**
109
+ * How often merges took merge-ort's paths that leave no trace in their result, for tests:
110
+ * `redos` counts the merges redone with the renames the first pass found
111
+ * (redo_after_renames). Not part of the package's API.
112
+ */
113
+ export declare const ortMergeCounters: {
114
+ redos: number;
115
+ };
116
+ /**
117
+ * Merges `theirs` into `ours` against `base`, as git's merge-ort
118
+ * (`merge_ort_nonrecursive_internal`). Content-merged blobs are stored in `blobs`.
119
+ */
120
+ export declare function ortMerge(blobs: Blobs, baseIn: Map<string, CheckedEntry>, oursIn: Map<string, CheckedEntry>, theirsIn: Map<string, CheckedEntry>, options: OrtMergeOptions): Promise<OrtMergeResult>;
121
+ /**
122
+ * merge-ort's result tree as a flat map: the merged entries, and at each conflict's path
123
+ * what git's result tree holds there (the file with markers, the surviving side, ours).
124
+ */
125
+ export declare function ortResultEntries(blobs: Blobs, merge: OrtMergeResult): Promise<Map<string, CheckedEntry>>;
126
+ //# sourceMappingURL=ort-merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ort-merge.d.ts","sourceRoot":"","sources":["../../src/commands/ort-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAY,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,qFAAqF;IACrF,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+FAA+F;AAC/F,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAE7D,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,kBAAkB,CAAC,EAAE,mBAAmB,CAAC;CAC1C;AAED,mCAAmC;AACnC,MAAM,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AAC,EAAE,CAAC;CACpC;AAED,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAClC,oDAAoD;IACpD,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACpC,0FAA0F;IAC1F,KAAK,EAAE,OAAO,CAAC;IACf,gFAAgF;IAChF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAuBD,0BAA0B;AAC1B,wBAAsB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAI9E;AAiID;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;IAAK,KAAK;CAAK,CAAC;AAE7C;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACjC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACnC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CAEzB;AA2zCD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAapC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * merge-ort's virtual merge base (`merge_ort_internal`): with several merge bases, git
3
+ * merges them pairwise (the oldest first, "Temporary merge branch 1" and "2" in the
4
+ * markers, their own merge bases merged the same way) and uses the result as the base of the
5
+ * real merge, named "merged common ancestors". The virtual commits and their trees stay in
6
+ * memory; only the blobs of content merges are stored, as git stores them.
7
+ */
8
+ import type { Blobs, ObjectId } from "@statewalker/vcs-core";
9
+ import type { CommandCommits, CommandTrees } from "../git-command.js";
10
+ import { type OrtMergeOptions, type OrtMergeResult } from "./ort-merge.js";
11
+ import type { CheckedEntry } from "./worktree-overwrite-checks.js";
12
+ /** The base a merge runs against, and its name after `|||||||`. */
13
+ export interface MergeBaseTree {
14
+ /** The base as a flat map (read on demand for a stored tree) */
15
+ tree(): Promise<Map<string, CheckedEntry>>;
16
+ /**
17
+ * Whether the base is a stored tree, `treeId` (undefined: the empty tree), rather than a
18
+ * virtual merge base held in memory
19
+ */
20
+ stored: boolean;
21
+ treeId?: ObjectId;
22
+ label: string;
23
+ }
24
+ /** What the virtual base needs of a command. */
25
+ export interface VirtualBaseContext {
26
+ commits: CommandCommits;
27
+ trees: CommandTrees;
28
+ blobs: Blobs;
29
+ /**
30
+ * A single merge base's label: git's `strbuf_add_unique_abbrev(..., DEFAULT_ABBREV)`
31
+ * (the command's `abbreviateObjectId`)
32
+ */
33
+ abbreviate: (id: ObjectId) => Promise<string>;
34
+ }
35
+ /**
36
+ * The base tree of a merge of `h1` and `h2` with merge bases `bases` (as merge-ort's
37
+ * merge_incore_recursive computes it): the empty tree ("empty tree") without a base, the
38
+ * base itself (its abbreviated id) with one, the virtual merge base ("merged common
39
+ * ancestors") with several.
40
+ */
41
+ export declare function mergeBaseTree(ctx: VirtualBaseContext, h1: ObjectId, h2: ObjectId, bases: ObjectId[], options: Omit<OrtMergeOptions, "oursLabel" | "theirsLabel" | "baseLabel">): Promise<MergeBaseTree>;
42
+ /**
43
+ * merge-ort over stored trees: `ours` and `theirs` (tree ids) against `base`. A stored base
44
+ * merges the trees as merge-ort reads them (directories all three hold alike are never
45
+ * read, {@link prunedFlatTrees}); a virtual base, or a merge that finds directory renames
46
+ * (which may move a path into any directory), merges the whole trees.
47
+ */
48
+ export declare function mergeStoredTrees(ctx: Pick<VirtualBaseContext, "trees" | "blobs">, base: MergeBaseTree, ours: ObjectId | undefined, theirs: ObjectId | undefined, options: OrtMergeOptions, flat?: (id: ObjectId | undefined) => Promise<Map<string, CheckedEntry>>): Promise<OrtMergeResult & {
49
+ ours: Map<string, CheckedEntry>;
50
+ }>;
51
+ /** A stored tree (undefined: the empty tree) as the base of {@link mergeStoredTrees}. */
52
+ export declare function storedBase(treeId: ObjectId | undefined, label: string, flat: () => Promise<Map<string, CheckedEntry>>): MergeBaseTree;
53
+ //# sourceMappingURL=ort-recursive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ort-recursive.d.ts","sourceRoot":"","sources":["../../src/commands/ort-recursive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAGpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAC3C;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb;;;OAGG;IACH,UAAU,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,QAAQ,EACZ,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,QAAQ,EAAE,EACjB,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC,GACxE,OAAO,CAAC,aAAa,CAAC,CAWxB;AAuDD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAC,EAChD,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,MAAM,EAAE,QAAQ,GAAG,SAAS,EAC5B,OAAO,EAAE,eAAe,EACxB,IAAI,GAAE,CAAC,EAAE,EAAE,QAAQ,GAAG,SAAS,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAC5C,GACxB,OAAO,CAAC,cAAc,GAAG;IAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CAAE,CAAC,CAY/D;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CACxB,MAAM,EAAE,QAAQ,GAAG,SAAS,EAC5B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,GAC7C,aAAa,CAEf"}
@@ -7,6 +7,12 @@ export interface PackRefsResult {
7
7
  refsPacked: number;
8
8
  /** Whether operation succeeded */
9
9
  success: boolean;
10
+ /**
11
+ * git's error lines (stderr), also in the hook output: a loose ref whose object is missing
12
+ * stays loose (`error: <ref> does not point to a valid object!`), a ref changed before its
13
+ * prune keeps its loose file (`error: cannot lock ref ...`)
14
+ */
15
+ errors: string[];
10
16
  }
11
17
  /**
12
18
  * Pack loose references into packed-refs.
@@ -16,6 +22,12 @@ export interface PackRefsResult {
16
22
  * This command packs loose reference files (.git/refs/*) into the
17
23
  * single .git/packed-refs file for efficiency.
18
24
  *
25
+ * Without {@link setAll} or refs named, the loose tags are packed (git's default
26
+ * `refs/tags/*`). The reference-transaction hook runs as in git: once for the packed-refs
27
+ * transaction (every loose ref packed, as `<zero> <id> <ref>`), then once per loose ref
28
+ * pruned; a refusal throws `RefTransactionAbortedError` (git dies there). {@link setAuto} is
29
+ * git 2.5x's `--auto`: nothing happens unless enough loose refs wait.
30
+ *
19
31
  * Based on JGit's PackRefsCommand.
20
32
  *
21
33
  * @example
@@ -34,6 +46,7 @@ export interface PackRefsResult {
34
46
  */
35
47
  export declare class PackRefsCommand extends GitCommand<PackRefsResult> {
36
48
  private all;
49
+ private auto;
37
50
  private refs;
38
51
  /**
39
52
  * Pack all loose refs.
@@ -41,6 +54,13 @@ export declare class PackRefsCommand extends GitCommand<PackRefsResult> {
41
54
  * @param all Whether to pack all refs
42
55
  */
43
56
  setAll(all: boolean): this;
57
+ /**
58
+ * git 2.5x's `pack-refs --auto` (files-backend.c `should_pack_refs`): pack only when at
59
+ * least `max(16, log2(<packed-refs size> / 100) * 5)` loose refs could be packed.
60
+ *
61
+ * @param auto Whether to pack only when needed
62
+ */
63
+ setAuto(auto: boolean): this;
44
64
  /**
45
65
  * Add a specific ref to pack.
46
66
  *
@@ -1 +1 @@
1
- {"version":3,"file":"pack-refs-command.d.ts","sourceRoot":"","sources":["../../src/commands/pack-refs-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,eAAgB,SAAQ,UAAU,CAAC,cAAc,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,IAAI,CAAgB;IAE5B;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAIzB;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI5B;IAED;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,CAgCpC;CACF"}
1
+ {"version":3,"file":"pack-refs-command.d.ts","sourceRoot":"","sources":["../../src/commands/pack-refs-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,eAAgB,SAAQ,UAAU,CAAC,cAAc,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAgB;IAE5B;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAIzB;IAED;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAI3B;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI5B;IAED;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,CAwBpC;CACF"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * git's patch-id of a commit (`commit_patch_id`, `diff_get_patch_id`): the diff against its
3
+ * parent (no rename detection), each file's header and diff lines with whitespace removed,
4
+ * hashed per file and summed, so the order of the files does not matter. Two commits with
5
+ * the same patch-id make the same change: `rebase` leaves out the commits whose change
6
+ * upstream already has (`--cherry-mark`).
7
+ */
8
+ import { type Blobs, type ObjectId } from "@statewalker/vcs-core";
9
+ import { type ObjectFormat } from "@statewalker/vcs-utils";
10
+ import type { CommandTrees } from "../git-command.js";
11
+ /** The trees a patch-id reads (a cache of them serves as well). */
12
+ export type PatchIdTrees = Pick<CommandTrees, "loadTree">;
13
+ /**
14
+ * The patch-id of the change from `parentTree` to `tree` (hex), or undefined when nothing
15
+ * changes. With `headerOnly` (git's `diff_header_only`), only the files' names and modes
16
+ * are hashed, no content read: equal patch-ids have equal header ids, so the cheap id sorts
17
+ * out candidates and the full one is computed only where they collide (patch-ids.c).
18
+ */
19
+ export declare function patchId(trees: PatchIdTrees, blobs: Blobs, parentTree: ObjectId | undefined, tree: ObjectId, options?: {
20
+ headerOnly?: boolean;
21
+ objectFormat?: ObjectFormat;
22
+ }): Promise<string | undefined>;
23
+ /** A changed file for {@link patchIdOfChanges}; `oldPath` differs from `path` for a rename. */
24
+ export interface PatchIdChange {
25
+ path: string;
26
+ oldPath?: string;
27
+ old?: {
28
+ mode: number;
29
+ id: ObjectId;
30
+ };
31
+ new?: {
32
+ mode: number;
33
+ id: ObjectId;
34
+ };
35
+ }
36
+ /**
37
+ * The patch-id of a list of changed files as the diff queue has them (renames and copies
38
+ * found by the caller, as `git format-patch --base` finds them).
39
+ */
40
+ export declare function patchIdOfChanges(blobs: Blobs, changes: PatchIdChange[], options?: {
41
+ headerOnly?: boolean;
42
+ objectFormat?: ObjectFormat;
43
+ }): Promise<string>;
44
+ //# sourceMappingURL=patch-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-id.d.ts","sourceRoot":"","sources":["../../src/commands/patch-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAgC,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAGL,KAAK,YAAY,EAGlB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtD,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AA0E1D;;;;;GAKG;AACH,wBAAsB,OAAO,CAC3B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,QAAQ,GAAG,SAAS,EAChC,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAO,GAClE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI7B;AAED,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,QAAQ,CAAA;KAAE,CAAC;IACrC,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,QAAQ,CAAA;KAAE,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,aAAa,EAAE,EACxB,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAO,GAClE,OAAO,CAAC,MAAM,CAAC,CAsEjB"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * `:(attr:...)` pathspec magic for the commands that match index and worktree paths
3
+ * (pathspec.c `parse_pathspec_attr_match`, dir.c `match_pathspec_item` calling
4
+ * `match_pathspec_attrs`): the attributes of the paths a command is about to match, read
5
+ * through the worktree's attribute stack (`.gitattributes` in the worktree, else the index
6
+ * entry, `$GIT_DIR/info/attributes`, `core.attributesFile`, the system file), then looked up
7
+ * synchronously while the paths are matched.
8
+ */
9
+ import type { AttributesResolver, Worktree } from "@statewalker/vcs-working-tree";
10
+ import { type PathspecAttributeValue, type PathspecItem } from "./pathspec.js";
11
+ /** Reads the attributes `names` of a path (a directory's with its trailing `/`). */
12
+ export type PathspecAttributeReader = (path: string, names: readonly string[]) => Promise<ReadonlyMap<string, PathspecAttributeValue>>;
13
+ /**
14
+ * The attributes of the paths a pathspec with `:(attr:...)` elements matches: bound to its
15
+ * elements (`attrLookup`), loaded for a batch of candidate paths before they are matched.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const items = parsePathspec([":(attr:text)"], { attr: true });
20
+ * const attributes = PathspecAttributes.forWorktree(items, worktree);
21
+ * await attributes?.load(indexPaths);
22
+ * const wanted = indexPaths.filter((p) => matchPathspec(items, p, 0) > 0);
23
+ * ```
24
+ */
25
+ export declare class PathspecAttributes {
26
+ private readonly read;
27
+ private readonly values;
28
+ private readonly names;
29
+ private readonly attrItems;
30
+ constructor(items: PathspecItem[], read: PathspecAttributeReader);
31
+ /**
32
+ * The attributes of `items` bound to the worktree's attribute stack (the check-in
33
+ * direction: the worktree's `.gitattributes` first, then the index's); undefined when no
34
+ * element has `:(attr:...)`.
35
+ *
36
+ * @throws GitApiError without a worktree, or when it reads no attributes
37
+ */
38
+ static forWorktree(items: PathspecItem[], worktree: Worktree | undefined): PathspecAttributes | undefined;
39
+ /**
40
+ * The attributes of `items` read by an attributes resolver (a bare repository's, without
41
+ * a worktree: builtin, system, global, `info/attributes` and an attribute source);
42
+ * undefined when no element has `:(attr:...)`.
43
+ */
44
+ static forResolver(items: PathspecItem[], resolver: AttributesResolver): PathspecAttributes | undefined;
45
+ /** Loads the attributes of the paths some element may match by its path. */
46
+ load(paths: Iterable<string>): Promise<void>;
47
+ /** Whether `path` may match an element by its path and its attributes are not loaded yet. */
48
+ needs(path: string): boolean;
49
+ /**
50
+ * Whether dir.c's untracked walk reaches the untracked `path` (its attributes loaded on
51
+ * the way): each untracked directory above it (one holding no index entry, so not in
52
+ * `trackedDirs`) must match `items` as a leading path by its own name and attributes
53
+ * (`treat_directory` with `DO_MATCH_LEADING_PATHSPEC`).
54
+ */
55
+ reachable(items: PathspecItem[], path: string, trackedDirs: Set<string>): Promise<boolean>;
56
+ /** Loads the attributes of `path` (whether an element may match it or not). */
57
+ loadOne(path: string): Promise<void>;
58
+ }
59
+ /**
60
+ * The attributes of `items` for the worktree, loaded for `paths` (none: the pathspec has no
61
+ * `:(attr:...)` element).
62
+ */
63
+ export declare function loadPathspecAttributes(items: PathspecItem[], worktree: Worktree | undefined, paths: Iterable<string>): Promise<PathspecAttributes | undefined>;
64
+ //# sourceMappingURL=pathspec-attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathspec-attributes.d.ts","sourceRoot":"","sources":["../../src/commands/pathspec-attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAElB,MAAM,eAAe,CAAC;AAEvB,oFAAoF;AACpF,MAAM,MAAM,uBAAuB,GAAG,CACpC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,MAAM,EAAE,KACrB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;IAO3B,OAAO,CAAC,QAAQ,CAAC,IAAI;IANvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkE;IACzF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAW;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAE3C,YACE,KAAK,EAAE,YAAY,EAAE,EACJ,IAAI,EAAE,uBAAuB,EAQ/C;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAChB,KAAK,EAAE,YAAY,EAAE,EACrB,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAC7B,kBAAkB,GAAG,SAAS,CAyBhC;IAED;;;;OAIG;IACH,MAA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