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

update with no arguments should follow remote, not upstream #80

Closed
zombiezen opened this issue Dec 28, 2018 · 1 comment
Closed

update with no arguments should follow remote, not upstream #80

zombiezen opened this issue Dec 28, 2018 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@zombiezen
Copy link
Member

Steps to Reproduce

# On an existing repository with master
$ gg branch foo  # implicit upstream of origin/master
$ gg push -create myfork
# changes made on myfork
$ gg pull -r foo myfork  # I realize I could have used -u here, but I forgot.
$ gg update

Expected Behavior

A fast-forward merge to myfork/foo.

Actual Behavior

gg up attempts to fast-forward merge on upstream, which results in exiting without doing anything with this error message:

fatal: Not possible to fast-forward, aborting.
gg: run git merge: exit status 128

Version Info

gg version 0.6.1, built on 2018-08-22T22:18:40Z
go: go1.10.3 gc linux/amd64
git version 2.19.1
@zombiezen zombiezen added the bug Something isn't working label Dec 28, 2018
@zombiezen zombiezen added this to the 0.7 milestone Dec 28, 2018
zombiezen added a commit that referenced this issue Jan 4, 2019
I'm going to use this as part of `gg update -merge`.

Updated "checkout" call sites I found.

Updates #80
@zombiezen zombiezen reopened this Jan 4, 2019
@zombiezen
Copy link
Member Author

I believe the logic I want is:

  • If the upstream has the same branch name as the current branch (i.e. if config branch.CURRENT.merge == CURRENT, where CURRENT is the HEAD ref), then use that to update.
  • Otherwise, use the ref from the default push remote.

Both of these require then looking up the remote.*.fetch configuration value and mapping the ref to a remote-tracking branch.

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

No branches or pull requests

1 participant