mirror of
https://github.com/abhinav/git-spice.git
synced 2026-08-31 07:47:47 +02:00
Rename binary to git-spice (#1032)
The 'gs' binary conflicting with ghostscript's 'gs' binary has been a recurring complaint, and is now affecting user-built extensions, e.g. - https://github.com/Smexey/git-spice-code-extension/issues/1 - https://github.com/jesseduffield/lazygit/pull/5219 There was previously discussion about this and I agreed to rename it: https://github.com/abhinav/git-spice/issues/469#issuecomment-3621214978 This finally performs the rename. However, to remain backwards compatible in this release: - the official archives, Homebrew Cask, and AUR package provide two binaries: 'git-spice' and 'gs' - if invoked as 'gs', the program prints a warning, but otherwise works as normal - the documentation website continues to use 'gs' for brevity, but includes a note about the alias Things to do after this is released: - update the homebrew-core formula to build as 'git-spice', and add a symlink from 'gs' to 'git-spice' - afterwards, we can update the import path to go.abhg.dev/git-spice. Refs #469 (Issue won't be resolved until the release after, when we delete the 'gs' binary.)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
kind: Changed
|
||||
body: >-
|
||||
Rename gs binary to git-spice in pre-built packaged artifacts.
|
||||
To ease the transition, both versions of the binary are included,
|
||||
and the command prints a deprecation warning when invoked as "gs".
|
||||
time: 2026-02-22T10:20:14.418243-08:00
|
||||
+14
-5
@@ -5,10 +5,10 @@ builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
main: .
|
||||
binary: gs
|
||||
binary: git-spice
|
||||
goos: [darwin, linux, windows]
|
||||
goarch: [amd64, arm64, arm]
|
||||
goarm: [5, 6, 7]
|
||||
goarm: ["5", "6", "7"]
|
||||
ldflags: '-s -w -X main._version={{.Version}}'
|
||||
ignore:
|
||||
- goos: darwin
|
||||
@@ -17,6 +17,9 @@ builds:
|
||||
goarch: arm
|
||||
flags:
|
||||
- -trimpath
|
||||
hooks:
|
||||
post:
|
||||
- cp "{{ .Path }}" "{{ dir .Path }}/gs{{ .Ext }}"
|
||||
|
||||
archives:
|
||||
- formats: tar.gz
|
||||
@@ -43,11 +46,15 @@ aurs:
|
||||
git_url: "ssh://aur@aur.archlinux.org/git-spice-bin.git"
|
||||
skip_upload: auto
|
||||
private_key: '{{ .Env.AUR_KEY }}'
|
||||
provides:
|
||||
- git-spice
|
||||
- gs
|
||||
conflicts:
|
||||
- git-spice # no non-bin package exists yet, but just in case
|
||||
- ghostscript # ghostscript also provides a 'gs' binary
|
||||
package: |-
|
||||
install -Dm755 "./gs" "${pkgdir}/usr/bin/gs"
|
||||
install -Dm755 "./git-spice" "${pkgdir}/usr/bin/git-spice"
|
||||
ln -s "git-spice" "${pkgdir}/usr/bin/gs"
|
||||
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/git-spice/LICENSE"
|
||||
install -Dm644 "./README.md" "${pkgdir}/usr/share/doc/git-spice/README.md"
|
||||
install -Dm644 "./CHANGELOG.md" "${pkgdir}/usr/share/doc/git-spice/CHANGELOG.md"
|
||||
@@ -68,12 +75,14 @@ homebrew_casks:
|
||||
description: "A tool for stacking Git branches."
|
||||
license: "GPL-3.0-or-later"
|
||||
skip_upload: auto
|
||||
binary: gs
|
||||
binaries: ["git-spice"]
|
||||
hooks:
|
||||
post:
|
||||
install: |
|
||||
bin.install_symlink "git-spice" => "gs"
|
||||
|
||||
if OS.mac?
|
||||
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/gs"]
|
||||
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/git-spice"]
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ in documentation
|
||||
The syntax is:
|
||||
|
||||
- $$gs *$$ will produce a link to the CLI reference page.
|
||||
- $$git-spice *$$ will produce a link to the CLI reference page.
|
||||
- $$spice.*$$ will produce a link to the configuration reference page.
|
||||
|
||||
By default, $$foo$$ will use {foo} as the link text.
|
||||
@@ -43,6 +44,11 @@ def on_page_markdown(
|
||||
icon = ":material-console:"
|
||||
id = title.replace(" ", "-")
|
||||
page = _CLI_PAGE
|
||||
elif title.startswith("git-spice "):
|
||||
icon = ":material-console:"
|
||||
suffix = title.removeprefix("git-spice ")
|
||||
id = "gs-" + suffix.replace(" ", "-")
|
||||
page = _CLI_PAGE
|
||||
elif title.startswith("spice."):
|
||||
icon = ":material-wrench:"
|
||||
id = title.replace(".", "").lower()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
```
|
||||
gs <command> [flags]
|
||||
git-spice <command> [flags]
|
||||
```
|
||||
|
||||
gs (git-spice) is a command line tool for stacking Git branches.
|
||||
git-spice is a command line tool for stacking Git branches.
|
||||
|
||||
**Global flags**
|
||||
|
||||
@@ -16,7 +16,7 @@ gs (git-spice) is a command line tool for stacking Git branches.
|
||||
|
||||
## Shell
|
||||
|
||||
### gs shell completion
|
||||
### git-spice shell completion {#gs-shell-completion}
|
||||
|
||||
```
|
||||
gs shell completion [<shell>]
|
||||
@@ -46,7 +46,7 @@ using a heuristic.
|
||||
|
||||
## Authentication
|
||||
|
||||
### gs auth login
|
||||
### git-spice auth login {#gs-auth-login}
|
||||
|
||||
```
|
||||
gs auth login [flags]
|
||||
@@ -76,7 +76,7 @@ or change the authentication method.
|
||||
|
||||
* `--refresh`: Force a refresh of the authentication token
|
||||
|
||||
### gs auth status
|
||||
### git-spice auth status {#gs-auth-status}
|
||||
|
||||
```
|
||||
gs auth status [flags]
|
||||
@@ -86,7 +86,7 @@ Show current login status
|
||||
|
||||
Exits with a non-zero code if not logged in.
|
||||
|
||||
### gs auth logout
|
||||
### git-spice auth logout {#gs-auth-logout}
|
||||
|
||||
```
|
||||
gs auth logout [flags]
|
||||
@@ -101,7 +101,7 @@ Does not do anything if not logged in.
|
||||
|
||||
## Repository
|
||||
|
||||
### gs repo init
|
||||
### git-spice repo init {#gs-repo-init}
|
||||
|
||||
```
|
||||
gs repo (r) init (i) [flags]
|
||||
@@ -134,7 +134,7 @@ and untrack all branches.
|
||||
* `--remote=NAME`: Name of the remote to push changes to
|
||||
* `--reset`: Forget all information about the repository
|
||||
|
||||
### gs repo sync
|
||||
### git-spice repo sync {#gs-repo-sync}
|
||||
|
||||
```
|
||||
gs repo (r) sync (s) [flags]
|
||||
@@ -155,7 +155,7 @@ was not initialized with a remote.
|
||||
|
||||
**Configuration**: [spice.repoSync.closedChanges](/cli/config.md#spicereposyncclosedchanges)
|
||||
|
||||
### gs repo restack
|
||||
### git-spice repo restack {#gs-repo-restack}
|
||||
|
||||
```
|
||||
gs repo (r) restack (r)
|
||||
@@ -170,7 +170,7 @@ respective bases in dependency order, ensuring a linear history.
|
||||
|
||||
## Log
|
||||
|
||||
### gs log short
|
||||
### git-spice log short {#gs-log-short}
|
||||
|
||||
```
|
||||
gs log (l) short (s) [flags]
|
||||
@@ -193,7 +193,7 @@ See https://abhinav.github.io/git-spice/cli/json/ for details.
|
||||
|
||||
**Configuration**: [spice.log.all](/cli/config.md#spicelogall), [spice.log.crFormat](/cli/config.md#spicelogcrformat), [spice.log.crStatus](/cli/config.md#spicelogcrstatus), [spice.log.pushStatusFormat](/cli/config.md#spicelogpushstatusformat), [spice.logLong.crFormat](/cli/config.md#spiceloglongcrformat), [spice.logShort.crFormat](/cli/config.md#spicelogshortcrformat)
|
||||
|
||||
### gs log long
|
||||
### git-spice log long {#gs-log-long}
|
||||
|
||||
```
|
||||
gs log (l) long (l) [flags]
|
||||
@@ -218,7 +218,7 @@ See https://abhinav.github.io/git-spice/cli/json/ for details.
|
||||
|
||||
## Stack
|
||||
|
||||
### gs stack submit
|
||||
### git-spice stack submit {#gs-stack-submit}
|
||||
|
||||
```
|
||||
gs stack (s) submit (s) [flags]
|
||||
@@ -271,7 +271,7 @@ only if there are multiple CRs in the stack.
|
||||
|
||||
**Configuration**: [spice.submit.assignees](/cli/config.md#spicesubmitassignees), [spice.submit.draft](/cli/config.md#spicesubmitdraft), [spice.submit.label](/cli/config.md#spicesubmitlabel), [spice.submit.listTemplatesTimeout](/cli/config.md#spicesubmitlisttemplatestimeout), [spice.submit.navigationComment](/cli/config.md#spicesubmitnavigationcomment), [spice.submit.navigationComment.downstack](/cli/config.md#spicesubmitnavigationcommentdownstack), [spice.submit.navigationCommentStyle.marker](/cli/config.md#spicesubmitnavigationcommentstylemarker), [spice.submit.navigationCommentSync](/cli/config.md#spicesubmitnavigationcommentsync), [spice.submit.publish](/cli/config.md#spicesubmitpublish), [spice.submit.reviewers](/cli/config.md#spicesubmitreviewers), [spice.submit.reviewers.addWhen](/cli/config.md#spicesubmitreviewersaddwhen), [spice.submit.skipRestackCheck](/cli/config.md#spicesubmitskiprestackcheck), [spice.submit.template](/cli/config.md#spicesubmittemplate), [spice.submit.updateOnly](/cli/config.md#spicesubmitupdateonly), [spice.submit.web](/cli/config.md#spicesubmitweb)
|
||||
|
||||
### gs stack restack
|
||||
### git-spice stack restack {#gs-stack-restack}
|
||||
|
||||
```
|
||||
gs stack (s) restack (r) [flags]
|
||||
@@ -288,7 +288,7 @@ Use --branch to rebase the stack of a different branch.
|
||||
|
||||
* `--branch=NAME`: Branch to restack the stack of
|
||||
|
||||
### gs stack edit
|
||||
### git-spice stack edit {#gs-stack-edit}
|
||||
|
||||
```
|
||||
gs stack (s) edit (e) [flags]
|
||||
@@ -313,7 +313,7 @@ Branches that are deleted from the list will be ignored.
|
||||
* `--editor=STRING`: Editor to use for editing the downstack. Defaults to Git's default editor.
|
||||
* `--branch=NAME`: Branch whose stack we're editing. Defaults to current branch.
|
||||
|
||||
### gs stack delete
|
||||
### git-spice stack delete {#gs-stack-delete}
|
||||
|
||||
```
|
||||
gs stack (s) delete (d) [flags]
|
||||
@@ -337,7 +337,7 @@ you must use the --force flag to confirm deletion.
|
||||
|
||||
* `--force`: Force deletion of the branches
|
||||
|
||||
### gs upstack submit
|
||||
### git-spice upstack submit {#gs-upstack-submit}
|
||||
|
||||
```
|
||||
gs upstack (us) submit (s) [flags]
|
||||
@@ -394,7 +394,7 @@ only if there are multiple CRs in the stack.
|
||||
|
||||
**Configuration**: [spice.submit.assignees](/cli/config.md#spicesubmitassignees), [spice.submit.draft](/cli/config.md#spicesubmitdraft), [spice.submit.label](/cli/config.md#spicesubmitlabel), [spice.submit.listTemplatesTimeout](/cli/config.md#spicesubmitlisttemplatestimeout), [spice.submit.navigationComment](/cli/config.md#spicesubmitnavigationcomment), [spice.submit.navigationComment.downstack](/cli/config.md#spicesubmitnavigationcommentdownstack), [spice.submit.navigationCommentStyle.marker](/cli/config.md#spicesubmitnavigationcommentstylemarker), [spice.submit.navigationCommentSync](/cli/config.md#spicesubmitnavigationcommentsync), [spice.submit.publish](/cli/config.md#spicesubmitpublish), [spice.submit.reviewers](/cli/config.md#spicesubmitreviewers), [spice.submit.reviewers.addWhen](/cli/config.md#spicesubmitreviewersaddwhen), [spice.submit.skipRestackCheck](/cli/config.md#spicesubmitskiprestackcheck), [spice.submit.template](/cli/config.md#spicesubmittemplate), [spice.submit.updateOnly](/cli/config.md#spicesubmitupdateonly), [spice.submit.web](/cli/config.md#spicesubmitweb)
|
||||
|
||||
### gs upstack restack
|
||||
### git-spice upstack restack {#gs-upstack-restack}
|
||||
|
||||
```
|
||||
gs upstack (us) restack (r) [flags]
|
||||
@@ -416,7 +416,7 @@ but still rebase all branches above it.
|
||||
* `--skip-start`: Do not restack the starting branch
|
||||
* `--branch=NAME`: Branch to restack the upstack of
|
||||
|
||||
### gs upstack onto
|
||||
### git-spice upstack onto {#gs-upstack-onto}
|
||||
|
||||
```
|
||||
gs upstack (us) onto (o) [<onto>] [flags]
|
||||
@@ -452,7 +452,7 @@ Use 'gs branch onto' to leave the branch's upstack alone.
|
||||
|
||||
**Configuration**: [spice.branchPrompt.sort](/cli/config.md#spicebranchpromptsort)
|
||||
|
||||
### gs upstack delete
|
||||
### git-spice upstack delete {#gs-upstack-delete}
|
||||
|
||||
```
|
||||
gs upstack (us) delete (d) [flags]
|
||||
@@ -476,7 +476,7 @@ you must use the --force flag to confirm deletion.
|
||||
|
||||
* `--force`: Force deletion of the branches
|
||||
|
||||
### gs downstack track
|
||||
### git-spice downstack track {#gs-downstack-track}
|
||||
|
||||
```
|
||||
gs downstack (ds) track (tr) [<branch>]
|
||||
@@ -494,7 +494,7 @@ until reaching trunk or an already-tracked branch.
|
||||
|
||||
* `branch`: Name of the branch to start tracking from
|
||||
|
||||
### gs downstack submit
|
||||
### git-spice downstack submit {#gs-downstack-submit}
|
||||
|
||||
```
|
||||
gs downstack (ds) submit (s) [flags]
|
||||
@@ -549,7 +549,7 @@ only if there are multiple CRs in the stack.
|
||||
|
||||
**Configuration**: [spice.submit.assignees](/cli/config.md#spicesubmitassignees), [spice.submit.draft](/cli/config.md#spicesubmitdraft), [spice.submit.label](/cli/config.md#spicesubmitlabel), [spice.submit.listTemplatesTimeout](/cli/config.md#spicesubmitlisttemplatestimeout), [spice.submit.navigationComment](/cli/config.md#spicesubmitnavigationcomment), [spice.submit.navigationComment.downstack](/cli/config.md#spicesubmitnavigationcommentdownstack), [spice.submit.navigationCommentStyle.marker](/cli/config.md#spicesubmitnavigationcommentstylemarker), [spice.submit.navigationCommentSync](/cli/config.md#spicesubmitnavigationcommentsync), [spice.submit.publish](/cli/config.md#spicesubmitpublish), [spice.submit.reviewers](/cli/config.md#spicesubmitreviewers), [spice.submit.reviewers.addWhen](/cli/config.md#spicesubmitreviewersaddwhen), [spice.submit.skipRestackCheck](/cli/config.md#spicesubmitskiprestackcheck), [spice.submit.template](/cli/config.md#spicesubmittemplate), [spice.submit.updateOnly](/cli/config.md#spicesubmitupdateonly), [spice.submit.web](/cli/config.md#spicesubmitweb)
|
||||
|
||||
### gs downstack edit
|
||||
### git-spice downstack edit {#gs-downstack-edit}
|
||||
|
||||
```
|
||||
gs downstack (ds) edit (e) [flags]
|
||||
@@ -575,7 +575,7 @@ Branches that are upstack of the current branch will not be modified.
|
||||
|
||||
## Branch
|
||||
|
||||
### gs branch track
|
||||
### git-spice branch track {#gs-branch-track}
|
||||
|
||||
```
|
||||
gs branch (b) track (tr) [<branch>] [flags]
|
||||
@@ -600,7 +600,7 @@ to track a manully created stack of branches at once.
|
||||
|
||||
* `-b`, `--base=BRANCH`: Base branch this merges into
|
||||
|
||||
### gs branch untrack
|
||||
### git-spice branch untrack {#gs-branch-untrack}
|
||||
|
||||
```
|
||||
gs branch (b) untrack (untr) [<branch>]
|
||||
@@ -620,7 +620,7 @@ a different branch.
|
||||
|
||||
* `branch`: Name of the branch to untrack. Defaults to current.
|
||||
|
||||
### gs branch checkout
|
||||
### git-spice branch checkout {#gs-branch-checkout}
|
||||
|
||||
```
|
||||
gs branch (b) checkout (co) [<branch>] [flags]
|
||||
@@ -648,7 +648,7 @@ without checking it out.
|
||||
|
||||
**Configuration**: [spice.branchCheckout.showUntracked](/cli/config.md#spicebranchcheckoutshowuntracked), [spice.branchCheckout.trackUntracked](/cli/config.md#spicebranchcheckouttrackuntracked), [spice.branchPrompt.sort](/cli/config.md#spicebranchpromptsort), [spice.checkout.verbose](/cli/config.md#spicecheckoutverbose)
|
||||
|
||||
### gs branch create
|
||||
### git-spice branch create {#gs-branch-create}
|
||||
|
||||
```
|
||||
gs branch (b) create (c) [<name>] [flags]
|
||||
@@ -727,7 +727,7 @@ target (A) to the specified branch:
|
||||
|
||||
**Configuration**: [spice.branchCreate.commit](/cli/config.md#spicebranchcreatecommit), [spice.branchCreate.generatedBranchNameLimit](/cli/config.md#spicebranchcreategeneratedbranchnamelimit), [spice.branchCreate.prefix](/cli/config.md#spicebranchcreateprefix), [spice.commit.signoff](/cli/config.md#spicecommitsignoff)
|
||||
|
||||
### gs branch delete
|
||||
### git-spice branch delete {#gs-branch-delete}
|
||||
|
||||
```
|
||||
gs branch (b) delete (d,rm) [<branches> ...] [flags]
|
||||
@@ -757,7 +757,7 @@ Use --force to delete the branch regardless of unmerged changes.
|
||||
|
||||
**Configuration**: [spice.branchPrompt.sort](/cli/config.md#spicebranchpromptsort)
|
||||
|
||||
### gs branch fold
|
||||
### git-spice branch fold {#gs-branch-fold}
|
||||
|
||||
```
|
||||
gs branch (b) fold (fo) [flags]
|
||||
@@ -776,7 +776,7 @@ Use the --branch flag to target a different branch.
|
||||
|
||||
* `--branch=NAME`: Name of the branch
|
||||
|
||||
### gs branch split
|
||||
### git-spice branch split {#gs-branch-split}
|
||||
|
||||
```
|
||||
gs branch (b) split (sp) [flags]
|
||||
@@ -824,7 +824,7 @@ would require a new name to be provided for commit 3.
|
||||
* `--at=COMMIT:NAME,...`: Commits to split the branch at.
|
||||
* `--branch=NAME`: Branch to split commits of.
|
||||
|
||||
### gs branch squash
|
||||
### git-spice branch squash {#gs-branch-squash}
|
||||
|
||||
```
|
||||
gs branch (b) squash (sq) [flags]
|
||||
@@ -847,7 +847,7 @@ Use the -m/--message flag to specify a commit message without editing.
|
||||
* `-m`, `--message=MSG`: Use the given message as the commit message.
|
||||
* `--branch=NAME`: Branch to squash. Defaults to current branch. <span class="mdx-badge"><span class="mdx-badge__icon">:material-tag:{ title="Released in version" }</span><span class="mdx-badge__text">[v0.16.0](/changelog.md#v0.16.0)</span>
|
||||
|
||||
### gs branch edit
|
||||
### git-spice branch edit {#gs-branch-edit}
|
||||
|
||||
```
|
||||
gs branch (b) edit (e)
|
||||
@@ -862,7 +862,7 @@ from this branch.
|
||||
After the rebase,
|
||||
branches upstack from this branch will be restacked.
|
||||
|
||||
### gs branch rename
|
||||
### git-spice branch rename {#gs-branch-rename}
|
||||
|
||||
```
|
||||
gs branch (b) rename (rn,mv) [<old-name> [<new-name>]]
|
||||
@@ -893,7 +893,7 @@ and track the new branch name with 'gs branch track <new>'.
|
||||
* `old-name`: Old name of the branch
|
||||
* `new-name`: New name of the branch
|
||||
|
||||
### gs branch restack
|
||||
### git-spice branch restack {#gs-branch-restack}
|
||||
|
||||
```
|
||||
gs branch (b) restack (r) [flags]
|
||||
@@ -909,7 +909,7 @@ Use --branch to target a different branch.
|
||||
|
||||
* `--branch=NAME`: Branch to restack
|
||||
|
||||
### gs branch onto
|
||||
### git-spice branch onto {#gs-branch-onto}
|
||||
|
||||
```
|
||||
gs branch (b) onto (on) [<onto>] [flags]
|
||||
@@ -951,7 +951,7 @@ Use 'gs upstack onto' to also move the upstack branches.
|
||||
|
||||
**Configuration**: [spice.branchPrompt.sort](/cli/config.md#spicebranchpromptsort)
|
||||
|
||||
### gs branch submit
|
||||
### git-spice branch submit {#gs-branch-submit}
|
||||
|
||||
```
|
||||
gs branch (b) submit (s) [flags]
|
||||
@@ -1008,7 +1008,7 @@ only if there are multiple CRs in the stack.
|
||||
|
||||
## Commit
|
||||
|
||||
### gs commit create
|
||||
### git-spice commit create {#gs-commit-create}
|
||||
|
||||
```
|
||||
gs commit (c) create (c) [flags]
|
||||
@@ -1044,7 +1044,7 @@ when you want to apply changes to an older commit.
|
||||
|
||||
**Configuration**: [spice.commit.signoff](/cli/config.md#spicecommitsignoff)
|
||||
|
||||
### gs commit amend
|
||||
### git-spice commit amend {#gs-commit-amend}
|
||||
|
||||
```
|
||||
gs commit (c) amend (a) [flags]
|
||||
@@ -1083,7 +1083,7 @@ The --no-prompt flag can be used to skip this prompt in scripts.
|
||||
|
||||
**Configuration**: [spice.branchCreate.generatedBranchNameLimit](/cli/config.md#spicebranchcreategeneratedbranchnamelimit), [spice.branchCreate.prefix](/cli/config.md#spicebranchcreateprefix), [spice.commit.signoff](/cli/config.md#spicecommitsignoff)
|
||||
|
||||
### gs commit split
|
||||
### git-spice commit split {#gs-commit-split}
|
||||
|
||||
```
|
||||
gs commit (c) split (sp) [flags]
|
||||
@@ -1100,7 +1100,7 @@ Branches upstack are restacked as needed.
|
||||
* `-m`, `--message=MSG`: Use the given message as the commit message.
|
||||
* `--no-verify`: Bypass pre-commit and commit-msg hooks.
|
||||
|
||||
### gs commit fixup
|
||||
### git-spice commit fixup {#gs-commit-fixup}
|
||||
|
||||
```
|
||||
gs commit (c) fixup (f) [<commit>] [flags]
|
||||
@@ -1127,7 +1127,7 @@ This command requires at least Git 2.45.
|
||||
|
||||
* `commit`: The commit to fixup. Must be reachable from the HEAD commit.
|
||||
|
||||
### gs commit pick
|
||||
### git-spice commit pick {#gs-commit-pick}
|
||||
|
||||
```
|
||||
gs commit (c) pick (p) [<commit>] [flags]
|
||||
@@ -1162,7 +1162,7 @@ This command requires at least Git 2.45.
|
||||
|
||||
## Rebase
|
||||
|
||||
### gs rebase continue
|
||||
### git-spice rebase continue {#gs-rebase-continue}
|
||||
|
||||
```
|
||||
gs rebase (rb) continue (c) [flags]
|
||||
@@ -1190,7 +1190,7 @@ and use --edit to override it.
|
||||
|
||||
**Configuration**: [spice.rebaseContinue.edit](/cli/config.md#spicerebasecontinueedit)
|
||||
|
||||
### gs rebase abort
|
||||
### git-spice rebase abort {#gs-rebase-abort}
|
||||
|
||||
```
|
||||
gs rebase (rb) abort (a)
|
||||
@@ -1210,7 +1210,7 @@ even if a git-spice operation is not currently in progress.
|
||||
|
||||
## Navigation
|
||||
|
||||
### gs up
|
||||
### git-spice up {#gs-up}
|
||||
|
||||
```
|
||||
gs up (u) [<n>] [flags]
|
||||
@@ -1234,7 +1234,7 @@ Use the -n flag to print the branch without checking it out.
|
||||
|
||||
**Configuration**: [spice.checkout.verbose](/cli/config.md#spicecheckoutverbose)
|
||||
|
||||
### gs down
|
||||
### git-spice down {#gs-down}
|
||||
|
||||
```
|
||||
gs down (d) [<n>] [flags]
|
||||
@@ -1258,7 +1258,7 @@ Use the -n flag to print the branch without checking it out.
|
||||
|
||||
**Configuration**: [spice.checkout.verbose](/cli/config.md#spicecheckoutverbose)
|
||||
|
||||
### gs top
|
||||
### git-spice top {#gs-top}
|
||||
|
||||
```
|
||||
gs top (U) [flags]
|
||||
@@ -1278,7 +1278,7 @@ Use the -n flag to print the branch without checking it out.
|
||||
|
||||
**Configuration**: [spice.checkout.verbose](/cli/config.md#spicecheckoutverbose)
|
||||
|
||||
### gs bottom
|
||||
### git-spice bottom {#gs-bottom}
|
||||
|
||||
```
|
||||
gs bottom (D) [flags]
|
||||
@@ -1300,7 +1300,7 @@ without checking it out.
|
||||
|
||||
**Configuration**: [spice.checkout.verbose](/cli/config.md#spicecheckoutverbose)
|
||||
|
||||
### gs trunk
|
||||
### git-spice trunk {#gs-trunk}
|
||||
|
||||
```
|
||||
gs trunk [flags]
|
||||
@@ -1315,7 +1315,7 @@ Move to the trunk branch
|
||||
|
||||
**Configuration**: [spice.checkout.verbose](/cli/config.md#spicecheckoutverbose)
|
||||
|
||||
## gs version
|
||||
## git-spice version {#gs-version}
|
||||
|
||||
```
|
||||
gs version [flags]
|
||||
|
||||
Generated
+5
@@ -1,6 +1,11 @@
|
||||
[[tools.python]]
|
||||
version = "3.14.3"
|
||||
backend = "core:python"
|
||||
"platforms.linux-arm64" = { checksum = "sha256:e9b0aef9baafb6b9e7a4d47b82d6d9778eeafb2c95d23fb5247d3a5f8e52c5a5", url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260211/cpython-3.14.3+20260211-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz"}
|
||||
"platforms.linux-x64" = { checksum = "sha256:759457004082459a402f369225b82565d88ca8257d9fd11c642a1c76ab0cb1cc", url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260211/cpython-3.14.3+20260211-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz"}
|
||||
"platforms.macos-arm64" = { checksum = "sha256:348647e4c13b662f7b0d218ccf472688038679815fb1a429ca664b7dce324237", url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260211/cpython-3.14.3+20260211-aarch64-apple-darwin-install_only_stripped.tar.gz"}
|
||||
"platforms.macos-x64" = { checksum = "sha256:107c71b272b5eeecd7b7b607c4fac0796b0f221bc3391e6155a349789cc7eb17", url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260211/cpython-3.14.3+20260211-x86_64-apple-darwin-install_only_stripped.tar.gz"}
|
||||
"platforms.windows-x64" = { checksum = "sha256:dc5feea0e16807e7c7b2d20af3f2c18c7153f9cbd4b54063172553fda60c5a1f", url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260211/cpython-3.14.3+20260211-x86_64-pc-windows-msvc-install_only_stripped.tar.gz"}
|
||||
|
||||
[[tools.uv]]
|
||||
version = "0.10.0"
|
||||
|
||||
@@ -63,6 +63,11 @@
|
||||
<!-- Further information -->
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="gs-alias-note">
|
||||
Examples on this website use <code>gs</code> for brevity.
|
||||
Use <code>git-spice</code> directly or set <code>alias gs=git-spice</code>.
|
||||
</div>
|
||||
|
||||
{% include "partials/copyright.html" %}
|
||||
|
||||
<!-- Social links -->
|
||||
|
||||
@@ -8,5 +8,7 @@ description: >-
|
||||
|
||||
# CLI
|
||||
|
||||
The git-spice CLI is delivered as the command `gs`.
|
||||
The git-spice CLI is delivered as the command `git-spice`.
|
||||
Most examples in this documentation use `gs`;
|
||||
add `alias gs=git-spice` in your shell config if you prefer that form.
|
||||
Explore the [complete list of available commands here](reference.md).
|
||||
|
||||
@@ -126,7 +126,7 @@ If you want to pass all arguments through to the command,
|
||||
add `"$@"` to the end of the command alias.
|
||||
|
||||
You can use shell command aliases to create custom helpers
|
||||
on top of git-spice commands, and invoke them through the `gs` command.
|
||||
on top of git-spice commands, and invoke them through the `gs` alias.
|
||||
|
||||
For example:
|
||||
|
||||
|
||||
@@ -97,3 +97,11 @@
|
||||
.used-by-marquee:hover .used-by-marquee-content {
|
||||
animation-play-state: paused;
|
||||
}
|
||||
|
||||
.gs-alias-note {
|
||||
margin: 0;
|
||||
max-width: 36ch;
|
||||
font-size: 0.7rem;
|
||||
line-height: 1.3;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ description: >-
|
||||
|
||||
git-spice supports completion for Bash, Zsh, and Fish.
|
||||
To set up completion, follow the instructions below.
|
||||
These snippets assume you have `gs` aliased to `git-spice`.
|
||||
If you don't use the alias, replace `gs` with `git-spice`.
|
||||
|
||||
=== "Bash"
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ that is able to download pre-built binaries from GitHub Releases.
|
||||
If you use ubi, use the following command to install git-spice:
|
||||
|
||||
```bash
|
||||
ubi --project abhinav/git-spice --exe gs
|
||||
ubi --project abhinav/git-spice --exe git-spice
|
||||
```
|
||||
|
||||
#### mise
|
||||
@@ -65,7 +65,7 @@ and includes a ubi backend.
|
||||
If you use mise, use the following command to install git-spice:
|
||||
|
||||
```bash
|
||||
mise use --global 'ubi:abhinav/git-spice[exe=gs]'
|
||||
mise use --global 'ubi:abhinav/git-spice[exe=git-spice]'
|
||||
```
|
||||
|
||||
### AUR (ArchLinux)
|
||||
@@ -98,6 +98,24 @@ To **build from source**, follow these steps:
|
||||
go install go.abhg.dev/gs@latest
|
||||
```
|
||||
|
||||
## Recommended: add a `gs` alias
|
||||
|
||||
The canonical command name is `git-spice`,
|
||||
but most examples in this documentation use `gs` for brevity.
|
||||
Add a shell alias so both forms work:
|
||||
|
||||
=== "Bash / Zsh"
|
||||
|
||||
```bash
|
||||
alias gs=git-spice
|
||||
```
|
||||
|
||||
=== "Fish"
|
||||
|
||||
```fish
|
||||
alias gs git-spice
|
||||
```
|
||||
|
||||
## Next steps
|
||||
|
||||
- [ ] [Create your first stack](stack.md)
|
||||
|
||||
@@ -56,7 +56,7 @@ func dumpShorthands(w io.Writer, shorts *shorthand.BuiltinSource) {
|
||||
var t table
|
||||
t.appendHeaders("Shorthand", "Long form")
|
||||
for _, key := range keys {
|
||||
cmd := cmdFullName(shorts.Node(key))
|
||||
cmd := cmdFullNameWithPrefix(shorts.Node(key), "gs")
|
||||
link := fmt.Sprintf("[%v](/cli/reference.md#%v)", cmd, strings.ReplaceAll(cmd, " ", "-"))
|
||||
t.addRow("gs "+key, link)
|
||||
}
|
||||
@@ -119,7 +119,7 @@ func (cmd *cliDumper) dump(app *kong.Application) {
|
||||
}
|
||||
|
||||
cmd.println("```")
|
||||
cmd.println("gs" + app.Summary())
|
||||
cmd.println("git-spice" + app.Summary())
|
||||
cmd.println("```")
|
||||
cmd.println()
|
||||
|
||||
@@ -155,7 +155,7 @@ func (cmd cliDumper) dumpCommand(node *kong.Node, level int) {
|
||||
return
|
||||
}
|
||||
|
||||
cmd.header(level, cmdFullName(node))
|
||||
cmd.header(level, fmt.Sprintf("%s {#%s}", cmdFullName(node), cmdLegacyAnchor(node)))
|
||||
cmd.println("```")
|
||||
cmd.println("gs " + node.Summary())
|
||||
cmd.println("```")
|
||||
@@ -380,11 +380,20 @@ func (cmd cliDumper) printf(format string, args ...interface{}) {
|
||||
}
|
||||
|
||||
func cmdFullName(node *kong.Node) string {
|
||||
return cmdFullNameWithPrefix(node, "git-spice")
|
||||
}
|
||||
|
||||
func cmdLegacyAnchor(node *kong.Node) string {
|
||||
full := cmdFullNameWithPrefix(node, "gs")
|
||||
return strings.ReplaceAll(full, " ", "-")
|
||||
}
|
||||
|
||||
func cmdFullNameWithPrefix(node *kong.Node, prefix string) string {
|
||||
var parts []string
|
||||
for n := node; n != nil && n.Type == kong.CommandNode; n = n.Parent {
|
||||
parts = append(parts, n.Name)
|
||||
}
|
||||
parts = append(parts, "gs")
|
||||
parts = append(parts, prefix)
|
||||
slices.Reverse(parts)
|
||||
return strings.Join(parts, " ")
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ func main() {
|
||||
cmdName := filepath.Base(os.Args[0])
|
||||
parser, err := kong.New(&cmd,
|
||||
kong.Name(cmdName),
|
||||
kong.Description("gs (git-spice) is a command line tool for stacking Git branches."),
|
||||
kong.Description("git-spice is a command line tool for stacking Git branches."),
|
||||
kong.Resolvers(spiceConfig),
|
||||
kong.Bind(logger, &forges, &sigStack),
|
||||
kong.BindTo(ctx, (*context.Context)(nil)),
|
||||
@@ -303,6 +303,15 @@ func (cmd *mainCmd) AfterApply(ctx context.Context, kctx *kong.Context, logger *
|
||||
// so that commands that don't need worktree aren't forced to use it
|
||||
// just to get the current branch name.
|
||||
|
||||
// Deprecation warning for using the "gs" name.
|
||||
// A future release will only be invokable as "git-spice".
|
||||
if filepath.Base(os.Args[0]) == "gs" && os.Getenv("GIT_SPICE_NO_GS_WARNING") != "1" {
|
||||
logger.Warn("Invoking git-spice as 'gs' is deprecated and will stop working in the future.")
|
||||
logger.Warn("Please use 'git-spice', or add the following to your shell configuration:")
|
||||
logger.Warn(" alias gs=git-spice")
|
||||
logger.Warn("To suppress this warning, set GIT_SPICE_NO_GS_WARNING=1")
|
||||
}
|
||||
|
||||
return errors.Join(
|
||||
kctx.BindSingletonProvider(func() (*git.Worktree, error) {
|
||||
return git.OpenWorktree(ctx, ".", git.OpenOptions{
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
[[tools.changie]]
|
||||
version = "1.24.0"
|
||||
backend = "github:miniscruff/changie"
|
||||
"platforms.linux-arm64" = { checksum = "sha256:0eaf34f01c24f7825614897427e42553070fb4407070a33759f82b117a6c3afc", url = "https://github.com/miniscruff/changie/releases/download/v1.24.0/changie_1.24.0_linux_arm64.tar.gz", url_api = "https://api.github.com/repos/miniscruff/changie/releases/assets/319542127"}
|
||||
"platforms.linux-x64" = { checksum = "sha256:706937c1874eb7c270d15f644d8a84a74dfa7f27778cbc8ca9cb045a0d68d9df", url = "https://github.com/miniscruff/changie/releases/download/v1.24.0/changie_1.24.0_linux_amd64.tar.gz", url_api = "https://api.github.com/repos/miniscruff/changie/releases/assets/319542133"}
|
||||
"platforms.linux-x64-changie" = { checksum = "blake3:8b63ce3ca2871dba4d3a50cea6b4fc8c8aad789a18fdb8c88fc8e6b3b26977cc"}
|
||||
"platforms.macos-arm64" = { checksum = "sha256:cdbca27a073fc741c5ff08e9792444f459dbc5cff151ecb7118f2fdab9ea346f", url = "https://github.com/miniscruff/changie/releases/download/v1.24.0/changie_1.24.0_darwin_arm64.tar.gz", url_api = "https://api.github.com/repos/miniscruff/changie/releases/assets/319542132"}
|
||||
"platforms.macos-x64" = { checksum = "sha256:4ffd88cb50b2ad382b609318a41be81e7d29a750be7607fab7024e76cccb67fa", url = "https://github.com/miniscruff/changie/releases/download/v1.24.0/changie_1.24.0_darwin_amd64.tar.gz", url_api = "https://api.github.com/repos/miniscruff/changie/releases/assets/319542130"}
|
||||
"platforms.windows-x64" = { checksum = "sha256:4a90748c1da0179afe282599b562e75ef2cb5ce34e25d5f67e70ef20725b9e1d", url = "https://github.com/miniscruff/changie/releases/download/v1.24.0/changie_1.24.0_windows_amd64.zip", url_api = "https://api.github.com/repos/miniscruff/changie/releases/assets/319542125"}
|
||||
|
||||
[[tools.go]]
|
||||
version = "1.26.0"
|
||||
@@ -22,7 +26,11 @@ backend = "ubi:mvdan/gofumpt"
|
||||
[[tools.golangci-lint]]
|
||||
version = "2.10.1"
|
||||
backend = "aqua:golangci/golangci-lint"
|
||||
"platforms.linux-arm64" = { checksum = "sha256:6652b42ae02915eb2f9cb2a2e0cac99514c8eded8388d88ae3e06e1a52c00de8", url = "https://github.com/golangci/golangci-lint/releases/download/v2.10.1/golangci-lint-2.10.1-linux-arm64.tar.gz"}
|
||||
"platforms.linux-x64" = { checksum = "sha256:dfa775874cf0561b404a02a8f4481fc69b28091da95aa697259820d429b09c99", url = "https://github.com/golangci/golangci-lint/releases/download/v2.10.1/golangci-lint-2.10.1-linux-amd64.tar.gz"}
|
||||
"platforms.macos-arm64" = { checksum = "sha256:03bfadf67e52b441b7ec21305e501c717df93c959836d66c7f97312654acb297", url = "https://github.com/golangci/golangci-lint/releases/download/v2.10.1/golangci-lint-2.10.1-darwin-arm64.tar.gz"}
|
||||
"platforms.macos-x64" = { checksum = "sha256:66fb0da81b8033b477f97eea420d4b46b230ca172b8bb87c6610109f3772b6b6", url = "https://github.com/golangci/golangci-lint/releases/download/v2.10.1/golangci-lint-2.10.1-darwin-amd64.tar.gz"}
|
||||
"platforms.windows-x64" = { checksum = "sha256:c60c87695e79db8e320f0e5be885059859de52bb5ee5f11be5577828570bc2a3", url = "https://github.com/golangci/golangci-lint/releases/download/v2.10.1/golangci-lint-2.10.1-windows-amd64.zip"}
|
||||
|
||||
[[tools.gotestsum]]
|
||||
version = "1.13.0"
|
||||
@@ -36,4 +44,8 @@ backend = "aqua:gotestyourself/gotestsum"
|
||||
[[tools.requiredfield]]
|
||||
version = "0.9.0"
|
||||
backend = "github:abhinav/requiredfield"
|
||||
"platforms.linux-arm64" = { checksum = "sha256:1bad25e1570b0df22f551c0ebec3fdb41fed7fb4fdd654ccc36f4fc844c44ec4", url = "https://github.com/abhinav/requiredfield/releases/download/v0.9.0/requiredfield.Linux-aarch64.tar.gz", url_api = "https://api.github.com/repos/abhinav/requiredfield/releases/assets/357740555"}
|
||||
"platforms.linux-x64" = { checksum = "sha256:46f82f7a552c0fd61dbe3ca7ffa165de85b6d5ed1e97a833fe7d154dfb331bcf", url = "https://github.com/abhinav/requiredfield/releases/download/v0.9.0/requiredfield.Linux-x86_64.tar.gz", url_api = "https://api.github.com/repos/abhinav/requiredfield/releases/assets/357740554"}
|
||||
"platforms.macos-arm64" = { checksum = "sha256:a9924eeb3161db4962466f3d2172d998f8719d8afebed5ef4e41c7b6287b9581", url = "https://github.com/abhinav/requiredfield/releases/download/v0.9.0/requiredfield.Darwin-arm64.tar.gz", url_api = "https://api.github.com/repos/abhinav/requiredfield/releases/assets/357740565"}
|
||||
"platforms.macos-x64" = { checksum = "sha256:3e0c8c89d2b2c9340807b659d76ba5aaaa15a38d178f92d5d59d1a3a4a453d2f", url = "https://github.com/abhinav/requiredfield/releases/download/v0.9.0/requiredfield.Darwin-x86_64.tar.gz", url_api = "https://api.github.com/repos/abhinav/requiredfield/releases/assets/357740567"}
|
||||
"platforms.windows-x64" = { checksum = "sha256:d431d9086678669e49a2d609ab77a07ecb1a09d676aa7907c8fa2e39fedd5a29", url = "https://github.com/abhinav/requiredfield/releases/download/v0.9.0/requiredfield.Windows-x86_64.zip", url_api = "https://api.github.com/repos/abhinav/requiredfield/releases/assets/357740550"}
|
||||
|
||||
@@ -140,11 +140,12 @@ usage = """
|
||||
flag "--pprof" help="Build with pofiling flags"
|
||||
"""
|
||||
run = """
|
||||
go install -tags="
|
||||
go build -o bin/git-spice -tags="
|
||||
{%- if flag(name='pprof') == 'true' -%}
|
||||
profile
|
||||
{%- endif -%}
|
||||
" go.abhg.dev/gs
|
||||
ln -sf git-spice {{ config_root }}/bin/gs
|
||||
"""
|
||||
wait_for = ["generate"]
|
||||
description = "Build the gs binary"
|
||||
|
||||
@@ -48,6 +48,10 @@ func TestMain(m *testing.M) {
|
||||
|
||||
testscript.Main(m, map[string]func(){
|
||||
"gs": func() {
|
||||
// Don't pollute tests with warnings about
|
||||
// the binary being named 'gs'.
|
||||
_ = os.Setenv("GIT_SPICE_NO_GS_WARNING", "1")
|
||||
|
||||
logger := silog.New(os.Stderr, &silog.Options{
|
||||
Level: silog.LevelDebug,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user