From: Junio C Hamano Date: Sun, 13 Jul 2008 22:15:23 +0000 (-0700) Subject: Merge branch 'jc/report-tracking' X-Git-Tag: v1.6.0-rc0~88 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e636799b4d6a6a8abad151697eae27044bb8e95b?ds=sidebyside;hp=-c Merge branch 'jc/report-tracking' * jc/report-tracking: branch -r -v: do not spit out garbage stat_tracking_info(): clear object flags used during counting git-branch -v: show the remote tracking statistics git-status: show the remote tracking statistics Refactor "tracking statistics" code used by "git checkout" --- e636799b4d6a6a8abad151697eae27044bb8e95b diff --combined revision.h index 83f364ace2,e8bac6d141..f57b6c5d9a --- a/revision.h +++ b/revision.h @@@ -11,6 -11,7 +11,7 @@@ #define ADDED (1u<<7) /* Parents already parsed and added? */ #define SYMMETRIC_LEFT (1u<<8) #define TOPOSORT (1u<<9) /* In the active toposort list.. */ + #define ALL_REV_FLAGS ((1u<<10)-1) struct rev_info; struct log_info; @@@ -111,8 -112,6 +112,8 @@@ struct rev_info #define REV_TREE_DIFFERENT 2 /* revision.c */ +void read_revisions_from_stdin(struct rev_info *revs); + typedef void (*show_early_output_fn_t)(struct rev_info *, struct commit_list *); volatile show_early_output_fn_t show_early_output; diff --combined wt-status.c index e7d42d0491,eeb106e13e..889e50f89f --- a/wt-status.c +++ b/wt-status.c @@@ -9,6 -9,7 +9,7 @@@ #include "diffcore.h" #include "quote.h" #include "run-command.h" + #include "remote.h" int wt_status_relative_paths = 1; int wt_status_use_color = -1; @@@ -315,6 -316,25 +316,25 @@@ static void wt_status_print_verbose(str run_diff_index(&rev, 1); } + static void wt_status_print_tracking(struct wt_status *s) + { + struct strbuf sb = STRBUF_INIT; + const char *cp, *ep; + struct branch *branch; + + assert(s->branch && !s->is_initial); + if (prefixcmp(s->branch, "refs/heads/")) + return; + branch = branch_get(s->branch + 11); + if (!format_tracking_info(branch, &sb)) + return; + + for (cp = sb.buf; (ep = strchr(cp, '\n')) != NULL; cp = ep + 1) + color_fprintf_ln(s->fp, color(WT_STATUS_HEADER), + "# %.*s", (int)(ep - cp), cp); + color_fprintf_ln(s->fp, color(WT_STATUS_HEADER), "#"); + } + void wt_status_print(struct wt_status *s) { unsigned char sha1[20]; @@@ -333,6 -353,8 +353,8 @@@ } color_fprintf(s->fp, color(WT_STATUS_HEADER), "# "); color_fprintf_ln(s->fp, branch_color, "%s%s", on_what, branch_name); + if (!s->is_initial) + wt_status_print_tracking(s); } if (s->is_initial) { @@@ -399,7 -421,7 +421,7 @@@ int git_status_config(const char *k, co } if (!strcmp(k, "status.showuntrackedfiles")) { if (!v) - return config_error_nonbool(v); + return config_error_nonbool(k); else if (!strcmp(v, "no")) show_untracked_files = SHOW_NO_UNTRACKED_FILES; else if (!strcmp(v, "normal"))