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

Re: Possible regression in ref advertisement

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 25, 2013, 21:16 UTC
Message-ID
<7vfw0kt7qc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1361824519.31692.12.camel@centaur.cmartin.tk>
Carlos Martín Nieto <cmn@elego.de> writes:
Show 5 quoted lines
>> As packed-refs file is expected to be a text file, it is not
>> surprising to get an undefined result if the it ends with an
>> incomplete line.
>
> I guess that depends on what you mean by incomplete.
I used that word in the POSIX sense, i.e.
  http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap03.html#tag_21_03_00_67

Unless the user edited the file, an incomplete line may indicate that the file has been truncated when (or after) it was written, and we have to suspect not just that the last "line" may have been truncated (in this case, not having the full 40-hex object name), but other records that should have been after that line were lost.

We may want to detect such corruption at runtime, at least at strategic places; making it a hard runtime error will make it difficult to use Git itself to recover from such an corruption (e.g. you may have a healty mirror from which you can recover refs with "fetch --mirror").

We should at least refrain from running repack/gc to make things worse, for example.

Previous: Carlos Martín NietoNext: Carlos Martín Nieto
Message 8 of 10 in “Possible regression in ref advertisement”
  1. Carlos Martín NietoFeb 25, 2013
  2. Junio C HamanoFeb 25, 2013
  3. Carlos Martín NietoFeb 25, 2013
  4. Junio C HamanoFeb 25, 2013
  5. Carlos Martín NietoFeb 25, 2013
  6. Junio C HamanoFeb 25, 2013
  7. Carlos Martín NietoFeb 25, 2013
  8. Junio C HamanoFeb 25, 2013
  9. Carlos Martín NietoFeb 26, 2013
  10. Junio C HamanoFeb 26, 2013

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.