fast-import: make default pack size unlimited
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>
This commit is contained in:
parent
427cb22c40
commit
89e0a3a131
@ -45,10 +45,7 @@ OPTIONS
|
|||||||
|
|
||||||
--max-pack-size=<n>::
|
--max-pack-size=<n>::
|
||||||
Maximum size of each output packfile.
|
Maximum size of each output packfile.
|
||||||
The default is 4 GiB as that is the maximum allowed
|
The default is unlimited.
|
||||||
packfile size (due to file format limitations). Some
|
|
||||||
importers may wish to lower this, such as to ensure the
|
|
||||||
resulting packfiles fit on CDs.
|
|
||||||
|
|
||||||
--big-file-threshold=<n>::
|
--big-file-threshold=<n>::
|
||||||
Maximum size of a blob that fast-import will attempt to
|
Maximum size of a blob that fast-import will attempt to
|
||||||
|
@ -191,7 +191,7 @@ struct mark_set
|
|||||||
struct last_object
|
struct last_object
|
||||||
{
|
{
|
||||||
struct strbuf data;
|
struct strbuf data;
|
||||||
uint32_t offset;
|
off_t offset;
|
||||||
unsigned int depth;
|
unsigned int depth;
|
||||||
unsigned no_swap : 1;
|
unsigned no_swap : 1;
|
||||||
};
|
};
|
||||||
@ -279,7 +279,7 @@ struct recent_command
|
|||||||
|
|
||||||
/* Configured limits on output */
|
/* Configured limits on output */
|
||||||
static unsigned long max_depth = 10;
|
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 uintmax_t big_file_threshold = 512 * 1024 * 1024;
|
||||||
static int force_update;
|
static int force_update;
|
||||||
static int pack_compression_level = Z_DEFAULT_COMPRESSION;
|
static int pack_compression_level = Z_DEFAULT_COMPRESSION;
|
||||||
@ -315,7 +315,7 @@ static unsigned int pack_id;
|
|||||||
static struct sha1file *pack_file;
|
static struct sha1file *pack_file;
|
||||||
static struct packed_git *pack_data;
|
static struct packed_git *pack_data;
|
||||||
static struct packed_git **all_packs;
|
static struct packed_git **all_packs;
|
||||||
static unsigned long pack_size;
|
static off_t pack_size;
|
||||||
|
|
||||||
/* Table of objects we've written. */
|
/* Table of objects we've written. */
|
||||||
static unsigned int object_entry_alloc = 5000;
|
static unsigned int object_entry_alloc = 5000;
|
||||||
@ -1068,7 +1068,7 @@ static int store_object(
|
|||||||
deflateEnd(&s);
|
deflateEnd(&s);
|
||||||
|
|
||||||
/* Determine if we should auto-checkpoint. */
|
/* 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) {
|
|| (pack_size + 60 + s.total_out) < pack_size) {
|
||||||
|
|
||||||
/* This new object needs to *not* have the current pack_id. */
|
/* This new object needs to *not* have the current pack_id. */
|
||||||
@ -1101,7 +1101,7 @@ static int store_object(
|
|||||||
crc32_begin(pack_file);
|
crc32_begin(pack_file);
|
||||||
|
|
||||||
if (delta) {
|
if (delta) {
|
||||||
unsigned long ofs = e->idx.offset - last->offset;
|
off_t ofs = e->idx.offset - last->offset;
|
||||||
unsigned pos = sizeof(hdr) - 1;
|
unsigned pos = sizeof(hdr) - 1;
|
||||||
|
|
||||||
delta_count_by_type[type]++;
|
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;
|
int status = Z_OK;
|
||||||
|
|
||||||
/* Determine if we should auto-checkpoint. */
|
/* 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)
|
|| (pack_size + 60 + len) < pack_size)
|
||||||
cycle_packfile();
|
cycle_packfile();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user