ejoffe / spr

Stacked Pull Requests on GitHub
MIT License
796 stars 68 forks source link

Git spr is not reporting the branch names in the Github PR that it would do earlier. #337

Closed MayureshGharat closed 1 year ago

MayureshGharat commented 1 year ago

Earlier: Screenshot 2023-06-21 at 12 00 11 PM

Now after spr update to latest: Screenshot 2023-06-21 at 11 59 55 AM

I also see a message on git spr u:

⚡  git spr u
error: unable to fetch remote branch info, using defaults> git rev-parse --show-toplevel
> git fetch
> git rebase origin/main --autostash

Can you advice?

ejoffe commented 1 year ago

The naming of pr branches has changed in the latest version. Old version used to be: pr/<user_name>/<local_branch>/<commit-id> New approach: spr/<remote_branch>/<commit-id>

This does mean that migrating from 12 -> 13, new prs will be created and the old ones need to be manually closed. Hope this helps.

MayureshGharat commented 1 year ago

@ejoffe thanks a lot for quick reply. How can we know branch names. The main reason I ask is because we can have a person working on multiple branches at the same time and would be waiting for the reviews. Once a PR for a particular branch is approved, the person might want to go to that branch to commit the PR using: git spr merge -c 1. Earlier, I could look at the local branch name like TemporalFixes in the above screenshot and navigate to that branch and commit my PRs.

ejoffe commented 1 year ago

Unfortunately this is no longer possible. The person will now have to know which pr belongs to which branch. The reason for this change is to make it easier and possible to share prs across users and branches. Personally in our workflows we end up using very little branches. 95% of the time everyone works on a single branch, just keep stacking and merging. There are some exceptions where a new branch is created, but those are usually very short lived.

MayureshGharat commented 1 year ago

I see. I was able to workaround a bit and get hold of the branch. Little painful but not a blocker. git checkout spr/main/255... and then :

Screenshot 2023-06-21 at 1 08 19 PM
ejoffe commented 1 year ago

One idea you might be able to try is to write a github bot (or maybe there is one out there) that labels the prs with the local branch.