Release Branch and Pull request weirdness

Hey Everyone - I am seeing something really weird and I am not sure if it’s my lack of understanding about Github PRs or if it’s a bug.

I created a repo as an example of what’s happening. https://github.com/austinbv/test-pr

I tried put links to the example repo in this post but it won’t let me as a new user. You can read the post here https://gist.github.com/austinbv/1c5dabb881bd0c039e738246eddd738e

The general workflow we are attempting:

  1. Developers work in a feature branch
  2. Developer pushes Feature branch and creates a PR from Feature branch into master
  3. Feature branch gets merged into master
  4. After a while, we cut a release by creating a PR from master into a prod
  5. master is merged into prod
  6. Rinse and repeat!

When we create merges into prod from master we always see merge conflicts, and ALL the commits that have happened on master since prod was created are applied.

Things that seem off:

  1. The PR shows too many commits being merged
  2. The PR Shows more changes than need to be applied
  3. The diff view on github shows the correct diff
  4. The create PR shows the incorrect diff
  5. All merges and rebases work as expected if I use git locally to do it

I did notice returning to a repo a few days later the diffs and pr’s were mergable so it could be a cache issue.

Any opinions on what we are doing are welcome

EDIT: I have tried to put more links in the post but b/c I am a new user I cant :frowning:

Hi there! :wave: Welcome to the Community!

It sounds like the confusion is stemming from what the PR diff is showing.

We show what’s called a “three-dot diff” which is the difference between the latest commit on the HEAD branch and the last common ancestor commit with the base branch. So if you forked off of a repo a while ago and things have changed in the parent repo since then, or if you opened a PR from the master branch and then the master branch has changed in the meantime, the diff wouldn’t show that.

It sounds like you’d rather see a “two-dot diff”, which would show the changes between the two most recent commits on each branch. If you’d like, you can merge the base branch back into the HEAD branch. That updates the last common ancestor and would be more likely to show you what you’re expecting to see there.

Hope that helps clear up some of the confusion!