Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Thu, 21 Mar 2013 21:06:55 +0000 (14:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Mar 2013 21:06:55 +0000 (14:06 -0700)
* maint:
diff.c: diff.renamelimit => diff.renameLimit in message
wt-status: fix possible use of uninitialized variable
fast-import: clarify "inline" logic in file_change_m
run-command: always set failed_errno in start_command
transport: drop "int cmp = cmp" hack
drop some obsolete "x = x" compiler warning hacks
fast-import: use pointer-to-pointer to keep list tail

1  2 
transport.c
wt-status.c
diff --combined transport.c
index bd290fa7d3d6fcb3e8b53fe8986ec79290fdea45,87b8f145acfce5579b05c5bf0fef6e1865477f9f..6f671c65061368496d90d74a162ef6af8eb4b1fe
@@@ -106,7 -106,7 +106,7 @@@ static void insert_packed_refs(const ch
                return;
  
        for (;;) {
-               int cmp = cmp, len;
+               int cmp, len;
  
                if (!fgets(buffer, sizeof(buffer), f)) {
                        fclose(f);
@@@ -518,9 -518,11 +518,9 @@@ static int fetch_refs_via_pack(struct t
                               int nr_heads, struct ref **to_fetch)
  {
        struct git_transport_data *data = transport->data;
 -      struct string_list sought = STRING_LIST_INIT_DUP;
        const struct ref *refs;
        char *dest = xstrdup(transport->url);
        struct fetch_pack_args args;
 -      int i;
        struct ref *refs_tmp = NULL;
  
        memset(&args, 0, sizeof(args));
        args.no_progress = !transport->progress;
        args.depth = data->options.depth;
  
 -      for (i = 0; i < nr_heads; i++)
 -              string_list_append(&sought, to_fetch[i]->name);
 -
        if (!data->got_remote_heads) {
                connect_setup(transport, 0, 0);
                get_remote_heads(data->fd[0], &refs_tmp, 0, NULL);
  
        refs = fetch_pack(&args, data->fd, data->conn,
                          refs_tmp ? refs_tmp : transport->remote_refs,
 -                        dest, &sought, &transport->pack_lockfile);
 +                        dest, to_fetch, nr_heads,
 +                        &transport->pack_lockfile);
        close(data->fd[0]);
        close(data->fd[1]);
        if (finish_connect(data->conn))
  
        free_refs(refs_tmp);
  
 -      string_list_clear(&sought, 0);
        free(dest);
        return (refs ? 0 : -1);
  }
diff --combined wt-status.c
index 7bb3f63f06d359f3f44277742ad1db522ffa283f,75558177860d14120636859e2dcc29b48b72a721..54f4391f9cc86d3d485ed80383cb142b1f25b1e7
@@@ -264,7 -264,7 +264,7 @@@ static void wt_status_print_change_data
  {
        struct wt_status_change_data *d = it->util;
        const char *c = color(change_type, s);
-       int status = status;
+       int status;
        char *one_name;
        char *two_name;
        const char *one, *two;
                }
                status = d->worktree_status;
                break;
+       default:
+               die("BUG: unhandled change_type %d in wt_status_print_change_data",
+                   change_type);
        }
  
        one = quote_path(one_name, -1, &onebuf, s->prefix);
@@@ -496,14 -499,9 +499,14 @@@ static void wt_status_collect_untracked
  {
        int i;
        struct dir_struct dir;
 +      struct timeval t_begin;
  
        if (!s->show_untracked_files)
                return;
 +
 +      if (advice_status_u_option)
 +              gettimeofday(&t_begin, NULL);
 +
        memset(&dir, 0, sizeof(dir));
        if (s->show_untracked_files != SHOW_ALL_UNTRACKED_FILES)
                dir.flags |=
        }
  
        free(dir.entries);
 +
 +      if (advice_status_u_option) {
 +              struct timeval t_end;
 +              gettimeofday(&t_end, NULL);
 +              s->untracked_in_ms =
 +                      (uint64_t)t_end.tv_sec * 1000 + t_end.tv_usec / 1000 -
 +                      ((uint64_t)t_begin.tv_sec * 1000 + t_begin.tv_usec / 1000);
 +      }
  }
  
  void wt_status_collect(struct wt_status *s)
@@@ -1110,18 -1100,6 +1113,18 @@@ void wt_status_print(struct wt_status *
                wt_status_print_other(s, &s->untracked, _("Untracked files"), "add");
                if (s->show_ignored_files)
                        wt_status_print_other(s, &s->ignored, _("Ignored files"), "add -f");
 +              if (advice_status_u_option && 2000 < s->untracked_in_ms) {
 +                      status_printf_ln(s, GIT_COLOR_NORMAL, "");
 +                      status_printf_ln(s, GIT_COLOR_NORMAL,
 +                               _("It took %.2f seconds to enumerate untracked files."
 +                                 "  'status -uno'"),
 +                               s->untracked_in_ms / 1000.0);
 +                      status_printf_ln(s, GIT_COLOR_NORMAL,
 +                               _("may speed it up, but you have to be careful not"
 +                                 " to forget to add"));
 +                      status_printf_ln(s, GIT_COLOR_NORMAL,
 +                               _("new files yourself (see 'git help status')."));
 +              }
        } else if (s->commitable)
                status_printf_ln(s, GIT_COLOR_NORMAL, _("Untracked files not listed%s"),
                        advice_status_hints