All of lore.kernel.org
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: Re: git bundle verify segfaults
Date: Fri, 24 May 2019 20:49:22 +0200	[thread overview]
Message-ID: <20190524184922.GJ951@szeder.dev> (raw)
In-Reply-To: <20190524174835.GA2068@chatter.i7.local>

On Fri, May 24, 2019 at 01:48:35PM -0400, Konstantin Ryabitsev wrote:
> I seem to be getting a segfault trying to verify bundles created from
> linux.git. It's easy to reproduce:
> 
> $ cd linux
> $ git show-ref master
> c50bbf615f2f0028ad1771506ef8807130ccc2ce refs/heads/master
> $ git bundle create /tmp/linux.bundle master
> Enumerating objects: 6705678, done.
> Counting objects: 100% (6705678/6705678), done.
> Delta compression using up to 8 threads
> Compressing objects: 100% (1037089/1037089), done.
> Writing objects: 100% (6705678/6705678), 1.19 GiB | 97.81 MiB/s, done.
> Total 6705678 (delta 5657955), reused 6664576 (delta 5622679)
> $ cd /tmp
> $ git bundle verify linux.bundle
> BUG: refs.c:1750: attempting to get main_ref_store outside of repository
> Aborted (core dumped)

'git bundle verify' needs a repository to check "that the prerequisite
commits exist and are fully linked in the current repository" (quoting
its manpage).  I presume your '/tmp' is not a git repository, so Git
complains, though it definitely shouldn't just BUG(), but rather say
"fatal: not a git repository (or any of the parent directories): .git"
instead.

However, if the bundle is self-contained (like the one you created
above), then there are no prerequisite commits to check, and a
repository is not strictly necessary to verify the bundle's integrity,
so 'git bundle verify' could actually get the job done even outside of
a repository.  And it used to work until commit b1ef400eec
(setup_git_env: avoid blind fall-back to ".git", 2016-10-20), so I add
Peff to Cc...



      reply	other threads:[~2019-05-24 18:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24 17:48 git bundle verify segfaults Konstantin Ryabitsev
2019-05-24 18:49 ` SZEDER Gábor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190524184922.GJ951@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.