git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Bug] branch.*.merge interpreted too strictly by tracking logic

From
Jeff King <peff@peff.net>
Date
Feb 5, 2014, 20:50 UTC
Message-ID
<20140205205030.GA16394@sigill.intra.peff.net>
In-Reply-To
<xmqqa9e67atv.fsf@gitster.dls.corp.google.com>
On Tue, Feb 04, 2014 at 02:49:16PM -0800, Junio C Hamano wrote:
Show 11 quoted lines
> Let's tell these branches that they are both supposed to be building
> on top of 'master'.
> 
>     : gitster track/master; git config branch.foo.remote .
>     : gitster track/master; git config branch.foo.merge refs/heads/master
>     : gitster track/master; git config branch.bar.remote .
>     : gitster track/master; git config branch.bar.merge master
> 
> The difference between the two is that 'foo' spells the @{upstream}
> branch in full (which is the recommended practice), while 'bar' is
> loose and asks for 'master'.
Is it legal to put an unqualified ref there? A wise man once said[1]:
  > 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.
  It wasn't.  Some places may accept them gracefully by either being
  extra nice or by accident.

I don't recall us ever doing anything after that. I don't have a problem with making it work, of course, but I am not sure if it is really a bug.

-Peff
[1] http://thread.gmane.org/gmane.comp.version-control.git/121671
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 6 in “[Bug] branch.*.merge interpreted too strictly by tracking logic”
  1. Junio C HamanoFeb 4, 2014
  2. Jeff KingFeb 5, 2014
  3. Junio C HamanoFeb 5, 2014
  4. Jeff KingFeb 5, 2014
  5. Junio C HamanoFeb 5, 2014
  6. checkout: report upstream correctly even with loosely defined branch.*.mergeJunio C Hamano, Oct 14, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.