Flame_Phoenix
Flame_Phoenix

Reputation: 17604

How to take ownership of a Pull Request?

Background

A few months ago I started using graylog2 and championing its use within my company. Things have been going great and I read all the documentation I could find, with the (very little) time I am given.

Still, I managed to contribute to the project itself! I found several wrongfully documented features and issues and I already made PR's ( that were accepted by the organization ) to fix them in several of their projects!

Given my will to contribute, they have given me a chance to go from zero to hero - finish a Pull Request that was abandoned: https://github.com/Wizcorp/node-graylog2

Problem

The problem here is that I don't know how to take ownership of an abandoned PR in github. According to what I read, there is no "pass ownership of this PR to someone else" feature.

I have asked for help but no one answered. I really want to take this chance and contribute to the community ( there are so many ways to help! ) but I have no idea on how to move forward.

Question

Can someone help me and tell me how I can take ownsership of an abandoned Pull Request ?

Upvotes: 9

Views: 7053

Answers (2)

You don't take ownership of the old PR. Take the branch name from the old PR and create a new PR to master / develop. You'll own this PR.

If that does not work for some reason, create a new branch from the branch of the old PR and now this branch will have the same changes as the old PR. You can raise a new PR from this newly created branch.

You said, this was for GitHub. I'd imagine the process is the same for other platforms.

Upvotes: 0

VonC
VonC

Reputation: 1330092

You can:

  • clone your fork
  • add Wizcorp as a remote to https://github.com/Wizcorp/node-graylog2
  • fetch Wizcorp: that will include the PR branch. See also "Checking out pull requests locally"
  • checkout your own PR branch to its HEAD
  • rebase it on top of current master (in order to validate the current PR work when used with the most recent code)
  • add your own commits to your PR branch (which includes the commits from the original PR)
  • push and make a new PR from your pushed branch.

That is:

git clone https://github.com/<you>/node-graylog2 # your fork of node-graylog2
cd node-graylog2
git remote add Wizcorp https://github.com/Wizcorp/node-graylog2

# replace ID with the old PR ID
# for instance: 22 for https://github.com/Wizcorp/node-graylog2/pull/22

# replace BRANCHNAME by a name representing the theme of your PR
git fetch Wizcorp pull/ID/head:BRANCHNAME 

git rebase master BRANCHNAME
# commit
git push -u origin BRANCHNAME

On GitHub, make a new PR from the branch you just pushed.
In other words, you don't take ownership of an old PR, you just make a new branch which will include the old PR commits plus your new ones.
You can write in the PR message that your work is based on the old PR.

Upvotes: 9

Related Questions