git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Santi Béjar" <santi@agolina.net>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: branch.<branch>.merge and --format='%(upstream)'
Date: Tue, 16 Jun 2009 16:07:50 +0200	[thread overview]
Message-ID: <adf1fd3d0906160707m713d9fe0l966d14c0e0af9127@mail.gmail.com> (raw)
In-Reply-To: <20090616122312.GB5227@coredump.intra.peff.net>

2009/6/16 Jeff King <peff@peff.net>:
> On Tue, Jun 16, 2009 at 01:08:02PM +0200, Santi Béjar wrote:
>
>>   I've noticed that having branch.<branch>.merge set with the branch
>> name, and not with the full ref, cause problems with
>> --format='%(upstream)'  and also with the "branch -av" and "git
>> status" upstream branch outputs. But git-fetch and git-pull works ok,
>> so it is a valid setting.
>
> Actually, it is broken in a lot of places. for-each-ref relies on the
> same code as "git status", "git checkout", etc, which will all fail to
> display tracking info. I believe the same code is also used for updating
> tracking branches on push. So I'm not sure if it was ever intended to be
> a valid setting.
>
> Fixing it would involve tweaks to remote_find_tracking, I think, but I
> haven't looked into it too closely.

It should be interpreted as "git pull branchname" does, or at least as
close as possible.

Another non-working example is with:

remote.origin.fetch=+master:refs/remotes/origin/master
branch.master.merge=refs/heads/master

so it looks like that both have to match for remote_find_tracking to
work (and in this case "git fetch" also works ok).

I suppose that remote_find_tracking should DWIM: build the full ref
prepending refs/ and heads/, as necessary.

>
> I'm not sure of the impliciations of allowing non-qualified refs in that
> config.

They are currently allowed (fetch/pull) since a long time, and it is
not only this config, but also remote.<remote>.fetch (see above).

In b888d61 (Make fetch a builtin, 2007-09-10):

commit b888d61c8308027433df9c243fa551f42db1c76a
Author: Daniel Barkalow <barkalow@iabervon.org>
Date:   Tue Sep 11 05:03:25 2007

[...]

    This changes a few small bits of behavior:

    branch.<name>.merge is parsed as if it were the lhs of a fetch
    refspec, and does not have to exactly match the actual lhs of a
    refspec, so long as it is a valid abbreviation for the same ref.

[...]


> Will we detect and warn about ambiguities? Does it actually work
> with non-branches?

With tags yes, but full qualified.

Santi

  reply	other threads:[~2009-06-16 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 11:08 branch.<branch>.merge and --format='%(upstream)' Santi Béjar
2009-06-16 12:23 ` Jeff King
2009-06-16 14:07   ` Santi Béjar [this message]
2009-06-16 15:46   ` Junio C Hamano
2009-06-16 22:34     ` Santi Béjar
  -- strict thread matches above, loose matches on Subject: below --
2009-06-18  7:57 [RFC/PATCH 0/2] Support for arbitrary mapping for "git pull --rebase" Santi Béjar
2009-06-18  7:57 ` branch.<branch>.merge and --format='%(upstream)' Santi Béjar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adf1fd3d0906160707m713d9fe0l966d14c0e0af9127@mail.gmail.com \
    --to=santi@agolina.net \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).