@statewalker/vcs-commands 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/add-command.d.ts +70 -0
- package/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/add-patch/add-patch.d.ts +7 -0
- package/dist/commands/add-patch/add-patch.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-backend.d.ts.map +1 -1
- package/dist/commands/am/am-command.d.ts +102 -1
- package/dist/commands/am/am-command.d.ts.map +1 -1
- package/dist/commands/am/index.d.ts +1 -0
- package/dist/commands/am/index.d.ts.map +1 -1
- package/dist/commands/am/mailsplit.d.ts +88 -0
- package/dist/commands/am/mailsplit.d.ts.map +1 -0
- package/dist/commands/apply/apply-command.d.ts +2 -0
- package/dist/commands/apply/apply-command.d.ts.map +1 -1
- package/dist/commands/apply/apply-engine.d.ts.map +1 -1
- package/dist/commands/apply/apply-parse.d.ts +7 -0
- package/dist/commands/apply/apply-parse.d.ts.map +1 -1
- package/dist/commands/apply/index.d.ts +1 -1
- package/dist/commands/apply/index.d.ts.map +1 -1
- package/dist/commands/bisect/bisect-command.d.ts +2 -0
- package/dist/commands/bisect/bisect-command.d.ts.map +1 -1
- package/dist/commands/blame-command.d.ts +303 -8
- package/dist/commands/blame-command.d.ts.map +1 -1
- package/dist/commands/blame-ignore.d.ts +48 -0
- package/dist/commands/blame-ignore.d.ts.map +1 -0
- package/dist/commands/branch-command.d.ts +148 -18
- package/dist/commands/branch-command.d.ts.map +1 -1
- package/dist/commands/branch-info-command.d.ts +55 -0
- package/dist/commands/branch-info-command.d.ts.map +1 -0
- package/dist/commands/branch-tracking.d.ts +106 -17
- package/dist/commands/branch-tracking.d.ts.map +1 -1
- package/dist/commands/branch-upstream-command.d.ts +83 -0
- package/dist/commands/branch-upstream-command.d.ts.map +1 -0
- package/dist/commands/check-mailmap-command.d.ts +49 -0
- package/dist/commands/check-mailmap-command.d.ts.map +1 -0
- package/dist/commands/checkout-command.d.ts +26 -3
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/checkout-paths.d.ts +4 -0
- package/dist/commands/checkout-paths.d.ts.map +1 -1
- package/dist/commands/cherry-command.d.ts +61 -0
- package/dist/commands/cherry-command.d.ts.map +1 -0
- package/dist/commands/cherry-pick-command.d.ts +82 -1
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-command.d.ts +44 -0
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clean-interactive.d.ts +56 -0
- package/dist/commands/clean-interactive.d.ts.map +1 -0
- package/dist/commands/clone-command.d.ts +116 -2
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/commit-command.d.ts +239 -5
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/commit-reuse.d.ts +33 -0
- package/dist/commands/commit-reuse.d.ts.map +1 -0
- package/dist/commands/config-command.d.ts +236 -0
- package/dist/commands/config-command.d.ts.map +1 -0
- package/dist/commands/config-value-types.d.ts +91 -0
- package/dist/commands/config-value-types.d.ts.map +1 -0
- package/dist/commands/core-config.d.ts +20 -0
- package/dist/commands/core-config.d.ts.map +1 -1
- package/dist/commands/describe-command.d.ts +71 -64
- package/dist/commands/describe-command.d.ts.map +1 -1
- package/dist/commands/diff-color-config.d.ts +73 -0
- package/dist/commands/diff-color-config.d.ts.map +1 -0
- package/dist/commands/diff-command.d.ts +369 -10
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/fetch-command.d.ts +80 -0
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/fetch-multiple-command.d.ts +193 -0
- package/dist/commands/fetch-multiple-command.d.ts.map +1 -0
- package/dist/commands/fmt-merge-msg-command.d.ts +124 -0
- package/dist/commands/fmt-merge-msg-command.d.ts.map +1 -0
- package/dist/commands/fork-point.d.ts +38 -0
- package/dist/commands/fork-point.d.ts.map +1 -0
- package/dist/commands/format-patch-command.d.ts +69 -3
- package/dist/commands/format-patch-command.d.ts.map +1 -1
- package/dist/commands/fsck/fetch-fsck.d.ts +51 -0
- package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -1
- package/dist/commands/gc-command.d.ts +8 -0
- package/dist/commands/gc-command.d.ts.map +1 -1
- package/dist/commands/git-describe.d.ts +81 -4
- package/dist/commands/git-describe.d.ts.map +1 -1
- package/dist/commands/git-hooks.d.ts +50 -1
- package/dist/commands/git-hooks.d.ts.map +1 -1
- package/dist/commands/grep/grep-command.d.ts +210 -0
- package/dist/commands/grep/grep-command.d.ts.map +1 -0
- package/dist/commands/grep/grep-engine.d.ts +218 -0
- package/dist/commands/grep/grep-engine.d.ts.map +1 -0
- package/dist/commands/grep/index.d.ts +3 -0
- package/dist/commands/grep/index.d.ts.map +1 -0
- package/dist/commands/index-adder.d.ts +13 -2
- package/dist/commands/index-adder.d.ts.map +1 -1
- package/dist/commands/index.d.ts +38 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +5 -3
- package/dist/commands/init-command.d.ts +89 -0
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/interpret-trailers-command.d.ts +90 -0
- package/dist/commands/interpret-trailers-command.d.ts.map +1 -0
- package/dist/commands/line-log.d.ts +161 -0
- package/dist/commands/line-log.d.ts.map +1 -0
- package/dist/commands/local-transport.d.ts +36 -5
- package/dist/commands/local-transport.d.ts.map +1 -1
- package/dist/commands/log-command.d.ts +527 -13
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-graph.d.ts +30 -3
- package/dist/commands/log-graph.d.ts.map +1 -1
- package/dist/commands/log-output.d.ts +199 -6
- package/dist/commands/log-output.d.ts.map +1 -1
- package/dist/commands/ls-remote-command.d.ts +2 -0
- package/dist/commands/ls-remote-command.d.ts.map +1 -1
- package/dist/commands/mailmap.d.ts +53 -0
- package/dist/commands/mailmap.d.ts.map +1 -1
- package/dist/commands/merge-base-command.d.ts +60 -0
- package/dist/commands/merge-base-command.d.ts.map +1 -0
- package/dist/commands/merge-bases.d.ts +23 -0
- package/dist/commands/merge-bases.d.ts.map +1 -1
- package/dist/commands/merge-command.d.ts +147 -10
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-drivers.d.ts +2 -0
- package/dist/commands/merge-drivers.d.ts.map +1 -1
- package/dist/commands/merge-strategy-options.d.ts +69 -0
- package/dist/commands/merge-strategy-options.d.ts.map +1 -0
- package/dist/commands/merge-support.d.ts +10 -0
- package/dist/commands/merge-support.d.ts.map +1 -1
- package/dist/commands/message-cleanup.d.ts +2 -0
- package/dist/commands/message-cleanup.d.ts.map +1 -1
- package/dist/commands/mv-command.d.ts +4 -0
- package/dist/commands/mv-command.d.ts.map +1 -1
- package/dist/commands/name-rev-command.d.ts +65 -0
- package/dist/commands/name-rev-command.d.ts.map +1 -0
- package/dist/commands/name-rev.d.ts +136 -0
- package/dist/commands/name-rev.d.ts.map +1 -0
- package/dist/commands/notes-command.d.ts.map +1 -1
- package/dist/commands/octopus-merge.d.ts +26 -1
- package/dist/commands/octopus-merge.d.ts.map +1 -1
- package/dist/commands/ort-merge.d.ts +16 -0
- package/dist/commands/ort-merge.d.ts.map +1 -1
- package/dist/commands/ort-recursive.d.ts.map +1 -1
- package/dist/commands/patch-id.d.ts +58 -0
- package/dist/commands/patch-id.d.ts.map +1 -1
- package/dist/commands/pathspec-file.d.ts +39 -0
- package/dist/commands/pathspec-file.d.ts.map +1 -0
- package/dist/commands/pathspec.d.ts +3 -0
- package/dist/commands/pathspec.d.ts.map +1 -1
- package/dist/commands/pretty-format.d.ts +43 -3
- package/dist/commands/pretty-format.d.ts.map +1 -1
- package/dist/commands/promisor-remote.d.ts.map +1 -1
- package/dist/commands/pull-command.d.ts +186 -32
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +225 -9
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/range-diff/index.d.ts +4 -0
- package/dist/commands/range-diff/index.d.ts.map +1 -0
- package/dist/commands/range-diff/linear-assignment.d.ts +27 -0
- package/dist/commands/range-diff/linear-assignment.d.ts.map +1 -0
- package/dist/commands/range-diff/range-diff-command.d.ts +121 -0
- package/dist/commands/range-diff/range-diff-command.d.ts.map +1 -0
- package/dist/commands/range-diff/range-diff.d.ts +106 -0
- package/dist/commands/range-diff/range-diff.d.ts.map +1 -0
- package/dist/commands/read-tree-command.d.ts +20 -0
- package/dist/commands/read-tree-command.d.ts.map +1 -1
- package/dist/commands/rebase-command.d.ts +189 -8
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/ref-filter/for-each-ref-command.d.ts +121 -0
- package/dist/commands/ref-filter/for-each-ref-command.d.ts.map +1 -0
- package/dist/commands/ref-filter/index.d.ts +8 -0
- package/dist/commands/ref-filter/index.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-atoms.d.ts +88 -0
- package/dist/commands/ref-filter/ref-atoms.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-filter.d.ts +178 -0
- package/dist/commands/ref-filter/ref-filter.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-format.d.ts +222 -0
- package/dist/commands/ref-filter/ref-format.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-listing-command.d.ts +56 -0
- package/dist/commands/ref-filter/ref-listing-command.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-quote.d.ts +20 -0
- package/dist/commands/ref-filter/ref-quote.d.ts.map +1 -0
- package/dist/commands/ref-filter/version-compare.d.ts +20 -0
- package/dist/commands/ref-filter/version-compare.d.ts.map +1 -0
- package/dist/commands/reflog-command.d.ts +120 -0
- package/dist/commands/reflog-command.d.ts.map +1 -1
- package/dist/commands/reflog-walk.d.ts +72 -0
- package/dist/commands/reflog-walk.d.ts.map +1 -0
- package/dist/commands/remerge-diff.d.ts +59 -0
- package/dist/commands/remerge-diff.d.ts.map +1 -0
- package/dist/commands/remote-command.d.ts +179 -29
- package/dist/commands/remote-command.d.ts.map +1 -1
- package/dist/commands/remote-show-command.d.ts +204 -0
- package/dist/commands/remote-show-command.d.ts.map +1 -0
- package/dist/commands/remote-transport.d.ts +7 -1
- package/dist/commands/remote-transport.d.ts.map +1 -1
- package/dist/commands/reset-command.d.ts +21 -4
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts +9 -3
- package/dist/commands/restore-command.d.ts.map +1 -1
- package/dist/commands/rev-filter/commit-filter.d.ts +95 -0
- package/dist/commands/rev-filter/commit-filter.d.ts.map +1 -0
- package/dist/commands/rev-filter/commit-grep.d.ts +91 -0
- package/dist/commands/rev-filter/commit-grep.d.ts.map +1 -0
- package/dist/commands/rev-filter/index.d.ts +3 -0
- package/dist/commands/rev-filter/index.d.ts.map +1 -0
- package/dist/commands/rev-list-command.d.ts +226 -2
- package/dist/commands/rev-list-command.d.ts.map +1 -1
- package/dist/commands/revert-command.d.ts +54 -1
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-range.d.ts +34 -1
- package/dist/commands/revision-range.d.ts.map +1 -1
- package/dist/commands/revision-resolver.d.ts +15 -0
- package/dist/commands/revision-resolver.d.ts.map +1 -1
- package/dist/commands/rm-command.d.ts +70 -2
- package/dist/commands/rm-command.d.ts.map +1 -1
- package/dist/commands/sequencer-pick.d.ts +186 -5
- package/dist/commands/sequencer-pick.d.ts.map +1 -1
- package/dist/commands/sequencer-support.d.ts +12 -1
- package/dist/commands/sequencer-support.d.ts.map +1 -1
- package/dist/commands/serve-repository.d.ts +7 -0
- package/dist/commands/serve-repository.d.ts.map +1 -1
- package/dist/commands/shortlog-command.d.ts +109 -0
- package/dist/commands/shortlog-command.d.ts.map +1 -0
- package/dist/commands/shortlog.d.ts +151 -0
- package/dist/commands/shortlog.d.ts.map +1 -0
- package/dist/commands/show-command.d.ts +130 -0
- package/dist/commands/show-command.d.ts.map +1 -0
- package/dist/commands/show-commit.d.ts +11 -0
- package/dist/commands/show-commit.d.ts.map +1 -0
- package/dist/commands/signature-check.d.ts +164 -0
- package/dist/commands/signature-check.d.ts.map +1 -0
- package/dist/commands/signing.d.ts +160 -0
- package/dist/commands/signing.d.ts.map +1 -0
- package/dist/commands/sparse-checkout-command.d.ts.map +1 -1
- package/dist/commands/sparse-index-view.d.ts +45 -0
- package/dist/commands/sparse-index-view.d.ts.map +1 -0
- package/dist/commands/ssh-signer.d.ts +29 -0
- package/dist/commands/ssh-signer.d.ts.map +1 -0
- package/dist/commands/ssh-verifier.d.ts +42 -0
- package/dist/commands/ssh-verifier.d.ts.map +1 -0
- package/dist/commands/stash-apply-command.d.ts +5 -0
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-branch-command.d.ts +34 -0
- package/dist/commands/stash-branch-command.d.ts.map +1 -0
- package/dist/commands/stash-create-command.d.ts +17 -0
- package/dist/commands/stash-create-command.d.ts.map +1 -1
- package/dist/commands/stash-info.d.ts +93 -0
- package/dist/commands/stash-info.d.ts.map +1 -0
- package/dist/commands/stash-list-command.d.ts +16 -0
- package/dist/commands/stash-list-command.d.ts.map +1 -1
- package/dist/commands/stash-pop-command.d.ts +39 -0
- package/dist/commands/stash-pop-command.d.ts.map +1 -0
- package/dist/commands/stash-show-command.d.ts +48 -0
- package/dist/commands/stash-show-command.d.ts.map +1 -0
- package/dist/commands/stash-store-command.d.ts +29 -0
- package/dist/commands/stash-store-command.d.ts.map +1 -0
- package/dist/commands/stash-working-tree.d.ts.map +1 -1
- package/dist/commands/status-command.d.ts +31 -2
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-header.d.ts +5 -0
- package/dist/commands/status-header.d.ts.map +1 -1
- package/dist/commands/submodule-add-command.d.ts +89 -0
- package/dist/commands/submodule-add-command.d.ts.map +1 -0
- package/dist/commands/submodule-auth.d.ts +90 -0
- package/dist/commands/submodule-auth.d.ts.map +1 -0
- package/dist/commands/submodule-commands.d.ts +463 -0
- package/dist/commands/submodule-commands.d.ts.map +1 -0
- package/dist/commands/submodule-fetch.d.ts +149 -0
- package/dist/commands/submodule-fetch.d.ts.map +1 -0
- package/dist/commands/submodule-model.d.ts +296 -0
- package/dist/commands/submodule-model.d.ts.map +1 -0
- package/dist/commands/submodule-unpack.d.ts +120 -0
- package/dist/commands/submodule-unpack.d.ts.map +1 -0
- package/dist/commands/submodule-update-command.d.ts +206 -0
- package/dist/commands/submodule-update-command.d.ts.map +1 -0
- package/dist/commands/subtree-shift.d.ts +27 -0
- package/dist/commands/subtree-shift.d.ts.map +1 -0
- package/dist/commands/switch-command.d.ts +3 -0
- package/dist/commands/switch-command.d.ts.map +1 -1
- package/dist/commands/tag-command.d.ts +259 -10
- package/dist/commands/tag-command.d.ts.map +1 -1
- package/dist/commands/trailers.d.ts +218 -17
- package/dist/commands/trailers.d.ts.map +1 -1
- package/dist/commands/tree-restore.d.ts +7 -0
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/verify-command.d.ts +92 -0
- package/dist/commands/verify-command.d.ts.map +1 -0
- package/dist/commands/worktree-add-command.d.ts +79 -7
- package/dist/commands/worktree-add-command.d.ts.map +1 -1
- package/dist/commands/worktree-overwrite-checks.d.ts +2 -0
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
- package/dist/commands/worktree-path-rules.d.ts +66 -0
- package/dist/commands/worktree-path-rules.d.ts.map +1 -0
- package/dist/commands/worktree-remove-command.d.ts +10 -3
- package/dist/commands/worktree-remove-command.d.ts.map +1 -1
- package/dist/commands/worktree-repair-command.d.ts +15 -2
- package/dist/commands/worktree-repair-command.d.ts.map +1 -1
- package/dist/commands/worktree-support.d.ts +5 -0
- package/dist/commands/worktree-support.d.ts.map +1 -1
- package/dist/{commands-DIJ91NnD.js → commands-CNvli5bl.js} +49442 -54941
- package/dist/errors/checkout-errors.d.ts +19 -0
- package/dist/errors/checkout-errors.d.ts.map +1 -1
- package/dist/errors/command-errors.d.ts +25 -0
- package/dist/errors/command-errors.d.ts.map +1 -1
- package/dist/errors/index.js +85 -3
- package/dist/errors/ref-errors.d.ts +19 -0
- package/dist/errors/ref-errors.d.ts.map +1 -1
- package/dist/errors/worktree-errors.d.ts +6 -1
- package/dist/errors/worktree-errors.d.ts.map +1 -1
- package/dist/fsck-CPeDh9fh.js +5138 -0
- package/dist/git-command.d.ts +58 -2
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +363 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/guarded-transport-command.d.ts +82 -0
- package/dist/guarded-transport-command.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/remote-config/index.d.ts +1 -1
- package/dist/remote-config/index.d.ts.map +1 -1
- package/dist/remote-config/remote-config-store.d.ts +55 -0
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/remote-transport-CCmBadm-.js +1606 -0
- package/dist/rename/detect-renames.d.ts +20 -0
- package/dist/rename/detect-renames.d.ts.map +1 -1
- package/dist/rename/diffcore-break.d.ts +51 -0
- package/dist/rename/diffcore-break.d.ts.map +1 -0
- package/dist/rename/index.d.ts +1 -0
- package/dist/rename/index.d.ts.map +1 -1
- package/dist/results/blame-format.d.ts +62 -1
- package/dist/results/blame-format.d.ts.map +1 -1
- package/dist/results/clone-result.d.ts +9 -0
- package/dist/results/clone-result.d.ts.map +1 -1
- package/dist/results/combined-diff.d.ts +3 -0
- package/dist/results/combined-diff.d.ts.map +1 -1
- package/dist/results/diff-check.d.ts +38 -0
- package/dist/results/diff-check.d.ts.map +1 -0
- package/dist/results/diff-color.d.ts +135 -0
- package/dist/results/diff-color.d.ts.map +1 -0
- package/dist/results/diff-dirstat.d.ts +36 -0
- package/dist/results/diff-dirstat.d.ts.map +1 -0
- package/dist/results/diff-entry.d.ts +10 -0
- package/dist/results/diff-entry.d.ts.map +1 -1
- package/dist/results/diff-formatter.d.ts.map +1 -1
- package/dist/results/diff-output.d.ts +103 -1
- package/dist/results/diff-output.d.ts.map +1 -1
- package/dist/results/diff-pickaxe.d.ts +67 -0
- package/dist/results/diff-pickaxe.d.ts.map +1 -0
- package/dist/results/diff-words.d.ts +55 -0
- package/dist/results/diff-words.d.ts.map +1 -0
- package/dist/results/fetch-result.d.ts +12 -1
- package/dist/results/fetch-result.d.ts.map +1 -1
- package/dist/results/index.d.ts +6 -0
- package/dist/results/index.d.ts.map +1 -1
- package/dist/results/index.js +2 -2
- package/dist/results/init-result.d.ts +8 -1
- package/dist/results/init-result.d.ts.map +1 -1
- package/dist/results/line-range-hunks.d.ts +27 -0
- package/dist/results/line-range-hunks.d.ts.map +1 -0
- package/dist/results/merge-result.d.ts +8 -1
- package/dist/results/merge-result.d.ts.map +1 -1
- package/dist/results/pull-result.d.ts +11 -0
- package/dist/results/pull-result.d.ts.map +1 -1
- package/dist/results/push-result.d.ts +12 -0
- package/dist/results/push-result.d.ts.map +1 -1
- package/dist/results/rebase-result.d.ts +2 -0
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/stash-result.d.ts +6 -0
- package/dist/results/stash-result.d.ts.map +1 -1
- package/dist/results/status-result.d.ts +1 -1
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/results-BDuEgdLU.js +46847 -0
- package/dist/transport-command.d.ts +14 -0
- package/dist/transport-command.d.ts.map +1 -1
- package/dist/whitespace/index.d.ts +2 -0
- package/dist/whitespace/index.d.ts.map +1 -0
- package/dist/whitespace/whitespace-rule.d.ts +94 -0
- package/dist/whitespace/whitespace-rule.d.ts.map +1 -0
- package/package.json +12 -12
- package/src/commands/add-command.ts +293 -17
- package/src/commands/add-patch/add-patch.ts +8 -0
- package/src/commands/add-patch/patch-backend.ts +20 -2
- package/src/commands/am/am-command.ts +400 -46
- package/src/commands/am/index.ts +1 -0
- package/src/commands/am/mailsplit.ts +326 -0
- package/src/commands/apply/apply-command.ts +58 -15
- package/src/commands/apply/apply-engine.ts +1 -1
- package/src/commands/apply/apply-parse.ts +17 -8
- package/src/commands/apply/index.ts +8 -1
- package/src/commands/bisect/bisect-command.ts +18 -5
- package/src/commands/blame-command.ts +1450 -51
- package/src/commands/blame-ignore.ts +307 -0
- package/src/commands/branch-command.ts +528 -53
- package/src/commands/branch-info-command.ts +150 -0
- package/src/commands/branch-tracking.ts +335 -60
- package/src/commands/branch-upstream-command.ts +218 -0
- package/src/commands/check-mailmap-command.ts +129 -0
- package/src/commands/checkout-command.ts +166 -55
- package/src/commands/checkout-paths.ts +28 -0
- package/src/commands/cherry-command.ts +187 -0
- package/src/commands/cherry-pick-command.ts +185 -1
- package/src/commands/clean-command.ts +126 -15
- package/src/commands/clean-interactive.ts +522 -0
- package/src/commands/clone-command.ts +598 -45
- package/src/commands/commit-command.ts +925 -74
- package/src/commands/commit-reuse.ts +94 -0
- package/src/commands/config-command.ts +1256 -0
- package/src/commands/config-value-types.ts +358 -0
- package/src/commands/core-config.ts +40 -0
- package/src/commands/describe-command.ts +341 -254
- package/src/commands/diff-color-config.ts +274 -0
- package/src/commands/diff-command.ts +1619 -99
- package/src/commands/fetch-command.ts +495 -14
- package/src/commands/fetch-multiple-command.ts +665 -0
- package/src/commands/fmt-merge-msg-command.ts +715 -0
- package/src/commands/fork-point.ts +63 -0
- package/src/commands/format-patch-command.ts +496 -116
- package/src/commands/fsck/fetch-fsck.ts +172 -18
- package/src/commands/gc-command.ts +31 -1
- package/src/commands/git-describe.ts +460 -201
- package/src/commands/git-hooks.ts +123 -3
- package/src/commands/grep/grep-command.ts +1077 -0
- package/src/commands/grep/grep-engine.ts +1024 -0
- package/src/commands/grep/index.ts +2 -0
- package/src/commands/index-adder.ts +46 -7
- package/src/commands/index.ts +43 -0
- package/src/commands/init-command.ts +603 -49
- package/src/commands/interpret-trailers-command.ts +256 -0
- package/src/commands/line-log.ts +931 -0
- package/src/commands/local-transport.ts +109 -10
- package/src/commands/log-command.ts +2599 -326
- package/src/commands/log-graph.ts +129 -29
- package/src/commands/log-output.ts +449 -27
- package/src/commands/ls-remote-command.ts +5 -0
- package/src/commands/mailmap.ts +155 -0
- package/src/commands/merge-base-command.ts +170 -0
- package/src/commands/merge-bases.ts +63 -8
- package/src/commands/merge-command.ts +601 -95
- package/src/commands/merge-drivers.ts +3 -0
- package/src/commands/merge-strategy-options.ts +224 -0
- package/src/commands/merge-support.ts +115 -22
- package/src/commands/message-cleanup.ts +1 -1
- package/src/commands/mv-command.ts +6 -3
- package/src/commands/name-rev-command.ts +184 -0
- package/src/commands/name-rev.ts +762 -0
- package/src/commands/notes-command.ts +11 -1
- package/src/commands/octopus-merge.ts +35 -11
- package/src/commands/ort-merge.ts +41 -7
- package/src/commands/ort-recursive.ts +40 -2
- package/src/commands/patch-id.ts +109 -0
- package/src/commands/pathspec-file.ts +72 -0
- package/src/commands/pathspec.ts +14 -2
- package/src/commands/pretty-format.ts +103 -19
- package/src/commands/promisor-remote.ts +10 -1
- package/src/commands/pull-command.ts +734 -221
- package/src/commands/push-command.ts +1035 -68
- package/src/commands/range-diff/index.ts +3 -0
- package/src/commands/range-diff/linear-assignment.ts +203 -0
- package/src/commands/range-diff/range-diff-command.ts +433 -0
- package/src/commands/range-diff/range-diff.ts +617 -0
- package/src/commands/read-tree-command.ts +102 -4
- package/src/commands/rebase-command.ts +1074 -194
- package/src/commands/ref-filter/for-each-ref-command.ts +298 -0
- package/src/commands/ref-filter/index.ts +7 -0
- package/src/commands/ref-filter/ref-atoms.ts +581 -0
- package/src/commands/ref-filter/ref-filter.ts +651 -0
- package/src/commands/ref-filter/ref-format.ts +1070 -0
- package/src/commands/ref-filter/ref-listing-command.ts +421 -0
- package/src/commands/ref-filter/ref-quote.ts +69 -0
- package/src/commands/ref-filter/version-compare.ts +177 -0
- package/src/commands/reflog-command.ts +492 -2
- package/src/commands/reflog-walk.ts +234 -0
- package/src/commands/remerge-diff.ts +241 -0
- package/src/commands/remote-command.ts +537 -69
- package/src/commands/remote-show-command.ts +836 -0
- package/src/commands/remote-transport.ts +9 -1
- package/src/commands/reset-command.ts +114 -34
- package/src/commands/restore-command.ts +27 -41
- package/src/commands/rev-filter/commit-filter.ts +159 -0
- package/src/commands/rev-filter/commit-grep.ts +444 -0
- package/src/commands/rev-filter/index.ts +2 -0
- package/src/commands/rev-list-command.ts +578 -15
- package/src/commands/revert-command.ts +123 -1
- package/src/commands/revision-range.ts +207 -5
- package/src/commands/revision-resolver.ts +23 -8
- package/src/commands/rm-command.ts +282 -21
- package/src/commands/sequencer-pick.ts +818 -111
- package/src/commands/sequencer-support.ts +184 -4
- package/src/commands/serve-repository.ts +18 -3
- package/src/commands/shortlog-command.ts +354 -0
- package/src/commands/shortlog.ts +361 -0
- package/src/commands/show-command.ts +491 -0
- package/src/commands/show-commit.ts +24 -0
- package/src/commands/signature-check.ts +657 -0
- package/src/commands/signing.ts +385 -0
- package/src/commands/sparse-checkout-command.ts +2 -9
- package/src/commands/sparse-checkout-support.ts +2 -2
- package/src/commands/sparse-index-view.ts +135 -0
- package/src/commands/ssh-signer.ts +199 -0
- package/src/commands/ssh-verifier.ts +523 -0
- package/src/commands/stash-apply-command.ts +16 -4
- package/src/commands/stash-branch-command.ts +88 -0
- package/src/commands/stash-create-command.ts +28 -0
- package/src/commands/stash-info.ts +243 -0
- package/src/commands/stash-list-command.ts +33 -0
- package/src/commands/stash-pop-command.ts +83 -0
- package/src/commands/stash-show-command.ts +141 -0
- package/src/commands/stash-store-command.ts +82 -0
- package/src/commands/stash-working-tree.ts +2 -2
- package/src/commands/status-command.ts +120 -27
- package/src/commands/status-format.ts +1 -1
- package/src/commands/status-header.ts +41 -7
- package/src/commands/submodule-add-command.ts +509 -0
- package/src/commands/submodule-auth.ts +276 -0
- package/src/commands/submodule-commands.ts +1835 -0
- package/src/commands/submodule-fetch.ts +789 -0
- package/src/commands/submodule-model.ts +938 -0
- package/src/commands/submodule-unpack.ts +265 -0
- package/src/commands/submodule-update-command.ts +1126 -0
- package/src/commands/subtree-shift.ts +215 -0
- package/src/commands/switch-command.ts +12 -1
- package/src/commands/tag-command.ts +876 -64
- package/src/commands/trailers.ts +837 -100
- package/src/commands/tree-restore.ts +44 -11
- package/src/commands/verify-command.ts +235 -0
- package/src/commands/worktree-add-command.ts +268 -24
- package/src/commands/worktree-overwrite-checks.ts +5 -0
- package/src/commands/worktree-path-rules.ts +183 -0
- package/src/commands/worktree-remove-command.ts +39 -5
- package/src/commands/worktree-repair-command.ts +52 -5
- package/src/commands/worktree-support.ts +22 -1
- package/src/errors/checkout-errors.ts +29 -0
- package/src/errors/command-errors.ts +37 -1
- package/src/errors/ref-errors.ts +23 -0
- package/src/errors/worktree-errors.ts +8 -1
- package/src/git-command.ts +153 -2
- package/src/git.ts +550 -1
- package/src/guarded-transport-command.ts +171 -0
- package/src/index.ts +1 -0
- package/src/remote-config/index.ts +2 -0
- package/src/remote-config/remote-config-store.ts +101 -0
- package/src/rename/detect-renames.ts +42 -8
- package/src/rename/diffcore-break.ts +166 -0
- package/src/rename/index.ts +1 -0
- package/src/results/blame-format.ts +268 -43
- package/src/results/clone-result.ts +6 -0
- package/src/results/combined-diff.ts +38 -18
- package/src/results/diff-check.ts +185 -0
- package/src/results/diff-color.ts +868 -0
- package/src/results/diff-dirstat.ts +117 -0
- package/src/results/diff-entry.ts +12 -0
- package/src/results/diff-formatter.ts +1 -0
- package/src/results/diff-output.ts +322 -32
- package/src/results/diff-pickaxe.ts +304 -0
- package/src/results/diff-words.ts +395 -0
- package/src/results/fetch-result.ts +12 -1
- package/src/results/index.ts +6 -0
- package/src/results/init-result.ts +10 -1
- package/src/results/line-range-hunks.ts +126 -0
- package/src/results/merge-result.ts +9 -0
- package/src/results/pull-result.ts +7 -0
- package/src/results/push-result.ts +12 -0
- package/src/results/rebase-result.ts +3 -0
- package/src/results/stash-result.ts +7 -0
- package/src/results/status-result.ts +2 -2
- package/src/transport-command.ts +34 -3
- package/src/whitespace/index.ts +1 -0
- package/src/{commands/apply/whitespace.ts → whitespace/whitespace-rule.ts} +173 -23
- package/dist/commands/apply/whitespace.d.ts +0 -58
- package/dist/commands/apply/whitespace.d.ts.map +0 -1
- package/dist/git-command-BGiOJ8Zk.js +0 -7246
- package/dist/results-WVlBhVb1.js +0 -2935
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
* what `--date=` takes, and so on; unset, the configuration's defaults apply (`format.pretty`,
|
|
17
17
|
* `log.date`, `log.abbrevCommit`, `log.decorate`, `log.showRoot`, `log.mailmap`,
|
|
18
18
|
* `log.follow`, `log.graphIndent`, `log.excludeDecoration`, `notes.displayRef`...). Colors
|
|
19
|
-
* are
|
|
19
|
+
* are written as `git log --color=always` writes them when the diff options or `color.ui` /
|
|
20
|
+
* `color.diff` ask for `always` (`auto` is git without a terminal: none), the graph's columns
|
|
21
|
+
* in `log.graphColors` (graph.c's `column_colors_ansi` by default).
|
|
20
22
|
*
|
|
21
23
|
* A commit with an `encoding` header is shown in UTF-8 (git's default `i18n.logOutputEncoding`);
|
|
22
24
|
* another output encoding is not supported. One quirk of git is not reproduced: where its C
|
|
@@ -33,13 +35,15 @@ import type { Commit, ObjectId, PersonIdent } from "@statewalker/vcs-core";
|
|
|
33
35
|
import { decodeGitPath, encodeGitPath, gitCharWidth } from "@statewalker/vcs-utils/encoding";
|
|
34
36
|
|
|
35
37
|
import { InvalidArgumentError } from "../errors/index.js";
|
|
38
|
+
import type { DiffColors } from "../results/diff-color.js";
|
|
36
39
|
import { ChangeType } from "../results/diff-entry.js";
|
|
37
40
|
import { type DateMode, DEFAULT_DATE_MODE, parseDateMode, showDate } from "./date-format.js";
|
|
38
|
-
import type
|
|
41
|
+
import { type DiffOutputFormat, type DiffTextOptions, hasPickaxe } from "./diff-command.js";
|
|
39
42
|
import { LogGraph } from "./log-graph.js";
|
|
40
43
|
import type { Mailmap } from "./mailmap.js";
|
|
41
44
|
import { parsePathspecItem } from "./pathspec.js";
|
|
42
45
|
import {
|
|
46
|
+
type DecorationPalette,
|
|
43
47
|
formatCommitPretty,
|
|
44
48
|
formatRefDecorations,
|
|
45
49
|
type PrettyCommit,
|
|
@@ -47,10 +51,17 @@ import {
|
|
|
47
51
|
type RefDecorations,
|
|
48
52
|
wrapText,
|
|
49
53
|
} from "./pretty-format.js";
|
|
50
|
-
import {
|
|
54
|
+
import type { SignatureCheck } from "./signature-check.js";
|
|
55
|
+
import { appendSignoff, type TrailerConfig } from "./trailers.js";
|
|
51
56
|
|
|
52
57
|
/** How `git log` treats merges in its diffs (`--diff-merges=<mode>`, `-m`, `-c`, `--cc`). */
|
|
53
|
-
export type LogDiffMerges =
|
|
58
|
+
export type LogDiffMerges =
|
|
59
|
+
| "off"
|
|
60
|
+
| "first-parent"
|
|
61
|
+
| "separate"
|
|
62
|
+
| "combined"
|
|
63
|
+
| "dense-combined"
|
|
64
|
+
| "remerge";
|
|
54
65
|
|
|
55
66
|
/** What `git log` prints of each commit (its command-line options). */
|
|
56
67
|
export interface LogOutputOptions {
|
|
@@ -60,6 +71,11 @@ export interface LogOutputOptions {
|
|
|
60
71
|
oneline?: boolean;
|
|
61
72
|
/** `--abbrev-commit` / `--no-abbrev-commit` (default `log.abbrevCommit`, false) */
|
|
62
73
|
abbrevCommit?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* `--parents`: each commit's parents after its id in the header, rewritten past the commits
|
|
76
|
+
* a path-limited walk leaves out (as `%P` and the graph see them)
|
|
77
|
+
*/
|
|
78
|
+
parents?: boolean;
|
|
63
79
|
/**
|
|
64
80
|
* `--abbrev=<n>` (default `core.abbrev`, automatic): at least n digits (4 to 40, as git
|
|
65
81
|
* clamps it), in the commits' ids and in the diffs' `index` lines (combined diffs keep the
|
|
@@ -91,6 +107,20 @@ export interface LogOutputOptions {
|
|
|
91
107
|
topoOrder?: boolean;
|
|
92
108
|
/** `--reverse` */
|
|
93
109
|
reverse?: boolean;
|
|
110
|
+
/** `--date-order` */
|
|
111
|
+
dateOrder?: boolean;
|
|
112
|
+
/** `--author-date-order` */
|
|
113
|
+
authorDateOrder?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* `--boundary`: the excluded parents of the commits shown too, marked `-` (`commit - <id>`,
|
|
116
|
+
* `- <id> <subject>` with `--oneline`, `%m`)
|
|
117
|
+
*/
|
|
118
|
+
boundary?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* `--source`: after each commit's id, a tab and the name it was reached from (a `%S` in
|
|
121
|
+
* the format asks for the names too)
|
|
122
|
+
*/
|
|
123
|
+
source?: boolean;
|
|
94
124
|
/** `-p` / `--patch` */
|
|
95
125
|
patch?: boolean;
|
|
96
126
|
/** `-s` / `--no-patch`: no diff output, whatever else asks for it */
|
|
@@ -110,6 +140,11 @@ export interface LogOutputOptions {
|
|
|
110
140
|
nameOnly?: boolean;
|
|
111
141
|
/** `--name-status` */
|
|
112
142
|
nameStatus?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* `--check`: each commit's whitespace errors and leftover conflict markers, in place of
|
|
145
|
+
* the other formats; the log's exit status is then 2 when any were found
|
|
146
|
+
*/
|
|
147
|
+
check?: boolean;
|
|
113
148
|
/** `-m`: merges' diffs against each parent (`log.diffMerges`, default `separate`) */
|
|
114
149
|
m?: boolean;
|
|
115
150
|
/** `-c`: combined diffs of merges (implies `-p`) */
|
|
@@ -118,6 +153,12 @@ export interface LogOutputOptions {
|
|
|
118
153
|
cc?: boolean;
|
|
119
154
|
/** `--diff-merges=<mode>` */
|
|
120
155
|
diffMerges?: LogDiffMerges;
|
|
156
|
+
/**
|
|
157
|
+
* `--remerge-diff`: each two-parent merge shown as the diff from merge-ort's automatic
|
|
158
|
+
* result of its parents (conflict markers included, merged in memory) to the merge, with
|
|
159
|
+
* the merge's conflicts as `remerge CONFLICT` headers (implies `-p`)
|
|
160
|
+
*/
|
|
161
|
+
remergeDiff?: boolean;
|
|
121
162
|
/**
|
|
122
163
|
* `--full-diff`: a path-limited log shows the commits' whole diffs (against their parents
|
|
123
164
|
* before `--graph` rewrote them)
|
|
@@ -152,6 +193,12 @@ export interface LogOutputOptions {
|
|
|
152
193
|
localTzName?: (time: number) => string;
|
|
153
194
|
/** `git format-patch`'s mail settings (with the `email` or `mboxrd` format) */
|
|
154
195
|
mail?: LogMailOptions;
|
|
196
|
+
/**
|
|
197
|
+
* `--show-signature` / `--no-show-signature` (default `log.showSignature`, false; never for
|
|
198
|
+
* `format-patch`, whose `mail` settings are given): each signed commit's check, then each
|
|
199
|
+
* `mergetag`'s, after the commit's header
|
|
200
|
+
*/
|
|
201
|
+
showSignature?: boolean;
|
|
155
202
|
}
|
|
156
203
|
|
|
157
204
|
/** What `git format-patch` adds to the `email` format (log-tree.c, pretty.c). */
|
|
@@ -168,6 +215,13 @@ export interface LogMailOptions {
|
|
|
168
215
|
preserveSubject?: boolean;
|
|
169
216
|
/** `--signoff`: this `Signed-off-by: ...` line (with LF) appended, unless already there */
|
|
170
217
|
signoff?: string;
|
|
218
|
+
/** The `trailer.*` settings the sign-off is added with (see `trailerConfigOf`) */
|
|
219
|
+
trailerConfig?: TrailerConfig;
|
|
220
|
+
/**
|
|
221
|
+
* A multipart mail (`--attach`, `--inline`): `afterSubject` carries the MIME headers, and
|
|
222
|
+
* no 8bit `Content-Type` header is added (log-tree.c's need_8bit_cte of -1)
|
|
223
|
+
*/
|
|
224
|
+
multipart?: boolean;
|
|
171
225
|
/** `--from=<ident>`: the `From:` header's ident (the author moves to an in-body From) */
|
|
172
226
|
from?: { name: string; email: string };
|
|
173
227
|
/** `--force-in-body-from` */
|
|
@@ -181,6 +235,12 @@ export interface LogMailOptions {
|
|
|
181
235
|
* commit that cannot be converted is shown as stored, as git shows it when iconv fails.
|
|
182
236
|
*/
|
|
183
237
|
outputEncoding?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Blocks shown after the message as commentary (git before 2.46 writes format-patch's
|
|
240
|
+
* `Interdiff:` and `Range-diff:` there): each after `---` (the first) or an empty line,
|
|
241
|
+
* its title line included
|
|
242
|
+
*/
|
|
243
|
+
commentary?: Uint8Array[];
|
|
184
244
|
}
|
|
185
245
|
|
|
186
246
|
/** A commit the walk shows, with the parents it is shown with (rewritten under `--graph`). */
|
|
@@ -190,6 +250,43 @@ export interface LogOutputEntry {
|
|
|
190
250
|
parents: ObjectId[];
|
|
191
251
|
/** The parents before `--graph` rewrote them (git's saved parents, for `--full-diff`) */
|
|
192
252
|
savedParents?: ObjectId[];
|
|
253
|
+
/** The reflog entry a reflog walk (`git log -g <ref>`) shows this commit for */
|
|
254
|
+
reflog?: LogReflogEntry;
|
|
255
|
+
/** A boundary commit (`--boundary`), marked `-` */
|
|
256
|
+
boundary?: boolean;
|
|
257
|
+
/** On the left side of a symmetric difference (`<` under `--left-right` and in `%m`) */
|
|
258
|
+
left?: boolean;
|
|
259
|
+
/** `--cherry-mark`: the other side has its change (`=`) */
|
|
260
|
+
patchSame?: boolean;
|
|
261
|
+
/** The name the commit was reached from (`--source`, `%S`) */
|
|
262
|
+
source?: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** A reflog entry of a reflog walk (reflog-walk.c's `reflog_info`). */
|
|
266
|
+
export interface LogReflogEntry {
|
|
267
|
+
/** The ref as given (`refs/stash`, `HEAD`) */
|
|
268
|
+
ref: string;
|
|
269
|
+
/** Its position, newest first (`<ref>@{n}`) */
|
|
270
|
+
index: number;
|
|
271
|
+
/** The entry's message, without its line end */
|
|
272
|
+
message: string;
|
|
273
|
+
/** Who made the change, and when */
|
|
274
|
+
who: PersonIdent;
|
|
275
|
+
/** The ref shortened (shorten_unambiguous_ref), for `%gd`; a prefix-stripped `ref` without */
|
|
276
|
+
shortRef?: string;
|
|
277
|
+
/**
|
|
278
|
+
* The selector the walk was given the ref with: `@{<n>}` shows indexes, `@{<date>}` dates,
|
|
279
|
+
* neither (undefined) indexes unless `--date` is given
|
|
280
|
+
*/
|
|
281
|
+
selector?: "index" | "date";
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** shorten_unambiguous_ref of a reflog's ref, for `%gd` */
|
|
285
|
+
function shortRefName(ref: string): string {
|
|
286
|
+
for (const prefix of ["refs/heads/", "refs/tags/", "refs/remotes/", "refs/"]) {
|
|
287
|
+
if (ref.startsWith(prefix)) return ref.slice(prefix.length);
|
|
288
|
+
}
|
|
289
|
+
return ref;
|
|
193
290
|
}
|
|
194
291
|
|
|
195
292
|
/** What the printer reads of the repository (see `LogCommand.callBytes`). */
|
|
@@ -215,6 +312,13 @@ export interface LogOutputHost {
|
|
|
215
312
|
notes(id: ObjectId): Promise<{ ref: string; text: string }[]>;
|
|
216
313
|
/** The mailmap */
|
|
217
314
|
mailmap(): Promise<Mailmap>;
|
|
315
|
+
/** The `%G` check of a commit (`check_commit_signature`), made once per commit */
|
|
316
|
+
signature?(id: ObjectId): Promise<SignatureCheck>;
|
|
317
|
+
/**
|
|
318
|
+
* `--show-signature`'s lines of a commit (log-tree.c's `show_signature` and
|
|
319
|
+
* `show_mergetag`): each block of text with whether its check failed
|
|
320
|
+
*/
|
|
321
|
+
signatureLines?(entry: LogOutputEntry): Promise<{ failed: boolean; text: string }[]>;
|
|
218
322
|
/**
|
|
219
323
|
* The diff of a commit against a parent (the empty tree for none): undefined bytes when
|
|
220
324
|
* nothing differs; `follow` the path followed, `followPath` the path to follow in the
|
|
@@ -235,6 +339,24 @@ export interface LogOutputHost {
|
|
|
235
339
|
* `names` as `--name-only` / `--name-status` list them (undefined for neither), `patch`
|
|
236
340
|
* the combined patch (when asked); `follow` the one path `--follow` limits it to
|
|
237
341
|
*/
|
|
342
|
+
/**
|
|
343
|
+
* `--remerge-diff`'s diff of a two-parent merge: from merge-ort's in-memory re-merge of
|
|
344
|
+
* `parents` to the merge, with the re-merge's `remerge CONFLICT` headers; nothing it
|
|
345
|
+
* stores reaches the repository
|
|
346
|
+
*/
|
|
347
|
+
remergeDiff?(
|
|
348
|
+
entry: LogOutputEntry,
|
|
349
|
+
parents: [ObjectId, ObjectId],
|
|
350
|
+
formats: DiffOutputFormat[],
|
|
351
|
+
options: {
|
|
352
|
+
statWidth?: number;
|
|
353
|
+
follow?: string;
|
|
354
|
+
fullDiff?: boolean;
|
|
355
|
+
abbrev?: number;
|
|
356
|
+
/** The commits the log has processed before this one (git 2.43 freed their parents) */
|
|
357
|
+
processed?: ReadonlySet<ObjectId>;
|
|
358
|
+
},
|
|
359
|
+
): Promise<{ bytes?: Uint8Array; followPath?: string }>;
|
|
238
360
|
combinedDiff(
|
|
239
361
|
entry: LogOutputEntry,
|
|
240
362
|
options: {
|
|
@@ -248,6 +370,20 @@ export interface LogOutputHost {
|
|
|
248
370
|
parentStatus?: (string | undefined)[];
|
|
249
371
|
},
|
|
250
372
|
): Promise<{ paths: number; names: Uint8Array; patch: Uint8Array }>;
|
|
373
|
+
/**
|
|
374
|
+
* `git log -L` (2.5x): the commit's pairs that touched the line ranges, through the diff
|
|
375
|
+
* pipeline with each patch cut to the ranges (line_log_queue_pairs, log_tree_diff_flush)
|
|
376
|
+
*/
|
|
377
|
+
lineLogDiff?(
|
|
378
|
+
entry: LogOutputEntry,
|
|
379
|
+
formats: DiffOutputFormat[],
|
|
380
|
+
options: { abbrev?: number },
|
|
381
|
+
): Promise<{ bytes?: Uint8Array }>;
|
|
382
|
+
/**
|
|
383
|
+
* `git log -L` (2.43): line-log's own diff of the commit (dump_diff_hacky), each line after
|
|
384
|
+
* `prefix`
|
|
385
|
+
*/
|
|
386
|
+
lineLogHacky?(entry: LogOutputEntry, prefix: string, colors?: DiffColors): Promise<Uint8Array>;
|
|
251
387
|
}
|
|
252
388
|
|
|
253
389
|
type Fmt = "raw" | "medium" | "short" | "email" | "mboxrd" | "fuller" | "full" | "oneline" | "user";
|
|
@@ -470,6 +606,20 @@ function addRfc2047(sb: string, text: string, address: boolean, encoding = "UTF-
|
|
|
470
606
|
return `${out}?=`;
|
|
471
607
|
}
|
|
472
608
|
|
|
609
|
+
/**
|
|
610
|
+
* pp_email_subject's subject header: `start` (`Subject: [PATCH 1/2] `) and the title, in
|
|
611
|
+
* RFC 2047 (unless `encodeHeaders` is false) or wrapped at 78 columns, with its LF.
|
|
612
|
+
*/
|
|
613
|
+
export function mailSubjectLine(
|
|
614
|
+
start: string,
|
|
615
|
+
title: string,
|
|
616
|
+
options: { encodeHeaders?: boolean; encoding?: string } = {},
|
|
617
|
+
): string {
|
|
618
|
+
if ((options.encodeHeaders ?? true) && needsRfc2047(title))
|
|
619
|
+
return `${start}${addRfc2047(start, title, false, options.encoding ?? "UTF-8")}\n`;
|
|
620
|
+
return `${start}${wrapText(title, -lastLineLength(start), 1, 78)}\n`;
|
|
621
|
+
}
|
|
622
|
+
|
|
473
623
|
/**
|
|
474
624
|
* The `From:` header of the email format (pp_user_info): RFC 2047 (unless
|
|
475
625
|
* `format.encodeEmailHeaders` is off) or quoted as needed.
|
|
@@ -585,6 +735,25 @@ function reencodeCommit(
|
|
|
585
735
|
return lines.join("");
|
|
586
736
|
}
|
|
587
737
|
|
|
738
|
+
/**
|
|
739
|
+
* pretty.c's repo_logmsg_reencode of a stored commit into `outputEncoding`, as `git commit`
|
|
740
|
+
* reads one for `-C`, `--amend`, `--fixup` and `--squash` (`read_commit_message`,
|
|
741
|
+
* `format_commit_message` with `get_commit_output_encoding()`): the message and the author
|
|
742
|
+
* from the converted buffer; undefined when nothing changes (no `encoding` header in another
|
|
743
|
+
* character set, or bytes that do not convert).
|
|
744
|
+
*/
|
|
745
|
+
export function reencodedCommitParts(
|
|
746
|
+
raw: Uint8Array,
|
|
747
|
+
outputEncoding: string,
|
|
748
|
+
): { message: string; author: PersonIdent | undefined } | undefined {
|
|
749
|
+
const text = decodeGitPath(raw);
|
|
750
|
+
const reencoded = reencodeCommit(text, parseRaw(text), outputEncoding);
|
|
751
|
+
if (reencoded === undefined) return undefined;
|
|
752
|
+
const parsed = parseRaw(reencoded);
|
|
753
|
+
const author = parsed.headerLines.find((l) => l.startsWith("author "));
|
|
754
|
+
return { message: parsed.body, author: author ? identOf(author) : undefined };
|
|
755
|
+
}
|
|
756
|
+
|
|
588
757
|
/** An `author`/`committer` header line's ident (`Name <email> time zone`) */
|
|
589
758
|
function identOf(line: string): PersonIdent | undefined {
|
|
590
759
|
const m = /^[a-z]+ (.*?) ?<([^>]*)> ?(\d*) ?([+-]?\d*)\n?$/.exec(line);
|
|
@@ -693,6 +862,7 @@ export class LogPrinter {
|
|
|
693
862
|
private readonly showRoot: boolean;
|
|
694
863
|
private readonly useMailmap: boolean;
|
|
695
864
|
private readonly showNotes: boolean;
|
|
865
|
+
private readonly showSignature: boolean;
|
|
696
866
|
private readonly decorate: "short" | "full" | undefined;
|
|
697
867
|
private readonly follow: boolean;
|
|
698
868
|
private decorations?: RefDecorations;
|
|
@@ -712,6 +882,14 @@ export class LogPrinter {
|
|
|
712
882
|
interesting: (id: ObjectId) => boolean;
|
|
713
883
|
firstParentOnly: boolean;
|
|
714
884
|
paths: string[];
|
|
885
|
+
/** `--left-right`: commits marked `<` or `>` */
|
|
886
|
+
leftRight?: boolean;
|
|
887
|
+
/** `--cherry-mark`: commits marked `=` or `+` */
|
|
888
|
+
cherryMark?: boolean;
|
|
889
|
+
/** The colors (`--color`, `color.ui`...), undefined for none */
|
|
890
|
+
colors?: { diff: DiffColors; decorations: DecorationPalette; graph: readonly string[] };
|
|
891
|
+
/** `-L`: the line-log of that git version prints each commit's diff */
|
|
892
|
+
lineLog?: "2.43" | "2.56";
|
|
715
893
|
},
|
|
716
894
|
) {
|
|
717
895
|
const prettyGiven = options.pretty !== undefined || !!options.oneline;
|
|
@@ -751,6 +929,7 @@ export class LogPrinter {
|
|
|
751
929
|
const formats: DiffOutputFormat[] = [];
|
|
752
930
|
if (options.nameOnly) formats.push("name-only");
|
|
753
931
|
else if (options.nameStatus) formats.push("name-status");
|
|
932
|
+
else if (options.check) formats.push("check");
|
|
754
933
|
if (options.numstat) formats.push("numstat");
|
|
755
934
|
if (options.stat) formats.push("stat");
|
|
756
935
|
if (options.shortstat) formats.push("shortstat");
|
|
@@ -767,8 +946,15 @@ export class LogPrinter {
|
|
|
767
946
|
this.fullHistory =
|
|
768
947
|
diffMerges === "separate" ||
|
|
769
948
|
diffMerges === "first-parent" ||
|
|
770
|
-
|
|
771
|
-
|
|
949
|
+
diffMerges === "remerge" ||
|
|
950
|
+
!!options.remergeDiff ||
|
|
951
|
+
(!!options.m &&
|
|
952
|
+
(mDefault === "separate" || mDefault === "first-parent" || mDefault === "remerge"));
|
|
953
|
+
if (options.remergeDiff) {
|
|
954
|
+
diffMerges = "remerge";
|
|
955
|
+
mergesNeedDiff = true;
|
|
956
|
+
implyPatch = true;
|
|
957
|
+
} else if (options.cc) {
|
|
772
958
|
diffMerges = "dense-combined";
|
|
773
959
|
mergesNeedDiff = true;
|
|
774
960
|
implyPatch = true;
|
|
@@ -787,13 +973,18 @@ export class LogPrinter {
|
|
|
787
973
|
diffMerges = "first-parent";
|
|
788
974
|
}
|
|
789
975
|
if ((implyPatch || mergesNeedDiff) && formats.length === 0) formats.push("patch");
|
|
790
|
-
//
|
|
791
|
-
|
|
976
|
+
// revision.c: -L shows patches unless a format (or -s) is given
|
|
977
|
+
if (walk.lineLog && formats.length === 0 && !options.noPatch) formats.push("patch");
|
|
978
|
+
// --name-only, --name-status and --check turn the other formats off (diff_setup_done)
|
|
979
|
+
const names = formats.find((f) => f === "name-only" || f === "name-status" || f === "check");
|
|
792
980
|
this.formats = options.noPatch ? [] : names ? [names] : formats;
|
|
793
981
|
this.diffMerges = diffMerges;
|
|
794
982
|
this.mergesNeedDiff = mergesNeedDiff;
|
|
795
983
|
this.showRoot = options.showRoot ?? bool(host.config("log.showRoot")) ?? true;
|
|
796
984
|
this.useMailmap = options.mailmap ?? bool(host.config("log.mailmap")) ?? true;
|
|
985
|
+
this.showSignature =
|
|
986
|
+
options.showSignature ??
|
|
987
|
+
(options.mail ? false : (bool(host.config("log.showSignature")) ?? false));
|
|
797
988
|
this.showNotes =
|
|
798
989
|
options.notes ??
|
|
799
990
|
((options.notesRefs?.length ?? 0) > 0 || !prettyGiven || /%N/.test(this.format.user ?? ""));
|
|
@@ -803,12 +994,47 @@ export class LogPrinter {
|
|
|
803
994
|
this.follow = (options.follow ?? bool(host.config("log.follow")) ?? false) && !!followPath;
|
|
804
995
|
if (this.follow) this.followPath = followPath;
|
|
805
996
|
// revision.c: --full-diff sets revs->diff too
|
|
806
|
-
|
|
997
|
+
// revision.c: --diff-filter needs the diffs too, and cmd_log_init_finish shows only
|
|
998
|
+
// the commits whose filtered diff is not empty (always_show_header off)
|
|
999
|
+
this.diffFiltered =
|
|
1000
|
+
options.diff?.diffFilter !== undefined || (!!options.diff && hasPickaxe(options.diff));
|
|
1001
|
+
this.allNeedDiff =
|
|
1002
|
+
userDiff ||
|
|
1003
|
+
implyPatch ||
|
|
1004
|
+
this.follow ||
|
|
1005
|
+
!!options.fullDiff ||
|
|
1006
|
+
this.diffFiltered ||
|
|
1007
|
+
(!!walk.lineLog && this.formats.length > 0);
|
|
807
1008
|
}
|
|
808
1009
|
|
|
809
|
-
/**
|
|
1010
|
+
/** `--diff-filter` or a pickaxe (`-S`, `-G`, `--find-object`) given */
|
|
1011
|
+
private readonly diffFiltered: boolean;
|
|
1012
|
+
|
|
1013
|
+
/** Whether a commit whose diff is empty is still shown (git's `always_show_header`) */
|
|
810
1014
|
get alwaysShowHeader(): boolean {
|
|
811
|
-
return !this.follow;
|
|
1015
|
+
return !this.follow && !this.diffFiltered;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* Whether the format shows the names commits were reached from (`%S`, as pretty.c's
|
|
1020
|
+
* userformat_find_requirements finds it): the walk keeps them then, as with `--source`.
|
|
1021
|
+
*/
|
|
1022
|
+
get wantsSource(): boolean {
|
|
1023
|
+
if (this.format.fmt !== "user") return false;
|
|
1024
|
+
const text = this.format.user ?? "";
|
|
1025
|
+
for (let i = 0; i < text.length; i++) {
|
|
1026
|
+
if (text[i] !== "%") continue;
|
|
1027
|
+
i++;
|
|
1028
|
+
if (text[i] === "%") continue;
|
|
1029
|
+
if (text[i] === "+" || text[i] === "-" || text[i] === " ") i++;
|
|
1030
|
+
if (text[i] === "S") return true;
|
|
1031
|
+
}
|
|
1032
|
+
return false;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/** Whether commits not shown (their diff empty) do not count (`--follow`) */
|
|
1036
|
+
get followsPath(): boolean {
|
|
1037
|
+
return this.follow;
|
|
812
1038
|
}
|
|
813
1039
|
|
|
814
1040
|
/** Prepares what the format reads (decorations, mailmap) and the graph */
|
|
@@ -835,9 +1061,23 @@ export class LogPrinter {
|
|
|
835
1061
|
firstParentOnly: this.walk.firstParentOnly,
|
|
836
1062
|
indent,
|
|
837
1063
|
...(this.options.graphLaneLimit ? { maxLanes: this.options.graphLaneLimit } : {}),
|
|
1064
|
+
...(this.walk.colors ? { colors: this.walk.colors.graph } : {}),
|
|
838
1065
|
});
|
|
839
1066
|
}
|
|
840
1067
|
|
|
1068
|
+
/**
|
|
1069
|
+
* revision.c's get_revision_mark: `-` boundary, `=` patch-same, `<`/`>` by side (always
|
|
1070
|
+
* without the walk's options, `%m`'s), else `*` in a graph, `+` under `--cherry-mark`, none.
|
|
1071
|
+
*/
|
|
1072
|
+
private revisionMark(entry: LogOutputEntry, withOptions: boolean): string {
|
|
1073
|
+
if (entry.boundary) return "-";
|
|
1074
|
+
if (entry.patchSame) return "=";
|
|
1075
|
+
if (!withOptions || this.walk.leftRight) return entry.left ? "<" : ">";
|
|
1076
|
+
if (this.graph) return "*";
|
|
1077
|
+
if (this.walk.cherryMark) return "+";
|
|
1078
|
+
return "";
|
|
1079
|
+
}
|
|
1080
|
+
|
|
841
1081
|
private padding(): string {
|
|
842
1082
|
return this.graph ? this.graph.showPadding() : "";
|
|
843
1083
|
}
|
|
@@ -851,6 +1091,19 @@ export class LogPrinter {
|
|
|
851
1091
|
return this.host.abbreviate(id, this.abbrevLength);
|
|
852
1092
|
}
|
|
853
1093
|
|
|
1094
|
+
/**
|
|
1095
|
+
* get_reflog_selector: `<ref>@{n}`, or `<ref>@{<date>}` for a ref given as `@{<date>}` or,
|
|
1096
|
+
* given without a selector, under an explicit `--date`; `shorten` for `%gd`
|
|
1097
|
+
*/
|
|
1098
|
+
private reflogSelector(reflog: LogReflogEntry, shorten: boolean): string {
|
|
1099
|
+
const ref = shorten ? (reflog.shortRef ?? shortRefName(reflog.ref)) : reflog.ref;
|
|
1100
|
+
const byDate =
|
|
1101
|
+
reflog.selector === "date" ||
|
|
1102
|
+
(reflog.selector === undefined && this.options.date !== undefined);
|
|
1103
|
+
const at = byDate ? this.formatDate(reflog.who) : String(reflog.index);
|
|
1104
|
+
return `${ref}@{${at}}`;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
854
1107
|
private formatDate(ident: PersonIdent, mode: DateMode = this.dateMode): string {
|
|
855
1108
|
return showDate(ident.timestamp, ident.tzOffset, mode, {
|
|
856
1109
|
...(this.options.now !== undefined ? { now: this.options.now } : {}),
|
|
@@ -871,7 +1124,18 @@ export class LogPrinter {
|
|
|
871
1124
|
* not shown (`--follow` and nothing of the path changed).
|
|
872
1125
|
*/
|
|
873
1126
|
async showCommit(entry: LogOutputEntry, lookahead: ObjectId[]): Promise<boolean> {
|
|
874
|
-
|
|
1127
|
+
try {
|
|
1128
|
+
return await this.showCommitOnce(entry, lookahead);
|
|
1129
|
+
} finally {
|
|
1130
|
+
this.processed.add(entry.id);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/** The commits {@link showCommit} was given so far (cmd_log_walk's loop) */
|
|
1135
|
+
private readonly processed = new Set<ObjectId>();
|
|
1136
|
+
|
|
1137
|
+
private async showCommitOnce(entry: LogOutputEntry, lookahead: ObjectId[]): Promise<boolean> {
|
|
1138
|
+
this.graph?.update(entry.id, lookahead, this.revisionMark(entry, true));
|
|
875
1139
|
if (this.follow) {
|
|
876
1140
|
const stored = this.followPaths.get(entry.id);
|
|
877
1141
|
if (stored !== undefined) this.followPath = stored;
|
|
@@ -903,8 +1167,21 @@ export class LogPrinter {
|
|
|
903
1167
|
entry: LogOutputEntry,
|
|
904
1168
|
log: { pending: boolean; parent: ObjectId | undefined },
|
|
905
1169
|
): Promise<boolean> {
|
|
1170
|
+
if (this.walk.lineLog === "2.43") {
|
|
1171
|
+
// line_log_print: the log, then line-log's own diff unless -s
|
|
1172
|
+
await this.showLog(entry, log);
|
|
1173
|
+
if (!this.options.noPatch && this.host.lineLogHacky) {
|
|
1174
|
+
this.out.bytes(await this.host.lineLogHacky(entry, this.padding(), this.walk.colors?.diff));
|
|
1175
|
+
}
|
|
1176
|
+
return true;
|
|
1177
|
+
}
|
|
906
1178
|
const allNeedDiff = this.allNeedDiff;
|
|
907
1179
|
if (!allNeedDiff && !this.mergesNeedDiff) return false;
|
|
1180
|
+
if (this.walk.lineLog) {
|
|
1181
|
+
// log_tree_diff: line_log_queue_pairs, then log_tree_diff_flush
|
|
1182
|
+
await this.diffFlush(entry, undefined, log, undefined, true);
|
|
1183
|
+
return !log.pending;
|
|
1184
|
+
}
|
|
908
1185
|
const parents = this.diffParents(entry);
|
|
909
1186
|
const isMerge = parents.length > 1;
|
|
910
1187
|
if (!isMerge && !allNeedDiff) return false;
|
|
@@ -913,6 +1190,18 @@ export class LogPrinter {
|
|
|
913
1190
|
return !log.pending;
|
|
914
1191
|
}
|
|
915
1192
|
const firstParentMerges = this.diffMerges === "first-parent";
|
|
1193
|
+
if (isMerge && this.diffMerges === "remerge") {
|
|
1194
|
+
if (parents.length > 2) {
|
|
1195
|
+
await this.showLog(entry, log);
|
|
1196
|
+
this.out.text("diff: warning: Skipping remerge-diff for octopus merges.\n");
|
|
1197
|
+
return true;
|
|
1198
|
+
}
|
|
1199
|
+
await this.diffFlush(entry, parents[0], log, [
|
|
1200
|
+
parents[0] as ObjectId,
|
|
1201
|
+
parents[1] as ObjectId,
|
|
1202
|
+
]);
|
|
1203
|
+
return !log.pending;
|
|
1204
|
+
}
|
|
916
1205
|
if (isMerge) {
|
|
917
1206
|
if (this.diffMerges === "combined" || this.diffMerges === "dense-combined") {
|
|
918
1207
|
await this.combined(entry, log, this.diffMerges === "dense-combined");
|
|
@@ -954,15 +1243,31 @@ export class LogPrinter {
|
|
|
954
1243
|
entry: LogOutputEntry,
|
|
955
1244
|
parent: ObjectId | undefined,
|
|
956
1245
|
log: { pending: boolean; parent: ObjectId | undefined },
|
|
1246
|
+
/** do_remerge_diff: the diff from these parents' re-merge instead of from `parent` */
|
|
1247
|
+
remerge?: [ObjectId, ObjectId],
|
|
1248
|
+
/** `-L`: the commit's pairs cut to the line ranges (line_log_queue_pairs) */
|
|
1249
|
+
lineLog = false,
|
|
957
1250
|
): Promise<void> {
|
|
958
1251
|
this.shownDashes = false;
|
|
959
1252
|
const width = this.graph ? this.graph.getWidth() : 0;
|
|
960
|
-
const
|
|
1253
|
+
const diffOptions = {
|
|
961
1254
|
...(width ? { statWidth: 80 - width } : {}),
|
|
962
1255
|
...(this.follow && this.followPath !== undefined ? { follow: this.followPath } : {}),
|
|
963
1256
|
...(this.options.fullDiff ? { fullDiff: true } : {}),
|
|
964
1257
|
...this.diffAbbrev(),
|
|
965
|
-
}
|
|
1258
|
+
};
|
|
1259
|
+
if (remerge && !this.host.remergeDiff) {
|
|
1260
|
+
throw new Error("--remerge-diff: the log's host cannot re-merge");
|
|
1261
|
+
}
|
|
1262
|
+
const result: { bytes?: Uint8Array; followPath?: string } =
|
|
1263
|
+
lineLog && this.host.lineLogDiff
|
|
1264
|
+
? await this.host.lineLogDiff(entry, this.formats, this.diffAbbrev())
|
|
1265
|
+
: remerge && this.host.remergeDiff
|
|
1266
|
+
? await this.host.remergeDiff(entry, remerge, this.formats, {
|
|
1267
|
+
...diffOptions,
|
|
1268
|
+
processed: this.processed,
|
|
1269
|
+
})
|
|
1270
|
+
: await this.host.diff(entry, parent, this.formats, diffOptions);
|
|
966
1271
|
if (this.follow && result.followPath !== undefined) this.followPath = result.followPath;
|
|
967
1272
|
if (!result.bytes) return;
|
|
968
1273
|
if (log.pending) {
|
|
@@ -1081,22 +1386,65 @@ export class LogPrinter {
|
|
|
1081
1386
|
const thread = mail?.threadHeaders?.(entry.id);
|
|
1082
1387
|
if (thread) this.out.text(thread);
|
|
1083
1388
|
} else if (fmt !== "user") {
|
|
1389
|
+
const colors = this.walk.colors;
|
|
1390
|
+
this.out.text(colors?.diff.commit ?? "");
|
|
1084
1391
|
if (fmt !== "oneline") this.out.text("commit ");
|
|
1392
|
+
// put_revision_mark
|
|
1393
|
+
if (!this.graph) {
|
|
1394
|
+
const mark = this.revisionMark(entry, true);
|
|
1395
|
+
if (mark) this.out.text(`${mark} `);
|
|
1396
|
+
}
|
|
1085
1397
|
this.out.text(await this.abbrevId(entry.id, this.abbrevCommit));
|
|
1398
|
+
// show_parents
|
|
1399
|
+
if (this.options.parents) {
|
|
1400
|
+
for (const p of entry.parents)
|
|
1401
|
+
this.out.text(` ${await this.abbrevId(p, this.abbrevCommit)}`);
|
|
1402
|
+
}
|
|
1086
1403
|
if (log.parent)
|
|
1087
1404
|
this.out.text(` (from ${await this.abbrevId(log.parent, this.abbrevCommit)})`);
|
|
1088
|
-
|
|
1405
|
+
this.out.text(colors?.diff.reset ?? "");
|
|
1406
|
+
// show_decorations: the source first
|
|
1407
|
+
if (entry.source !== undefined) this.out.text(`\t${entry.source}`);
|
|
1408
|
+
if (this.decorate) {
|
|
1409
|
+
this.out.text(formatRefDecorations(this.decorations, entry.id, {}, colors?.decorations));
|
|
1410
|
+
}
|
|
1089
1411
|
if (fmt === "oneline") this.out.text(" ");
|
|
1090
1412
|
else {
|
|
1091
1413
|
this.out.text("\n");
|
|
1092
1414
|
this.out.text(this.oneline());
|
|
1093
1415
|
}
|
|
1416
|
+
const reflog = entry.reflog;
|
|
1417
|
+
if (reflog) {
|
|
1418
|
+
// show_reflog_message: the selector unshortened; oneline shows nothing else
|
|
1419
|
+
const selector = this.reflogSelector(reflog, false);
|
|
1420
|
+
if (fmt === "oneline") {
|
|
1421
|
+
this.out.text(`${selector}: ${reflog.message}\n`);
|
|
1422
|
+
this.missingNewline = false;
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1425
|
+
this.out.text(
|
|
1426
|
+
`Reflog: ${selector} (${reflog.who.name} <${reflog.who.email}>)\nReflog message: ${reflog.message}\n`,
|
|
1427
|
+
);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
if (this.showSignature && this.host.signatureLines) {
|
|
1431
|
+
// show_sig_lines: each line, then the graph's padding for the next one
|
|
1432
|
+
for (const { text } of await this.host.signatureLines(entry)) {
|
|
1433
|
+
let at = 0;
|
|
1434
|
+
while (at < text.length) {
|
|
1435
|
+
const nl = text.indexOf("\n", at);
|
|
1436
|
+
const end = nl < 0 ? text.length : nl;
|
|
1437
|
+
this.out.text(`${text.slice(at, end)}${nl < 0 ? "" : "\n"}`);
|
|
1438
|
+
this.out.text(this.oneline());
|
|
1439
|
+
at = nl < 0 ? end : nl + 1;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1094
1442
|
}
|
|
1095
1443
|
let notes: string | undefined;
|
|
1096
1444
|
if (this.showNotes) notes = await this.notesText(entry.id, fmt === "user");
|
|
1097
1445
|
let msg = await this.prettyPrint(entry, notes ?? "");
|
|
1098
1446
|
if (isMail && this.options.mail?.signoff)
|
|
1099
|
-
msg = appendSignoff(msg, this.options.mail.signoff,
|
|
1447
|
+
msg = appendSignoff(msg, this.options.mail.signoff, this.options.mail.trailerConfig, true);
|
|
1100
1448
|
if (fmt !== "user" && notes) {
|
|
1101
1449
|
if (isMail) {
|
|
1102
1450
|
msg += this.shownDashes ? "\n" : "---\n";
|
|
@@ -1110,6 +1458,14 @@ export class LogPrinter {
|
|
|
1110
1458
|
if (!this.missingNewline) this.out.text(this.padding());
|
|
1111
1459
|
this.out.text("\n");
|
|
1112
1460
|
}
|
|
1461
|
+
// git before 2.46: format-patch's interdiff and range-diff as commentary blocks
|
|
1462
|
+
if (isMail) {
|
|
1463
|
+
for (const block of this.options.mail?.commentary ?? []) {
|
|
1464
|
+
this.out.text(this.shownDashes ? "\n" : "---\n");
|
|
1465
|
+
this.shownDashes = true;
|
|
1466
|
+
this.out.bytes(block);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1113
1469
|
}
|
|
1114
1470
|
|
|
1115
1471
|
/** notes.c's format_display_notes */
|
|
@@ -1159,10 +1515,31 @@ export class LogPrinter {
|
|
|
1159
1515
|
return formatCommitPretty(this.format.user ?? "", commit, entry.id, {
|
|
1160
1516
|
abbreviate: (id) => this.abbrevId(id, this.abbrevLength !== 40),
|
|
1161
1517
|
...(this.decorations ? { decorations: this.decorations } : {}),
|
|
1162
|
-
|
|
1518
|
+
...(this.walk.colors
|
|
1519
|
+
? { color: true, decorationColors: this.walk.colors.decorations }
|
|
1520
|
+
: {}),
|
|
1521
|
+
// get_revision_mark(NULL, commit)
|
|
1522
|
+
mark: this.revisionMark(entry, false),
|
|
1523
|
+
...(entry.source !== undefined ? { source: entry.source } : {}),
|
|
1163
1524
|
// %N stays as written unless notes are shown
|
|
1164
1525
|
...(this.showNotes ? { notes } : {}),
|
|
1526
|
+
...(entry.reflog
|
|
1527
|
+
? {
|
|
1528
|
+
reflog: {
|
|
1529
|
+
selector: this.reflogSelector(entry.reflog, false),
|
|
1530
|
+
shortSelector: this.reflogSelector(entry.reflog, true),
|
|
1531
|
+
message: entry.reflog.message,
|
|
1532
|
+
ident: entry.reflog.who,
|
|
1533
|
+
},
|
|
1534
|
+
}
|
|
1535
|
+
: {}),
|
|
1165
1536
|
formatDate: (ident) => this.formatDate(ident),
|
|
1537
|
+
...(this.host.signature
|
|
1538
|
+
? {
|
|
1539
|
+
signature: () =>
|
|
1540
|
+
(this.host.signature as (id: ObjectId) => Promise<SignatureCheck>)(entry.id),
|
|
1541
|
+
}
|
|
1542
|
+
: {}),
|
|
1166
1543
|
...(mailmap && !mailmap.empty ? { mailmap: (n, e) => mailmap.map(n, e) } : {}),
|
|
1167
1544
|
...(this.options.now !== undefined ? { now: this.options.now } : {}),
|
|
1168
1545
|
...(this.options.localTzOffset ? { localTzOffset: this.options.localTzOffset } : {}),
|
|
@@ -1205,14 +1582,19 @@ export class LogPrinter {
|
|
|
1205
1582
|
const title = parts.join(mail?.preserveSubject ? "\n" : " ");
|
|
1206
1583
|
if (fmt === "oneline") sb += `${title}\n`;
|
|
1207
1584
|
else {
|
|
1208
|
-
sb += mail?.subject ? mail.subject(entry.id) : "Subject: [PATCH] "
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
//
|
|
1214
|
-
// header with one
|
|
1215
|
-
if (
|
|
1585
|
+
sb += mailSubjectLine(mail?.subject ? mail.subject(entry.id) : "Subject: [PATCH] ", title, {
|
|
1586
|
+
encodeHeaders: mail?.encodeHeaders ?? true,
|
|
1587
|
+
encoding: mail?.outputEncoding ?? "UTF-8",
|
|
1588
|
+
});
|
|
1589
|
+
// need_8bit_cte: never in a multipart mail; else a sign-off by a committer whose
|
|
1590
|
+
// ident is not ASCII, a body (after the header) with a byte above 0x7f, or an
|
|
1591
|
+
// in-body header with one
|
|
1592
|
+
if (
|
|
1593
|
+
!mail?.multipart &&
|
|
1594
|
+
((mail?.signoff !== undefined && hasNonAscii(mail.signoff)) ||
|
|
1595
|
+
hasNonAscii(parsed.body) ||
|
|
1596
|
+
inBody.some(hasNonAscii))
|
|
1597
|
+
) {
|
|
1216
1598
|
sb += `MIME-Version: 1.0\nContent-Type: text/plain; charset=${mail?.outputEncoding ?? "UTF-8"}\nContent-Transfer-Encoding: 8bit\n`;
|
|
1217
1599
|
}
|
|
1218
1600
|
if (mail?.afterSubject) sb += mail.afterSubject;
|
|
@@ -1256,8 +1638,10 @@ export class LogPrinter {
|
|
|
1256
1638
|
ident: PersonIdent,
|
|
1257
1639
|
mail: boolean,
|
|
1258
1640
|
inBody: string[] = [],
|
|
1641
|
+
tagger = false,
|
|
1259
1642
|
): string {
|
|
1260
|
-
|
|
1643
|
+
const mailmap = !tagger;
|
|
1644
|
+
let { name, email } = mailmap ? this.mapped(ident) : ident;
|
|
1261
1645
|
let out = sb;
|
|
1262
1646
|
const from = mail ? this.options.mail?.from : undefined;
|
|
1263
1647
|
if (
|
|
@@ -1270,7 +1654,8 @@ export class LogPrinter {
|
|
|
1270
1654
|
}
|
|
1271
1655
|
if (mail) {
|
|
1272
1656
|
out += mailFromHeader(name, email, {
|
|
1273
|
-
|
|
1657
|
+
// show_tagger's context sets no encode_email_headers
|
|
1658
|
+
encodeHeaders: tagger ? false : (this.options.mail?.encodeHeaders ?? true),
|
|
1274
1659
|
encoding: this.options.mail?.outputEncoding ?? "UTF-8",
|
|
1275
1660
|
});
|
|
1276
1661
|
} else {
|
|
@@ -1293,6 +1678,40 @@ export class LogPrinter {
|
|
|
1293
1678
|
return out;
|
|
1294
1679
|
}
|
|
1295
1680
|
|
|
1681
|
+
/**
|
|
1682
|
+
* `git show`'s `putchar('\n')` before a tag or tree header once something was shown
|
|
1683
|
+
* (git's `rev.shown_one`, shared with the commits' separators)
|
|
1684
|
+
*/
|
|
1685
|
+
separateObject(): void {
|
|
1686
|
+
if (this.shownOne) this.out.text("\n");
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
/** `git show` showed a tag or tree header (`rev.shown_one = 1`) */
|
|
1690
|
+
markShown(): void {
|
|
1691
|
+
this.shownOne = true;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/** Text written as it is (a tag's or tree's header) */
|
|
1695
|
+
writeText(text: string): void {
|
|
1696
|
+
this.out.text(text);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
/** Bytes written as they are (a blob, a tag's message, tree entry names) */
|
|
1700
|
+
writeBytes(bytes: Uint8Array): void {
|
|
1701
|
+
this.out.bytes(bytes);
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* builtin/log.c's show_tagger: pp_user_info of a tag's `tagger` line in the commits'
|
|
1706
|
+
* format and date mode, without the mailmap and, in the email formats, without RFC 2047
|
|
1707
|
+
* (git's context sets neither)
|
|
1708
|
+
*/
|
|
1709
|
+
writeTagger(ident: PersonIdent): void {
|
|
1710
|
+
if (this.format.fmt === "oneline") return;
|
|
1711
|
+
const mail = this.format.fmt === "email" || this.format.fmt === "mboxrd";
|
|
1712
|
+
this.out.text(this.userInfo("", "Tagger", ident, mail, [], true));
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1296
1715
|
/** The output so far */
|
|
1297
1716
|
result(): Uint8Array {
|
|
1298
1717
|
return this.out.result();
|
|
@@ -1353,6 +1772,9 @@ export function mergesMode(value: string): LogDiffMerges | undefined {
|
|
|
1353
1772
|
case "cc":
|
|
1354
1773
|
case "dense-combined":
|
|
1355
1774
|
return "dense-combined";
|
|
1775
|
+
case "r":
|
|
1776
|
+
case "remerge":
|
|
1777
|
+
return "remerge";
|
|
1356
1778
|
default:
|
|
1357
1779
|
return undefined;
|
|
1358
1780
|
}
|