Re: [BUG] git show <remote>: bad information: Local ref configured if push.default=tracking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In message <20101113010934.GA4017@burratino>, Jonathan Nieder writes:

    On Fri, Nov 12, 2010 at 07:41:39PM -0500, Seth Robertson wrote:

    > 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.

    However, if you want the push-to-where-you-pull-from behavior,
    just add
	    [push]
		    default = tracking
    to your ~/.gitconfig.

I already had this turned on in my ~/.gitconfig.  However, you bring
up a good point, the output as shown would be correct if the default
"matching" value was used.  Thus I guess the bug summary needs to be:

git show <remote> produces inaccurate information about "Local ref
configured" if git-config's push.default==tracking

    For your test example: rather than sample output, could you describe
    next to each command what you expect to happen and how that differs
    from what happens instead?  This would make it easier to find the
    lurking bugs.

In my example, I set up each remote identically and only varied the
name of the branch.  In all cases, you could push and pull changes
using `git pull` and `git push`, meaning that they were properly
configured tracking branches.  Thus, I argue that they should produce
information for "Local ref configured" in each case, and furthermore
that the named refs should be appropriate for the mapping in question.

I'll annotate the output below with my desired behavior.  Search for
"^**" in the output below.

In other news, the last argument of the last command of the Test case
prep should have been bar/foo_master instead of bar/master.  This
affects the "git remote show bar" subcase output, showing that the
"Local branch configured" information is correct.  The "Local ref
configured" information remains incorrect/obscure.  I updated the test
case to include the push.default=tracking configuration.

					-Seth Robertson


----------------------------------------------------------------------
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; git config push.default tracking

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

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

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/foo_master
git config push.default tracking
----------------------------------------------------------------------

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
 --------------------------------------------------
** DESIRED ADDITION **
 --------------------------------------------------
   Local ref configured for 'git push':
     foo_master pushes to other (up to date)
 --------------------------------------------------

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)
 --------------------------------------------------
** OUTPUT CORRECT **

cd ../biff; 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)
 --------------------------------------------------
** OUTPUT CORRECT **

cd ../biff; git remote show baz
 --------------------------------------------------
 * 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)
 --------------------------------------------------
** CORRECTED LAST TWO LINES **
 --------------------------------------------------
   Local ref configured for 'git push':
     baz_master pushes to master (up to date)
 --------------------------------------------------

cd ../biff; git remote show bar
 --------------------------------------------------
 * remote bar
   Fetch URL: ../bar
   Push  URL: ../bar
   HEAD branch: foo_master
   Remote branch:
     foo_master tracked
   Local branch configured for 'git pull':
     bar_master merges with remote foo_master
 --------------------------------------------------
** DESIRED ADDITION **
 --------------------------------------------------
   Local ref configured for 'git push':
     bar_master pushes to foo_master (up to date)
 --------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]