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

Re: FETCH_HEAD format is undocumented

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 16, 2020, 19:03 UTC
Message-ID
<xmqq7dql9l9w.fsf@gitster.c.googlers.com>
In-Reply-To
<218FCFFA-1F4F-42DE-B32D-D7C731813206@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
Show 8 quoted lines
> While trying to use `git fmt-merge-msg`, I figured it only accepts
> inputs in the format used in the 'FETCH_HEAD' file.
>
> I then tried to find a description of the format of this file in the documentation, 
> but could not find any. For example, 'git grep not-for-merge' in /Documentation
> returns a single hit, in the release notes for Git 2.5.0.
>
> I think it could be good if we documented the FETCH_HEAD format.

Not just the format of FETCH_HEAD file, but the whole usage of fmt-merge-msg is meant as a mere implementation detail of the one-way communication from "git fetch" to "git merge". I'd rather leave it opaque so that we can update the format as needed. For one thing it is impossible to do i18n with the current format, I think, which some folks may eventually want to change.

I am OK with documenting it somewhere in Documentation/technical/ with a warning written in big red letters that it is subject to change, to clearly mark that the format of the file should not be relied upon and the only useful thing you could do is to rely on the fact that its first 40-byte gives one object name (so you could say "git log ...FETCH_HEAD" for example) and to feed it to "git merge".

Previous: Philippe Blain
Message 2 of 2 in “FETCH_HEAD format is undocumented”
  1. Philippe BlainNov 16, 2020
  2. Junio C HamanoNov 16, 2020

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.