From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 5/5] sha1_file: don't re-scan pack directory for null sha1
Date: Wed, 22 Nov 2017 10:49:25 +0900 [thread overview]
Message-ID: <xmqqr2srxeu2.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20171121231739.GB21197@sigill> (Jeff King's message of "Tue, 21 Nov 2017 18:17:39 -0500")
Jeff King <peff@peff.net> writes:
> Here's a re-roll of patch 5 that behaves this way (the patch should be
> unsurprising, but I've updated the commit message to match).
>
> I did notice one other thing: the function looks up replace objects, so
> we have both the original and the replaced sha1 available. My earlier
> patch used the original sha1, but this one uses the replaced value.
> I'm not sure if that's sane or not. It lets the fast-path kick in if you
> point a replace ref at 0{40}. And it lets you point refs/replace/0{40}
> to something else. I doubt that's useful, but it could perhaps be for
> debugging, etc.
>
> In most cases, of course, it wouldn't matter (since pointing to or from
> the null sha1 is vaguely crazy in the first place).
I tend to agree that those who go crazy/fancy with replace mechanism
can keep both halves when it breaks.
WRT existing codepaths that pass 0{40} and refuses to notice a
potential repository corruption (from getting a NULL for a non null
object name), I think we would need a sweep of the codebase and fix
them in the longer term. As long as that will happen someday, either
approach between "we know 'no loose object? let's redo the packs' is
the part that matters performance-wise, so let's do a short-cut only
for that" and "we know that callers that comes with 0{40} want to get
NULL back" should be OK, I would think.
next prev parent reply other threads:[~2017-11-22 1:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 20:26 [PATCH 0/5] avoiding pointless pack-directory re-scans Jeff King
2017-11-20 20:26 ` [PATCH 1/5] p5550: factor our nonsense-pack creation Jeff King
2017-11-20 23:55 ` Eric Sunshine
2017-11-21 15:58 ` Jeff King
2017-11-22 0:32 ` Stefan Beller
2017-11-22 22:38 ` Jeff King
2017-11-23 2:41 ` Junio C Hamano
2017-11-23 5:02 ` Jeff King
2017-11-20 20:27 ` [PATCH 2/5] t/perf/lib-pack: use fast-import checkpoint to create packs Jeff King
2017-11-20 20:28 ` [PATCH 3/5] p5551: add a script to test fetch pack-dir rescans Jeff King
2017-11-20 20:29 ` [PATCH 4/5] everything_local: use "quick" object existence check Jeff King
2017-11-20 20:35 ` [PATCH 5/5] sha1_file: don't re-scan pack directory for null sha1 Jeff King
2017-11-20 20:47 ` Stefan Beller
2017-11-20 20:58 ` Jeff King
2017-11-21 2:37 ` Junio C Hamano
2017-11-21 22:57 ` Jeff King
2017-11-22 1:42 ` Junio C Hamano
2017-11-22 22:36 ` Jeff King
2017-11-23 2:35 ` Junio C Hamano
2017-11-24 17:32 ` Jeff King
2017-11-25 3:20 ` Junio C Hamano
2017-11-21 5:20 ` Junio C Hamano
2017-11-21 23:17 ` Jeff King
2017-11-22 1:49 ` Junio C Hamano [this message]
2017-11-22 3:17 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqr2srxeu2.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.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.