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

Re: [RFC 0/1] Tolerate broken headers in `packed-refs` files

From
Derrick Stolee <stolee@gmail.com>
Date
Mar 26, 2018, 13:08 UTC
Message-ID
<f8d0f3b6-69b3-ba42-c39c-551814caf335@gmail.com>
In-Reply-To
<cover.1522062649.git.mhagger@alum.mit.edu>
On 3/26/2018 8:42 AM, Michael Haggerty wrote:
Show 17 quoted lines
> [...]
>
> But there might be some tools out in the wild that have been writing
> broken headers. In that case, users who upgrade Git might suddenly
> find that they can't read repositories that they could read before. In
> fact, a tool that we wrote and use internally at GitHub was doing
> exactly that, which is how we discovered this "problem".
>
> This patch shows what it would look like to relax the parsing again,
> albeit *only* for the first line of the file, and *only* for lines
> that start with '#'.
>
> The problem with this patch is that it would make it harder for people
> who implement broken tools in the future to discover their mistakes.
> The only result of the error would be that it is slower to work with
> the `packed-refs` files that they wrote. Such an error could go
> undiscovered for a long time.

My opinion is that we shouldn't maintain back-compat with formats that may have been written by another tool because Git wasn't strict about it. As long as Git never wrote files with these formats, then they shouldn't be supported.

You are absolutely right that staying strict will help discover the tools that are writing an incorrect format.

Since most heavily-used tools that didn't spawn Git processes use LibGit2 to interact with Git repos, I added Ed Thomson to CC to see if libgit2 could ever write these bad header comments.

Thanks for writing this RFC so we can have the discussion and more quickly identify this issue if/when users are broken.

Thanks, -Stolee

Previous: Michael HaggertyNext: Jeff King
Message 3 of 5 in “[RFC 0/1] Tolerate broken headers in `packed-refs` files”
  1. Michael HaggertyMar 26, 2018
  2. 1/1 packed-backend: ignore broken headersMichael Haggerty, Mar 26, 2018
  3. Derrick StoleeMar 26, 2018
  4. Jeff KingMar 26, 2018
  5. Edward ThomsonMar 26, 2018

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.