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

Re: FETCH_HEAD question

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 17, 2009, 07:41 UTC
Message-ID
<76718490902162341y2f122427i470c77d3915ff554@mail.gmail.com>
In-Reply-To
<7vr61x8ra4.fsf@gitster.siamese.dyndns.org>
On Tue, Feb 17, 2009 at 2:18 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> Because it is designed to handle a lot more general case of fetching all
> remote branches into your remote tracking branches with wildcard refspecs,
> and most of the entries need to be marked with not-for-merge marker.  If
> you left only the for-merge branches, you would not have any sane way to
> learn what refs were fetched after you said "git fetch" (and no, looking
> at timestamp of files in .git/refs/remotes/origin/ is not a sensible
> answer).
We are talking past each other.

I understand the not-for-merge marker, why git fetch puts it there, and how it is used by git pull.

I was asking why "git merge FETCH_HEAD" is useful, and you gave an example of fetching a *single* branch using "git fetch <url> <branch>". But in that case, as you said, git fetch does *not* leave a "not-for-merge" marker, since only one branch was fetched.

So then, why does "git merge FETCH_HEAD" bother to strip out a not-for-merge marker that wouldn't be there?

I can only guess there is a use case where one fetches multiple branches and then uses "git merge FETCH_HEAD".

j.
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 15 in “FETCH_HEAD question”
  1. Jay SoffianFeb 17, 2009
  2. Jay SoffianFeb 17, 2009
  3. Junio C HamanoFeb 17, 2009
  4. Jay SoffianFeb 17, 2009
  5. Junio C HamanoFeb 17, 2009
  6. Jay SoffianFeb 17, 2009
  7. Junio C HamanoFeb 17, 2009
  8. Jay SoffianFeb 17, 2009
  9. Johannes SchindelinFeb 17, 2009
  10. Jay SoffianFeb 17, 2009
  11. PUSH_HEAD, was Re: FETCH_HEAD questionJohannes Schindelin, Feb 17, 2009
  12. Junio C HamanoFeb 17, 2009
  13. Jay SoffianFeb 18, 2009
  14. Johannes SchindelinFeb 18, 2009
  15. Sitaram ChamartyFeb 17, 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.