Code

Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Wed, 13 Feb 2008 22:33:19 +0000 (14:33 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Feb 2008 22:33:19 +0000 (14:33 -0800)
* 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"

1  2 
builtin-pack-objects.c
wt-status.c

diff --combined builtin-pack-objects.c
index acb05554d499598677bc1f0cec3b6ff37e796d88,d3efeff03f89cc0f4d0da463ddf878c28effb31e..692a76126b027133fd046f03003fe8e49218f192
@@@ -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);
                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--;
                }
  
                        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);
        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 f14022f2a9b8ce740067f7c6bf03bd51203cf2ca,991e373785bec5f2aab2d2a09c7d1cb6e3640196..0b060934e218f1d6fb95777ea7dd7faef1c2dd93
@@@ -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 <file>...\" to unstage)", s->reference);
        } else {
                color_fprintf_ln(s->fp, c, "#   (use \"git rm --cached <file>...\" 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);