scmpuff icon indicating copy to clipboard operation
scmpuff copied to clipboard

feat: add support for git branch

Open hansonw opened this issue 7 months ago • 2 comments

Thanks for this tool! this implements https://github.com/mroth/scmpuff/issues/20 :)

Summary

  • Implemented a new branch sub-command that prints git branches with numbers
    • Handles edge cases (e.g. running outside a git repo, detached HEAD)
  • Added gb as an alias for scmpuff_branch in the initialization scripts
  • Created shell wrapper functions to export numbered branch names for both Bash and Fish users
  • Extended initialization to load the new branch functionality and updated the binary’s command list

Testing

  • go test ./...
  • make features (failed to find zsh during integration tests)

Example

CleanShot 2025-05-23 at 22 32 37@2x

hansonw avatar May 24 '25 05:05 hansonw

Very cool! Thanks for such a detailed PR. It might take me a little while to review this, hopefully @hansonw you might be up for a few rounds of back and forth so we can figure out how this would interface with the broader refactor of the codebase? I really appreciate this!

mroth avatar May 26 '25 13:05 mroth

Thanks for reviewing! If you’re in the middle of a big refactor maybe it’s easier to just wait until after that lands to make this change?

full disclosure this PR was 95% generated by OpenAI Codex (which I work on ;)) so nbd to just do it again later!

hansonw avatar May 27 '25 01:05 hansonw