From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Tomas Carnecky <tom@dbservice.com>,
Heikki Orsila <shdl@zakalwe.fi>,
git@vger.kernel.org
Subject: Re: [PATCH] diff: use 64-bit integers for diffstat calculations
Date: Sat, 17 Apr 2010 10:00:44 -0700 [thread overview]
Message-ID: <7vvdbq2ev7.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20100417102543.GB23110@coredump.intra.peff.net> (Jeff King's message of "Sat\, 17 Apr 2010 06\:25\:43 -0400")
Jeff King <peff@peff.net> writes:
> Yuck, we use "unsigned int" for the actual storage, and then convert to
> a regular "int" in some other places. I think we should just do this:
>
> -- >8 --
> Subject: [PATCH] diff: use 64-bit integers for diffstat calculations
>
> The diffstat "added" and "changed" fields generally store
> line counts; however, for binary files, they store file
> sizes. Since we store and print these values as ints, a
> diffstat on a file larger than 2G can show a negative size.
> Instead, let's explicitly use 64-bit integers.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
Yes, but we would probably be better off using using uintmax_t for things
like this if the quantity a variable represents is not closely tied to
external file format (e.g. the offset field of pack idx file), nor the
code is only for a particular platform (e.g. compat/win32mmap.c), don't
you think?
That is the impression I am getting on the discipline expressed in the
current codebase, from browsing the output from "git grep uint64_t".
next prev parent reply other threads:[~2010-04-17 17:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-16 13:59 A bug in git 1.6.5.2 with git log --stat: shows a negative number as a size Heikki Orsila
2010-04-16 15:02 ` Tomas Carnecky
2010-04-17 10:25 ` [PATCH] diff: use 64-bit integers for diffstat calculations Jeff King
2010-04-17 17:00 ` Junio C Hamano [this message]
2010-04-17 17:41 ` 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=7vvdbq2ev7.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=shdl@zakalwe.fi \
--cc=tom@dbservice.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).