Re: [PATCH v2] count-objects: output "KiB" instead of "kilobytes"
- From
Mihai Capotă <mihai@mihaic.ro>
- Date
- Apr 5, 2013, 09:38 UTC
- Message-ID
- <CADyhzG04H-9w51YsUruW58LHyPxFCLhEcd7Za2CQhDgxR4fKBw@mail.gmail.com>
- In-Reply-To
- <7vvc82jm77.fsf@alter.siamese.dyndns.org>
On Thu, Apr 4, 2013 at 6:27 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 38 quoted lines
> Mihai Capotă <mihai@mihaic.ro> writes: > >> The git manual contains an explicit warning about the output of a >> porcelain command changing: "The interface to Porcelain commands on >> the other hand are subject to change in order to improve the end user >> experience." > > Yeah, I know that, as I wrote it ;-) > > Aside from count-object being not exactly a Porcelain, the statement > does not give us a blank check to make random changes as we see fit. > There needs to be a clear improvement. > > I am just having a hard time weighing the benefit of using more > accurate kibibytes over kilobytes and the possible downside of > breaking other peoples' tools. > > Perhaps it would be alright if the change was accompanied by a > warning in the Release Notes to say something like: > > If you have scripts that decide when to run "git repack" by > parsing the output from "git count-objects", this release > may break them. Sorry about that. One of the scripts > shipped by git-core itself also had to be adjusted. The > command reports the total diskspace used to store loose > objects in kibibytes, but it was labelled as "kilobytes". > The number now is shown with "KiB", e.g. "6750 objects, > 50928 KiB". > > You may want to consider updating such scripts to always > call "git gc --auto" to let it decide when to repack for > you. > > Also, I suspect that for the purpose of this exact output field, > nobody cares the difference between kibibytes and kilobytes. > Depending on the system, we add up either st.st_blocks or st.st_size > and the result is not that exact as "how much diskspace is > consumed".
I agree completely. I think the release notes warning is a good plan. Just in case you decide against it, I'm also sending a completely different patch to document the issue.
Mihai