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

Re: [PATCH/RFC 2/3] git-fetch: Split fetch and merge logic

From
SBSanti Béjar <sbejar@gmail.com>
Date
Feb 20, 2007, 11:21 UTC
Message-ID
<8aa486160702200321l35e309eeqe5799dc56be5dac6@mail.gmail.com>
In-Reply-To
<7vfy91684y.fsf@assigned-by-dhcp.cox.net>
On 2/20/07, Junio C Hamano <junkio@cox.net> wrote:
Show 25 quoted lines
> "Santi Béjar" <sbejar@gmail.com> writes:
>
> >> > There are two cases where the behaviour is changed:
> >> >
> >> > 1) branch.*.merge no longer must exactly match the remote part
> >> >    of the branch fetched. Both are expanded in full (as refs/heads/...)
> >> >    and matched afterwards.
> > ...
> >>  I see this as a regression.
> >> If you are setting configuration, wouldn't you rather see the
> >> behaviour consistent even when remote adds new refs?
>
> Maybe I misread your description, but I took it to mean that you
> are allowing:
>
>         branch.master.merge = a
>
> to mean what we traditionally spelled
>
>         branch.master.merge = refs/heads/a
>
> and guessed (I haven't looked for where it happens in the code)
> the way you do that conversion is by tail-matching the ref; if
> the other end creates "refs/heads/b/a", suddenly remote branch
> b/a starts matching that pattern wouldn't it?

No. branch.master.merge = a is equivalent to refs/heads/a and only matches with the remote branch refs/heads/a. It continues to exactly match the two branches, but with the full patch (refs/...). So now it is possible to have:

[remote "origin"] url = ... fetch = refs/heads/*:refs/heads/origin/*

[branch "master"] remote = origin merge = master

or the other way:

[remote "origin"] url = ... fetch = master:refs/heads/origin

[branch "master"] remote = origin merge = refs/heads/master

Show 9 quoted lines
>
> Earlier we fixed the ambiguous use of branch.*.merge in
> 756373da; I think the same reasoning should apply here.
>
> Configuration is something you set once because you want to
> forget about it afterwards (iow, not having to type every time),
> and I think making sure it names things unambiguously outweighs
> one-time convenience of being able to write the configuration in
> a looser fashion.
It is unambiguous.
But if it is problematic I'll try to keep the current behaviour.
Santi
Previous: Junio C HamanoNext: Santi Béjar
Message 6 of 14 in “Split fetch and merge logic”
  1. 0/3 Split fetch and merge logicSanti Béjar, Feb 16, 2007
  2. 2/3 git-fetch: Split fetch and merge logicSanti Béjar, Feb 16, 2007
  3. Junio C HamanoFeb 19, 2007
  4. Santi BéjarFeb 19, 2007
  5. Junio C HamanoFeb 19, 2007
  6. Santi BéjarFeb 20, 2007
  7. 3/3 t/t5515: fixes for the separate fetch and merge logicSanti Béjar, Feb 16, 2007
  8. Junio C HamanoFeb 16, 2007
  9. Santi BéjarFeb 16, 2007
  10. Junio C HamanoFeb 16, 2007
  11. Santi BéjarFeb 16, 2007
  12. Junio C HamanoFeb 16, 2007
  13. Santi BéjarFeb 19, 2007
  14. Santi BéjarFeb 16, 2007

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.