4

How do you deal with new dependencies on an older pull request in GitHub

When you have to update a branch that already has an existing pull request but has become dependent on a future branch

See Awfully crafted flow chart

http://imgur.com/41uVbQN

Details:

So lets say you make

feature 1 --> pull request
feature 2 --> pull request
feature 3 --> pull request

Client/boss request a change to feature one that will make it dependent on feature 2

Now if the pull request gets processed in the order 1, 2 ,3 then the first pull can not be tested until branch 2 is merged

The question is what is the right way to deal with this ?

What I currently do ...

Tell client ignore branch one's pull request and make one and two part of the same request (this only works if they are in a succession sometimes the pulls are not in order)

Or

Make a new branch with all the changes and tell client ignore the first 3 requests

This seems silly, what is the proper way to handle this/ how do you handle it

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
hanco ike
  • 285
  • 2
  • 14
  • Does this answer your question? [Good strategy to handle dependencies between sequential pull requests](https://stackoverflow.com/questions/41969437/good-strategy-to-handle-dependencies-between-sequential-pull-requests) – Inigo Dec 01 '21 at 01:54
  • I recommend that any useful parts of the question and also @VonC's answer be moved to the above question which already has more votes. – Inigo Dec 01 '21 at 01:55

1 Answers1

1

Client/boss request a change to feature one that will make it dependent on feature 2

That means feature 1 and 2 just became one.

You can merge those two feature branches into a new feature branch, delete the old branches, and make a pull request from the new feature branch.
The third branch is unchanged.

From the point of view of the programmer consuming the pull request (on the original repo), he/she must not ask whether or not a pull request depends on another: each PR must be able to be tested in isolation.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Ok but what should happen to the first 2 pull requests ? delete as well ? Will they get deleted when I push the deleted branch ? – hanco ike Mar 05 '14 at 17:44
  • @user3304698 as I mention in http://stackoverflow.com/a/14681796/6309, if you `git push --force` the new history of feature1 on your repo, the associated pull request will be updated automatically. You can simply close the other pull request, and delete its branch if you want, but this isn't mandatory. you cannot delete a pull request (http://www.quora.com/GitHub/What-are-ways-to-delete-a-pull-request-on-GitHub) – VonC Mar 05 '14 at 17:50