Environment:
- Atlassian Stash v3.11.2 (https://hub.docker.com/r/atlassian/stash/)
- Git client (1.9.1)
- And a git novice (me)
On pushing changes to a file test.txt on branch b1, I see a prompt to create a pull request, which I did (id 1). Then, on another VM:
git fetch origin +refs/pull-requests/1/merge:my_pr_branch_01
git checkout my_pr_branch_01
File test.txt shows my changes, which is fine.
On the earlier VM, more changes were made to test.txt (and pushed to origin b1
). Pull request now has 2 commits. This is where the confusion arises:
When I run this on VM2:
git checkout master
git fetch origin +refs/pull-requests/1/merge:my_pr_branch_01
git checkout my_pr_branch_01
Expected to see changes from 2nd commit too. Did not find them.
Then ran:
git fetch origin +refs/pull-requests/1/merge:my_pr_branch_02
git checkout my_pr_branch_02
Changes from 2nd commit still did not appear in test.txt.
Then hit the stash UI, and looked at the diff tab of pull request. Changes from 2nd commit did show up. Then on VM2:
git fetch origin +refs/pull-requests/1/merge:my_pr_branch_03
git checkout my_pr_branch_03
And now I did see test.txt with changes from 2nd commit.
So here are the questions:
- When does it detect newer commits (apart from visiting pull request URL) ?
- How to make git aware of newer commits on pull request ?
- How to make it (surely) ignore newer commits on pull request ?
My ultimate intent is to use Stash Pull Request builder plugin on Jenkins on a number of jobs (kicked off via build flow). For this, I'm trying to figure an assured way of making all jobs use the same code.