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

Re: git 2.46.0 crashes when trying to verify-pack outside of a repo

From
Patrick Steinhardt <ps@pks.im>
Date
Sep 2, 2024, 13:47 UTC
Message-ID
<ZtXCBcn6WZIHr65b@tanuki>
In-Reply-To
<ZtW7LtQEobPpVB99@tapette.crustytoothpaste.net>
On Mon, Sep 02, 2024 at 01:18:38PM +0000, brian m. carlson wrote:
Show 11 quoted lines
> On 2024-09-01 at 23:45:43, Patrick Steinhardt wrote:
> > So we basically have three different options:
> > 
> >   - Accept that we just don't handle this case correctly and let the
> >     code error out. This pessimizes all hashes but SHA256.
> > 
> >   - Bail out when outside of a repository when `--object-format=` wasn't
> >     given. This pessimizes all hashes, but gives a clear indicator to
> >     the user why things don't work.
> 
> This is what I would recommend.

I'm also leaning into this direction. I want us to move to a world where SHA1 and SHA256 are equal citizens. We won't ever get folks to move on to SHA256 repositories when it continues to be an afterthought that behaves worse than SHA1 repositories.

That's basically where this whole exercise to stop setting the default hash came from. GitLab nowadays has support for SHA256 repositories, so I want to ensure that it can be used as a drop-in replacement for SHA1 in basically all ways.

Show 5 quoted lines
> >   - Introduce packfiles v3 and encode the object format into the header.
> >     Then do either (1) or (2) on top.
> 
> I think we have pack v3 already (which is the same as v2), and v4 was
> for an experimental format that never landed fully.  Maybe v5?
Ah, fair enough.
Show 9 quoted lines
> If you wanted to do this, you could add support for arbitrary chunks,
> like with multi-pack indexes, that would allow for extensibility in the
> future.  However, you'd also need some protocol capabilities if you
> want to send pack v5 or certain chunks over the protocol.
> 
> > The last option is of course the cleanest, but also the most involved.
> 
> I'd personally recommend just requiring the `--object-format=` option,
> but of course if you want to write pack v5, don't let me stop you.

Well, in the context of this issue I'd definitely aim for the easier fix first. Regardless of whether or not we introduce v5, we'd still have to address the underlying issue for repositories that do not (yet) have v5 packfiles.

Patrick
Previous: brian m. carlsonNext: Junio C Hamano
Message 5 of 7 in “git 2.46.0 crashes when trying to verify-pack outside of a repo”
  1. Ilya KAug 31, 2024
  2. Junio C HamanoSep 1, 2024
  3. Patrick SteinhardtSep 1, 2024
  4. brian m. carlsonSep 2, 2024
  5. Patrick SteinhardtSep 2, 2024
  6. Junio C HamanoSep 3, 2024
  7. builtin/index-pack: fix segfaults when running outside of a repoPatrick Steinhardt, Sep 4, 2024

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.