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

Re: Syncing HEAD

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 17, 2018, 16:28 UTC
Message-ID
<xmqq6009c5ys.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180814214723.GA667@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> So all of this really implies to me that you want to be able to say
> "take this symref on the other side and update this one on the local
> side". I.e., some way to tell a refspec "don't update the value, update
> the symref destination". ...
> ...
>   git fetch origin ~HEAD:refs/remotes/origin/HEAD
We need to be a bit careful here.

You can define the meaning of the above sanely if you know that refmap refs/heads/*:refs/remotes/origin/* is in effect for the remote to read "My HEAD points at refs/heads/frotz" and interpret it as "In order to match, I need to make my refs/remotes/origin/HEAD to point at refs/remotes/origin/frotz".

Also, what should the above form of "git fetch" write in FETCH_HEAD? Should "git pull origin ~HEAD:refs/remotes/origin/HEAD" run the fetch and then merge it (which may have value of refs/remotes/origin/frotz) to the current branch? Should the underlying fetch be also fetching the frotz branch from them at the same time, or do we attempt to merge a possibly stale 'frotz' (which might not even have been there, the last time we fetched from them)?

Previous: Jeff KingNext: Jeff King
Message 8 of 10 in “Syncing HEAD”
  1. Christian CouderAug 14, 2018
  2. Stefan BellerAug 14, 2018
  3. Brandon WilliamsAug 14, 2018
  4. Jeff KingAug 14, 2018
  5. Jeff KingAug 14, 2018
  6. Christian CouderAug 15, 2018
  7. Jeff KingAug 17, 2018
  8. Junio C HamanoAug 17, 2018
  9. Jeff KingAug 17, 2018
  10. Ævar Arnfjörð BjarmasonAug 14, 2018

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.