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, 06:21 UTC
Message-ID
<76718490902162221i31e02052j48c9f620a2d47985@mail.gmail.com>
In-Reply-To
<7veixxaale.fsf@gitster.siamese.dyndns.org>
On Tue, Feb 17, 2009 at 12:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
> [... explanation of how git pull and git fetch communicate via FETCH_HEAD...]

I'm aware of all that, and I apologize for not making that clear, since I made you do lots of extra typing. :-(

Show 13 quoted lines
> Having said that, being able to directly use FETCH_HEAD as an extended
> SHA-1 is often useful when somebody asks an integrator to pull one-shot
> with git-request-pull.  Upon receiving such a request, the integrator can
> say:
>
>        $ git fetch git://repo.or.cz/his.git for-linus
>        $ git log -p ..FETCH_HEAD ;# to inspect
>        $ git merge FETCH_HEAD
>
> to take advantage of the fact that the commit object name that appears at
> the beginning of resulting FETCH_HEAD file is actually the commit we would
> want, because by definition FETCH_HEAD records only one commit when we are
> fetching only one branch.

That makes sense, but I was confused why git merge goes through the trouble of stripping out the not-for-merge tag which in the above use case wouldn't be there.

j.
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 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.