git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Jiang Xin <worldhello.net@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git List <git@vger.kernel.org>,
	"Daniel C . Klauer" <daniel.c.klauer@web.de>,
	Jiang Xin <zhiyou.jx@alibaba-inc.com>
Subject: Re: [PATCH] pack-redundant: fix crash when one packfile in repo
Date: Wed, 16 Dec 2020 13:46:37 -0500	[thread overview]
Message-ID: <X9pWDRAn7GmJgt7Z@coredump.intra.peff.net> (raw)
In-Reply-To: <20201216100952.16890-1-worldhello.net@gmail.com>

On Wed, Dec 16, 2020 at 05:09:52AM -0500, Jiang Xin wrote:

> Command `git pack-redundant --all` will crash if there is only one
> packfile in the repository.  This is because, if there is only one
> packfile in local_packs, `cmp_local_packs` will do nothing and will
> leave `pl->unique_objects` as uninitialized.

Thanks, that makes sense. And I'm glad I waited to get the opinion of
somebody much more clueful. Mine was a band-aid, but yours is hitting
the root cause and will help any other downstream code that assumes
unique_objects isn't NULL.

>  builtin/pack-redundant.c  |  6 ++++
>  t/t5323-pack-redundant.sh | 65 +++++++++++++++++++++++++++++----------

The new test coverage makes sense, I think, though as Junio noted, it
should be done independent of the $git_pack_redundant change (which will
also make the diff a lot easier to review).

-Peff

  parent reply	other threads:[~2020-12-16 18:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 17:34 bug report: "git pack-redundant --all" crash in minimize() Daniel C. Klauer
2020-12-15 18:21 ` Jeff King
2020-12-15 22:32   ` Junio C Hamano
2020-12-16  9:21   ` Jiang Xin
2020-12-16 10:09     ` [PATCH] pack-redundant: fix crash when one packfile in repo Jiang Xin
2020-12-16 17:32       ` Junio C Hamano
2020-12-17  1:57         ` [PATCH v2] " Jiang Xin
2020-12-17  6:08           ` Junio C Hamano
2020-12-16 18:46       ` Jeff King [this message]
2020-12-16 13:22   ` bug report: "git pack-redundant --all" crash in minimize() Daniel Klauer
2020-12-16 19:00     ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=X9pWDRAn7GmJgt7Z@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=daniel.c.klauer@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=worldhello.net@gmail.com \
    --cc=zhiyou.jx@alibaba-inc.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).