git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] git show <remote>: bad information: Local branch|ref configured
@ 2010-11-13  0:41 Seth Robertson
  2010-11-13  1:09 ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: Seth Robertson @ 2010-11-13  0:41 UTC (permalink / raw
  To: git


Over in #git we ran into a user wondering why a particular remote said
something about "master pushes to master" when the local branch mapped
to that remote was not named master.

Not having inspected the code, it certainly appears as if the "Local
branch configured" and "Local ref configured" information is only
accidentally correct, but since the normal configuration is the case
in which it is accurate, no-one noticed the problem.

In the test case below, in the "bar" case we are missing the "Local
ref configured for 'git push'" section entirely.  Strange since git push
does indeed work.

In the "baz" case we see the message and master does push to master.

In the "biff" case we see the confluence of the two previous cases.
The "foo" remote/subcase shows what we might expect, but the "baz"
remote/subcase shows the 'Local ref configured' information is a lie.
Finally, the "bar" remote/subcase shows that even the "Local branch
configured" information is somehow magic based on the remote branch
being named master.

This test was done using git 1.7.3.1

Test case prep
----------------------------------------------------------------------
mkdir foo; cd foo; git init; echo A>A; git add A; git commit -m A;
git checkout -b other; echo B>B; git add B; git commit -m B;
git checkout master

mkdir ../bar; cd ../bar; git init; git remote add foo ../foo;
git fetch foo; git checkout --track -b foo_master foo/other

mkdir ../baz; cd ../baz; git init; git remote add foo ../foo;
git fetch foo; git checkout --track -b master foo/master

mkdir ../biff; cd ../biff; git init; git remote add foo ../foo;
git fetch foo; git checkout --track -b master foo/master;
git remote add baz ../baz; git fetch baz;
git checkout --track -b baz_master baz/master
git remote add bar ../bar; git fetch bar;
git checkout --track -b bar_master bar/master
----------------------------------------------------------------------

cd ../bar; git remote show foo
 --------------------------------------------------
 * remote foo
   Fetch URL: ../foo
   Push  URL: ../foo
   HEAD branch: master
   Remote branches:
     master tracked
     other  tracked
   Local branch configured for 'git pull':
     foo_master merges with remote other
 --------------------------------------------------

cd ../baz; git remote show foo
 --------------------------------------------------
 * remote foo
   Fetch URL: ../foo
   Push  URL: ../foo
   HEAD branch: master
   Remote branches:
     master tracked
     other  tracked
   Local branch configured for 'git pull':
     master merges with remote master
   Local ref configured for 'git push':
     master pushes to master (up to date)
 --------------------------------------------------

cd ../biff; git remote show foo; git remote show baz; git remote show bar
 --------------------------------------------------
 * remote foo
   Fetch URL: ../foo
   Push  URL: ../foo
   HEAD branch: master
   Remote branches:
     master tracked
     other  tracked
   Local branch configured for 'git pull':
     master merges with remote master
   Local ref configured for 'git push':
     master pushes to master (up to date)
 * remote baz
   Fetch URL: ../baz
   Push  URL: ../baz
   HEAD branch: master
   Remote branch:
     master tracked
   Local branch configured for 'git pull':
     baz_master merges with remote master
   Local ref configured for 'git push':
     master pushes to master (up to date)
 * remote bar
   Fetch URL: ../bar
   Push  URL: ../bar
   HEAD branch: foo_master
   Remote branch:
     foo_master tracked
 --------------------------------------------------

					-Seth Robertson

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

end of thread, other threads:[~2010-11-13  4:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-13  0:41 [BUG] git show <remote>: bad information: Local branch|ref configured Seth Robertson
2010-11-13  1:09 ` Jonathan Nieder
2010-11-13  1:44   ` [BUG] git show <remote>: bad information: Local ref configured if push.default=tracking Seth Robertson
2010-11-13  4:46     ` Jonathan Nieder

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).