spacedentist / spr

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

spr diff does not work after rebasing #149

Closed opqpop closed 1 year ago

opqpop commented 1 year ago

i tried rebasing and now spr diff doesnt work, it keeps creating a brand new PR,

could you help check where i did wrong following steps in https://getcord.github.io/spr/user/simple.html#conflicts-on-landing?

image
  1. git checkout origin/spr/opqpop/dracuieasy-split-solid-liquid-investments
  2. git rebase origin/main
  3. now the rebase replays it with new commit hashes and the branch name is no longer there, believe this is expected (see a5435a3e)
  4. normally if i wasnt using spr, i'd force push my PR, but instructions say to run spr diff again after rebasing to update the PR
  5. i do that and it ends up creating a new PR w/ the name origin/spr/opqpop/-initial-version instead

am i missing something in step 4? Do I need to do something after rebasing before calling spr diff again, or did I mess up the rebase command in step 2?

image

instructions say to rebase but doesnt say how so I wasnt sure

Rebase your PR onto latest upstream main, resolving conflicts in the process.
Run spr diff to update the PR
sven-of-cord commented 1 year ago

There is a slight mistake in your workflow:

  1. git checkout origin/spr/opqpop/dracuieasy-split-solid-liquid-investments

You shouldn't checkout the branch that spr created on GitHub, but your local branch that has the commit in it that you originally submitted using spr. Your old, original commit is the one you need to rebase onto current master and then resubmit with spr diff.

When you run spr diff the first time, spr injects one line into your local commit message beginning with "Pull Request:". Now you can amend and/or rebase that commit and call spr diff again to update on GitHub. When spr diff is run on a commit which has the "Pull Request:" line in the commit message, it updates an existing commit.

spr does create those spr/opgpop/... branches on GitHub. Please ignore those completely. Never check them out. Those branches are what spr prepares under-the-hood to translate changes of your local commit to a branch GitHub understands. You just keep working with your original commit on your local branch.

opqpop commented 1 year ago

Ohhh thank you so much! That makes so much sense. I've confirmed everything works as long as I'm always using my original commit and not the under the hood commits created by spf.

And big thanks for this project, it's been a huge productivity boost for my team!