# I can use some help with a pull request

**URL:** <https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554>\
**Category:** Ansible Developer\
**Created:** [January 25, 2017, 9:46am UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554 "2017-01-25T09:46:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 25, 2017, 9:46am UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/1 "2017-01-25T09:46:43Z")

</div>

Hi all,

I’m not sure if my actions on my pull request were correct… Hopefully someone can comment on it…

Using the Github web interface, I forked ‘[https://github.com/ansible/ansible](https://github.com/ansible/ansible)’. I used that same interface to  
edit and add files, and comitted to my fork. Apparently that branch is called ‘devel’ since the fork was  
done from the Ansible ‘devel’ branch. From there I issued a pull request.

Recently Ansibot mentioned that I should rebase, which is obviously no surprise after a while.  
I could not find a way to use the web interface to do that, so I used the commandline interface on my  
Linux laptop :

$ git clone [https://github.com/PieterVoet/ansible.git](https://github.com/PieterVoet/ansible.git)  
$ cd ansible  
$ remote add upstream [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git)

initially I used

$ git fetch upstream devel  
$ git rebase -i upstream/devel

rename all but first ‘pick’ to ‘squash’  
save

$ git commit  
$ git push -f origin devel

but the web interface for my pull request did not show the commits, and the status still remained ‘needs rebase’.  
After some days, I tried :

$ git pull upstream devel --rebase  
$ git push origin HEAD:devel  
$ git pull upstream devel --rebase

now I got some messages about confilcts, so I edited my files and saved

$ vi lib/ansible/plugins/strategy/ **init**.py  
$ vi lib/ansible/modules/utilities/logic/set\_extra\_var.py  
$ git add lib/ansible/modules/utilities/logic/set\_extra\_var.py  
$ git add lib/ansible/plugins/strategy/ **init**.py  
$ git commit  
$ git push origin HEAD:devel

I now can see the commits in the web interface, but it now also says :

‘wants to merge 367 commits into ansible:devel from PieterVoet:devel’

Oww… now I get confused… I did not expect the commits that I got from the rebase to be commits  
for my own pull request… Maybe I really messed up…

Can someone please verify my steps and check if I did someting wrong ? If so, what should  
I do to correct ?  
Thanks in advance for any help .

---

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 25, 2017, 9:52am UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/2 "2017-01-25T09:52:09Z")

</div>

btw. my pull request is #19007

---

<div class="post-metadata">

**Author:** ![Rene\_Moser](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@Rene\_Moser](https://forum.ansible.com/u/Rene_Moser)\
**Post date:** [January 25, 2017, 11:25am UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/3 "2017-01-25T11:25:08Z")

</div>

Hi Pieter

You did everything right expect one thing. Never commit to the devel  
branch, create a new branch from the devel branch and commit to this.

Since you already commited to the devel branch just do the following:

# make sure you are on the devel branch first  
git checkout devel

# branch off the devel branch  
git checkout -b feature/xyz  
git push origin feature/xyz

In your case you now have all the commits in the new branch, not reset  
the devel branch to the state of the upstream devel

git checkout devel  
git reset --hard upstream:devel

your devel branch has now the state of the upstreams devel again

Regards  
René

---

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 25, 2017, 11:53am UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/4 "2017-01-25T11:53:56Z")

</div>

> Hi Rene,

thanks a lot for your help !  
I executed the steps you gave me, but the last step gives an error :

$ git reset --hard upstream:devel  
fatal: Invalid object name ‘upstream’.

I have defined ‘upstream’ as a remote

$ git remote -v  
origin [https://github.com/PieterVoet/ansible.git](https://github.com/PieterVoet/ansible.git) (fetch)  
origin [https://github.com/PieterVoet/ansible.git](https://github.com/PieterVoet/ansible.git) (push)  
upstream [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git) (fetch)  
upstream [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git) (push)

could you maybe please comment on this a bit more ? Thanks again !

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [January 25, 2017, 12:22pm UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/5 "2017-01-25T12:22:11Z")

</div>

​That should be a slash, not a colon:

​  
git reset --hard upstream/devel ​

​Serge​

---

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 25, 2017, 12:26pm UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/6 "2017-01-25T12:26:36Z")

</div>

> Thanks Serge,

unfortunately it then says :

$ git reset --hard upstream/devel ​  
fatal: Cannot do hard reset with paths.

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [January 25, 2017, 12:47pm UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/7 "2017-01-25T12:47:10Z")

</div>

​That Should Not Happen™

Do you by any chance have a folder upstream/devel at your $PWD?​

Serge

---

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 25, 2017, 1:02pm UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/8 "2017-01-25T13:02:40Z")

</div>

Good hunch, but no, there’s no directory ( of file ) called ‘upstream’…

---

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 26, 2017, 1:23pm UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/9 "2017-01-26T13:23:01Z")

</div>

… and I also noticed that the ‘needs\_rebase’ label is still there… ???

---

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 30, 2017, 8:26am UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/10 "2017-01-30T08:26:54Z")

</div>

Hi all,

I just read about the 2.3 Core Freeze that’s coming up. I’m not sure if my pull request is in a valid  
state for being eligible to be part of 2.3. Can somebody please verify if pull request #19007  
is sane ?

Thanks in advance…

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [January 30, 2017, 4:20pm UTC](https://forum.ansible.com/t/i-can-use-some-help-with-a-pull-request/23554/11 "2017-01-30T16:20:11Z")

</div>

Sorry, it looks like you have masses of unrelated commits in [https://github.com/ansible/ansible/pull/19007](https://github.com/ansible/ansible/pull/19007)

By the way I still think you could potentially use set\_fact because facts set with set\_fact do continue to exist during the run time of the rest of the playbook (even into subsequent plays within the playbook).

Hope this helps,

Jon
