From: Junio C Hamano Date: Thu, 21 Mar 2013 21:06:55 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.8.3-rc0~190 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/328455fc588d8b5a9357f9b1c053cfffc8577e15?ds=inline;hp=-c Merge branch 'maint' * 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 --- 328455fc588d8b5a9357f9b1c053cfffc8577e15 diff --combined transport.c index bd290fa7d3,87b8f145ac..6f671c6506 --- a/transport.c +++ b/transport.c @@@ -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)); @@@ -534,6 -536,9 +534,6 @@@ 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); @@@ -542,8 -547,7 +542,8 @@@ 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)) @@@ -553,6 -557,7 +553,6 @@@ free_refs(refs_tmp); - string_list_clear(&sought, 0); free(dest); return (refs ? 0 : -1); } diff --combined wt-status.c index 7bb3f63f06,7555817786..54f4391f9c --- a/wt-status.c +++ b/wt-status.c @@@ -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; @@@ -292,6 -292,9 +292,9 @@@ } 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 |= @@@ -535,14 -533,6 +538,14 @@@ } 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