All of lore.kernel.org
 help / color / mirror / Atom feed
* git pull bug report
@ 2021-11-15  8:42 Erwin Villejo
  2021-11-15  8:54 ` Bagas Sanjaya
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Erwin Villejo @ 2021-11-15  8:42 UTC (permalink / raw)
  To: git

> What did you do before the bug happened? (Steps to reproduce your issue)
* make local changes, stage, and commit
* local is ahead of upstream. confirmed by `git status`:

```
$ git status
On branch main
Your branch is ahead of 'github/main' by 1 commit.
  (use "git push" to publish your local commits)
```

* try to pull upstream to local

> What did you expect to happen? (Expected behavior)
No-op (and NO failure) since local is ahead of upstream.

> What happened instead? (Actual behavior)
`git pull` fails with error:

```
$ git pull
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.
```

> What's different between what you expected and what actually happened?
I expected no failure and no-op since local is ahead of upstream.
Instead, `git pull`
fails because it thinks the branches have diverged.

> Anything else you want to add:
I found this bug in VSCode. VSCode runs `git pull` first before `git
push` when pushing to upstream.
This bug causes pushing via VSCode to always fail, although it can be
worked around by simply opening
a terminal and running `git push` manually.

[System Info]
git version:
git version 2.33.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.15.2-arch1-1 #1 SMP PREEMPT Fri, 12 Nov 2021 19:22:10
+0000 x86_64
compiler info: gnuc: 11.1
libc info: glibc: 2.33
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]

Best regards,
Erwin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15  8:42 git pull bug report Erwin Villejo
@ 2021-11-15  8:54 ` Bagas Sanjaya
  2021-11-15  8:56   ` Erwin Villejo
  2021-11-15 17:56 ` Bryan Turner
  2021-11-15 20:40 ` Junio C Hamano
  2 siblings, 1 reply; 11+ messages in thread
From: Bagas Sanjaya @ 2021-11-15  8:54 UTC (permalink / raw)
  To: Erwin Villejo, git

On 15/11/21 15.42, Erwin Villejo wrote:
>> What did you do before the bug happened? (Steps to reproduce your issue)
> * make local changes, stage, and commit
> * local is ahead of upstream. confirmed by `git status`:
> 
> ```
> $ git status
> On branch main
> Your branch is ahead of 'github/main' by 1 commit.
>    (use "git push" to publish your local commits)
> ```
> 
> * try to pull upstream to local
> 
>> What did you expect to happen? (Expected behavior)
> No-op (and NO failure) since local is ahead of upstream.
> 
>> What happened instead? (Actual behavior)
> `git pull` fails with error:
> 
> ```
> $ git pull
> hint: You have divergent branches and need to specify how to reconcile them.
> hint: You can do so by running one of the following commands sometime before
> hint: your next pull:
> hint:
> hint:   git config pull.rebase false  # merge (the default strategy)
> hint:   git config pull.rebase true   # rebase
> hint:   git config pull.ff only       # fast-forward only
> hint:
> hint: You can replace "git config" with "git config --global" to set a default
> hint: preference for all repositories. You can also pass --rebase, --no-rebase,
> hint: or --ff-only on the command line to override the configured default per
> hint: invocation.
> fatal: Need to specify how to reconcile divergent branches.
> ```
> 
>> What's different between what you expected and what actually happened?
> I expected no failure and no-op since local is ahead of upstream.
> Instead, `git pull`
> fails because it thinks the branches have diverged.
> 
>> Anything else you want to add:
> I found this bug in VSCode. VSCode runs `git pull` first before `git
> push` when pushing to upstream.
> This bug causes pushing via VSCode to always fail, although it can be
> worked around by simply opening
> a terminal and running `git push` manually.

You need to do the prompt above, so not a bug.

When reconciling, do you want merge or rebase?

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15  8:54 ` Bagas Sanjaya
@ 2021-11-15  8:56   ` Erwin Villejo
  2021-11-15  9:12     ` Bagas Sanjaya
  0 siblings, 1 reply; 11+ messages in thread
From: Erwin Villejo @ 2021-11-15  8:56 UTC (permalink / raw)
  To: Bagas Sanjaya; +Cc: git

There is nothing to reconcile since the branches have not diverged:
local is ahead of upstream. So I think it is a bug, no?

Best regards,
Erwin

On Mon, Nov 15, 2021 at 3:54 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
>
> On 15/11/21 15.42, Erwin Villejo wrote:
> >> What did you do before the bug happened? (Steps to reproduce your issue)
> > * make local changes, stage, and commit
> > * local is ahead of upstream. confirmed by `git status`:
> >
> > ```
> > $ git status
> > On branch main
> > Your branch is ahead of 'github/main' by 1 commit.
> >    (use "git push" to publish your local commits)
> > ```
> >
> > * try to pull upstream to local
> >
> >> What did you expect to happen? (Expected behavior)
> > No-op (and NO failure) since local is ahead of upstream.
> >
> >> What happened instead? (Actual behavior)
> > `git pull` fails with error:
> >
> > ```
> > $ git pull
> > hint: You have divergent branches and need to specify how to reconcile them.
> > hint: You can do so by running one of the following commands sometime before
> > hint: your next pull:
> > hint:
> > hint:   git config pull.rebase false  # merge (the default strategy)
> > hint:   git config pull.rebase true   # rebase
> > hint:   git config pull.ff only       # fast-forward only
> > hint:
> > hint: You can replace "git config" with "git config --global" to set a default
> > hint: preference for all repositories. You can also pass --rebase, --no-rebase,
> > hint: or --ff-only on the command line to override the configured default per
> > hint: invocation.
> > fatal: Need to specify how to reconcile divergent branches.
> > ```
> >
> >> What's different between what you expected and what actually happened?
> > I expected no failure and no-op since local is ahead of upstream.
> > Instead, `git pull`
> > fails because it thinks the branches have diverged.
> >
> >> Anything else you want to add:
> > I found this bug in VSCode. VSCode runs `git pull` first before `git
> > push` when pushing to upstream.
> > This bug causes pushing via VSCode to always fail, although it can be
> > worked around by simply opening
> > a terminal and running `git push` manually.
>
> You need to do the prompt above, so not a bug.
>
> When reconciling, do you want merge or rebase?
>
> --
> An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15  8:56   ` Erwin Villejo
@ 2021-11-15  9:12     ` Bagas Sanjaya
  2021-11-15  9:19       ` Erwin Villejo
  0 siblings, 1 reply; 11+ messages in thread
From: Bagas Sanjaya @ 2021-11-15  9:12 UTC (permalink / raw)
  To: Erwin Villejo; +Cc: git

On 15/11/21 15.56, Erwin Villejo wrote:
> There is nothing to reconcile since the branches have not diverged:
> local is ahead of upstream. So I think it is a bug, no?

You have the situation like:

---o---a (your mainline)
    \
     b---c---d (remote mainline)

Your mainline only have one commit ahead of base point `o`, while the remote 
mainline have three commits ahead of `o` but unrelated. In this sense, your and 
remote mainline is divergent - you need to either merge or rebase.

Next time, keep your mainline pristine (don't commit any local changes on it, 
instead branch to the topic branch and commit there).

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15  9:12     ` Bagas Sanjaya
@ 2021-11-15  9:19       ` Erwin Villejo
  2021-11-15  9:39         ` Erwin Villejo
  0 siblings, 1 reply; 11+ messages in thread
From: Erwin Villejo @ 2021-11-15  9:19 UTC (permalink / raw)
  To: Bagas Sanjaya; +Cc: git

> the remote mainline have three commits ahead
Where did you get this info? This is not true in my case.

* local is ahead of upstream. confirmed by `git status`:

```
$ git status
On branch main
Your branch is ahead of 'github/main' by 1 commit.
  (use "git push" to publish your local commits)
```

If remote was ahead, `git status` would say so. And this is my
personal repo in GitHub with only me as the sole developer/contributor
so I can assure you that the upstream has no commits ahead of my
local.

Best regards,
Erwin

On Mon, Nov 15, 2021 at 4:12 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
>
> On 15/11/21 15.56, Erwin Villejo wrote:
> > There is nothing to reconcile since the branches have not diverged:
> > local is ahead of upstream. So I think it is a bug, no?
>
> You have the situation like:
>
> ---o---a (your mainline)
>     \
>      b---c---d (remote mainline)
>
> Your mainline only have one commit ahead of base point `o`, while the remote
> mainline have three commits ahead of `o` but unrelated. In this sense, your and
> remote mainline is divergent - you need to either merge or rebase.
>
> Next time, keep your mainline pristine (don't commit any local changes on it,
> instead branch to the topic branch and commit there).
>
> --
> An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15  9:19       ` Erwin Villejo
@ 2021-11-15  9:39         ` Erwin Villejo
  2021-11-15 18:15           ` Bryan Turner
  0 siblings, 1 reply; 11+ messages in thread
From: Erwin Villejo @ 2021-11-15  9:39 UTC (permalink / raw)
  To: Bagas Sanjaya; +Cc: git

$ git log main github/main --graph --decorate -n 3
* commit b73d3e132f9638afbf5b98b0c278ed6b93a3ae50 (HEAD -> main)
| Author: Erwin Villejo <erwin.villejo@gmail.com>
| Date:   Mon Nov 15 15:22:53 2021 +0700
|
|     init activity api
|
* commit d370bf256a756a777c14609c8ad4184aa7e9e60f (github/main)
| Author: Erwin Villejo <erwin.villejo@gmail.com>
| Date:   Sat Nov 13 19:18:45 2021 +0700
|
|     refactor partitioning migration
|
* commit 5124511d287f1a6c384ff9766fdcc0e3e07043e8
| Author: Erwin Villejo <erwin.villejo@gmail.com>
| Date:   Mon Nov 8 17:24:19 2021 +0700
|
|     wip pg

$ git remote -v
github    git@github.com:erwinv/database-sandbox.git (fetch)
github    git@github.com:erwinv/database-sandbox.git (push)

Link to the [upstream branch on
GitHub](https://github.com/erwinv/database-sandbox/commits/main) so
you could see for yourself that my local is ahead of upstream and that
the upstream has no commits ahead of local.

Best regards,
Erwin


On Mon, Nov 15, 2021 at 4:19 PM Erwin Villejo <erwinvillejo@gmail.com> wrote:
>
> > the remote mainline have three commits ahead
> Where did you get this info? This is not true in my case.
>
> * local is ahead of upstream. confirmed by `git status`:
>
> ```
> $ git status
> On branch main
> Your branch is ahead of 'github/main' by 1 commit.
>   (use "git push" to publish your local commits)
> ```
>
> If remote was ahead, `git status` would say so. And this is my
> personal repo in GitHub with only me as the sole developer/contributor
> so I can assure you that the upstream has no commits ahead of my
> local.
>
> Best regards,
> Erwin
>
> On Mon, Nov 15, 2021 at 4:12 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
> >
> > On 15/11/21 15.56, Erwin Villejo wrote:
> > > There is nothing to reconcile since the branches have not diverged:
> > > local is ahead of upstream. So I think it is a bug, no?
> >
> > You have the situation like:
> >
> > ---o---a (your mainline)
> >     \
> >      b---c---d (remote mainline)
> >
> > Your mainline only have one commit ahead of base point `o`, while the remote
> > mainline have three commits ahead of `o` but unrelated. In this sense, your and
> > remote mainline is divergent - you need to either merge or rebase.
> >
> > Next time, keep your mainline pristine (don't commit any local changes on it,
> > instead branch to the topic branch and commit there).
> >
> > --
> > An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15  8:42 git pull bug report Erwin Villejo
  2021-11-15  8:54 ` Bagas Sanjaya
@ 2021-11-15 17:56 ` Bryan Turner
  2021-11-15 20:40 ` Junio C Hamano
  2 siblings, 0 replies; 11+ messages in thread
From: Bryan Turner @ 2021-11-15 17:56 UTC (permalink / raw)
  To: Erwin Villejo; +Cc: git

On Mon, Nov 15, 2021 at 12:42 AM Erwin Villejo <erwinvillejo@gmail.com> wrote:
>
> > What did you do before the bug happened? (Steps to reproduce your issue)
> * make local changes, stage, and commit
> * local is ahead of upstream. confirmed by `git status`:
>
> ```
> $ git status
> On branch main
> Your branch is ahead of 'github/main' by 1 commit.
>   (use "git push" to publish your local commits)
> ```
>
> * try to pull upstream to local
>
> > What did you expect to happen? (Expected behavior)
> No-op (and NO failure) since local is ahead of upstream.
>
> > What happened instead? (Actual behavior)
> `git pull` fails with error:
>
> ```
> $ git pull
> hint: You have divergent branches and need to specify how to reconcile them.
> hint: You can do so by running one of the following commands sometime before
> hint: your next pull:
> hint:
> hint:   git config pull.rebase false  # merge (the default strategy)
> hint:   git config pull.rebase true   # rebase
> hint:   git config pull.ff only       # fast-forward only
> hint:
> hint: You can replace "git config" with "git config --global" to set a default
> hint: preference for all repositories. You can also pass --rebase, --no-rebase,
> hint: or --ff-only on the command line to override the configured default per
> hint: invocation.
> fatal: Need to specify how to reconcile divergent branches.
> ```
>
> > What's different between what you expected and what actually happened?
> I expected no failure and no-op since local is ahead of upstream.
> Instead, `git pull`
> fails because it thinks the branches have diverged.

You're making a logical, but still incorrect, assumption about what
the "git status" output means. "git status" does NOT actually check
the remote server.

When you pull, there are typically 3 refs that are involved, not 2.
(Given it appears you're on "main", I'll use that name below.)
refs/heads/main: This is the local branch you're working on
refs/remotes/github/main: This is your _local copy_ of what the
_remote_ branch was pointed at the last time you fetched or pulled
successfully
refs/heads/main on Github: This is the remote branch you're trying to push to

When you run "git status", it is NOT talking to Github; it's simply
comparing the state of your "refs/heads/main" and
"refs/remotes/github/main" branches.

When you run "git pull", it's actually talking to Github, which allows
it to find out about commits that are present remotely but have not
been fetched to your "refs/heads/main" or "refs/remotes/github/main"
branches.

If you run "git fetch", rather than "git pull", that will update your
local "refs/remotes/github/main" branch without trying to also update
"refs/heads/main". If you then run "git status", it will tell you your
"main" branch has diverged, just like "git pull" does, instead of
showing it as ahead.

Hope this helps,
Bryan

>
> > Anything else you want to add:
> I found this bug in VSCode. VSCode runs `git pull` first before `git
> push` when pushing to upstream.
> This bug causes pushing via VSCode to always fail, although it can be
> worked around by simply opening
> a terminal and running `git push` manually.
>
> [System Info]
> git version:
> git version 2.33.1
> cpu: x86_64
> no commit associated with this build
> sizeof-long: 8
> sizeof-size_t: 8
> shell-path: /bin/sh
> uname: Linux 5.15.2-arch1-1 #1 SMP PREEMPT Fri, 12 Nov 2021 19:22:10
> +0000 x86_64
> compiler info: gnuc: 11.1
> libc info: glibc: 2.33
> $SHELL (typically, interactive shell): /bin/bash
>
>
> [Enabled Hooks]
>
> Best regards,
> Erwin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15  9:39         ` Erwin Villejo
@ 2021-11-15 18:15           ` Bryan Turner
  2021-11-15 18:22             ` Erwin Villejo
  0 siblings, 1 reply; 11+ messages in thread
From: Bryan Turner @ 2021-11-15 18:15 UTC (permalink / raw)
  To: Erwin Villejo; +Cc: Bagas Sanjaya, git

On Mon, Nov 15, 2021 at 1:40 AM Erwin Villejo <erwinvillejo@gmail.com> wrote:
>
> $ git log main github/main --graph --decorate -n 3
> * commit b73d3e132f9638afbf5b98b0c278ed6b93a3ae50 (HEAD -> main)
> | Author: Erwin Villejo <erwin.villejo@gmail.com>
> | Date:   Mon Nov 15 15:22:53 2021 +0700
> |
> |     init activity api
> |
> * commit d370bf256a756a777c14609c8ad4184aa7e9e60f (github/main)
> | Author: Erwin Villejo <erwin.villejo@gmail.com>
> | Date:   Sat Nov 13 19:18:45 2021 +0700
> |
> |     refactor partitioning migration
> |
> * commit 5124511d287f1a6c384ff9766fdcc0e3e07043e8
> | Author: Erwin Villejo <erwin.villejo@gmail.com>
> | Date:   Mon Nov 8 17:24:19 2021 +0700
> |
> |     wip pg
>
> $ git remote -v
> github    git@github.com:erwinv/database-sandbox.git (fetch)
> github    git@github.com:erwinv/database-sandbox.git (push)
>
> Link to the [upstream branch on
> GitHub](https://github.com/erwinv/database-sandbox/commits/main) so
> you could see for yourself that my local is ahead of upstream and that
> the upstream has no commits ahead of local.

Certainly looks "ahead". There _has_ been at least one confirmed bug
in 2.33 related to how "ahead" is handled[1], but it doesn't seem like
it's related to what you're seeing here. The "git pull" output
suggests you don't have "pull.ff=only" set.

Are you able to pull down either Git 2.32 or the just-released Git
2.34 and try one of those?
My suggestion to try "git fetch" could still also be useful, to see if
your "git status" output changes.

[1] https://lore.kernel.org/git/CH2PR06MB650424B4205102AC6A48F489B1BD9@CH2PR06MB6504.namprd06.prod.outlook.com/

>
> Best regards,
> Erwin
>
>
> On Mon, Nov 15, 2021 at 4:19 PM Erwin Villejo <erwinvillejo@gmail.com> wrote:
> >
> > > the remote mainline have three commits ahead
> > Where did you get this info? This is not true in my case.
> >
> > * local is ahead of upstream. confirmed by `git status`:
> >
> > ```
> > $ git status
> > On branch main
> > Your branch is ahead of 'github/main' by 1 commit.
> >   (use "git push" to publish your local commits)
> > ```
> >
> > If remote was ahead, `git status` would say so. And this is my
> > personal repo in GitHub with only me as the sole developer/contributor
> > so I can assure you that the upstream has no commits ahead of my
> > local.
> >
> > Best regards,
> > Erwin
> >
> > On Mon, Nov 15, 2021 at 4:12 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
> > >
> > > On 15/11/21 15.56, Erwin Villejo wrote:
> > > > There is nothing to reconcile since the branches have not diverged:
> > > > local is ahead of upstream. So I think it is a bug, no?
> > >
> > > You have the situation like:
> > >
> > > ---o---a (your mainline)
> > >     \
> > >      b---c---d (remote mainline)
> > >
> > > Your mainline only have one commit ahead of base point `o`, while the remote
> > > mainline have three commits ahead of `o` but unrelated. In this sense, your and
> > > remote mainline is divergent - you need to either merge or rebase.
> > >
> > > Next time, keep your mainline pristine (don't commit any local changes on it,
> > > instead branch to the topic branch and commit there).
> > >
> > > --
> > > An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15 18:15           ` Bryan Turner
@ 2021-11-15 18:22             ` Erwin Villejo
  0 siblings, 0 replies; 11+ messages in thread
From: Erwin Villejo @ 2021-11-15 18:22 UTC (permalink / raw)
  To: Bryan Turner; +Cc: Bagas Sanjaya, git

Sure, if you insist:
```
 I  ~/c/database-sandbox main ↑1 ❱ git fetch
 I  ~/c/database-sandbox main ↑1 3.3s ❱ git log --graph --oneline
--decorate main github/main -n 3
* b73d3e1 (HEAD -> main) init activity api
* d370bf2 (github/main) refactor partitioning migration
* 5124511 wip pg
 I  ~/c/database-sandbox main ↑1 ❱ git status
On branch main
Your branch is ahead of 'github/main' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
 I  ~/c/database-sandbox main ↑1 ❱
```

I did some more investigation:

```
 I  ~/c/database-sandbox main ↑1 ❱ git pull --ff-only
fatal: Not possible to fast-forward, aborting.
 I  ~/c/database-sandbox main ↑1 3.4s [128] git pull --ff
Already up to date.
 I  ~/c/database-sandbox main ↑1 3.3s ❱ git pull
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.
 I  ~/c/database-sandbox main ↑1 3.3s [128]
```

As you can see above:
- `pull --ff-only` aborts with "Not possible to fast-forward" error
- `pull --ff` succeeds with "Already up to date."
- `pull` only (unspecified `--ff`) aborts with "divergent branches"

The --ff-only case was recently fixed by
https://github.com/git/git/commit/361cb52383fb986f76a34506bdec9a1dd11133f0

The unspecified `--ff` is the bug that I encounter and I have started
a fix here: https://github.com/git/git/compare/master...erwinv:master

Best regards,
Erwin

On Tue, Nov 16, 2021 at 1:15 AM Bryan Turner <bturner@atlassian.com> wrote:
>
> On Mon, Nov 15, 2021 at 1:40 AM Erwin Villejo <erwinvillejo@gmail.com> wrote:
> >
> > $ git log main github/main --graph --decorate -n 3
> > * commit b73d3e132f9638afbf5b98b0c278ed6b93a3ae50 (HEAD -> main)
> > | Author: Erwin Villejo <erwin.villejo@gmail.com>
> > | Date:   Mon Nov 15 15:22:53 2021 +0700
> > |
> > |     init activity api
> > |
> > * commit d370bf256a756a777c14609c8ad4184aa7e9e60f (github/main)
> > | Author: Erwin Villejo <erwin.villejo@gmail.com>
> > | Date:   Sat Nov 13 19:18:45 2021 +0700
> > |
> > |     refactor partitioning migration
> > |
> > * commit 5124511d287f1a6c384ff9766fdcc0e3e07043e8
> > | Author: Erwin Villejo <erwin.villejo@gmail.com>
> > | Date:   Mon Nov 8 17:24:19 2021 +0700
> > |
> > |     wip pg
> >
> > $ git remote -v
> > github    git@github.com:erwinv/database-sandbox.git (fetch)
> > github    git@github.com:erwinv/database-sandbox.git (push)
> >
> > Link to the [upstream branch on
> > GitHub](https://github.com/erwinv/database-sandbox/commits/main) so
> > you could see for yourself that my local is ahead of upstream and that
> > the upstream has no commits ahead of local.
>
> Certainly looks "ahead". There _has_ been at least one confirmed bug
> in 2.33 related to how "ahead" is handled[1], but it doesn't seem like
> it's related to what you're seeing here. The "git pull" output
> suggests you don't have "pull.ff=only" set.
>
> Are you able to pull down either Git 2.32 or the just-released Git
> 2.34 and try one of those?
> My suggestion to try "git fetch" could still also be useful, to see if
> your "git status" output changes.
>
> [1] https://lore.kernel.org/git/CH2PR06MB650424B4205102AC6A48F489B1BD9@CH2PR06MB6504.namprd06.prod.outlook.com/
>
> >
> > Best regards,
> > Erwin
> >
> >
> > On Mon, Nov 15, 2021 at 4:19 PM Erwin Villejo <erwinvillejo@gmail.com> wrote:
> > >
> > > > the remote mainline have three commits ahead
> > > Where did you get this info? This is not true in my case.
> > >
> > > * local is ahead of upstream. confirmed by `git status`:
> > >
> > > ```
> > > $ git status
> > > On branch main
> > > Your branch is ahead of 'github/main' by 1 commit.
> > >   (use "git push" to publish your local commits)
> > > ```
> > >
> > > If remote was ahead, `git status` would say so. And this is my
> > > personal repo in GitHub with only me as the sole developer/contributor
> > > so I can assure you that the upstream has no commits ahead of my
> > > local.
> > >
> > > Best regards,
> > > Erwin
> > >
> > > On Mon, Nov 15, 2021 at 4:12 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
> > > >
> > > > On 15/11/21 15.56, Erwin Villejo wrote:
> > > > > There is nothing to reconcile since the branches have not diverged:
> > > > > local is ahead of upstream. So I think it is a bug, no?
> > > >
> > > > You have the situation like:
> > > >
> > > > ---o---a (your mainline)
> > > >     \
> > > >      b---c---d (remote mainline)
> > > >
> > > > Your mainline only have one commit ahead of base point `o`, while the remote
> > > > mainline have three commits ahead of `o` but unrelated. In this sense, your and
> > > > remote mainline is divergent - you need to either merge or rebase.
> > > >
> > > > Next time, keep your mainline pristine (don't commit any local changes on it,
> > > > instead branch to the topic branch and commit there).
> > > >
> > > > --
> > > > An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
  2021-11-15  8:42 git pull bug report Erwin Villejo
  2021-11-15  8:54 ` Bagas Sanjaya
  2021-11-15 17:56 ` Bryan Turner
@ 2021-11-15 20:40 ` Junio C Hamano
       [not found]   ` <CADL96rsnUCXchnrTa1rZ7WgJz2kDA-3TzeOiCy4AXNFdXtTmng@mail.gmail.com>
  2 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2021-11-15 20:40 UTC (permalink / raw)
  To: Erwin Villejo; +Cc: git

Erwin Villejo <erwinvillejo@gmail.com> writes:

> $ git pull
> hint: You have divergent branches and need to specify how to reconcile them.
> ...
> hint: invocation.
> fatal: Need to specify how to reconcile divergent branches.
> ```
>
>> What's different between what you expected and what actually happened?
> I expected no failure and no-op since local is ahead of upstream.
> Instead, `git pull`
> fails because it thinks the branches have diverged.

I think this was fixed at 361cb523 (pull: --ff-only should make it a
noop when already-up-to-date, 2021-10-20); it was broken between Git
2.33 and Git 2.33.1, IIRC.

Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: git pull bug report
       [not found]   ` <CADL96rsnUCXchnrTa1rZ7WgJz2kDA-3TzeOiCy4AXNFdXtTmng@mail.gmail.com>
@ 2021-11-16  1:43     ` Erwin Villejo
  0 siblings, 0 replies; 11+ messages in thread
From: Erwin Villejo @ 2021-11-16  1:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Please check PR: https://github.com/gitgitgadget/git/pull/1078

Thanks.


On Tue, Nov 16, 2021 at 7:23 AM Erwin Villejo <erwinvillejo@gmail.com> wrote:
>
> 361cb523 fixes only the --ff-only case.
>
> It's still broken for unspecified/unset fast-forward flag and config (pull.ff and pull.rebase).
>
> Br, Erwin
>
>
> On Tue, Nov 16, 2021, 3:40 AM Junio C Hamano, <gitster@pobox.com> wrote:
>>
>> Erwin Villejo <erwinvillejo@gmail.com> writes:
>>
>> > $ git pull
>> > hint: You have divergent branches and need to specify how to reconcile them.
>> > ...
>> > hint: invocation.
>> > fatal: Need to specify how to reconcile divergent branches.
>> > ```
>> >
>> >> What's different between what you expected and what actually happened?
>> > I expected no failure and no-op since local is ahead of upstream.
>> > Instead, `git pull`
>> > fails because it thinks the branches have diverged.
>>
>> I think this was fixed at 361cb523 (pull: --ff-only should make it a
>> noop when already-up-to-date, 2021-10-20); it was broken between Git
>> 2.33 and Git 2.33.1, IIRC.
>>
>> Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-11-16  4:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15  8:42 git pull bug report Erwin Villejo
2021-11-15  8:54 ` Bagas Sanjaya
2021-11-15  8:56   ` Erwin Villejo
2021-11-15  9:12     ` Bagas Sanjaya
2021-11-15  9:19       ` Erwin Villejo
2021-11-15  9:39         ` Erwin Villejo
2021-11-15 18:15           ` Bryan Turner
2021-11-15 18:22             ` Erwin Villejo
2021-11-15 17:56 ` Bryan Turner
2021-11-15 20:40 ` Junio C Hamano
     [not found]   ` <CADL96rsnUCXchnrTa1rZ7WgJz2kDA-3TzeOiCy4AXNFdXtTmng@mail.gmail.com>
2021-11-16  1:43     ` Erwin Villejo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.