Skip to content

Releases: abhinav/git-spice

v0.19.1

26 Oct 00:43
70a7dd0

Choose a tag to compare

Fixed

  • branch delete: Fix prompt for unmerged branch deletion not respecting the "no" answer.

v0.19.0

19 Oct 00:22
69aa4ee

Choose a tag to compare

Added

  • Add experimental 'gs commit pick' to cherry-pick a commit and update upstack branches in one go. Opt into it with git config --global spice.experiment.commitPick true. The command presents an interactive prompt when invoked without any arguments. demo of gs commit pick
  • Add 'gs downstack track' command to track a manually created stack of branches in one go. demo of gs downstack track
  • {stack, upstack} restack: prompt for confirmation when invoked from trunk to prevent accidental full-repository restacking. To do this without a prompt, prefer using the gs repo restack command instead.
  • submit: Add spice.submit.navigationCommentStyle.marker configuration option to customize the marker in navigation comments

Changed

  • branch create: -m/--message now implies --commit
  • submit: Warn and prompt for confirmation when submitting branches with zero commits

Fixed

  • repo sync: Fix failure to delete merged branches after a sync operation because an upstack branch of the merged branch is checked out in a worktree.

v0.18.0

25 Sep 04:12
f75dfb5

Choose a tag to compare

A couple highlights from this release:

  • News for macOS users:
    If you installed git-spice from the official Tap
    (brew install abhinav/tap/git-spice),
    you'll need to switch to the Cask version of the package
    as the Formula version is being deprecated.

    brew uninstall abhinav/tap/git-spice
    brew install --cask abhinav/tap/git-spice

    If you installed git-spice from homebrew-core (brew install git-spice),
    you can ignore this message.

    For context: Homebrew supports Formulae and Casks.
    Formulae are typically built from source.
    git-spice's Homebrew Tap previously published git-spice as a Formula,
    but it distributed pre-built binaries instead of source code.
    We're switching to publishing a Cask to more accurately reflect
    what's being distributed.

  • git-spice now supports an experimental new command: gs commit fixup.
    It is able to amend any commit in the current branch or any downstack branch.
    Think git commit --amend, but fully stack-aware.

    demo of gs commit fixup

    As the feature is experimental, you must opt into it to access it by running:

    git config spice.experiment.commitFixup true  # enable for this repository
    git config --global spice.experiment.commitFixup true    # enable globally

    If you use it, please feedback and issues about the experimental feature at
    https://github.com/abhinav/git-spice/discussions/867.

  • We've addressed a long-standing limitation of gs branch split:
    it was previously unable to move the branch being split down to another commit.
    Suppose if the branch being split--say 'penguin'--has two commits:
    (a) Invent penguins, and (b) Refactor pangolin, and the branch head points to commit (b).
    Previously, gs branch split would not let you use the name 'penguin' for commit (a),
    as it was already attached to commit (b).

    This limitation has now been resolved: you can now move 'penguin' down to commit (a),
    and create a new branch 'pangolin' for commit (b).

    demo of gs branch split re-using a branch name

  • gs log long (gs ll) and gs log short (gs ls) both now support a --json flag.
    When used, they print all available information as JSON to stdout.
    You can consume this output with tools like jq to implement custom automations using information from git-spice.

Added

  • branch checkout/delete/onto: Include CR numbers in prompt visualization, and allow searching and filtering by CR identifiers.
  • Experimental 'gs branch fixup' command that acts like 'git commit --amend' for any downstack commit. It will commit staged changes to a downstack commit, and automatically rebase the rest of the stack on top of it. See https://abhinav.github.io/git-spice/cli/experiments for instructions on enabling this experimental feature.
  • log {long, short}: Add --json flag. This prints information about tracked branches to stdout as a stream of JSON objects.
  • log {long, short}: Add -S/--cr-status flag to request the statuses of change requests that have been published.

Changed

  • branch split: Allow reusing original branch name for intermediate commits during split.
  • Homebrew Tap now publishes the package as a Cask. If you previously installed with brew install abhinav/tap/git-spice, switch to the cask with brew install --cask abhinav/tap/git-spice. You can ignore this if you installed from homebrew-core (brew install git-spice).
  • gitlab: Submit Merge Requests with remove_source_branch=true. This will delete the source branch when the MR is merged. Opt out of this behavior with the spice.forge.gitlab.removeSourceBranch option.

Removed

  • commit amend: Delete -n flag that was deprecated in favor of --no-edit in v0.10.0 (2025-01-02). If you need a short way to use this flag, try defining a custom shorthand.

Fixed

  • repo restack: Autostash dirty changes in the working tree before the operation. Previously, the changes wouldn't be stashed until checking out the first branch, an operation which might fail because of other conflicts.

v0.17.1

13 Sep 17:04
fda9dc3

Choose a tag to compare

Fixed

  • log: When used without --all, query only requested branches internally. This was wasted work and slowed the command down in repositories with many branches.
  • log: List all tracked branches when run from an untracked branch or detached HEAD. Previously, this behavior was undefined.
  • Fix incorrect paths being logged when autostashed changes fail to reapply after a rebase operation.

v0.17.0

25 Aug 03:33
e3aad17

Choose a tag to compare

Added

  • submit: Add 'spice.submit.updateOnly' configuration option to default to --update-only for upstack, downstack, and stack submit operations.
  • submit: Add 'spice.submit.template' configuration option to automatically select a template when multiple PR templates are available.
  • repo sync: Add 'spice.repoSync.closedChanges' configuration option to control how git-spice handles closed change requests.
  • branch checkout: Allow checking out remote branches by name. This will create a local branch and allow git-spice to start tracking it.

Changed

  • branch checkout: With --detach, prompt now allows selecting any branch, including those checked out in other worktrees.

Fixed

  • submit: If a pre-push hook fails, surface messages printed to stdout in the error.
  • restack: Fix issue where restack operations would leave the target branch checked out instead of the previously checked out branch, even when no restack operations were performed.

v0.16.1

09 Aug 01:01
1bf9177

Choose a tag to compare

Fixed

  • Fix panic when the 'spice.submit.navigationCommentSync' configuration option is set to 'downstack', and one of the downstacks has already been merged.

v0.16.0

02 Aug 03:24
06c4d74

Choose a tag to compare

This release contains a number of improvements.
Full list available below, but a couple highlights:

  • Custom shorthands now support shelling out to external commands by prefixing them with !--similarly to Git aliases.
  • A number of fixes have been made to make git-spice commands play nicer with Git worktrees.
  • submit commands now support a --label flag and configuration option that adds labels to GitHub Pull Requests and GitLab Merge Requests upon submission.
  • submit commands can now be configured to open a web browser only for newly created CRs. Use git config --global spice.submit.web create to opt into this behavior.

Added

  • Add support for custom shorthands to invoke external shell commands.
  • submit: Add -l/--label flag and accompanying 'spice.submit.label' configuration option to add labels to created/updated CRs.
  • stack delete: New command to delete all branches in the current branch's stack.
  • upstack delete: New command to delete all branches upstack from the current branch, not including the current branch.
  • repo restack: New command to restack all tracked branches.
  • submit: Add 'spice.submit.draft' configuration option to control the default value of --draft/--no-draft for new CRs.
  • checkout: Add 'spice.checkout.verbose' configuration option to report the branch name checked out. This works for up, down, top, and bottom commands too.
  • submit: Add 'spice.submit.navigationCommentSync' configuration option to control which branches' navigation comments are updated when a change is submitted.
  • stack restack: Add --branch option to restack the stack of a different branch.
  • branch squash: Add --branch option to specify the branch being targeted.
  • branch squash: Add --no-edit flag to use generated commit message without opening an editor.

Changed

  • submit: Support a value of 'created' for the --web flag and the 'spice.submit.web' configuration option. This will result in only new CRs being opened in a browser.
  • branch fold: Confirm user intent when called from a branch based directly on the trunk branch. This prevents accidentally folding changes into trunk.
  • repo init: Warn when trunk is behind upstream at initialization time. This prevents issues caused by trying to rebase newer feature branches on top of a severely old trunk branch.
  • branch squash: Use a commit message template similar to Git. Information from git-spice is commented out and commit messages are presented in oldest-to-newest order.

Fixed

  • repo init: Validate that the trunk branch is a local branch.
  • repo sync: Don't fail if a merged branch is checked out in another worktree. Log a message and skip it.
  • branch delete: Don't fail if the branch to check out after deletion is checked out in another worktree. Log a message and detach HEAD.
  • restack: If a branch planned to be restacked is checked out in another worktree, don't attempt to restack it or its upstacks.
  • log long: Fix incorrect list of commits listed in the log following a manual rebase operation.
  • branch squash: Fix no-op commit left behind in some scenarios when 'branch squash' is run after a manual rebase.
  • Fix concurrent updates to git-spice's state causing "cannot lock ref" warnings.
  • up: Don't re-load state repeatedly when going up >1 branches. This is >8x faster in degenerate cases.
  • stack restack: Don't reload state information to determine upstack/downstack branches.

v0.15.2

08 Jul 02:39
f22450c

Choose a tag to compare

Fixed

  • submit: Pre-push hooks should run in the same worktree as the submit command.

v0.15.1

26 Jun 01:51
508090e

Choose a tag to compare

Fixed

  • Fix several operations using the incorrect Git worktree when invoked from the non-primary worktree.

v0.15.0

23 Jun 00:42
3c4a7c9

Choose a tag to compare

Added

  • log short: Add spice.logShort.crFormat configuration option. This takes precedence over spice.log.crFormat for gs log short/gs ls.
  • log long: Add spice.logLong.crFormat configuration option. This takes precedence over spice.log.crFormat for gs log long/gs ll.
  • submit: Add --no-verify flag to bypass pre-push hooks.

Changed

  • repo sync: If a CR is closed without being merged, sync will now offer to delete their branches as well.
  • branch create: Reject untracked base branches sooner in the process. This prevents unnecessary work, such as writing a commit message only to have the operation fail later.
  • commit amend: Confirm user intent when called from the trunk branch, providing an option to create a new branch instead. This prevents accidental changes to the trunk branch.
  • commit amend: Confirm user intent when called during a rebase operation with unresolved conflicts. This prevents accidental amendments that could complicate the rebase process.

Fixed

  • branch submit: If a GitHub PR cannot be submitted because the base branch hasn't been pushed, present a more friendly error message.
  • GitLab: CLI authentication now recognizes the new token format (glab-XXXX).
  • Rebase operations now detect conflicts caused by autostashed dirty changes to prevent corrupted state.