git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Dana How <danahow@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 5/8] get-repack --max-pack-size: write_object() takes 'limit' arg
Date: Sun, 08 Apr 2007 17:15:32 -0700	[thread overview]
Message-ID: <7vr6qu768r.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7v4pnq8ld4.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Sun, 08 Apr 2007 17:03:35 -0700")

Junio C Hamano <junkio@cox.net> writes:

> Dana How <danahow@gmail.com> writes:
>
>> Accept new 'limit' argument and check against it
>> before each group of writes.  Update delta usability rules
>> for possibility of delta base being in a previously-
>> written pack. Inline sha1write_compressed() so we know
>> the exact size of the written data when it needs to be compressed.
>>
>> Signed-off-by: Dana How <how@deathvalley.cswitch.com>
>
> My first reaction of open-coding sha1write_compressed() was
> "Ugh", but as you are removing the only user of that function,
> maybe this is not as bad as it looks.

Having said that, I suspect that for other possible users of
that function we might have later, it would be a better
interface to add an optional 'limit' and 'prelude' to
sha1write_compressed().  The function would write prelude
followed by the compressed payload, only if they fit the limit.

Then your write_object() would prepare the header (depending on
the type, the object header, ofs-delta header or ref-delta
header) in header[] but would not cal sha1write() itself.
Instead it would send header[] in as prelude, *buf as the
payload, with an appropriate limit.

  reply	other threads:[~2007-04-09  0:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-08 23:24 [PATCH 5/8] get-repack --max-pack-size: write_object() takes 'limit' arg Dana How
2007-04-09  0:03 ` Junio C Hamano
2007-04-09  0:15   ` Junio C Hamano [this message]
2007-04-09  2:28     ` Nicolas Pitre
2007-04-09  0:40 ` Nicolas Pitre
2007-04-09 18:51   ` Dana How
2007-04-09 18:59     ` Nicolas Pitre
2007-04-09 19:20       ` Dana How
2007-04-09 19:25         ` Nicolas Pitre
2007-04-09 20:09         ` Junio C Hamano

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=7vr6qu768r.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=danahow@gmail.com \
    --cc=git@vger.kernel.org \
    /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).