From: Duy Nguyen <pclouds@gmail.com>
To: Philip Oakley <philipoakley@iee.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Git List" <git@vger.kernel.org>,
"Torsten Bögershausen" <tboegi@web.de>,
"Thomas Braun" <thomas.braun@virtuell-zuhause.de>,
"Johannes Schindelin" <johannes.schindelin@gmx.de>
Subject: Re: test suite: why does git add large_file create a pack, rather than an object?
Date: Tue, 2 Apr 2019 17:35:44 +0700 [thread overview]
Message-ID: <CACsJy8Bs6uso4oL6sSz9xC5gv-xcxkNc2KRcxX=eCT5KcMjSSQ@mail.gmail.com> (raw)
In-Reply-To: <8850d755-07ce-d8d2-6e5c-88393fce34de@iee.org>
On Mon, Apr 1, 2019 at 10:10 PM Philip Oakley <philipoakley@iee.org> wrote:
>
> hi Junio,
> On 01/04/2019 11:47, Junio C Hamano wrote:
> > Philip Oakley <philipoakley@iee.org> writes:
> >
> >> At the moment I'm using an extended _test_ case that starts by adding
> >> a ~5.1Gb file and then using verify-pack, which aborts with an error.
> >>
> >> dd if=/dev/zero of=file bs=1M count=5100 &&
> >> git config core.compression 0 &&
> >> git config core.looseCompression 0 &&
> >> git add file &&
> >> git verify-pack -s .git/objects/pack/*.pack &&
> >> git fsck --verbose --strict --full &&
> >> ...
> >>
> >> If however I simple execute the commands from the GfW bash, the added
> >> file is stored as a blob object, rather than a pack.
> >>
> >> I'm at a loss to understand the reason for the change in behaviour
> >> [store file as pack, vs store as object] between running the code as a
> >> test script and at the terminal. What am I missing?
> > To which test are you adding the above piece? Perhaps one of those
> > that configures core.bigfilethreashold?
> The test script (t-large-files-on-winows.sh: [1] below) was specific to
> this debugging.
>
> I didn't set core.bigfilethreshold - Is that done (or unset) by the test
> setup at all?
>
> It does prompt me to check that all the bigfilethreshold checks are
> actually size_t, rather than a simple 'long'/uInt which would only be
> 32bits on Windows and potentially a downcast comparison, resulting in
> mistaken bigfile actions because of the modulo 2^32 action.
>
> So when I run the test script [1] on Windows I get my error from
> verify-pack, and the trash directory contains a single pack file.
> I tried doing the commands singly on a fresh repo, but that time found
> that the add/verify produced a blob object (rather than a pack with one
> object), so it got me wondering if I was testing like for like.
>
> When I tried using gdb at the add stage, with a break point, I got a
> back trace [2], and when run to completion it had the loose object, so I
> was confused. (my fixup code is at [3])
Streaming a blob directly to a pack is done by index_stream(). I
suggest you force a crashwhen that function is called (from your test
script) then examine with gdb for more info. You should be able to see
what's its caller (in case it's not index_fd), then perhaps you could
add a bunch of printtfs to show all the conditions that lead (or not
lead) to that function?
There are some would_convert_ calls in index_fd(). Maybe some other
config keys are affecting this.
PS. I also don't know what index_stream_convert_blob() does. Not sure
if it's really streaming to blob or streaming from somewhee to a
converter. You might want to check that too.
--
Duy
prev parent reply other threads:[~2019-04-02 10:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-30 14:13 test suite: why does git add large_file create a pack, rather than an object? Philip Oakley
2019-04-01 10:47 ` Junio C Hamano
2019-04-01 15:09 ` Philip Oakley
2019-04-02 10:35 ` Duy Nguyen [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
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='CACsJy8Bs6uso4oL6sSz9xC5gv-xcxkNc2KRcxX=eCT5KcMjSSQ@mail.gmail.com' \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=philipoakley@iee.org \
--cc=tboegi@web.de \
--cc=thomas.braun@virtuell-zuhause.de \
/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).