git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Krüger" <jk@jk.gs>
To: Git ML <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>, Nicolas Pitre <nico@fluxnic.net>
Subject: [PATCH] repack: add -F option that passes --no-reuse-delta to pack-objects
Date: Mon, 27 Sep 2010 13:31:04 +0200	[thread overview]
Message-ID: <20100927133104.25ce5285@jk.gs> (raw)

In 479b56ba ('make "repack -f" imply "pack-objects --no-reuse-object"'),
git repack -f was changed to include recompressing all objects on the
zlib level on the assumption that if the user wants to spend that much
time already, some more time won't hurt (and recompressing is useful if
the user changed the zlib compression level).

However, "some more time" can be quite long with very big repositories,
so some users are going to appreciate being able to choose. Hence, this
adds a new -F option that uses the old behaviour of recalculating deltas
only and keeping the zlib compression intact.

Measurements taken using this patch on a current clone of git.git
indicate a 17% decrease in time being made available to users:

git repack -Adf  38.79s user 0.56s system 133% cpu 29.394 total
git repack -AdF  34.84s user 0.56s system 145% cpu 24.388 total

Signed-off-by: Jan Krüger <jk@jk.gs>
---

The concrete case that prompted me to write this patch was a repository
of 25 GB that some guys were trying to repack. 17% of the time needed to
repack -f that much data is... substantial.

Discussion point: it might make more sense to switch the meanings
around, making -F do the 'bigger' routine and reverting -f to what it
used to be. I don't feel strongly about that, however.

Cc'ing those who were involved in the discussion leading to 479b56ba.

 Documentation/git-repack.txt |    6 +++++-
 git-repack.sh                |    2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt
index 8c67d17..cce32e2 100644
--- a/Documentation/git-repack.txt
+++ b/Documentation/git-repack.txt
@@ -8,7 +8,7 @@ git-repack - Pack unpacked objects in a repository
 
 SYNOPSIS
 --------
-'git repack' [-a] [-A] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]
+'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [--window=N] [--depth=N]
 
 DESCRIPTION
 -----------
@@ -65,6 +65,10 @@ other objects in that pack they already have locally.
 	Pass the `--no-reuse-object` option to `git-pack-objects`, see
 	linkgit:git-pack-objects[1].
 
+-F::
+	Pass the `--no-reuse-delta` option to `git-pack-objects`, see
+	linkgit:git-pack-objects[1].
+
 -q::
 	Pass the `-q` option to 'git pack-objects'. See
 	linkgit:git-pack-objects[1].
diff --git a/git-repack.sh b/git-repack.sh
index 1eb3bca..a010406 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -11,6 +11,7 @@ a               pack everything in a single pack
 A               same as -a, and turn unreachable objects loose
 d               remove redundant packs, and run git-prune-packed
 f               pass --no-reuse-object to git-pack-objects
+F               pass --no-reuse-delta to git-pack-objects
 n               do not run git-update-server-info
 q,quiet         be quiet
 l               pass --local to git-pack-objects
@@ -35,6 +36,7 @@ do
 	-d)	remove_redundant=t ;;
 	-q)	GIT_QUIET=t ;;
 	-f)	no_reuse=--no-reuse-object ;;
+	-F)	no_reuse=--no-reuse-delta ;;
 	-l)	local=--local ;;
 	--max-pack-size|--window|--window-memory|--depth)
 		extra="$extra $1=$2"; shift ;;
-- 
1.7.2.3.392.g02377.dirty

             reply	other threads:[~2010-09-27 11:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-27 11:31 Jan Krüger [this message]
2010-09-27 11:53 ` [PATCH] repack: add -F option that passes --no-reuse-delta to pack-objects Nicolas Pitre
2010-09-27 12:19   ` [Alt. PATCH 1/2] repack: add -F flag to let user choose between --no-reuse-delta/object Jan Krüger
2010-09-27 12:21     ` [Alt. PATCH 2/2] Documentation: pack.compression: explain how to recompress Jan Krüger
2010-09-27 14:10       ` Nicolas Pitre
2010-09-27 14:10     ` [Alt. PATCH 1/2] repack: add -F flag to let user choose between --no-reuse-delta/object Nicolas Pitre
2010-09-27 16:50 ` [PATCH] repack: add -F option that passes --no-reuse-delta to pack-objects Junio C Hamano
2010-09-28  6:44   ` Jan Krüger
2010-09-28  9:49     ` 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=20100927133104.25ce5285@jk.gs \
    --to=jk@jk.gs \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@fluxnic.net \
    /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).