Skip to content

PR merge should, after switching branches, pull #1444

Description

@Habbie

Describe the bug

After gh pr merge, I get put back onto my default branch (which, in this case, the PR was against). However, this branch was not locally updated to have the merge present.

Steps to reproduce the behavior

Terminal log (edited for prompt brevity, I only left the branch name in):

[pres-ietf-108] $ gh pr merge
? What merge method would you like to use? Create a merge commit
? Delete the branch locally and on GitHub? Yes
✔ Merged pull request #38 (presentation for IETF 108 DPRIVE)
✔ Deleted branch pres-ietf-108 and switched to branch master
[master] $ git pull
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), done.
From github.com:PowerDNS/parent-signals-dot
   6436913..34a4249  master     -> origin/master
Updating 6436913..34a4249
Fast-forward
 draft-vandijk-dprive-ds-dot-signal-and-pin/presentations/bs         |   7 +
 .../presentations/ietf-108-dprive.md                                | 217 ++++++++++++++++++++++++++++
 .../presentations/template/index.html                               |  22 +++
 .../presentations/template/remark.min.js                            |  18 +++
 .../presentations/template/style.scss                               | 225 ++++++++++++++++++++++++++++++
 5 files changed, 489 insertions(+)
 create mode 100755 draft-vandijk-dprive-ds-dot-signal-and-pin/presentations/bs
 create mode 100644 draft-vandijk-dprive-ds-dot-signal-and-pin/presentations/ietf-108-dprive.md
 create mode 100644 draft-vandijk-dprive-ds-dot-signal-and-pin/presentations/template/index.html
 create mode 100644 draft-vandijk-dprive-ds-dot-signal-and-pin/presentations/template/remark.min.js
 create mode 100644 draft-vandijk-dprive-ds-dot-signal-and-pin/presentations/template/style.scss
$ gh --version
gh version 0.11.0 (2020-07-16)
https://github.com/cli/cli/releases/tag/v0.11.0

Expected vs actual behavior

I would have expected my master branch to have the PR merge before I did git pull myself.

Logs

Done above as part of 'Steps to reproduce'.

Other details

When checking if there was an open issue about this, I found #1096, which I feel is part of the same surprise - it also breaks 'I expect to end up in the merged state I asked for'.

Activity

  1. Habbie commented on Jul 28, 2020

    @Habbie
    Author

    The repository in question, just in case it helps make sense of the terminal log: https://github.com/PowerDNS/parent-signals-dot

  2. mislav commented on Jul 29, 2020

    @mislav
    Contributor

    Agreed that it would make the most sense to

    1. check out the base branch;
    2. make sure the base branch is fast-forwarded so it includes the merge commit.

    Thanks for writing in!

  3. added
    priority-2Affects more than a few users but doesn't prevent core functions
    on Sep 30, 2020
  4. Exagone313 commented on Oct 27, 2020

    @Exagone313

    Note that it could make sense to use git pull --ff-only in that automatic pull, so that it avoids creating a merge commit while pulling if base branch is divergent. It could be a setting.

  5. Habbie commented on Nov 29, 2021

    @Habbie
    Author

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions