From: Junio C Hamano Date: Wed, 13 Feb 2008 22:33:19 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.5.5-rc0~221 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/aa8d53ec387a7baf72ab5e3a91c35bb5bf20eb4d?ds=inline;hp=-c Merge branch 'maint' * maint: config: add test cases for empty value and no value config variables. cvsimport: have default merge regex also match beginning of commit message git clone -s documentation: force a new paragraph for the NOTE status: suggest "git rm --cached" to unstage for initial commit Protect get_author_ident_from_commit() from filenames in work tree upload-pack: Initialize the exec-path. bisect: use verbatim commit subject in the bisect log git-cvsimport.txt: fix '-M' description. Revert "pack-objects: only throw away data during memory pressure" --- aa8d53ec387a7baf72ab5e3a91c35bb5bf20eb4d diff --combined builtin-pack-objects.c index acb05554d4,d3efeff03f..692a76126b --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@@ -68,7 -68,7 +68,7 @@@ static int allow_ofs_delta static const char *base_name; static int progress = 1; static int window = 10; -static uint32_t pack_size_limit; +static uint32_t pack_size_limit, pack_size_limit_cfg; static int depth = 50; static int delta_search_threads = 1; static int pack_to_stdout; @@@ -1464,7 -1464,7 +1464,7 @@@ static unsigned int check_delta_limit(s return m; } - static unsigned long free_unpacked_data(struct unpacked *n) + static unsigned long free_unpacked(struct unpacked *n) { unsigned long freed_mem = sizeof_delta_index(n->index); free_delta_index(n->index); @@@ -1474,12 -1474,6 +1474,6 @@@ free(n->data); n->data = NULL; } - return freed_mem; - } - - static unsigned long free_unpacked(struct unpacked *n) - { - unsigned long freed_mem = free_unpacked_data(n); n->entry = NULL; n->depth = 0; return freed_mem; @@@ -1520,7 -1514,7 +1514,7 @@@ static void find_deltas(struct object_e mem_usage > window_memory_limit && count > 1) { uint32_t tail = (idx + window - count) % window; - mem_usage -= free_unpacked_data(array + tail); + mem_usage -= free_unpacked(array + tail); count--; } @@@ -1553,9 -1547,6 +1547,6 @@@ if (!m->entry) break; ret = try_delta(n, m, max_depth, &mem_usage); - if (window_memory_limit && - mem_usage > window_memory_limit) - mem_usage -= free_unpacked_data(m); if (ret < 0) break; else if (ret > 0) @@@ -1876,10 -1867,6 +1867,10 @@@ static int git_pack_config(const char * die("bad pack.indexversion=%d", pack_idx_default_version); return 0; } + if (!strcmp(k, "pack.packsizelimit")) { + pack_size_limit_cfg = git_config_ulong(k, v); + return 0; + } return git_default_config(k, v); } @@@ -2109,7 -2096,6 +2100,7 @@@ int cmd_pack_objects(int argc, const ch } if (!prefixcmp(arg, "--max-pack-size=")) { char *end; + pack_size_limit_cfg = 0; pack_size_limit = strtoul(arg+16, &end, 0) * 1024 * 1024; if (!arg[16] || *end) usage(pack_usage); @@@ -2234,9 -2220,6 +2225,9 @@@ if (pack_to_stdout != !base_name) usage(pack_usage); + if (!pack_to_stdout && !pack_size_limit) + pack_size_limit = pack_size_limit_cfg; + if (pack_to_stdout && pack_size_limit) die("--max-pack-size cannot be used to build a pack for transfer."); diff --combined wt-status.c index f14022f2a9,991e373785..0b060934e2 --- a/wt-status.c +++ b/wt-status.c @@@ -60,7 -60,7 +60,7 @@@ static void wt_status_print_cached_head { const char *c = color(WT_STATUS_HEADER); color_fprintf_ln(s->fp, c, "# Changes to be committed:"); - if (s->reference) { + if (!s->is_initial) { color_fprintf_ln(s->fp, c, "# (use \"git reset %s ...\" to unstage)", s->reference); } else { color_fprintf_ln(s->fp, c, "# (use \"git rm --cached ...\" to unstage)"); @@@ -217,12 -217,19 +217,12 @@@ static void wt_status_print_changed_cb( wt_status_print_trailer(s); } -static void wt_read_cache(struct wt_status *s) -{ - discard_cache(); - read_cache_from(s->index_file); -} - static void wt_status_print_initial(struct wt_status *s) { int i; struct strbuf buf; strbuf_init(&buf, 0); - wt_read_cache(s); if (active_nr) { s->commitable = 1; wt_status_print_cached_header(s); @@@ -249,6 -256,7 +249,6 @@@ static void wt_status_print_updated(str rev.diffopt.detect_rename = 1; rev.diffopt.rename_limit = 100; rev.diffopt.break_opt = 0; - wt_read_cache(s); run_diff_index(&rev, 1); } @@@ -260,6 -268,7 +260,6 @@@ static void wt_status_print_changed(str rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK; rev.diffopt.format_callback = wt_status_print_changed_cb; rev.diffopt.format_callback_data = s; - wt_read_cache(s); run_diff_files(&rev, 0); } @@@ -326,6 -335,7 +326,6 @@@ static void wt_status_print_verbose(str setup_revisions(0, NULL, &rev, s->reference); rev.diffopt.output_format |= DIFF_FORMAT_PATCH; rev.diffopt.detect_rename = 1; - wt_read_cache(s); run_diff_index(&rev, 1); fflush(stdout);