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

Re: [RFC/PATCH 1/2] remote tracking: return the tracking branch for the given branches

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 18, 2009, 19:19 UTC
Message-ID
<7v63etnydr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<adf1fd3d0906181201r5f3b2f55t8427e7be5ba07e9a@mail.gmail.com>
Santi Béjar <santi@agolina.net> writes:
Show 6 quoted lines
> One thing it just occurred to me is to return the explicit refspec
> instead of the tracking branch. So with the default config (after a
> clone):
>
> $ git remote tracking origin refs/heads/master
> refs/heads/master:refs/remotes/origin/master

I think the output is sensible, instead of saying something like 'origin/master'.

We can and should allow the end users to use abbreviated form as input to us (either command line or configuration value) when it is unambiguous, but when returning values for use by Porcelains, we should be strict and precise to avoid ambiguities.

Show 9 quoted lines
> this makes a difference in case we want to allow returning all the
> matching tracking branch and not the first one with more than one
> branch, as:
>
> $ git config remote.origin.fetch --add +refs/heads/*:refs/remote/another/*
>
> $ git remote tracking origin refs/heads/master
> refs/heads/master:refs/remotes/origin/master
> refs/heads/next:refs/remotes/origin/next

I am not sure what this example is doing. You asked about refs/heads/master but you also talk about refs/heads/next? I guess you meant to say

    $ git remote tracking origin refs/heads/master
    refs/heads/master:refs/remotes/origin/master
    refs/heads/master:refs/remotes/another/master
instead, judging from the next example?
Show 5 quoted lines
> $ git remote tracking origin refs/heads/master refs/heads/next
> refs/heads/master:refs/remotes/origin/master
> refs/heads/master:refs/remotes/another/master
> refs/heads/next:refs/remotes/origin/next
> refs/heads/next:refs/remotes/another/next
Previous: Santi BéjarNext: Santi Béjar
Message 12 of 19 in “Support for arbitrary mapping for "git pull --rebase"”
  1. 0/2 Support for arbitrary mapping for "git pull --rebase"Santi Béjar, Jun 18, 2009
  2. 1/2 remote tracking: return the tracking branch for the given branchesSanti Béjar, Jun 18, 2009
  3. Paolo BonziniJun 18, 2009
  4. Santi BéjarJun 18, 2009
  5. Johannes SchindelinJun 18, 2009
  6. Santi BéjarJun 18, 2009
  7. Jakub NarebskiJun 18, 2009
  8. Santi BéjarJun 18, 2009
  9. Jakub NarebskiJun 18, 2009
  10. Santi BéjarJun 18, 2009
  11. Santi BéjarJun 18, 2009
  12. Junio C HamanoJun 18, 2009
  13. Santi BéjarJun 18, 2009
  14. Santi BéjarJun 18, 2009
  15. 2/2 get_remote_merge_branch: Support for arbitrary mappingSanti Béjar, Jun 18, 2009
  16. Santi BéjarJun 18, 2009
  17. Johannes SchindelinJun 18, 2009
  18. Santi BéjarJun 18, 2009
  19. Santi BéjarJun 19, 2009

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.