summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 427cb22)
raw | patch | inline | side by side (parent: 427cb22)
author | Nicolas Pitre <nico@fluxnic.net> | |
Wed, 17 Feb 2010 19:05:54 +0000 (14:05 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 17 Feb 2010 19:08:43 +0000 (11:08 -0800) |
Now that fast-import is creating packs with index version 2, there is
no point limiting the pack size by default. A pack split will still
happen if off_t is not sufficiently large to hold large offsets.
While updating the doc, let's remove the "packfiles fit on CDs"
suggestion. Pack files created by fast-import are still suboptimal and
a 'git repack -a -f -d' or even 'git gc --aggressive' would be a pretty
good idea before considering storage on CDs.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
no point limiting the pack size by default. A pack split will still
happen if off_t is not sufficiently large to hold large offsets.
While updating the doc, let's remove the "packfiles fit on CDs"
suggestion. Pack files created by fast-import are still suboptimal and
a 'git repack -a -f -d' or even 'git gc --aggressive' would be a pretty
good idea before considering storage on CDs.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-import.txt | patch | blob | history | |
fast-import.c | patch | blob | history |
index 6764ff188688070bfea379de7dccc13a1557cb20..19082b04eb7ec77bcf974e0c76b8d20bb736c021 100644 (file)
--max-pack-size=<n>::
Maximum size of each output packfile.
- The default is 4 GiB as that is the maximum allowed
- packfile size (due to file format limitations). Some
- importers may wish to lower this, such as to ensure the
- resulting packfiles fit on CDs.
+ The default is unlimited.
--big-file-threshold=<n>::
Maximum size of a blob that fast-import will attempt to
diff --git a/fast-import.c b/fast-import.c
index 9d7ab09620b81ce2937fc38dbf7324956835c6f8..d2f45b18d9793c7548b997a3c6e318789f84ba8d 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
struct last_object
{
struct strbuf data;
- uint32_t offset;
+ off_t offset;
unsigned int depth;
unsigned no_swap : 1;
};
/* Configured limits on output */
static unsigned long max_depth = 10;
-static off_t max_packsize = (1LL << 32) - 1;
+static off_t max_packsize;
static uintmax_t big_file_threshold = 512 * 1024 * 1024;
static int force_update;
static int pack_compression_level = Z_DEFAULT_COMPRESSION;
static struct sha1file *pack_file;
static struct packed_git *pack_data;
static struct packed_git **all_packs;
-static unsigned long pack_size;
+static off_t pack_size;
/* Table of objects we've written. */
static unsigned int object_entry_alloc = 5000;
deflateEnd(&s);
/* Determine if we should auto-checkpoint. */
- if ((pack_size + 60 + s.total_out) > max_packsize
+ if ((max_packsize && (pack_size + 60 + s.total_out) > max_packsize)
|| (pack_size + 60 + s.total_out) < pack_size) {
/* This new object needs to *not* have the current pack_id. */
crc32_begin(pack_file);
if (delta) {
- unsigned long ofs = e->idx.offset - last->offset;
+ off_t ofs = e->idx.offset - last->offset;
unsigned pos = sizeof(hdr) - 1;
delta_count_by_type[type]++;
@@ -1170,7 +1170,7 @@ static void stream_blob(uintmax_t len, unsigned char *sha1out, uintmax_t mark)
int status = Z_OK;
/* Determine if we should auto-checkpoint. */
- if ((pack_size + 60 + len) > max_packsize
+ if ((max_packsize && (pack_size + 60 + len) > max_packsize)
|| (pack_size + 60 + len) < pack_size)
cycle_packfile();