Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That doesn't work if the base and PR branch are in different repos, which is the most common way of doing things in Github.
 help



When the base and PR branch are in different repos, it'll still work if the PR branch's repo is a fork of the base one.

No it doesn't. Here's the situation. You have an upstream repo github.com/fancyproject/fancyproject. You fork it to github.com/yourname/fancyproject. You make a branch `feature_0`, push it to yourname/fancyproject. Make a PR.

Next you create another branch `feature_1`, based on `feature_0`. You push `feature_1` to yourname/fancyproject. There is now no way to make a PR for `feature_1` that includes only the changes from feature_0 to feature_1. You can't do it because when you create the PR (in fancyproject/fancyproject) you can't select `feature_0` as a base branch because that branch doesn't exist in fancyproject/fancyproject.


Interesting.

Are you're saying that you'd want the commits for `feature_0` through `feature_1` to be in the PR (to the upstream fancyproject repo), and you'd want it to exclude the commits in the range from the fork commit through to `feature_0`?

While that's a very edge case scenario, I think (theoretically) you'd be able to do it if you first cherry-pick the commits you want onto a new branch based upon the same original fork commit that your repo forked from.

ie ensure the PR branch you create doesn't include any commits you want excluded

That should pretty much guarantee the PR goes smoothly. In theory. :)


> Are you're saying that you'd want the commits for `feature_0` through `feature_1` to be in the PR (to the upstream fancyproject repo), and you'd want it to exclude the commits in the range from the fork commit through to `feature_0`?

That's what stacked PRs are

You can review just the addition, knowing what it is building on top of.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: