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

Re: [PATCH/RFC v2] Document format of basic Git objects

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Feb 20, 2012, 13:55 UTC
Message-ID
<CACsJy8CEeZPf55idLB9NE-rf--ySmZh_9gkMc_zo0VmiVftMUg@mail.gmail.com>
In-Reply-To
<7vlinzp67m.fsf@alter.siamese.dyndns.org>
2012/2/19 Junio C Hamano <gitster@pobox.com>:
>>  - Do we assume tag/commit header in utf-8 or ascii?
>
> Author-ident is typically utf-8 already, so you cannot assume "ASCII".

I wonder if anyone puts non utf-8 strings in there, or could we enforce utf-8 (i.e. validate and reject non utf-8 strings) and accept encoded word syntax (rfc 2047) with the help of the new $GIT_IDENT_ENCODING variable. The "accept ..." part can wait until someone is hit by "utf-8 only" check and steps up.

By the same reasoning, maybe we should declare tag content is utf-8 only, until someone needs and adds "encoding" support for it.

>> +The filename may be an arbitrary nonempty string of bytes, as long as
>> +it contains no '/' or NUL character.
>
> s/, as long as it contains no/; it cannot contain any/

Pathname also cannot be "." nor "..", I suppose. Since we also support Windows, should '\\' be banned too? ... probably not worth it.

>> +The header must not contain NUL.
>
> I vaguely recall that you made sure neither the header nor the body
> contains NUL.

One of the purposes of this document is to note all constraints and limitations (another one is a reference for users who want to dig deep in git data structure without looking at the code). The problem with handling NUL probably only exists in C Git (and maybe libgit2). I'll turn that to "should not contain NUL".

-- 
Duy
Previous: Junio C HamanoNext: Jeff King
Message 8 of 17 in “Document format of basic Git objects”
  1. Document format of basic Git objectsNguyễn Thái Ngọc Duy, Feb 15, 2012
  2. Jonathan NiederFeb 15, 2012
  3. Junio C HamanoFeb 15, 2012
  4. Junio C HamanoFeb 16, 2012
  5. Document format of basic Git objectsNguyễn Thái Ngọc Duy, Feb 19, 2012
  6. Junio C HamanoFeb 19, 2012
  7. Junio C HamanoFeb 19, 2012
  8. Nguyen Thai Ngoc DuyFeb 20, 2012
  9. Jeff KingFeb 20, 2012
  10. Manually decoding a git objectPhilip Oakley, Feb 19, 2012
  11. 徐迪Feb 20, 2012
  12. Philip OakleyFeb 20, 2012
  13. Thomas RastFeb 20, 2012
  14. Philip OakleyFeb 20, 2012
  15. Thomas RastFeb 20, 2012
  16. 徐迪Feb 20, 2012
  17. Philip OakleyFeb 20, 2012

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.