Skip to content

feat(git): fish-style abbreviation for branch and worktree names #613

Description

@axisrow

Feature request

Fish-style abbreviation for the Git Branch and Git Worktree widgets: collapse every name segment but the last to its first character, the same way the Current Working Dir widget's fish-style mode shortens paths.

Current Fish-style
⎇ main ⎇ m
⎇ feature/worktree ⎇ f/worktree
⎇ fix/np/story ⎇ f/p/story
𖠰 dir/wt 𖠰 d/wt

Motivation

  • The full path widgets already have this mode (Current Working Dir → (f)ish style), so abbreviated branches would keep the status line visually consistent.
  • Branch names like fix/np/story-123 are long; f/p/story-123 keeps the distinguishing tail while cutting most of the width.
  • It would be off by default (a per-widget toggle, (f) in the widget editor, metadata.fishStyle), so nothing changes for existing setups.

Notes

  • The repo-link feature keeps the full branch name in the URL; only the visible label is abbreviated.
  • maxWidth continues to apply on top of the abbreviated text.

Happy to send a PR — a working implementation with tests is ready.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions