Skip to content

Stacked Git 2.2.0

Compare
Choose a tag to compare
@jpgrayson jpgrayson released this 24 Feb 23:33
· 599 commits to master since this release
v2.2.0
327d1db

This release contains several quality of life features, including new options for specifying patches and branches on the command line. And improved performance.

Patch Locator Syntax

In addition to being able to specify patches by name, StGit now supports several new alternatives for specifying patches:

  • By relative offset from the topmost patch, e.g. -1, +3, or ~2.
  • By their absolute index in the stack, e.g. 0 or 12.
  • By offset from another patch, e.g. some-patch~ or some-patch+2.
  • By relative offset from the last visible patch, e.g. ^ or ^2.

The new patch locator syntax is detailed in the stg man page.

New Options for stg series

To complement the new patch locator syntax, new -O/--offsets and -I/--indices options display each patch's relative offset from top and absolute index, respectively.

The new -r/--reverse option allows the stack to be shown top-side up. This may produce a more intuitive view of the stack for some StGit users. Consider adding a stack alias using this option, for example with git config --global stgit.alias.stack 'series -rOP'.

Speaking of aliases, now each of the "Display Options" for stg series have a --no-xxx variant. These can be helpful for masking options used in series aliases. For example, the stack offset suggested above could be run as stg stack --no-offsets to disable display of offsets.

Finally, the --short option now takes an optional integer value to specify the number of patches to show.

Branch Locators

StGit now supports specifying a branch using the same @{-<n>} syntax supported by git. This enables, for example, switching to the previously checked-out branch with stg branch @{-1} or just stg branch - (where - is synonymous with @{-1}).

Command Line Options

The --signoff option now has a short variant -s. This is a breaking change. The --submodules no longer has a -s short option. Similarly, the --series options for stg import, stg float, and stg sync now use -S instead of -s for their short variants.

Gitoxide

StGit now uses Gitoxide (gix crate) instead of libgit2 (git2 crate) as its git access library. In addition to being a pure-Rust dependency, gitoxide has considerably less startup overhead (4x) than git2. This has a big impact on the latency of StGit commands.

Removed

  • feat!: remove short -s option for --submodules
  • fix!: patch name cannot be {base} or @

Added

  • feat: patch locator syntax
  • feat: locate branches using @{-N} syntax
  • feat(series): Add --reverse option
  • feat(series): options for patch offsets and indices
  • feat(series): --no-xxx options to override display options
  • feat(series): optional value for --short
  • feat!: short -s option for --signoff (#245)
  • feat(init): add -b/--branch option

Changed

  • fix!: use -S as short opt for --series
  • feat!: constrain refresh -p to visible patches
  • feat(series)!: empty patch prefix changed to *
  • feat!: spell errors in lowercase
  • refactor: use gitoxide instead of git2
  • refactor: use time crate instead of chrono
  • feat!: update to clap 4.1
  • chore: update to latest dependencies

Fixed

  • fix: Error if author or committer is not configured
  • fix: Use correct base directory for core.hooksPaths
  • fix(rename): colliding patch names
  • fix(rebase): repair rebasing to a tag (#265)
  • fix(branch): switch branch with detached head
  • docs: Repair docstrings being confused as html
  • docs: normalized spelling for --branch value