Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport sync: merge mess #484

Merged
merged 7 commits into from Apr 6, 2020
Merged

backport sync: merge mess #484

merged 7 commits into from Apr 6, 2020

Conversation

neteler
Copy link
Member

@neteler neteler commented Apr 4, 2020

Due to reasons unknown to me these backports didn't reach the releasebranch_7_8 yet.

At time I locally get

Fetching origin
Fetching upstream
Already on 'releasebranch_7_8'
Already up to date.
To github.com:neteler/grass.git
 ! [rejected]            releasebranch_7_8 -> releasebranch_7_8 (non-fast-forward)
error: failed to push some refs to 'git@github.com:neteler/grass.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

@neteler neteler requested a review from landam April 4, 2020 09:58
@neteler neteler added this to the 7.8.3 milestone Apr 4, 2020
@neteler
Copy link
Member Author

neteler commented Apr 4, 2020

Preferably someone uses the references in here and does proper cherry-picking, then I'll remove this PR.

@neteler neteler changed the title backport sync backport sync: merge mess Apr 4, 2020
@neteler neteler added the bug Something isn't working label Apr 4, 2020
@neteler
Copy link
Member Author

neteler commented Apr 6, 2020

ok, I'll merge this now.

@neteler neteler merged commit d48c648 into OSGeo:releasebranch_7_8 Apr 6, 2020
@neteler neteler deleted the releasebranch_7_8 branch April 6, 2020 17:07
@wenzeslaus
Copy link
Member

Fortunately, having Squash and merge saves the day here. Couple notes:

  1. If you end up doing git pull instead of git rebase, you can try setting git config --global pull.rebase true for git pull to be automatically turned into git pull --rebase. I don't have experience with how this plays out with the upstream+fork setup, so you need to test. However, the point here is that Git won't do merge unless you ask it to do it, well, git pull is one of the ways you are telling Git to do merge, although it does not seem that way. I recommend the git man page generator to mediate the pain from this.
  2. Squash and merge allows editing the commit message.
  3. Unless you do or already did something to fix it, your releasebranch_7_8 (i.e., releasebranch_7_8 in the neteler fork) still contains all this and you need to clean it before you can backport again. You need to trash (assuming it's trash) what you have in your local releasebranch_7_8 branch and force it to be whatever the upstream state of the branch is. The git reset command should do the trick with these parameters: git reset --hard upstream/releasebranch_7_8 (related SO answer). You can confirm by looking at commits on GitHub and locally with git log.
  4. If you are doing a PR to update any branch, you need to do that from a new dedicated branch in your fork. If you don't do that, your branch (here: neteler:releasebranch_7_8) will diverge from the upstream one (here: OSGeo:releasebranch_7_8) and you will end up doing steps in number 3 in order to stop propagating the unwanted commits. This is due to the difference between doing push directly to upstream (git push upstream releasebranch_7_8) which just pushes local commit(s) you have and PR workflow where a new commit is always created in the upstream and thus you don't have it locally.

As I mentioned previously on mailing list, note that the randomly generated Git man pages actually need to explicitly say that they are not the real documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants