with git-next, git pull --rebase can print out "fatal: No such ref: ''" for branches without an upstream

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

with git-next, git pull --rebase can print out "fatal: No such ref: ''" for branches without an upstream

From: Siddharth Agarwal <hidden>
Date: 2016-06-15 22:59:40

With git-next, where git pull --rebase can print out "fatal: No such 
ref: ''" if git pull --rebase is run on branches without an upstream.

With git at b139ac2589b15d55cd9fa5c6957da44b150d0737, the following 
commands demonstrate the problem:

git init repo1
cd repo1
touch a; git add a; git commit -m "a"
cd ..
git clone repo1 repo2
cd repo2
git config remote.origin.fetch refs/heads/master:refs/remotes/origin/master
git checkout -b test
git pull --rebase

This results in the following output:

fatal: No such ref: ''
Current branch test is up to date.

So the pull --rebase looks like it works, but it prints out a spurious 
fatal error.

I've managed to bisect this down to 
https://github.com/gitster/git/commit/48059e405028ebf8a09c5a9aede89dfb460cce98. 
Looks like get_remote_merge_branch is called without arguments, and it 
returns an empty string. This string is passed as-is to git merge-base, 
which causes the error.

Re: with git-next, git pull --rebase can print out "fatal: No such ref: ''" for branches without an upstream

From: Jeff King <hidden>
Date: 2016-06-15 22:59:41

On Thu, Jan 16, 2014 at 05:08:14PM -0800, Siddharth Agarwal wrote:
With git-next, where git pull --rebase can print out "fatal: No such
ref: ''" if git pull --rebase is run on branches without an upstream.
This is already fixed in bb3f458 (rebase: fix fork-point with zero
arguments, 2014-01-09), I think.

-Peff

Re: with git-next, git pull --rebase can print out "fatal: No such ref: ''" for branches without an upstream

From: Siddharth Agarwal <hidden>
Date: 2016-06-15 22:59:41

On 01/16/2014 06:21 PM, Jeff King wrote:
On Thu, Jan 16, 2014 at 05:08:14PM -0800, Siddharth Agarwal wrote:
quoted
With git-next, where git pull --rebase can print out "fatal: No such
ref: ''" if git pull --rebase is run on branches without an upstream.
This is already fixed in bb3f458 (rebase: fix fork-point with zero
arguments, 2014-01-09), I think.
If I'm reading the patch correctly, that only fixes it for git rebase, 
not for git pull --rebase. git-pull.sh contains a separate invocation of 
git merge-base --fork-point.

Re: with git-next, git pull --rebase can print out "fatal: No such ref: ''" for branches without an upstream

From: John Keeping <hidden>
Date: 2016-06-15 22:59:41

On Thu, Jan 16, 2014 at 06:47:38PM -0800, Siddharth Agarwal wrote:
On 01/16/2014 06:21 PM, Jeff King wrote:
quoted
On Thu, Jan 16, 2014 at 05:08:14PM -0800, Siddharth Agarwal wrote:
quoted
With git-next, where git pull --rebase can print out "fatal: No such
ref: ''" if git pull --rebase is run on branches without an upstream.
This is already fixed in bb3f458 (rebase: fix fork-point with zero
arguments, 2014-01-09), I think.
If I'm reading the patch correctly, that only fixes it for git rebase, 
not for git pull --rebase. git-pull.sh contains a separate invocation of 
git merge-base --fork-point.
I'm pretty sure the invocation in git-pull.sh is OK.  The error then
comes out of git-rebase.sh when git-pull invokes it.

Are you running a version of git-next that includes bb3f458?

Re: with git-next, git pull --rebase can print out "fatal: No such ref: ''" for branches without an upstream

From: Siddharth Agarwal <hidden>
Date: 2016-06-15 22:59:41

On 01/17/2014 12:40 AM, John Keeping wrote:
On Thu, Jan 16, 2014 at 06:47:38PM -0800, Siddharth Agarwal wrote:
quoted
On 01/16/2014 06:21 PM, Jeff King wrote:
quoted
On Thu, Jan 16, 2014 at 05:08:14PM -0800, Siddharth Agarwal wrote:
quoted
With git-next, where git pull --rebase can print out "fatal: No such
ref: ''" if git pull --rebase is run on branches without an upstream.
This is already fixed in bb3f458 (rebase: fix fork-point with zero
arguments, 2014-01-09), I think.
If I'm reading the patch correctly, that only fixes it for git rebase,
not for git pull --rebase. git-pull.sh contains a separate invocation of
git merge-base --fork-point.
I'm pretty sure the invocation in git-pull.sh is OK.  The error then
comes out of git-rebase.sh when git-pull invokes it.
That doesn't square with 48059e4 being the culprit commit.
Are you running a version of git-next that includes bb3f458?
Yes, I am.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help