From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] pack-objects: turn off bitmaps when we see --shallow lines
Date: Wed, 13 Aug 2014 01:09:36 -0400 [thread overview]
Message-ID: <20140813050935.GA21559@peff.net> (raw)
In-Reply-To: <CACsJy8AQ4vC4QKR_y62h_Gjd619QfBg-rDB2F6HFj2fvJj41tg@mail.gmail.com>
On Tue, Aug 12, 2014 at 10:13:03PM +0700, Duy Nguyen wrote:
> On Tue, Aug 12, 2014 at 11:34 AM, Jeff King <peff@peff.net> wrote:
> > Arguably is_repository_shallow should return 1 if anybody has registered
> > a shallow graft, but that wouldn't be enough to fix this (we'd still
> > need to check it again _after_ reading the --shallow lines). So I think
> > this fix is fine here. I don't know if any other parts of the code would
> > care, though.
>
> It's getting too subtle (is_repository_shallow fails to return 1).
> register_shallow() is used elsewhere too, luckily pack bitmap's use is
> still limited in pack-objects (I think).
It is, though I have some patches in the works to use it in more places.
I was tempted to make a check in prepare_bitmap_walk() to just return -1
(the same as if there are no bitmaps at all) if any commit grafts are in
use. That would also catch new callers. But the graft (and replace)
rules are not always the same. We should not respect those features when
packing or pruning (though I think pruning _does_ currently respect
grafts, which seems like an accident waiting to happen).
I think this is a good minimal fix for now, but I'll revisit the
replace/graft/shallow issues when I add more bitmap users outside of
pack-objects.
> I prefer (in future) to teach is_repository_shallow about
> register_shallow and move it to right before
> get_object_list_from_bitmap() is called, and some sort of mechanism to
> say "hey I'm all set, never change shallow repo status again from now
> on, or just die if you have to do it" to protect us from similar bugs.
> But for now your fix is good (and simple).
Yeah, that sounds like a good direction for the shallow part of it.
-Peff
prev parent reply other threads:[~2014-08-13 5:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-12 4:34 [PATCH] pack-objects: turn off bitmaps when we see --shallow lines Jeff King
2014-08-12 15:13 ` Duy Nguyen
2014-08-13 5:09 ` Jeff King [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=20140813050935.GA21559@peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.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.
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 NNTP newsgroup(s).