Skip to content

Commit 784fe7d

Browse files
authored
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. - Smexey/git-spice-code-extension#1 - jesseduffield/lazygit#5219 There was previously discussion about this and I agreed to rename it: #469 (comment) 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.)
1 parent 296ebd9 commit 784fe7d

16 files changed

Lines changed: 159 additions & 63 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Changed
2+
body: >-
3+
Rename gs binary to git-spice in pre-built packaged artifacts.
4+
To ease the transition, both versions of the binary are included,
5+
and the command prints a deprecation warning when invoked as "gs".
6+
time: 2026-02-22T10:20:14.418243-08:00

.goreleaser.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ builds:
55
- env:
66
- CGO_ENABLED=0
77
main: .
8-
binary: gs
8+
binary: git-spice
99
goos: [darwin, linux, windows]
1010
goarch: [amd64, arm64, arm]
11-
goarm: [5, 6, 7]
11+
goarm: ["5", "6", "7"]
1212
ldflags: '-s -w -X main._version={{.Version}}'
1313
ignore:
1414
- goos: darwin
@@ -17,6 +17,9 @@ builds:
1717
goarch: arm
1818
flags:
1919
- -trimpath
20+
hooks:
21+
post:
22+
- cp "{{ .Path }}" "{{ dir .Path }}/gs{{ .Ext }}"
2023

2124
archives:
2225
- formats: tar.gz
@@ -43,11 +46,15 @@ aurs:
4346
git_url: "ssh://aur@aur.archlinux.org/git-spice-bin.git"
4447
skip_upload: auto
4548
private_key: '{{ .Env.AUR_KEY }}'
49+
provides:
50+
- git-spice
51+
- gs
4652
conflicts:
4753
- git-spice # no non-bin package exists yet, but just in case
4854
- ghostscript # ghostscript also provides a 'gs' binary
4955
package: |-
50-
install -Dm755 "./gs" "${pkgdir}/usr/bin/gs"
56+
install -Dm755 "./git-spice" "${pkgdir}/usr/bin/git-spice"
57+
ln -s "git-spice" "${pkgdir}/usr/bin/gs"
5158
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/git-spice/LICENSE"
5259
install -Dm644 "./README.md" "${pkgdir}/usr/share/doc/git-spice/README.md"
5360
install -Dm644 "./CHANGELOG.md" "${pkgdir}/usr/share/doc/git-spice/CHANGELOG.md"
@@ -68,12 +75,14 @@ homebrew_casks:
6875
description: "A tool for stacking Git branches."
6976
license: "GPL-3.0-or-later"
7077
skip_upload: auto
71-
binary: gs
78+
binaries: ["git-spice"]
7279
hooks:
7380
post:
7481
install: |
82+
bin.install_symlink "git-spice" => "gs"
83+
7584
if OS.mac?
76-
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/gs"]
85+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/git-spice"]
7786
end
7887
7988

doc/hooks/cliref.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
The syntax is:
66
77
- $$gs *$$ will produce a link to the CLI reference page.
8+
- $$git-spice *$$ will produce a link to the CLI reference page.
89
- $$spice.*$$ will produce a link to the configuration reference page.
910
1011
By default, $$foo$$ will use {foo} as the link text.
@@ -43,6 +44,11 @@ def _replace(match):
4344
icon = ":material-console:"
4445
id = title.replace(" ", "-")
4546
page = _CLI_PAGE
47+
elif title.startswith("git-spice "):
48+
icon = ":material-console:"
49+
suffix = title.removeprefix("git-spice ")
50+
id = "gs-" + suffix.replace(" ", "-")
51+
page = _CLI_PAGE
4652
elif title.startswith("spice."):
4753
icon = ":material-wrench:"
4854
id = title.replace(".", "").lower()

0 commit comments

Comments
 (0)