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

Re: Possible regression in git-rev-list --header

From
Junio C Hamano <junkio@cox.net>
Date
Jan 3, 2007, 10:10 UTC
Message-ID
<7vodpgpgj0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<e5bfff550701030121n700fab25x63278457c884a3f7@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
Show 38 quoted lines
> On 1/1/07, Junio C Hamano <junkio@cox.net> wrote:
>> "Marco Costalba" <mcostalba@gmail.com> writes:
>>
>> > On 12/31/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>> >>
>> >> Further, if you rely on parsing being super-fast, why not just parse
>> >> _only_ the header information that you actually need? The header still
>> >> consists of
>> >>
>> >>         - exactly one "tree",
>> >>         - an arbitrary amount of "parent" lines,
>> >>         - exactly one "author", and
>> >>         - exactly one "committer" line
>> >>
>> >> After that may come optional headers,
>>
>> They are more like 'other' headers.  Nobody said the set of
>> headers are cast in stone forever.  The only things parsers
>> safely can assume are that the original four kinds come at the
>> beginning in the above order, and there is a blank line that
>> separates headers and the body.
>>
>
> I'm cooking the qgit parser fix, please confirm the following
> assumption is correct:
>
> 	When git-rev-list is called with --header option, after the first
> 	line with the commit sha, the following information is produced
> 	
> 	- one line with "tree"
> 	- an arbitrary amount of "parent" lines
> 	- one line with "author"
> 	- one line with "committer"
> 	- zero or more *non blank* lines with other info, as the encoding
> 	- one blank line
> 	- zero or one line with log title
> 	- zero or more lines with log message
> 	- a terminating '\0'

I think that is correct, except that rev-list does not even care the distinction between log title and log message.

I do not think of a reason to change the order of the first four offhand, so while it might be prudent to prepare the code to accept them in any order if it is not too much trouble from purist point of view, I do not think it is necessary in practice and you should be able to depend on the order in which they appear. I do not think it would hurt anybody if we right now declared that other extra headers people have talked about (such as "notes") should always come after the first four.

Previous: Marco CostalbaNext: Lars Hjemli
Message 17 of 26 in “Possible regression in git-rev-list --header”
  1. Marco CostalbaDec 30, 2006
  2. Jakub NarebskiDec 30, 2006
  3. Johannes SchindelinDec 30, 2006
  4. Junio C HamanoDec 30, 2006
  5. Junio C HamanoDec 30, 2006
  6. Johannes SchindelinDec 31, 2006
  7. Junio C HamanoDec 31, 2006
  8. Marco CostalbaDec 31, 2006
  9. Johannes SchindelinDec 31, 2006
  10. Marco CostalbaDec 31, 2006
  11. Junio C HamanoJan 1, 2007
  12. Johannes SchindelinJan 2, 2007
  13. Junio C HamanoJan 2, 2007
  14. Johannes SchindelinJan 2, 2007
  15. Marco CostalbaJan 2, 2007
  16. Marco CostalbaJan 3, 2007
  17. Junio C HamanoJan 3, 2007
  18. Lars HjemliJan 3, 2007
  19. Marco CostalbaJan 3, 2007
  20. Lars HjemliJan 3, 2007
  21. Andreas EricssonJan 4, 2007
  22. Andreas EricssonJan 4, 2007
  23. Lars HjemliJan 3, 2007
  24. Johannes SchindelinDec 31, 2006
  25. Move commit reencoding parameter parsing to revision.cJunio C Hamano, Dec 30, 2006
  26. Johannes SchindelinDec 31, 2006

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.