Git development
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Allan Wind <allan_wind@lifeintegrity.com>
Cc: git@vger.kernel.org
Subject: Re: Why does diff --binary include content of files being deleted?
Date: Sun, 22 Jun 2008 00:15:10 -0400	[thread overview]
Message-ID: <20080622041510.GE11793@spearce.org> (raw)
In-Reply-To: <20080622040536.GA10813@lifeintegrity.com>

Allan Wind <allan_wind@lifeintegrity.com> wrote:
> On 2008-06-21T23:51:18-0400, Shawn O. Pearce wrote:
> > In order to apply the diff in reverse we need the old binary data
> > in the diff output.  So that's why its larger.
> 
> Makes sense, thanks.  In my use case (where I do not need the reverse 
> diff) this adds 500+ MB or 43159% overhead.

Well, then in that case you have to omit --binary I think, or use a
filter script to strip out the binary data from the resulting patch.

> When I tried to apply the large diff my virtual private server with 512 
> MB of memory git apply ran out of memory and died.  Is there any way to 
> bound the memory usage of git apply?

If you submit patches for it.  ;-)

git-apply today is meant for applying small patches, like those that
would typically be written by a developer hacking on open source
software.  It tries to be completely atomic; either the entire
patch applies at once, or the entire patch rejects with no changes
being made to the local directory.  As such it applies everything in
memory, and only writes out when we are sure the patch applies clean.

So no, there isn't a way to make git-apply use less memory.

-- 
Shawn.

      reply	other threads:[~2008-06-22  4:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22  3:34 Why does diff --binary include content of files being deleted? Allan Wind
2008-06-22  3:51 ` Shawn O. Pearce
2008-06-22  4:05   ` Allan Wind
2008-06-22  4:15     ` Shawn O. Pearce [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080622041510.GE11793@spearce.org \
    --to=spearce@spearce.org \
    --cc=allan_wind@lifeintegrity.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