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: Sat, 21 Jun 2008 23:51:18 -0400	[thread overview]
Message-ID: <20080622035118.GD11793@spearce.org> (raw)
In-Reply-To: <20080622033454.GA10578@lifeintegrity.com>

Allan Wind <allan_wind@lifeintegrity.com> wrote:
> Between tag1 and tag2 I am deleting a number of binary files, and I was 
> surprised seeing the binaries being added to the diff when said files
> are to be deleted:
> 
> git diff --binary tag1 tag2 > /tmp/diff && ls -l /tmp/diff
> -rw-r--r-- 1 allan users 555135993 2008-06-21 22:37 /tmp/diff
> 
> git diff tag1 tag2 > /tmp/diff2 && ls -l /tmp/diff2
> -rw-r--r-- 1 allan users 12862 2008-06-21 23:33 /tmp/diff2

In order to apply the diff in reverse we need the old binary data
in the diff output.  So that's why its larger.

In other words lets say you actually wanted to go back to tag1,
after having tag2 for a while:

	$ git checkout tag2
	$ git diff --binary tag1 tag2 | git apply --index -R

without the binary data in the diff, apply cannot run in the
reverse direction to restore back to tag1.  :)

-- 
Shawn.

  reply	other threads:[~2008-06-22  3:52 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 [this message]
2008-06-22  4:05   ` Allan Wind
2008-06-22  4:15     ` Shawn O. Pearce

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=20080622035118.GD11793@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