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

Add refs argument do diff command #160

Open DylanZA opened 1 year ago

DylanZA commented 1 year ago

It is often useful to only update the PR further up the stack.

Eg if you have a stack of 4 but made changes to the second one only you could run: spr diff -r HEAD~3. Alternatively if you made changes to all but this one (for example because you haven't made a PR from it): spr diff -r HEAD~4..HEAD~1

DylanZA commented 1 year ago

I think it would be good to error if the user runs spr diff with both the -r and -a option, because that's ambiguous.

I did this

And bonus points for adding this to the documentation in docs/ 😛

This I haven't done - but I might still depending on how much you want it

I updated the PR as it had a bug when initially creating the PR on a commit up the tree. It would sort of leave things dangling which is not ideal. Fixed this by tracking the commits we want to run pull requests on in that loop, but keeping the commit information for the rewrite_commit_message stage