gt-gh 0.0.0 → 0.1.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/README.md +32 -1
- package/dist/package.json +107 -0
- package/dist/scripts/node_version.d.ts +1 -0
- package/dist/scripts/node_version.js +15 -0
- package/dist/scripts/node_version.js.map +1 -0
- package/dist/src/actions/branch_traversal.d.ts +9 -0
- package/dist/src/actions/branch_traversal.js +80 -0
- package/dist/src/actions/branch_traversal.js.map +1 -0
- package/dist/src/actions/checkout_branch.d.ts +5 -0
- package/dist/src/actions/checkout_branch.js +44 -0
- package/dist/src/actions/checkout_branch.js.map +1 -0
- package/dist/src/actions/commit_amend.d.ts +7 -0
- package/dist/src/actions/commit_amend.js +29 -0
- package/dist/src/actions/commit_amend.js.map +1 -0
- package/dist/src/actions/commit_create.d.ts +6 -0
- package/dist/src/actions/commit_create.js +23 -0
- package/dist/src/actions/commit_create.js.map +1 -0
- package/dist/src/actions/continue.d.ts +4 -0
- package/dist/src/actions/continue.js +48 -0
- package/dist/src/actions/continue.js.map +1 -0
- package/dist/src/actions/create_branch.d.ts +8 -0
- package/dist/src/actions/create_branch.js +61 -0
- package/dist/src/actions/create_branch.js.map +1 -0
- package/dist/src/actions/create_pr_body_footer.d.ts +4 -0
- package/dist/src/actions/create_pr_body_footer.js +78 -0
- package/dist/src/actions/create_pr_body_footer.js.map +1 -0
- package/dist/src/actions/current_branch_onto.d.ts +2 -0
- package/dist/src/actions/current_branch_onto.js +14 -0
- package/dist/src/actions/current_branch_onto.js.map +1 -0
- package/dist/src/actions/delete_branch.d.ts +11 -0
- package/dist/src/actions/delete_branch.js +46 -0
- package/dist/src/actions/delete_branch.js.map +1 -0
- package/dist/src/actions/edit/edit_downstack.d.ts +2 -0
- package/dist/src/actions/edit/edit_downstack.js +37 -0
- package/dist/src/actions/edit/edit_downstack.js.map +1 -0
- package/dist/src/actions/edit/stack_edit_file.d.ts +6 -0
- package/dist/src/actions/edit/stack_edit_file.js +44 -0
- package/dist/src/actions/edit/stack_edit_file.js.map +1 -0
- package/dist/src/actions/edit_branch.d.ts +2 -0
- package/dist/src/actions/edit_branch.js +27 -0
- package/dist/src/actions/edit_branch.js.map +1 -0
- package/dist/src/actions/fold_branch.d.ts +2 -0
- package/dist/src/actions/fold_branch.js +24 -0
- package/dist/src/actions/fold_branch.js.map +1 -0
- package/dist/src/actions/init.d.ts +5 -0
- package/dist/src/actions/init.js +87 -0
- package/dist/src/actions/init.js.map +1 -0
- package/dist/src/actions/log.d.ts +14 -0
- package/dist/src/actions/log.js +223 -0
- package/dist/src/actions/log.js.map +1 -0
- package/dist/src/actions/log_short_classic.d.ts +2 -0
- package/dist/src/actions/log_short_classic.js +32 -0
- package/dist/src/actions/log_short_classic.js.map +1 -0
- package/dist/src/actions/persist_continuation.d.ts +7 -0
- package/dist/src/actions/persist_continuation.js +28 -0
- package/dist/src/actions/persist_continuation.js.map +1 -0
- package/dist/src/actions/print_conflict_status.d.ts +2 -0
- package/dist/src/actions/print_conflict_status.js +32 -0
- package/dist/src/actions/print_conflict_status.js.map +1 -0
- package/dist/src/actions/rename_branch.d.ts +5 -0
- package/dist/src/actions/rename_branch.js +45 -0
- package/dist/src/actions/rename_branch.js.map +1 -0
- package/dist/src/actions/restack.d.ts +2 -0
- package/dist/src/actions/restack.js +42 -0
- package/dist/src/actions/restack.js.map +1 -0
- package/dist/src/actions/show_branch.d.ts +11 -0
- package/dist/src/actions/show_branch.js +99 -0
- package/dist/src/actions/show_branch.js.map +1 -0
- package/dist/src/actions/split.d.ts +4 -0
- package/dist/src/actions/split.js +241 -0
- package/dist/src/actions/split.js.map +1 -0
- package/dist/src/actions/squash.d.ts +3 -0
- package/dist/src/actions/squash.js +14 -0
- package/dist/src/actions/squash.js.map +1 -0
- package/dist/src/actions/submit/pr_body.d.ts +13 -0
- package/dist/src/actions/submit/pr_body.js +111 -0
- package/dist/src/actions/submit/pr_body.js.map +1 -0
- package/dist/src/actions/submit/pr_draft.d.ts +2 -0
- package/dist/src/actions/submit/pr_draft.js +20 -0
- package/dist/src/actions/submit/pr_draft.js.map +1 -0
- package/dist/src/actions/submit/pr_title.d.ts +5 -0
- package/dist/src/actions/submit/pr_title.js +21 -0
- package/dist/src/actions/submit/pr_title.js.map +1 -0
- package/dist/src/actions/submit/prepare_branches.d.ts +24 -0
- package/dist/src/actions/submit/prepare_branches.js +207 -0
- package/dist/src/actions/submit/prepare_branches.js.map +1 -0
- package/dist/src/actions/submit/reviewers.d.ts +1 -0
- package/dist/src/actions/submit/reviewers.js +11 -0
- package/dist/src/actions/submit/reviewers.js.map +1 -0
- package/dist/src/actions/submit/submit_action.d.ts +17 -0
- package/dist/src/actions/submit/submit_action.js +161 -0
- package/dist/src/actions/submit/submit_action.js.map +1 -0
- package/dist/src/actions/submit/submit_prs.d.ts +20 -0
- package/dist/src/actions/submit/submit_prs.js +124 -0
- package/dist/src/actions/submit/submit_prs.js.map +1 -0
- package/dist/src/actions/submit/validate_branches.d.ts +3 -0
- package/dist/src/actions/submit/validate_branches.js +130 -0
- package/dist/src/actions/submit/validate_branches.js.map +1 -0
- package/dist/src/actions/sync/clean_branches.d.ts +13 -0
- package/dist/src/actions/sync/clean_branches.js +155 -0
- package/dist/src/actions/sync/clean_branches.js.map +1 -0
- package/dist/src/actions/sync/get.d.ts +10 -0
- package/dist/src/actions/sync/get.js +123 -0
- package/dist/src/actions/sync/get.js.map +1 -0
- package/dist/src/actions/sync/sync.d.ts +9 -0
- package/dist/src/actions/sync/sync.js +95 -0
- package/dist/src/actions/sync/sync.js.map +1 -0
- package/dist/src/actions/sync_pr_info.d.ts +5 -0
- package/dist/src/actions/sync_pr_info.js +31 -0
- package/dist/src/actions/sync_pr_info.js.map +1 -0
- package/dist/src/actions/test.d.ts +7 -0
- package/dist/src/actions/test.js +87 -0
- package/dist/src/actions/test.js.map +1 -0
- package/dist/src/actions/track_branch.d.ts +11 -0
- package/dist/src/actions/track_branch.js +126 -0
- package/dist/src/actions/track_branch.js.map +1 -0
- package/dist/src/actions/unbranch.d.ts +2 -0
- package/dist/src/actions/unbranch.js +19 -0
- package/dist/src/actions/unbranch.js.map +1 -0
- package/dist/src/actions/untrack_branch.d.ts +5 -0
- package/dist/src/actions/untrack_branch.js +41 -0
- package/dist/src/actions/untrack_branch.js.map +1 -0
- package/dist/src/background_tasks/fetch_pr_info.d.ts +2 -0
- package/dist/src/background_tasks/fetch_pr_info.js +21 -0
- package/dist/src/background_tasks/fetch_pr_info.js.map +1 -0
- package/dist/src/commands/abort.d.ts +23 -0
- package/dist/src/commands/abort.js +34 -0
- package/dist/src/commands/abort.js.map +1 -0
- package/dist/src/commands/auth.d.ts +24 -0
- package/dist/src/commands/auth.js +64 -0
- package/dist/src/commands/auth.js.map +1 -0
- package/dist/src/commands/bottom.d.ts +9 -0
- package/dist/src/commands/bottom.js +13 -0
- package/dist/src/commands/bottom.js.map +1 -0
- package/dist/src/commands/branch-commands/bottom.d.ts +10 -0
- package/dist/src/commands/branch-commands/bottom.js +16 -0
- package/dist/src/commands/branch-commands/bottom.js.map +1 -0
- package/dist/src/commands/branch-commands/checkout.d.ts +40 -0
- package/dist/src/commands/branch-commands/checkout.js +29 -0
- package/dist/src/commands/branch-commands/checkout.js.map +1 -0
- package/dist/src/commands/branch-commands/create.d.ts +82 -0
- package/dist/src/commands/branch-commands/create.js +60 -0
- package/dist/src/commands/branch-commands/create.js.map +1 -0
- package/dist/src/commands/branch-commands/delete.d.ts +42 -0
- package/dist/src/commands/branch-commands/delete.js +30 -0
- package/dist/src/commands/branch-commands/delete.js.map +1 -0
- package/dist/src/commands/branch-commands/down.d.ts +26 -0
- package/dist/src/commands/branch-commands/down.js +25 -0
- package/dist/src/commands/branch-commands/down.js.map +1 -0
- package/dist/src/commands/branch-commands/edit.d.ts +10 -0
- package/dist/src/commands/branch-commands/edit.js +16 -0
- package/dist/src/commands/branch-commands/edit.js.map +1 -0
- package/dist/src/commands/branch-commands/fold.d.ts +26 -0
- package/dist/src/commands/branch-commands/fold.js +22 -0
- package/dist/src/commands/branch-commands/fold.js.map +1 -0
- package/dist/src/commands/branch-commands/info.d.ts +54 -0
- package/dist/src/commands/branch-commands/info.js +40 -0
- package/dist/src/commands/branch-commands/info.js.map +1 -0
- package/dist/src/commands/branch-commands/rename.d.ts +40 -0
- package/dist/src/commands/branch-commands/rename.js +37 -0
- package/dist/src/commands/branch-commands/rename.js.map +1 -0
- package/dist/src/commands/branch-commands/restack.d.ts +10 -0
- package/dist/src/commands/branch-commands/restack.js +24 -0
- package/dist/src/commands/branch-commands/restack.js.map +1 -0
- package/dist/src/commands/branch-commands/split.d.ts +40 -0
- package/dist/src/commands/branch-commands/split.js +35 -0
- package/dist/src/commands/branch-commands/split.js.map +1 -0
- package/dist/src/commands/branch-commands/squash.d.ts +50 -0
- package/dist/src/commands/branch-commands/squash.js +37 -0
- package/dist/src/commands/branch-commands/squash.js.map +1 -0
- package/dist/src/commands/branch-commands/submit.d.ts +5 -0
- package/dist/src/commands/branch-commands/submit.js +41 -0
- package/dist/src/commands/branch-commands/submit.js.map +1 -0
- package/dist/src/commands/branch-commands/top.d.ts +9 -0
- package/dist/src/commands/branch-commands/top.js +15 -0
- package/dist/src/commands/branch-commands/top.js.map +1 -0
- package/dist/src/commands/branch-commands/track.d.ts +54 -0
- package/dist/src/commands/branch-commands/track.js +43 -0
- package/dist/src/commands/branch-commands/track.js.map +1 -0
- package/dist/src/commands/branch-commands/unbranch.d.ts +10 -0
- package/dist/src/commands/branch-commands/unbranch.js +14 -0
- package/dist/src/commands/branch-commands/unbranch.js.map +1 -0
- package/dist/src/commands/branch-commands/untrack.d.ts +38 -0
- package/dist/src/commands/branch-commands/untrack.js +31 -0
- package/dist/src/commands/branch-commands/untrack.js.map +1 -0
- package/dist/src/commands/branch-commands/up.d.ts +26 -0
- package/dist/src/commands/branch-commands/up.js +25 -0
- package/dist/src/commands/branch-commands/up.js.map +1 -0
- package/dist/src/commands/branch.d.ts +5 -0
- package/dist/src/commands/branch.js +16 -0
- package/dist/src/commands/branch.js.map +1 -0
- package/dist/src/commands/checkout.d.ts +71 -0
- package/dist/src/commands/checkout.js +47 -0
- package/dist/src/commands/checkout.js.map +1 -0
- package/dist/src/commands/children.d.ts +9 -0
- package/dist/src/commands/children.js +15 -0
- package/dist/src/commands/children.js.map +1 -0
- package/dist/src/commands/commit-commands/amend.d.ts +78 -0
- package/dist/src/commands/commit-commands/amend.js +55 -0
- package/dist/src/commands/commit-commands/amend.js.map +1 -0
- package/dist/src/commands/commit-commands/create.d.ts +52 -0
- package/dist/src/commands/commit-commands/create.js +41 -0
- package/dist/src/commands/commit-commands/create.js.map +1 -0
- package/dist/src/commands/commit.d.ts +5 -0
- package/dist/src/commands/commit.js +16 -0
- package/dist/src/commands/commit.js.map +1 -0
- package/dist/src/commands/completion.d.ts +1 -0
- package/dist/src/commands/completion.js +44 -0
- package/dist/src/commands/completion.js.map +1 -0
- package/dist/src/commands/continue.d.ts +26 -0
- package/dist/src/commands/continue.js +22 -0
- package/dist/src/commands/continue.js.map +1 -0
- package/dist/src/commands/create.d.ts +143 -0
- package/dist/src/commands/create.js +98 -0
- package/dist/src/commands/create.js.map +1 -0
- package/dist/src/commands/delete.d.ts +71 -0
- package/dist/src/commands/delete.js +54 -0
- package/dist/src/commands/delete.js.map +1 -0
- package/dist/src/commands/demo.d.ts +9 -0
- package/dist/src/commands/demo.js +78 -0
- package/dist/src/commands/demo.js.map +1 -0
- package/dist/src/commands/dev-commands/cache.d.ts +21 -0
- package/dist/src/commands/dev-commands/cache.js +29 -0
- package/dist/src/commands/dev-commands/cache.js.map +1 -0
- package/dist/src/commands/dev-commands/meta.d.ts +33 -0
- package/dist/src/commands/dev-commands/meta.js +45 -0
- package/dist/src/commands/dev-commands/meta.js.map +1 -0
- package/dist/src/commands/dev.d.ts +4 -0
- package/dist/src/commands/dev.js +15 -0
- package/dist/src/commands/dev.js.map +1 -0
- package/dist/src/commands/down.d.ts +25 -0
- package/dist/src/commands/down.js +21 -0
- package/dist/src/commands/down.js.map +1 -0
- package/dist/src/commands/downstack-commands/edit.d.ts +24 -0
- package/dist/src/commands/downstack-commands/edit.js +25 -0
- package/dist/src/commands/downstack-commands/edit.js.map +1 -0
- package/dist/src/commands/downstack-commands/get.d.ts +40 -0
- package/dist/src/commands/downstack-commands/get.js +29 -0
- package/dist/src/commands/downstack-commands/get.js.map +1 -0
- package/dist/src/commands/downstack-commands/restack.d.ts +10 -0
- package/dist/src/commands/downstack-commands/restack.js +25 -0
- package/dist/src/commands/downstack-commands/restack.js.map +1 -0
- package/dist/src/commands/downstack-commands/submit.d.ts +5 -0
- package/dist/src/commands/downstack-commands/submit.js +32 -0
- package/dist/src/commands/downstack-commands/submit.js.map +1 -0
- package/dist/src/commands/downstack-commands/test.d.ts +42 -0
- package/dist/src/commands/downstack-commands/test.js +35 -0
- package/dist/src/commands/downstack-commands/test.js.map +1 -0
- package/dist/src/commands/downstack-commands/track.d.ts +40 -0
- package/dist/src/commands/downstack-commands/track.js +29 -0
- package/dist/src/commands/downstack-commands/track.js.map +1 -0
- package/dist/src/commands/downstack.d.ts +5 -0
- package/dist/src/commands/downstack.js +16 -0
- package/dist/src/commands/downstack.js.map +1 -0
- package/dist/src/commands/feedback-commands/debug_context.d.ts +35 -0
- package/dist/src/commands/feedback-commands/debug_context.js +45 -0
- package/dist/src/commands/feedback-commands/debug_context.js.map +1 -0
- package/dist/src/commands/feedback.d.ts +4 -0
- package/dist/src/commands/feedback.js +15 -0
- package/dist/src/commands/feedback.js.map +1 -0
- package/dist/src/commands/fish.d.ts +10 -0
- package/dist/src/commands/fish.js +22 -0
- package/dist/src/commands/fish.js.map +1 -0
- package/dist/src/commands/fold.d.ts +2 -0
- package/dist/src/commands/fold.js +10 -0
- package/dist/src/commands/fold.js.map +1 -0
- package/dist/src/commands/get.d.ts +103 -0
- package/dist/src/commands/get.js +60 -0
- package/dist/src/commands/get.js.map +1 -0
- package/dist/src/commands/info.d.ts +73 -0
- package/dist/src/commands/info.js +47 -0
- package/dist/src/commands/info.js.map +1 -0
- package/dist/src/commands/init.d.ts +33 -0
- package/dist/src/commands/init.js +25 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/internal-only-commands/cat.d.ts +35 -0
- package/dist/src/commands/internal-only-commands/cat.js +29 -0
- package/dist/src/commands/internal-only-commands/cat.js.map +1 -0
- package/dist/src/commands/internal-only-commands/changed-files.d.ts +23 -0
- package/dist/src/commands/internal-only-commands/changed-files.js +36 -0
- package/dist/src/commands/internal-only-commands/changed-files.js.map +1 -0
- package/dist/src/commands/internal-only-commands/config.d.ts +23 -0
- package/dist/src/commands/internal-only-commands/config.js +30 -0
- package/dist/src/commands/internal-only-commands/config.js.map +1 -0
- package/dist/src/commands/internal-only-commands/diff.d.ts +31 -0
- package/dist/src/commands/internal-only-commands/diff.js +43 -0
- package/dist/src/commands/internal-only-commands/diff.js.map +1 -0
- package/dist/src/commands/internal-only-commands/init.d.ts +9 -0
- package/dist/src/commands/internal-only-commands/init.js +17 -0
- package/dist/src/commands/internal-only-commands/init.js.map +1 -0
- package/dist/src/commands/internal-only-commands/log.d.ts +9 -0
- package/dist/src/commands/internal-only-commands/log.js +65 -0
- package/dist/src/commands/internal-only-commands/log.js.map +1 -0
- package/dist/src/commands/internal-only-commands/metaedit.d.ts +33 -0
- package/dist/src/commands/internal-only-commands/metaedit.js +31 -0
- package/dist/src/commands/internal-only-commands/metaedit.js.map +1 -0
- package/dist/src/commands/internal-only-commands/profile.d.ts +9 -0
- package/dist/src/commands/internal-only-commands/profile.js +19 -0
- package/dist/src/commands/internal-only-commands/profile.js.map +1 -0
- package/dist/src/commands/internal-only-commands/relative-cat.d.ts +43 -0
- package/dist/src/commands/internal-only-commands/relative-cat.js +49 -0
- package/dist/src/commands/internal-only-commands/relative-cat.js.map +1 -0
- package/dist/src/commands/internal-only-commands/repo-info.d.ts +9 -0
- package/dist/src/commands/internal-only-commands/repo-info.js +36 -0
- package/dist/src/commands/internal-only-commands/repo-info.js.map +1 -0
- package/dist/src/commands/internal-only-commands/root.d.ts +21 -0
- package/dist/src/commands/internal-only-commands/root.js +30 -0
- package/dist/src/commands/internal-only-commands/root.js.map +1 -0
- package/dist/src/commands/internal-only-commands/set-config.d.ts +43 -0
- package/dist/src/commands/internal-only-commands/set-config.js +41 -0
- package/dist/src/commands/internal-only-commands/set-config.js.map +1 -0
- package/dist/src/commands/internal-only-commands/status.d.ts +9 -0
- package/dist/src/commands/internal-only-commands/status.js +43 -0
- package/dist/src/commands/internal-only-commands/status.js.map +1 -0
- package/dist/src/commands/internal-only-commands/templates.d.ts +9 -0
- package/dist/src/commands/internal-only-commands/templates.js +24 -0
- package/dist/src/commands/internal-only-commands/templates.js.map +1 -0
- package/dist/src/commands/log-commands/default.d.ts +61 -0
- package/dist/src/commands/log-commands/default.js +47 -0
- package/dist/src/commands/log-commands/default.js.map +1 -0
- package/dist/src/commands/log-commands/long.d.ts +10 -0
- package/dist/src/commands/log-commands/long.js +13 -0
- package/dist/src/commands/log-commands/long.js.map +1 -0
- package/dist/src/commands/log-commands/short.d.ts +74 -0
- package/dist/src/commands/log-commands/short.js +57 -0
- package/dist/src/commands/log-commands/short.js.map +1 -0
- package/dist/src/commands/log.d.ts +5 -0
- package/dist/src/commands/log.js +15 -0
- package/dist/src/commands/log.js.map +1 -0
- package/dist/src/commands/modify.d.ts +139 -0
- package/dist/src/commands/modify.js +107 -0
- package/dist/src/commands/modify.js.map +1 -0
- package/dist/src/commands/move.d.ts +53 -0
- package/dist/src/commands/move.js +60 -0
- package/dist/src/commands/move.js.map +1 -0
- package/dist/src/commands/parent.d.ts +9 -0
- package/dist/src/commands/parent.js +14 -0
- package/dist/src/commands/parent.js.map +1 -0
- package/dist/src/commands/pop.d.ts +9 -0
- package/dist/src/commands/pop.js +13 -0
- package/dist/src/commands/pop.js.map +1 -0
- package/dist/src/commands/pr.d.ts +35 -0
- package/dist/src/commands/pr.js +35 -0
- package/dist/src/commands/pr.js.map +1 -0
- package/dist/src/commands/rename.d.ts +2 -0
- package/dist/src/commands/rename.js +10 -0
- package/dist/src/commands/rename.js.map +1 -0
- package/dist/src/commands/reorder.d.ts +21 -0
- package/dist/src/commands/reorder.js +25 -0
- package/dist/src/commands/reorder.js.map +1 -0
- package/dist/src/commands/repo-commands/repo_disable_github.d.ts +23 -0
- package/dist/src/commands/repo-commands/repo_disable_github.js +27 -0
- package/dist/src/commands/repo-commands/repo_disable_github.js.map +1 -0
- package/dist/src/commands/repo-commands/repo_init.d.ts +34 -0
- package/dist/src/commands/repo-commands/repo_init.js +26 -0
- package/dist/src/commands/repo-commands/repo_init.js.map +1 -0
- package/dist/src/commands/repo-commands/repo_name.d.ts +23 -0
- package/dist/src/commands/repo-commands/repo_name.js +28 -0
- package/dist/src/commands/repo-commands/repo_name.js.map +1 -0
- package/dist/src/commands/repo-commands/repo_owner.d.ts +23 -0
- package/dist/src/commands/repo-commands/repo_owner.js +28 -0
- package/dist/src/commands/repo-commands/repo_owner.js.map +1 -0
- package/dist/src/commands/repo-commands/repo_pr_templates.d.ts +9 -0
- package/dist/src/commands/repo-commands/repo_pr_templates.js +17 -0
- package/dist/src/commands/repo-commands/repo_pr_templates.js.map +1 -0
- package/dist/src/commands/repo-commands/repo_remote.d.ts +23 -0
- package/dist/src/commands/repo-commands/repo_remote.js +28 -0
- package/dist/src/commands/repo-commands/repo_remote.js.map +1 -0
- package/dist/src/commands/repo-commands/repo_sync.d.ts +80 -0
- package/dist/src/commands/repo-commands/repo_sync.js +59 -0
- package/dist/src/commands/repo-commands/repo_sync.js.map +1 -0
- package/dist/src/commands/repo.d.ts +5 -0
- package/dist/src/commands/repo.js +16 -0
- package/dist/src/commands/repo.js.map +1 -0
- package/dist/src/commands/restack.d.ts +55 -0
- package/dist/src/commands/restack.js +47 -0
- package/dist/src/commands/restack.js.map +1 -0
- package/dist/src/commands/revert.d.ts +37 -0
- package/dist/src/commands/revert.js +56 -0
- package/dist/src/commands/revert.js.map +1 -0
- package/dist/src/commands/shared-commands/submit.d.ts +161 -0
- package/dist/src/commands/shared-commands/submit.js +95 -0
- package/dist/src/commands/shared-commands/submit.js.map +1 -0
- package/dist/src/commands/split.d.ts +3 -0
- package/dist/src/commands/split.js +11 -0
- package/dist/src/commands/split.js.map +1 -0
- package/dist/src/commands/squash.d.ts +2 -0
- package/dist/src/commands/squash.js +10 -0
- package/dist/src/commands/squash.js.map +1 -0
- package/dist/src/commands/stack-commands/restack.d.ts +20 -0
- package/dist/src/commands/stack-commands/restack.js +22 -0
- package/dist/src/commands/stack-commands/restack.js.map +1 -0
- package/dist/src/commands/stack-commands/submit.d.ts +5 -0
- package/dist/src/commands/stack-commands/submit.js +33 -0
- package/dist/src/commands/stack-commands/submit.js.map +1 -0
- package/dist/src/commands/stack-commands/test.d.ts +42 -0
- package/dist/src/commands/stack-commands/test.js +31 -0
- package/dist/src/commands/stack-commands/test.js.map +1 -0
- package/dist/src/commands/stack.d.ts +5 -0
- package/dist/src/commands/stack.js +16 -0
- package/dist/src/commands/stack.js.map +1 -0
- package/dist/src/commands/submit.d.ts +306 -0
- package/dist/src/commands/submit.js +139 -0
- package/dist/src/commands/submit.js.map +1 -0
- package/dist/src/commands/sync.d.ts +57 -0
- package/dist/src/commands/sync.js +43 -0
- package/dist/src/commands/sync.js.map +1 -0
- package/dist/src/commands/top.d.ts +9 -0
- package/dist/src/commands/top.js +13 -0
- package/dist/src/commands/top.js.map +1 -0
- package/dist/src/commands/track.d.ts +49 -0
- package/dist/src/commands/track.js +37 -0
- package/dist/src/commands/track.js.map +1 -0
- package/dist/src/commands/trunk.d.ts +33 -0
- package/dist/src/commands/trunk.js +27 -0
- package/dist/src/commands/trunk.js.map +1 -0
- package/dist/src/commands/unlink.d.ts +25 -0
- package/dist/src/commands/unlink.js +24 -0
- package/dist/src/commands/unlink.js.map +1 -0
- package/dist/src/commands/untrack.d.ts +39 -0
- package/dist/src/commands/untrack.js +31 -0
- package/dist/src/commands/untrack.js.map +1 -0
- package/dist/src/commands/up.d.ts +35 -0
- package/dist/src/commands/up.js +26 -0
- package/dist/src/commands/up.js.map +1 -0
- package/dist/src/commands/upstack-commands/onto.d.ts +40 -0
- package/dist/src/commands/upstack-commands/onto.js +48 -0
- package/dist/src/commands/upstack-commands/onto.js.map +1 -0
- package/dist/src/commands/upstack-commands/restack.d.ts +10 -0
- package/dist/src/commands/upstack-commands/restack.js +15 -0
- package/dist/src/commands/upstack-commands/restack.js.map +1 -0
- package/dist/src/commands/upstack-commands/submit.d.ts +5 -0
- package/dist/src/commands/upstack-commands/submit.js +41 -0
- package/dist/src/commands/upstack-commands/submit.js.map +1 -0
- package/dist/src/commands/upstack-commands/test.d.ts +28 -0
- package/dist/src/commands/upstack-commands/test.js +24 -0
- package/dist/src/commands/upstack-commands/test.js.map +1 -0
- package/dist/src/commands/upstack.d.ts +5 -0
- package/dist/src/commands/upstack.js +16 -0
- package/dist/src/commands/upstack.js.map +1 -0
- package/dist/src/commands/user-commands/branch_date.d.ts +35 -0
- package/dist/src/commands/user-commands/branch_date.js +40 -0
- package/dist/src/commands/user-commands/branch_date.js.map +1 -0
- package/dist/src/commands/user-commands/branch_prefix.d.ts +39 -0
- package/dist/src/commands/user-commands/branch_prefix.js +46 -0
- package/dist/src/commands/user-commands/branch_prefix.js.map +1 -0
- package/dist/src/commands/user-commands/branch_replacement.d.ts +47 -0
- package/dist/src/commands/user-commands/branch_replacement.js +53 -0
- package/dist/src/commands/user-commands/branch_replacement.js.map +1 -0
- package/dist/src/commands/user-commands/editor.d.ts +35 -0
- package/dist/src/commands/user-commands/editor.js +45 -0
- package/dist/src/commands/user-commands/editor.js.map +1 -0
- package/dist/src/commands/user-commands/pager.d.ts +45 -0
- package/dist/src/commands/user-commands/pager.js +58 -0
- package/dist/src/commands/user-commands/pager.js.map +1 -0
- package/dist/src/commands/user-commands/restack_date.d.ts +21 -0
- package/dist/src/commands/user-commands/restack_date.js +36 -0
- package/dist/src/commands/user-commands/restack_date.js.map +1 -0
- package/dist/src/commands/user-commands/submit_body.d.ts +21 -0
- package/dist/src/commands/user-commands/submit_body.js +34 -0
- package/dist/src/commands/user-commands/submit_body.js.map +1 -0
- package/dist/src/commands/user-commands/tips.d.ts +35 -0
- package/dist/src/commands/user-commands/tips.js +41 -0
- package/dist/src/commands/user-commands/tips.js.map +1 -0
- package/dist/src/commands/user.d.ts +4 -0
- package/dist/src/commands/user.js +15 -0
- package/dist/src/commands/user.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +38 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/api/pr_info.d.ts +20 -0
- package/dist/src/lib/api/pr_info.js +107 -0
- package/dist/src/lib/api/pr_info.js.map +1 -0
- package/dist/src/lib/cli_shared_types.d.ts +43 -0
- package/dist/src/lib/cli_shared_types.js +3 -0
- package/dist/src/lib/cli_shared_types.js.map +1 -0
- package/dist/src/lib/colors.d.ts +2 -0
- package/dist/src/lib/colors.js +15 -0
- package/dist/src/lib/colors.js.map +1 -0
- package/dist/src/lib/context.d.ts +35 -0
- package/dist/src/lib/context.js +70 -0
- package/dist/src/lib/context.js.map +1 -0
- package/dist/src/lib/debug_context.d.ts +4 -0
- package/dist/src/lib/debug_context.js +163 -0
- package/dist/src/lib/debug_context.js.map +1 -0
- package/dist/src/lib/engine/cache_loader.d.ts +9 -0
- package/dist/src/lib/engine/cache_loader.js +54 -0
- package/dist/src/lib/engine/cache_loader.js.map +1 -0
- package/dist/src/lib/engine/cache_lock.d.ts +5 -0
- package/dist/src/lib/engine/cache_lock.js +22 -0
- package/dist/src/lib/engine/cache_lock.js.map +1 -0
- package/dist/src/lib/engine/cached_meta.d.ts +44 -0
- package/dist/src/lib/engine/cached_meta.js +73 -0
- package/dist/src/lib/engine/cached_meta.js.map +1 -0
- package/dist/src/lib/engine/engine.d.ts +120 -0
- package/dist/src/lib/engine/engine.js +725 -0
- package/dist/src/lib/engine/engine.js.map +1 -0
- package/dist/src/lib/engine/metadata_ref.d.ts +32 -0
- package/dist/src/lib/engine/metadata_ref.js +116 -0
- package/dist/src/lib/engine/metadata_ref.js.map +1 -0
- package/dist/src/lib/engine/parse_branches_and_meta.d.ts +26 -0
- package/dist/src/lib/engine/parse_branches_and_meta.js +140 -0
- package/dist/src/lib/engine/parse_branches_and_meta.js.map +1 -0
- package/dist/src/lib/engine/scope_spec.d.ts +32 -0
- package/dist/src/lib/engine/scope_spec.js +31 -0
- package/dist/src/lib/engine/scope_spec.js.map +1 -0
- package/dist/src/lib/errors.d.ts +36 -0
- package/dist/src/lib/errors.js +102 -0
- package/dist/src/lib/errors.js.map +1 -0
- package/dist/src/lib/git/add_all.d.ts +1 -0
- package/dist/src/lib/git/add_all.js +13 -0
- package/dist/src/lib/git/add_all.js.map +1 -0
- package/dist/src/lib/git/branch_ops.d.ts +10 -0
- package/dist/src/lib/git/branch_ops.js +65 -0
- package/dist/src/lib/git/branch_ops.js.map +1 -0
- package/dist/src/lib/git/changed_files.d.ts +11 -0
- package/dist/src/lib/git/changed_files.js +3 -0
- package/dist/src/lib/git/changed_files.js.map +1 -0
- package/dist/src/lib/git/clean.d.ts +1 -0
- package/dist/src/lib/git/clean.js +14 -0
- package/dist/src/lib/git/clean.js.map +1 -0
- package/dist/src/lib/git/commit.d.ts +10 -0
- package/dist/src/lib/git/commit.js +24 -0
- package/dist/src/lib/git/commit.js.map +1 -0
- package/dist/src/lib/git/commit_info.d.ts +2 -0
- package/dist/src/lib/git/commit_info.js +23 -0
- package/dist/src/lib/git/commit_info.js.map +1 -0
- package/dist/src/lib/git/commit_range.d.ts +11 -0
- package/dist/src/lib/git/commit_range.js +81 -0
- package/dist/src/lib/git/commit_range.js.map +1 -0
- package/dist/src/lib/git/commit_tree.d.ts +1 -0
- package/dist/src/lib/git/commit_tree.js +30 -0
- package/dist/src/lib/git/commit_tree.js.map +1 -0
- package/dist/src/lib/git/diff.d.ts +5 -0
- package/dist/src/lib/git/diff.js +69 -0
- package/dist/src/lib/git/diff.js.map +1 -0
- package/dist/src/lib/git/fetch_branch.d.ts +4 -0
- package/dist/src/lib/git/fetch_branch.js +40 -0
- package/dist/src/lib/git/fetch_branch.js.map +1 -0
- package/dist/src/lib/git/file_contents.d.ts +1 -0
- package/dist/src/lib/git/file_contents.js +13 -0
- package/dist/src/lib/git/file_contents.js.map +1 -0
- package/dist/src/lib/git/files_changed.d.ts +2 -0
- package/dist/src/lib/git/files_changed.js +55 -0
- package/dist/src/lib/git/files_changed.js.map +1 -0
- package/dist/src/lib/git/find_remote_branch.d.ts +1 -0
- package/dist/src/lib/git/find_remote_branch.js +17 -0
- package/dist/src/lib/git/find_remote_branch.js.map +1 -0
- package/dist/src/lib/git/get_email.d.ts +1 -0
- package/dist/src/lib/git/get_email.js +18 -0
- package/dist/src/lib/git/get_email.js.map +1 -0
- package/dist/src/lib/git/get_sha.d.ts +7 -0
- package/dist/src/lib/git/get_sha.js +55 -0
- package/dist/src/lib/git/get_sha.js.map +1 -0
- package/dist/src/lib/git/git.d.ts +92 -0
- package/dist/src/lib/git/git.js +98 -0
- package/dist/src/lib/git/git.js.map +1 -0
- package/dist/src/lib/git/git_editor.d.ts +2 -0
- package/dist/src/lib/git/git_editor.js +23 -0
- package/dist/src/lib/git/git_editor.js.map +1 -0
- package/dist/src/lib/git/git_status_utils.d.ts +2 -0
- package/dist/src/lib/git/git_status_utils.js +20 -0
- package/dist/src/lib/git/git_status_utils.js.map +1 -0
- package/dist/src/lib/git/is_merged.d.ts +4 -0
- package/dist/src/lib/git/is_merged.js +38 -0
- package/dist/src/lib/git/is_merged.js.map +1 -0
- package/dist/src/lib/git/log.d.ts +1 -0
- package/dist/src/lib/git/log.js +21 -0
- package/dist/src/lib/git/log.js.map +1 -0
- package/dist/src/lib/git/merge_base.d.ts +2 -0
- package/dist/src/lib/git/merge_base.js +21 -0
- package/dist/src/lib/git/merge_base.js.map +1 -0
- package/dist/src/lib/git/merge_conflict_help.d.ts +2 -0
- package/dist/src/lib/git/merge_conflict_help.js +41 -0
- package/dist/src/lib/git/merge_conflict_help.js.map +1 -0
- package/dist/src/lib/git/prune_remote.d.ts +1 -0
- package/dist/src/lib/git/prune_remote.js +13 -0
- package/dist/src/lib/git/prune_remote.js.map +1 -0
- package/dist/src/lib/git/pull_branch.d.ts +5 -0
- package/dist/src/lib/git/pull_branch.js +28 -0
- package/dist/src/lib/git/pull_branch.js.map +1 -0
- package/dist/src/lib/git/push_branch.d.ts +6 -0
- package/dist/src/lib/git/push_branch.js +22 -0
- package/dist/src/lib/git/push_branch.js.map +1 -0
- package/dist/src/lib/git/rebase.d.ts +14 -0
- package/dist/src/lib/git/rebase.js +67 -0
- package/dist/src/lib/git/rebase.js.map +1 -0
- package/dist/src/lib/git/rebase_in_progress.d.ts +3 -0
- package/dist/src/lib/git/rebase_in_progress.js +23 -0
- package/dist/src/lib/git/rebase_in_progress.js.map +1 -0
- package/dist/src/lib/git/reset_branch.d.ts +4 -0
- package/dist/src/lib/git/reset_branch.js +37 -0
- package/dist/src/lib/git/reset_branch.js.map +1 -0
- package/dist/src/lib/git/restore_file.d.ts +1 -0
- package/dist/src/lib/git/restore_file.js +14 -0
- package/dist/src/lib/git/restore_file.js.map +1 -0
- package/dist/src/lib/git/runner.d.ts +42 -0
- package/dist/src/lib/git/runner.js +153 -0
- package/dist/src/lib/git/runner.js.map +1 -0
- package/dist/src/lib/git/set_remote_tracking.d.ts +5 -0
- package/dist/src/lib/git/set_remote_tracking.js +13 -0
- package/dist/src/lib/git/set_remote_tracking.js.map +1 -0
- package/dist/src/lib/git/show_commits.d.ts +1 -0
- package/dist/src/lib/git/show_commits.js +21 -0
- package/dist/src/lib/git/show_commits.js.map +1 -0
- package/dist/src/lib/git/sorted_branch_names.d.ts +1 -0
- package/dist/src/lib/git/sorted_branch_names.js +23 -0
- package/dist/src/lib/git/sorted_branch_names.js.map +1 -0
- package/dist/src/lib/git/status.d.ts +2 -0
- package/dist/src/lib/git/status.js +120 -0
- package/dist/src/lib/git/status.js.map +1 -0
- package/dist/src/lib/global_arguments.d.ts +40 -0
- package/dist/src/lib/global_arguments.js +42 -0
- package/dist/src/lib/global_arguments.js.map +1 -0
- package/dist/src/lib/gt.fish +31 -0
- package/dist/src/lib/pre-yargs/deprecated_commands.d.ts +1 -0
- package/dist/src/lib/pre-yargs/deprecated_commands.js +55 -0
- package/dist/src/lib/pre-yargs/deprecated_commands.js.map +1 -0
- package/dist/src/lib/pre-yargs/passthrough.d.ts +1 -0
- package/dist/src/lib/pre-yargs/passthrough.js +66 -0
- package/dist/src/lib/pre-yargs/passthrough.js.map +1 -0
- package/dist/src/lib/pre-yargs/preprocess_command.d.ts +1 -0
- package/dist/src/lib/pre-yargs/preprocess_command.js +42 -0
- package/dist/src/lib/pre-yargs/preprocess_command.js.map +1 -0
- package/dist/src/lib/preconditions.d.ts +5 -0
- package/dist/src/lib/preconditions.js +48 -0
- package/dist/src/lib/preconditions.js.map +1 -0
- package/dist/src/lib/retype.d.ts +35 -0
- package/dist/src/lib/retype.js +61 -0
- package/dist/src/lib/retype.js.map +1 -0
- package/dist/src/lib/runner.d.ts +5 -0
- package/dist/src/lib/runner.js +130 -0
- package/dist/src/lib/runner.js.map +1 -0
- package/dist/src/lib/spiffy/cache_lock_spf.d.ts +26 -0
- package/dist/src/lib/spiffy/cache_lock_spf.js +51 -0
- package/dist/src/lib/spiffy/cache_lock_spf.js.map +1 -0
- package/dist/src/lib/spiffy/cache_spf.d.ts +146 -0
- package/dist/src/lib/spiffy/cache_spf.js +49 -0
- package/dist/src/lib/spiffy/cache_spf.js.map +1 -0
- package/dist/src/lib/spiffy/continuation_spf.d.ts +39 -0
- package/dist/src/lib/spiffy/continuation_spf.js +64 -0
- package/dist/src/lib/spiffy/continuation_spf.js.map +1 -0
- package/dist/src/lib/spiffy/pr_info_spf.d.ts +66 -0
- package/dist/src/lib/spiffy/pr_info_spf.js +50 -0
- package/dist/src/lib/spiffy/pr_info_spf.js.map +1 -0
- package/dist/src/lib/spiffy/repo_config_spf.d.ts +88 -0
- package/dist/src/lib/spiffy/repo_config_spf.js +148 -0
- package/dist/src/lib/spiffy/repo_config_spf.js.map +1 -0
- package/dist/src/lib/spiffy/spiffy.d.ts +32 -0
- package/dist/src/lib/spiffy/spiffy.js +92 -0
- package/dist/src/lib/spiffy/spiffy.js.map +1 -0
- package/dist/src/lib/spiffy/survey_responses_spf.d.ts +82 -0
- package/dist/src/lib/spiffy/survey_responses_spf.js +63 -0
- package/dist/src/lib/spiffy/survey_responses_spf.js.map +1 -0
- package/dist/src/lib/spiffy/upgrade_message_spf.d.ts +35 -0
- package/dist/src/lib/spiffy/upgrade_message_spf.js +53 -0
- package/dist/src/lib/spiffy/upgrade_message_spf.js.map +1 -0
- package/dist/src/lib/spiffy/user_config_spf.d.ts +125 -0
- package/dist/src/lib/spiffy/user_config_spf.js +144 -0
- package/dist/src/lib/spiffy/user_config_spf.js.map +1 -0
- package/dist/src/lib/utils/assert_unreachable.d.ts +1 -0
- package/dist/src/lib/utils/assert_unreachable.js +7 -0
- package/dist/src/lib/utils/assert_unreachable.js.map +1 -0
- package/dist/src/lib/utils/branch_name.d.ts +7 -0
- package/dist/src/lib/utils/branch_name.js +50 -0
- package/dist/src/lib/utils/branch_name.js.map +1 -0
- package/dist/src/lib/utils/cute_string.d.ts +1 -0
- package/dist/src/lib/utils/cute_string.js +6 -0
- package/dist/src/lib/utils/cute_string.js.map +1 -0
- package/dist/src/lib/utils/git_repo.d.ts +32 -0
- package/dist/src/lib/utils/git_repo.js +139 -0
- package/dist/src/lib/utils/git_repo.js.map +1 -0
- package/dist/src/lib/utils/make_id.d.ts +1 -0
- package/dist/src/lib/utils/make_id.js +14 -0
- package/dist/src/lib/utils/make_id.js.map +1 -0
- package/dist/src/lib/utils/perform_in_tmp_dir.d.ts +1 -0
- package/dist/src/lib/utils/perform_in_tmp_dir.js +17 -0
- package/dist/src/lib/utils/perform_in_tmp_dir.js.map +1 -0
- package/dist/src/lib/utils/pr_templates.d.ts +26 -0
- package/dist/src/lib/utils/pr_templates.js +87 -0
- package/dist/src/lib/utils/pr_templates.js.map +1 -0
- package/dist/src/lib/utils/prompts_helpers.d.ts +8 -0
- package/dist/src/lib/utils/prompts_helpers.js +28 -0
- package/dist/src/lib/utils/prompts_helpers.js.map +1 -0
- package/dist/src/lib/utils/spawn.d.ts +1 -0
- package/dist/src/lib/utils/spawn.js +16 -0
- package/dist/src/lib/utils/spawn.js.map +1 -0
- package/dist/src/lib/utils/splog.d.ts +16 -0
- package/dist/src/lib/utils/splog.js +58 -0
- package/dist/src/lib/utils/splog.js.map +1 -0
- package/dist/src/lib/utils/tracer.d.ts +54 -0
- package/dist/src/lib/utils/tracer.js +123 -0
- package/dist/src/lib/utils/tracer.js.map +1 -0
- package/dist/src/lib/utils/ts_helpers.d.ts +1 -0
- package/dist/src/lib/utils/ts_helpers.js +3 -0
- package/dist/src/lib/utils/ts_helpers.js.map +1 -0
- package/package.json +92 -11
- package/index.js +0 -2
package/README.md
CHANGED
|
@@ -2,4 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
GitHub-only stacked changes CLI compatible with Graphite-style `gt` commands.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g gt-gh
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Then run:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
gt --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
If you already have another `gt` binary installed, use the package-specific binary:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
gt-gh --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
gt init --trunk main
|
|
27
|
+
gt create my-change -a -m "My change"
|
|
28
|
+
gt submit
|
|
29
|
+
gt submit --stack
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Notes
|
|
33
|
+
|
|
34
|
+
- PR operations use the GitHub CLI (`gh`), not Graphite APIs.
|
|
35
|
+
- Authenticate GitHub first with `gh auth login` or `gt auth`.
|
|
36
|
+
- Graphite-platform-only features such as AI metadata and merge-when-ready are not supported.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gt-gh",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "GitHub-only stacked changes CLI compatible with Graphite-style gt commands.",
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"main": "dist/src/index.js",
|
|
7
|
+
"types": "dist/src/index.d.ts",
|
|
8
|
+
"homepage": "https://github.com/tianrendong/gt",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+ssh://git@github.com/tianrendong/gt.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"git",
|
|
15
|
+
"github",
|
|
16
|
+
"graphite",
|
|
17
|
+
"gt",
|
|
18
|
+
"stacked-prs",
|
|
19
|
+
"stacked-diffs",
|
|
20
|
+
"stacked-changes"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"chalk": "^4.1.2",
|
|
24
|
+
"fast-json-stable-hash": "^1.0.3",
|
|
25
|
+
"fs-extra": "^10.1.0",
|
|
26
|
+
"prompts": "^2.4.2",
|
|
27
|
+
"semver": "^7.3.7",
|
|
28
|
+
"strip-ansi": "^6.0.1",
|
|
29
|
+
"tmp": "^0.2.1",
|
|
30
|
+
"yargs": "^17.5.1"
|
|
31
|
+
},
|
|
32
|
+
"pkg": {
|
|
33
|
+
"scripts": "dist/src/**/*.js",
|
|
34
|
+
"assets": [
|
|
35
|
+
"dist/src/commands/**/*",
|
|
36
|
+
"dist/src/lib/gt.fish"
|
|
37
|
+
],
|
|
38
|
+
"targets": [
|
|
39
|
+
"node18-macos",
|
|
40
|
+
"node18-linux"
|
|
41
|
+
],
|
|
42
|
+
"outputPath": "pkg"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"prepack": "corepack yarn build",
|
|
49
|
+
"prepublishOnly": "corepack yarn build",
|
|
50
|
+
"postinstall": "node scripts/node_version.js || node dist/scripts/node_version.js",
|
|
51
|
+
"lint": "eslint src --quiet --ext .ts --cache",
|
|
52
|
+
"check": "tsc --noEmit",
|
|
53
|
+
"build": "rm -rf dist/ && yarn lint && tsc && cp scripts/node_version.js dist/scripts/node_version.js && cp src/lib/gt.fish dist/src/lib/gt.fish",
|
|
54
|
+
"build-pkg": "pkg dist/src/index.js -c package.json --public-packages \"*\"",
|
|
55
|
+
"dev": "./scripts/installation/develop.sh",
|
|
56
|
+
"cli": "node ./dist/src/index.js",
|
|
57
|
+
"test": "tsc && yarn mocha \"dist/test/**/*.test.js\" --parallel --jobs 8",
|
|
58
|
+
"test-ci": "tsc && nyc --reporter=lcovonly yarn mocha \"dist/test/**/*.test.js\" --parallel --jobs 8",
|
|
59
|
+
"test-one": "tsc && yarn mocha",
|
|
60
|
+
"test-grep": "tsc && yarn mocha \"dist/test/**/*.test.js\" -g"
|
|
61
|
+
},
|
|
62
|
+
"nyc": {
|
|
63
|
+
"exclude": ".yarn/**/*"
|
|
64
|
+
},
|
|
65
|
+
"files": [
|
|
66
|
+
"dist/src",
|
|
67
|
+
"dist/scripts",
|
|
68
|
+
"dist/package.json",
|
|
69
|
+
"README.md"
|
|
70
|
+
],
|
|
71
|
+
"bin": {
|
|
72
|
+
"gt": "dist/src/index.js",
|
|
73
|
+
"gt-gh": "dist/src/index.js"
|
|
74
|
+
},
|
|
75
|
+
"engines": {
|
|
76
|
+
"node": ">=18"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@types/chai": "^4.3.1",
|
|
80
|
+
"@types/chai-as-promised": "^7.1.5",
|
|
81
|
+
"@types/fs-extra": "^9.0.13",
|
|
82
|
+
"@types/mocha": "^9.1.1",
|
|
83
|
+
"@types/node": "^17.0.40",
|
|
84
|
+
"@types/prettier": "^2",
|
|
85
|
+
"@types/prompts": "^2.4.3",
|
|
86
|
+
"@types/semver": "^7",
|
|
87
|
+
"@types/tmp": "^0.2.3",
|
|
88
|
+
"@types/yargs": "^17.0.10",
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
90
|
+
"@typescript-eslint/parser": "^5.27.1",
|
|
91
|
+
"chai": "^4.3.6",
|
|
92
|
+
"chai-as-promised": "^7.1.1",
|
|
93
|
+
"eslint": "^8.17.0",
|
|
94
|
+
"eslint-config-prettier": "^8.5.0",
|
|
95
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
96
|
+
"eslint-plugin-import": "^2.26.0",
|
|
97
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
98
|
+
"mocha": "^10.0.0",
|
|
99
|
+
"nock": "^13.2.6",
|
|
100
|
+
"nyc": "^15.1.0",
|
|
101
|
+
"pinst": "^3.0.0",
|
|
102
|
+
"pkg": "^5.8.1",
|
|
103
|
+
"prettier": "^2.8.3",
|
|
104
|
+
"ts-node": "^10.8.1",
|
|
105
|
+
"typescript": "^4.7.3"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
const requiredVersion = '>=v14';
|
|
3
|
+
const semver = require('semver');
|
|
4
|
+
try {
|
|
5
|
+
if (!semver.satisfies(process.version, requiredVersion)) {
|
|
6
|
+
console.error(
|
|
7
|
+
require('chalk').red(
|
|
8
|
+
`Required Node.js version ${requiredVersion} not satisfied with current version ${process.version}.`
|
|
9
|
+
)
|
|
10
|
+
);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
} catch {
|
|
14
|
+
console.error(`Unable to validate Node.js version. Note that Charcoal requires v14 or higher.`)
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_version.js","sourceRoot":"","sources":["../../scripts/node_version.js"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjC,IAAI;IACH,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE;QACtD,OAAO,CAAC,KAAK,CACX,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAClB,4BAA4B,eAAe,uCAAuC,OAAO,CAAC,OAAO,GAAG,CACrG,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;CACF;AAAC,MAAM;IACN,OAAO,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAA;CACjG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TContext } from '../lib/context';
|
|
2
|
+
declare type TBranchNavigation = {
|
|
3
|
+
direction: 'UP' | 'DOWN';
|
|
4
|
+
numSteps: number;
|
|
5
|
+
} | {
|
|
6
|
+
direction: 'TOP' | 'BOTTOM';
|
|
7
|
+
};
|
|
8
|
+
export declare function switchBranchAction(branchNavigation: TBranchNavigation, context: TContext): Promise<void>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.switchBranchAction = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const errors_1 = require("../lib/errors");
|
|
9
|
+
const prompts_helpers_1 = require("../lib/utils/prompts_helpers");
|
|
10
|
+
const checkout_branch_1 = require("./checkout_branch");
|
|
11
|
+
async function switchBranchAction(branchNavigation, context) {
|
|
12
|
+
const currentBranchName = context.engine.currentBranchPrecondition;
|
|
13
|
+
context.splog.info(chalk_1.default.blueBright(currentBranchName));
|
|
14
|
+
const newBranchName = await traverseBranches(branchNavigation, currentBranchName, context);
|
|
15
|
+
if (newBranchName !== currentBranchName) {
|
|
16
|
+
await (0, checkout_branch_1.checkoutBranch)({ branchName: newBranchName }, context);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
context.splog.info(`Already at the ${branchNavigation.direction === 'DOWN' ||
|
|
20
|
+
branchNavigation.direction === 'BOTTOM'
|
|
21
|
+
? 'bottom most'
|
|
22
|
+
: 'top most'} branch in the stack.`);
|
|
23
|
+
}
|
|
24
|
+
exports.switchBranchAction = switchBranchAction;
|
|
25
|
+
async function traverseBranches(branchNavigation, fromBranchName, context) {
|
|
26
|
+
switch (branchNavigation.direction) {
|
|
27
|
+
case 'BOTTOM': {
|
|
28
|
+
return traverseDownward(fromBranchName, context);
|
|
29
|
+
}
|
|
30
|
+
case 'DOWN': {
|
|
31
|
+
return traverseDownward(fromBranchName, context, branchNavigation.numSteps > 1 ? branchNavigation.numSteps : 1);
|
|
32
|
+
}
|
|
33
|
+
case 'TOP': {
|
|
34
|
+
return await traverseUpward(fromBranchName, context);
|
|
35
|
+
}
|
|
36
|
+
case 'UP': {
|
|
37
|
+
return await traverseUpward(fromBranchName, context, branchNavigation.numSteps > 1 ? branchNavigation.numSteps : 1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function traverseDownward(currentBranchName, context, stepsRemaining = 'bottom') {
|
|
42
|
+
if (stepsRemaining === 0 || context.engine.isTrunk(currentBranchName)) {
|
|
43
|
+
return currentBranchName;
|
|
44
|
+
}
|
|
45
|
+
const parentBranchName = context.engine.getParentPrecondition(currentBranchName);
|
|
46
|
+
if (stepsRemaining === 'bottom' && context.engine.isTrunk(parentBranchName)) {
|
|
47
|
+
return currentBranchName;
|
|
48
|
+
}
|
|
49
|
+
context.splog.info('⮑ ' + parentBranchName);
|
|
50
|
+
return traverseDownward(parentBranchName, context, stepsRemaining === 'bottom' ? 'bottom' : stepsRemaining - 1);
|
|
51
|
+
}
|
|
52
|
+
async function traverseUpward(currentBranchName, context, stepsRemaining = 'top') {
|
|
53
|
+
if (stepsRemaining === 0) {
|
|
54
|
+
return currentBranchName;
|
|
55
|
+
}
|
|
56
|
+
const children = context.engine.getChildren(currentBranchName);
|
|
57
|
+
if (children.length === 0) {
|
|
58
|
+
return currentBranchName;
|
|
59
|
+
}
|
|
60
|
+
const childBranchName = children.length === 1
|
|
61
|
+
? children[0]
|
|
62
|
+
: await handleMultipleChildren(children, context);
|
|
63
|
+
context.splog.info('⮑ ' + childBranchName);
|
|
64
|
+
return await traverseUpward(childBranchName, context, stepsRemaining === 'top' ? 'top' : stepsRemaining - 1);
|
|
65
|
+
}
|
|
66
|
+
async function handleMultipleChildren(children, context) {
|
|
67
|
+
if (!context.interactive) {
|
|
68
|
+
throw new errors_1.ExitFailedError(`Cannot get upstack branch in non-interactive mode; multiple choices available:\n${children.join('\n')}`);
|
|
69
|
+
}
|
|
70
|
+
return (await context.prompts({
|
|
71
|
+
type: 'autocomplete',
|
|
72
|
+
name: 'value',
|
|
73
|
+
message: 'Multiple branches found at the same level. Select a branch to guide the navigation (autocomplete or arrow keys)',
|
|
74
|
+
choices: children.map((b) => {
|
|
75
|
+
return { title: b, value: b };
|
|
76
|
+
}),
|
|
77
|
+
suggest: prompts_helpers_1.suggest,
|
|
78
|
+
})).value;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=branch_traversal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch_traversal.js","sourceRoot":"","sources":["../../../src/actions/branch_traversal.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,0CAAgD;AAChD,kEAAuD;AACvD,uDAAmD;AAQ5C,KAAK,UAAU,kBAAkB,CACtC,gBAAmC,EACnC,OAAiB;IAEjB,MAAM,iBAAiB,GAAG,OAAO,CAAC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MAAM,cAAc,CACzB,eAAe,EACf,OAAO,EACP,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,GAAG,CAAC,CACtD,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,QAAkB,EAAE,OAAiB;IACzE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;QACxB,MAAM,IAAI,wBAAe,CACvB,mFAAmF,QAAQ,CAAC,IAAI,CAC9F,IAAI,CACL,EAAE,CACJ,CAAC;KACH;IACD,OAAO,CACL,MAAM,OAAO,CAAC,OAAO,CAAC;QACpB,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,OAAO;QACb,OAAO,EACL,iHAAiH;QACnH,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC1B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAChC,CAAC,CAAC;QACF,OAAO,EAAP,yBAAO;KACR,CAAC,CACH,CAAC,KAAK,CAAC;AACV,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.checkoutBranch = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const scope_spec_1 = require("../lib/engine/scope_spec");
|
|
9
|
+
const log_1 = require("./log");
|
|
10
|
+
async function checkoutBranch({ branchName, showUntracked, }, context) {
|
|
11
|
+
if (!branchName) {
|
|
12
|
+
branchName = await (0, log_1.interactiveBranchSelection)({
|
|
13
|
+
message: 'Checkout a branch (autocomplete or arrow keys)',
|
|
14
|
+
showUntracked,
|
|
15
|
+
}, context);
|
|
16
|
+
}
|
|
17
|
+
if (branchName === context.engine.currentBranch) {
|
|
18
|
+
context.splog.info(`Already on ${chalk_1.default.cyan(branchName)}.`);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
context.engine.checkoutBranch(branchName);
|
|
22
|
+
context.splog.info(`Checked out ${chalk_1.default.cyan(branchName)}.`);
|
|
23
|
+
printBranchInfo(branchName, context);
|
|
24
|
+
}
|
|
25
|
+
exports.checkoutBranch = checkoutBranch;
|
|
26
|
+
function printBranchInfo(branchName, context) {
|
|
27
|
+
if (!context.engine.isTrunk(branchName) &&
|
|
28
|
+
!context.engine.isBranchTracked(branchName)) {
|
|
29
|
+
context.splog.info(`This branch is not tracked by Charcoal.`);
|
|
30
|
+
}
|
|
31
|
+
else if (!context.engine.isBranchFixed(branchName)) {
|
|
32
|
+
context.splog.info(`This branch has fallen behind ${chalk_1.default.blueBright(context.engine.getParentPrecondition(branchName))} - you may want to ${chalk_1.default.cyan(`gt upstack restack`)}.`);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const nearestAncestorNeedingRestack = context.engine
|
|
36
|
+
.getRelativeStack(branchName, scope_spec_1.SCOPE.DOWNSTACK)
|
|
37
|
+
.reverse()
|
|
38
|
+
.find((ancestor) => !context.engine.isBranchFixed(ancestor));
|
|
39
|
+
if (nearestAncestorNeedingRestack) {
|
|
40
|
+
context.splog.info(`The downstack branch ${chalk_1.default.cyan(nearestAncestorNeedingRestack)} has fallen behind ${chalk_1.default.blueBright(context.engine.getParentPrecondition(nearestAncestorNeedingRestack))} - you may want to ${chalk_1.default.cyan(`gt stack restack`)}.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=checkout_branch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout_branch.js","sourceRoot":"","sources":["../../../src/actions/checkout_branch.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,yDAAiD;AACjD,+BAAmD;AAE5C,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AAK,CAAC,SAAS,CAAC;aAC7C,OAAO,EAAE;aACT,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE/D,IAAI,6BAA6B,EAAE;YACjC,OAAO,CAAC,KAAK,CAAC,IAAI,CAChB,wBAAwB,eAAK,CAAC,IAAI,CAChC,6BAA6B,CAC9B,sBAAsB,eAAK,CAAC,UAAU,CACrC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,6BAA6B,CAAC,CACpE,sBAAsB,eAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CACzD,CAAC;SACH;KACF;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commitAmendAction = void 0;
|
|
4
|
+
const scope_spec_1 = require("../lib/engine/scope_spec");
|
|
5
|
+
const errors_1 = require("../lib/errors");
|
|
6
|
+
const restack_1 = require("./restack");
|
|
7
|
+
function commitAmendAction(opts, context) {
|
|
8
|
+
if (context.engine.isBranchEmpty(context.engine.currentBranchPrecondition)) {
|
|
9
|
+
throw new errors_1.PreconditionsFailedError('No commits in this branch to amend');
|
|
10
|
+
}
|
|
11
|
+
if (context.engine.rebaseInProgress()) {
|
|
12
|
+
throw new errors_1.BlockedDuringRebaseError();
|
|
13
|
+
}
|
|
14
|
+
if (opts.addAll) {
|
|
15
|
+
context.engine.addAll();
|
|
16
|
+
}
|
|
17
|
+
context.engine.commit({
|
|
18
|
+
amend: true,
|
|
19
|
+
noEdit: opts.noEdit,
|
|
20
|
+
message: opts.message,
|
|
21
|
+
patch: !opts.addAll && opts.patch,
|
|
22
|
+
});
|
|
23
|
+
if (!opts.noEdit) {
|
|
24
|
+
context.splog.tip('In the future, you can skip editing the commit message with the `--no-edit` flag.');
|
|
25
|
+
}
|
|
26
|
+
(0, restack_1.restackBranches)(context.engine.getRelativeStack(context.engine.currentBranchPrecondition, scope_spec_1.SCOPE.UPSTACK_EXCLUSIVE), context);
|
|
27
|
+
}
|
|
28
|
+
exports.commitAmendAction = commitAmendAction;
|
|
29
|
+
//# sourceMappingURL=commit_amend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit_amend.js","sourceRoot":"","sources":["../../../src/actions/commit_amend.ts"],"names":[],"mappings":";;;AACA,yDAAiD;AACjD,0CAGuB;AACvB,uCAA4C;AAE5C,SAAgB,iBAAiB,CAC/B,IAKC,EACD,OAAiB;IAEjB,IAAI,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE;QAC1E,MAAM,IAAI,iCAAwB,CAAC,oCAAoC,CAAC,CAAC;KAC1E;IACD,IAAI,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE;QACrC,MAAM,IAAI,iCAAwB,EAAE,CAAC;KACtC;IAED,IAAI,IAAI,CAAC,MAAM,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;KACzB;IAED,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK;KAClC,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QAChB,OAAO,CAAC,KAAK,CAAC,GAAG,CACf,mFAAmF,CACpF,CAAC;KACH;IAED,IAAA,yBAAe,EACb,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAC7B,OAAO,CAAC,MAAM,CAAC,yBAAyB,EACxC,kBAAK,CAAC,iBAAiB,CACxB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAxCD,8CAwCC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commitCreateAction = void 0;
|
|
4
|
+
const scope_spec_1 = require("../lib/engine/scope_spec");
|
|
5
|
+
const preconditions_1 = require("../lib/preconditions");
|
|
6
|
+
const errors_1 = require("../lib/errors");
|
|
7
|
+
const restack_1 = require("./restack");
|
|
8
|
+
function commitCreateAction(opts, context) {
|
|
9
|
+
if (context.engine.rebaseInProgress()) {
|
|
10
|
+
throw new errors_1.BlockedDuringRebaseError();
|
|
11
|
+
}
|
|
12
|
+
if (opts.addAll) {
|
|
13
|
+
context.engine.addAll();
|
|
14
|
+
}
|
|
15
|
+
(0, preconditions_1.ensureSomeStagedChangesPrecondition)(context);
|
|
16
|
+
context.engine.commit({
|
|
17
|
+
message: opts.message,
|
|
18
|
+
patch: !opts.addAll && opts.patch,
|
|
19
|
+
});
|
|
20
|
+
(0, restack_1.restackBranches)(context.engine.getRelativeStack(context.engine.currentBranchPrecondition, scope_spec_1.SCOPE.UPSTACK_EXCLUSIVE), context);
|
|
21
|
+
}
|
|
22
|
+
exports.commitCreateAction = commitCreateAction;
|
|
23
|
+
//# sourceMappingURL=commit_create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit_create.js","sourceRoot":"","sources":["../../../src/actions/commit_create.ts"],"names":[],"mappings":";;;AACA,yDAAiD;AACjD,wDAA2E;AAC3E,0CAAyD;AACzD,uCAA4C;AAE5C,SAAgB,kBAAkB,CAChC,IAIC,EACD,OAAiB;IAEjB,IAAI,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE;QACrC,MAAM,IAAI,iCAAwB,EAAE,CAAC;KACtC;IAED,IAAI,IAAI,CAAC,MAAM,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;KACzB;IAED,IAAA,mDAAmC,EAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK;KAClC,CAAC,CAAC;IAEH,IAAA,yBAAe,EACb,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAC7B,OAAO,CAAC,MAAM,CAAC,yBAAyB,EACxC,kBAAK,CAAC,iBAAiB,CACxB,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AA7BD,gDA6BC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.continueAction = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const errors_1 = require("../lib/errors");
|
|
9
|
+
const persist_continuation_1 = require("./persist_continuation");
|
|
10
|
+
const print_conflict_status_1 = require("./print_conflict_status");
|
|
11
|
+
const restack_1 = require("./restack");
|
|
12
|
+
const get_1 = require("./sync/get");
|
|
13
|
+
async function continueAction(opts, context) {
|
|
14
|
+
if (!context.engine.rebaseInProgress()) {
|
|
15
|
+
(0, persist_continuation_1.clearContinuation)(context);
|
|
16
|
+
throw new errors_1.NoGraphiteContinue();
|
|
17
|
+
}
|
|
18
|
+
if (opts.addAll) {
|
|
19
|
+
context.engine.addAll();
|
|
20
|
+
}
|
|
21
|
+
const rebasedBranchBase = context.continueConfig.data.rebasedBranchBase;
|
|
22
|
+
const branchesToSync = context.continueConfig.data?.branchesToSync;
|
|
23
|
+
const branchesToRestack = context.continueConfig.data?.branchesToRestack;
|
|
24
|
+
if (!rebasedBranchBase) {
|
|
25
|
+
(0, persist_continuation_1.clearContinuation)(context);
|
|
26
|
+
throw new errors_1.NoGraphiteContinue('git rebase --continue');
|
|
27
|
+
}
|
|
28
|
+
const cont = context.engine.continueRebase(rebasedBranchBase);
|
|
29
|
+
if (cont.result === 'REBASE_CONFLICT') {
|
|
30
|
+
(0, persist_continuation_1.persistContinuation)({ branchesToRestack: branchesToRestack, rebasedBranchBase }, context);
|
|
31
|
+
(0, print_conflict_status_1.printConflictStatus)(`Rebase conflict is not yet resolved.`, context);
|
|
32
|
+
throw new errors_1.RebaseConflictError();
|
|
33
|
+
}
|
|
34
|
+
context.splog.info(`Resolved rebase conflict for ${chalk_1.default.green(cont.branchName)}.`);
|
|
35
|
+
if (branchesToSync) {
|
|
36
|
+
await (0, get_1.getBranchesFromRemote)({
|
|
37
|
+
downstack: branchesToSync,
|
|
38
|
+
base: context.engine.currentBranchPrecondition,
|
|
39
|
+
force: false,
|
|
40
|
+
}, context);
|
|
41
|
+
}
|
|
42
|
+
if (branchesToRestack) {
|
|
43
|
+
(0, restack_1.restackBranches)(branchesToRestack, context);
|
|
44
|
+
}
|
|
45
|
+
(0, persist_continuation_1.clearContinuation)(context);
|
|
46
|
+
}
|
|
47
|
+
exports.continueAction = continueAction;
|
|
48
|
+
//# sourceMappingURL=continue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continue.js","sourceRoot":"","sources":["../../../src/actions/continue.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,0CAAwE;AACxE,iEAAgF;AAChF,mEAA8D;AAC9D,uCAA4C;AAC5C,oCAAmD;AAE5C,KAAK,UAAU,cAAc,CAClC,IAAyB,EACzB,OAAiB;IAEjB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE;QACtC,IAAA,wCAAiB,EAAC,OAAO,CAAC,CAAC;QAC3B,MAAM,IAAI,2BAAkB,EAAE,CAAC;KAChC;IAED,IAAI,IAAI,CAAC,MAAM,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;KACzB;IACD,MAAM,iB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: true });
|
|
3
|
+
exports.createBranchAction = void 0;
|
|
4
|
+
const scope_spec_1 = require("../lib/engine/scope_spec");
|
|
5
|
+
const errors_1 = require("../lib/errors");
|
|
6
|
+
const branch_name_1 = require("../lib/utils/branch_name");
|
|
7
|
+
const restack_1 = require("./restack");
|
|
8
|
+
async function createBranchAction(opts, context) {
|
|
9
|
+
const branchName = (0, branch_name_1.newBranchName)(opts.branchName, opts.message, context);
|
|
10
|
+
if (!branchName) {
|
|
11
|
+
throw new errors_1.ExitFailedError(`Must specify either a branch name or commit message.`);
|
|
12
|
+
}
|
|
13
|
+
context.engine.checkoutNewBranch(branchName);
|
|
14
|
+
if (opts.all) {
|
|
15
|
+
context.engine.addAll();
|
|
16
|
+
}
|
|
17
|
+
if (context.engine.detectStagedChanges()) {
|
|
18
|
+
try {
|
|
19
|
+
context.engine.commit({
|
|
20
|
+
message: opts.message,
|
|
21
|
+
patch: !opts.all && opts.patch,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
try {
|
|
26
|
+
context.engine.deleteBranch(branchName);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// pass
|
|
30
|
+
}
|
|
31
|
+
throw e;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
context.splog.info(`No staged changes; created a branch with no commit.`);
|
|
36
|
+
}
|
|
37
|
+
// The reason we get the list of siblings here instead of having all
|
|
38
|
+
// the `--insert` logic in a separate function is so that we only
|
|
39
|
+
// show the tip if the user creates a branch with siblings.
|
|
40
|
+
const siblings = context.engine
|
|
41
|
+
.getChildren(context.engine.getParentPrecondition(branchName))
|
|
42
|
+
.filter((childBranchName) => childBranchName !== branchName);
|
|
43
|
+
if (siblings.length === 0) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!opts.insert) {
|
|
47
|
+
context.splog.tip([
|
|
48
|
+
'To insert a created branch into the middle of your stack, use the `--insert` flag.',
|
|
49
|
+
"If you meant to insert this branch, you can rearrange your stack's dependencies with `gt upstack onto`",
|
|
50
|
+
].join('\n'));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// Now we actually handle the `insert` case.
|
|
54
|
+
// Change the parent of each sibling to the new branch.
|
|
55
|
+
siblings.forEach((siblingBranchName) => context.engine.setParent(siblingBranchName, branchName));
|
|
56
|
+
// If we're restacking siblings onto this branch, we need to restack
|
|
57
|
+
// all of their recursive children as well. Get all the upstacks!
|
|
58
|
+
(0, restack_1.restackBranches)(siblings.flatMap((siblingBranchName) => context.engine.getRelativeStack(siblingBranchName, scope_spec_1.SCOPE.UPSTACK)), context);
|
|
59
|
+
}
|
|
60
|
+
exports.createBranchAction = createBranchAction;
|
|
61
|
+
//# sourceMappingURL=create_branch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create_branch.js","sourceRoot":"","sources":["../../../src/actions/create_branch.ts"],"names":[],"mappings":";;;AACA,yDAAiD;AACjD,0CAAgD;AAChD,0DAAyD;AACzD,uCAA4C;AAErC,KAAK,UAAU,kBAAkB,CACtC,IAMC,EACD,OAAiB;IAEjB,MAAM,UAAU,GAAG,IAAA,2BAAa,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACzE,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,wBAAe,CACvB,sDAAsD,CACvD,CAAC;KACH;IAED,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAE7C,IAAI,IAAI,CAAC,GAAG,EAAE;QACZ,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;KACzB;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE;QACxC,IAAI;YACF,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;gBACpB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,KAAK,EAAE,CAAC,I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|
+
import { TContext } from '../lib/context';
|
|
2
|
+
export declare const footerTitle = "\n\n\n#### PR Dependency Tree\n\n";
|
|
3
|
+
export declare const footerFooter = "\n\nThis tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)";
|
|
4
|
+
export declare function createPrBodyFooter(context: TContext, branch: string): string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPrBodyFooter = exports.footerFooter = exports.footerTitle = void 0;
|
|
4
|
+
exports.footerTitle = '\n\n\n#### PR Dependency Tree\n\n';
|
|
5
|
+
exports.footerFooter = '\n\nThis tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)';
|
|
6
|
+
function createPrBodyFooter(context, branch) {
|
|
7
|
+
const terminalParent = findTerminalParent(context, branch);
|
|
8
|
+
const tree = buildBranchTree({
|
|
9
|
+
context,
|
|
10
|
+
currentBranches: [terminalParent],
|
|
11
|
+
prBranch: branch,
|
|
12
|
+
currentDepth: 0,
|
|
13
|
+
});
|
|
14
|
+
return `${exports.footerTitle}${tree}${exports.footerFooter}`;
|
|
15
|
+
}
|
|
16
|
+
exports.createPrBodyFooter = createPrBodyFooter;
|
|
17
|
+
function buildBranchTree({ context, currentBranches, prBranch, currentDepth, }) {
|
|
18
|
+
let tree = '';
|
|
19
|
+
for (const branch of currentBranches) {
|
|
20
|
+
if (branch !== prBranch &&
|
|
21
|
+
!(
|
|
22
|
+
// If we aren't on the last branch,
|
|
23
|
+
// then we should print it if the pr branch is either a parent or child
|
|
24
|
+
// of the current branch being looked at in our recursive algorithm
|
|
25
|
+
(isParentOfBranch(context, branch, prBranch) ||
|
|
26
|
+
isParentOfBranch(context, prBranch, branch)))) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const leaf = buildLeaf({
|
|
30
|
+
context,
|
|
31
|
+
branch,
|
|
32
|
+
depth: currentDepth,
|
|
33
|
+
prBranch,
|
|
34
|
+
});
|
|
35
|
+
tree += leaf || '';
|
|
36
|
+
const children = context.engine.getChildren(branch);
|
|
37
|
+
if (children.length) {
|
|
38
|
+
tree += `${buildBranchTree({
|
|
39
|
+
context,
|
|
40
|
+
currentBranches: children,
|
|
41
|
+
prBranch,
|
|
42
|
+
currentDepth: currentDepth + 1,
|
|
43
|
+
})}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return tree;
|
|
47
|
+
}
|
|
48
|
+
function buildLeaf({ context, branch, depth, prBranch, }) {
|
|
49
|
+
const prInfo = context.engine.getPrInfo(branch);
|
|
50
|
+
const number = prInfo?.number;
|
|
51
|
+
if (!number) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
return `\n${' '.repeat(depth)}* **PR #${number}**${branch === prBranch ? ' 👈' : ''}`;
|
|
55
|
+
}
|
|
56
|
+
function findTerminalParent(context, currentBranch) {
|
|
57
|
+
const parent = context.engine.getParent(currentBranch);
|
|
58
|
+
if (!parent) {
|
|
59
|
+
throw new Error('Parent branch is undefined');
|
|
60
|
+
}
|
|
61
|
+
if (context.engine.isTrunk(parent)) {
|
|
62
|
+
return currentBranch;
|
|
63
|
+
}
|
|
64
|
+
return findTerminalParent(context, parent);
|
|
65
|
+
}
|
|
66
|
+
function isParentOfBranch(context, parent, branch) {
|
|
67
|
+
const children = context.engine.getChildren(parent);
|
|
68
|
+
if (children.includes(branch)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
for (const child of children) {
|
|
72
|
+
if (isParentOfBranch(context, child, branch)) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=create_pr_body_footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create_pr_body_footer.js","sourceRoot":"","sources":["../../../src/actions/create_pr_body_footer.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,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