From: "Thanassis Tsiodras" <ttsiodras@gmail.com>
To: git@vger.kernel.org
Subject: Are binary xdeltas only used if you use git-gc?
Date: Fri, 31 Oct 2008 11:43:43 +0200 [thread overview]
Message-ID: <f1d2d9ca0810310243r669840bbj2c5ee7183e0caaed@mail.gmail.com> (raw)
Hi everyone.
I've been usig Git for the last couple of months and am quite happy with it.
In one of my Git repositories, I am storing uncompressed .tar files
(since being uncompressed allows git to detect and store
only their "real"differences).
However, when I introduce a new filename in the repos (with a minor
set of differences compared to an existing file with a different filename)
I've been unsuccessful in finding a way to tell Git to do it efficiently...
This is what I mean:
bash$ mkdir -p /var/tmp/tst
bash$ cd /var/tmp/tst
bash$ git init
bash$ cp /var/www/renderer-2.0e.tar .
bash$ git add renderer-2.0e.tar
bash$ git commit -m "First version"
bash$ du -s -k .git/
1724 .git/
bash$ cp renderer-2.0e.tar renderer-2.0f.tar
bash$ git add renderer-2.0f.tar
bash$ git commit -m "To add new version, first copy the first, so Git
detects it"
bash$ du -s -k .git/
1740 .git/
bash$ echo Good, Git detected it is the same
bash$ cp /var/www/renderer-2.0f.tar .
bash$ git add renderer-2.0f.tar
bash$ git commit -m "Real new version, slightly different to first"
bash$ du -s -k .git/
3344 .git/
bash$ echo What... did I do something wrong
bash$ xdelta delta renderer-2.0e.tar renderer-2.0f.tar delta
bash$ ls -l
total 7788
-rw-r--r-- 1 ttsiod ttsiod 8181 2008-10-31 11:27 delta
-rw-r--r-- 1 ttsiod ttsiod 3962880 2008-10-31 11:23 renderer-2.0e.tar
-rw-r--r-- 1 ttsiod ttsiod 3993600 2008-10-31 11:25 renderer-2.0f.tar
bash$ git-gc
bash$ du -s -k .git/
1660 .git/
So even though the xdelta is just 8KB, and git-gc actually finds out
that indeed
the new file is very similar to the old one, the initial commit of the
new version
in the repos is not taking advantage.
I found out about this when I tried to "git push" over a PSTN modem...
Then again, I must confess I only did the git-gc after I pushed.
Does the git-push actually take advantage of the similarities only if
I do a git-gc first?
If that is the case, I will create an alias to always git-gc after commits...
--
What I gave, I have; what I spent, I had; what I kept, I lost. -Old Epitaph
next reply other threads:[~2008-10-31 9:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-31 9:43 Thanassis Tsiodras [this message]
2008-10-31 11:02 ` Are binary xdeltas only used if you use git-gc? Pierre Habouzit
2008-10-31 11:16 ` Thanassis Tsiodras
2008-10-31 19:47 ` Nicolas Pitre
2008-10-31 19:31 ` Nicolas Pitre
2008-10-31 11:15 ` Jakub Narebski
2008-10-31 11:28 ` Thanassis Tsiodras
2008-10-31 16:26 ` Jakub Narebski
2008-10-31 16:42 ` Matthieu Moy
2008-10-31 19:53 ` Nicolas Pitre
2008-11-01 11:54 ` Thanassis Tsiodras
2008-11-01 13:25 ` Nicolas Pitre
2008-11-03 20:35 ` Thanassis Tsiodras
2008-11-03 20:52 ` Pieter de Bie
2008-11-03 21:42 ` Nicolas Pitre
2008-11-03 22:53 ` Thanassis Tsiodras
2008-11-04 1:18 ` Nicolas Pitre
2008-11-04 1:36 ` Junio C Hamano
2008-11-04 1:57 ` Nicolas Pitre
2008-11-04 3:17 ` Junio C Hamano
2008-10-31 17:03 ` Jean-Luc Herren
2008-10-31 12:42 ` Matthieu Moy
2008-10-31 14:22 ` Thanassis Tsiodras
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=f1d2d9ca0810310243r669840bbj2c5ee7183e0caaed@mail.gmail.com \
--to=ttsiodras@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).