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

Re: [PATCH 1/2] builtin/bundle: have unbundle check for repo before opening its bundle

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 13, 2024, 09:21 UTC
Message-ID
<CAPig+cQiNfD-8ByukhWgSQRBuDWgyQC_zxBF3Dhr0--m1hUFZg@mail.gmail.com>
In-Reply-To
<c57e1cca4c7d2a0f52ae8d4e0870e4e0667184fe.1723540604.git.ps@pks.im>
On Tue, Aug 13, 2024 at 5:18 AM Patrick Steinhardt <ps@pks.im> wrote:
> The `git bundle unbundle` subcommand requires a repository to unbundle
> the contents into. As thus, the subcommand checks whether we have a
> startup repository in the first place, and if not it dies.
Perhaps you meant: s/As thus/As such/
Show 8 quoted lines
> This check happens after we have already opened the bundle though. This
> causes a segfault when running outside of a repository starting with
> c8aed5e8da (repository: stop setting SHA1 as the default object hash,
> 2024-05-07) because we have no hash function set up, but we do try to
> parse refs advertised by the bundle's header.
>
> The next commit will fix that underlying issue by defaulting to the SHA1
> object format for bundles, which will also the described segfault here.
Presumably: s/also the/also fix the/
Show 7 quoted lines
> But as we know that we will die anyway, we can do better than that and
> avoid some vain work by moving the check for a repository before we try
> to open the bundle.
>
> Reported-by: ArcticLampyrid <ArcticLampyrid@outlook.com>
> Suggested-by: Jeff King <peff@peff.net>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 7 of 10 in “SIGSEGV Error Occurs When Attempting to Unbundle Without Initializing Git Repository.”
  1. ArcticLampyridAug 12, 2024
  2. Jeff KingAug 12, 2024
  3. Junio C HamanoAug 12, 2024
  4. brian m. carlsonAug 12, 2024
  5. 0/2 bundle: fix handling of object formatPatrick Steinhardt, Aug 13, 2024
  6. 1/2 builtin/bundle: have unbundle check for repo before opening its bundlePatrick Steinhardt, Aug 13, 2024
  7. Eric SunshineAug 13, 2024
  8. 2/2 bundle: default to SHA1 when reading bundle headersPatrick Steinhardt, Aug 13, 2024
  9. Jeff KingAug 13, 2024
  10. Junio C HamanoAug 13, 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.