spacedentist / spr

Submit pull requests for individual, amendable, rebaseable commits to GitHub
https://getcord.github.io/spr/
MIT License
376 stars 33 forks source link

`spr init` should validate the provided branchPrefix #152

Closed AdarLieberDembo-at closed 1 year ago

AdarLieberDembo-at commented 1 year ago

As the branchPrefix will be part of the refname, it should be validated against the criteria found in the git check-ref-format manpage. Otherwise spr diff can fail like this:

fatal: invalid refspec '40cf956ffd653ba646b24d0fef9cb1696300babb:refs/heads/spr/someUser/[bad branchPrefix]/some-commit-summary'
  �  git push failed
cadolphs commented 1 year ago

I thought this was a reasonably straightforward issue to dive in and get my hands dirty. Love the idea behind the spr tool and even better that it's written in Rust :)