summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ed863a)
raw | patch | inline | side by side (parent: 7ed863a)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 5 Apr 2011 17:44:11 +0000 (10:44 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Apr 2011 03:25:49 +0000 (20:25 -0700) |
The pack-objects command should take notice of the object file and
refrain from attempting to delta large ones, to be consistent with
the fast-import command.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refrain from attempting to delta large ones, to be consistent with
the fast-import command.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt | patch | blob | history | |
builtin/pack-objects.c | patch | blob | history | |
cache.h | patch | blob | history | |
config.c | patch | blob | history | |
environment.c | patch | blob | history | |
fast-import.c | patch | blob | history |
index c5e183516a104e6efb7ed597fb4498d75560ab68..c5598f4af96a6d24f1b9375d737a4471a846cd16 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
be delta compressed, but larger binary media files won't be.
+
Common unit suffixes of 'k', 'm', or 'g' are supported.
-+
-Currently only linkgit:git-fast-import[1] honors this setting.
core.excludesfile::
In addition to '.gitignore' (per-directory) and
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index b0503b202afb4356caaca794518fb4e21082a48f..f402a843bb5ee23360d29bdbbc6cc9c5b9c72008 100644 (file)
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
sorted_by_offset[i] = objects + i;
qsort(sorted_by_offset, nr_objects, sizeof(*sorted_by_offset), pack_offset_sort);
- for (i = 0; i < nr_objects; i++)
- check_object(sorted_by_offset[i]);
+ for (i = 0; i < nr_objects; i++) {
+ struct object_entry *entry = sorted_by_offset[i];
+ check_object(entry);
+ if (big_file_threshold <= entry->size)
+ entry->no_try_delta = 1;
+ }
free(sorted_by_offset);
}
index d83d68c859904fadbe2501cabd8575be09131d7b..baec5edf031a72204fd4347586d7da0d0bb3d7ba 100644 (file)
--- a/cache.h
+++ b/cache.h
extern size_t packed_git_window_size;
extern size_t packed_git_limit;
extern size_t delta_base_cache_limit;
+extern unsigned long big_file_threshold;
extern int read_replace_refs;
extern int fsync_object_files;
extern int core_preload_index;
diff --git a/config.c b/config.c
index 625e0518767712583f917762634c2fc852c4d2eb..85f956058c59e05b4aafb71d05c54e47cd07f39f 100644 (file)
--- a/config.c
+++ b/config.c
return 0;
}
+ if (!strcmp(var, "core.bigfilethreshold")) {
+ long n = git_config_int(var, value);
+ big_file_threshold = 0 < n ? n : 0;
+ return 0;
+ }
+
if (!strcmp(var, "core.packedgitlimit")) {
packed_git_limit = git_config_int(var, value);
return 0;
diff --git a/environment.c b/environment.c
index 9564475f429312a467a020106f7443112367d5da..8557e84ff6870b2736ec0a2db11f6f75a28906d3 100644 (file)
--- a/environment.c
+++ b/environment.c
size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
size_t delta_base_cache_limit = 16 * 1024 * 1024;
+unsigned long big_file_threshold = 512 * 1024 * 1024;
const char *pager_program;
int pager_use_color = 1;
const char *editor_program;
diff --git a/fast-import.c b/fast-import.c
index 60f26fe473ad6922166e952f4f7e5be2b79d45de..1421dcd6eb5db6e617fca4bac7471cd83d0cd592 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
/* Configured limits on output */
static unsigned long max_depth = 10;
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 int pack_compression_seen;
max_packsize = git_config_ulong(k, v);
return 0;
}
- if (!strcmp(k, "core.bigfilethreshold")) {
- long n = git_config_int(k, v);
- big_file_threshold = 0 < n ? n : 0;
- }
return git_default_config(k, v, cb);
}