|
|
@ -185,31 +185,12 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q, |
|
|
|
wt_status_print_trailer(s); |
|
|
|
wt_status_print_trailer(s); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void wt_status_print_initial(struct wt_status *s) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int i; |
|
|
|
|
|
|
|
struct strbuf buf = STRBUF_INIT; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (active_nr) { |
|
|
|
|
|
|
|
s->commitable = 1; |
|
|
|
|
|
|
|
wt_status_print_cached_header(s); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (i = 0; i < active_nr; i++) { |
|
|
|
|
|
|
|
color_fprintf(s->fp, color(WT_STATUS_HEADER), "#\t"); |
|
|
|
|
|
|
|
color_fprintf_ln(s->fp, color(WT_STATUS_UPDATED), "new file: %s", |
|
|
|
|
|
|
|
quote_path(active_cache[i]->name, -1, |
|
|
|
|
|
|
|
&buf, s->prefix)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (active_nr) |
|
|
|
|
|
|
|
wt_status_print_trailer(s); |
|
|
|
|
|
|
|
strbuf_release(&buf); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void wt_status_print_updated(struct wt_status *s) |
|
|
|
static void wt_status_print_updated(struct wt_status *s) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct rev_info rev; |
|
|
|
struct rev_info rev; |
|
|
|
init_revisions(&rev, NULL); |
|
|
|
init_revisions(&rev, NULL); |
|
|
|
setup_revisions(0, NULL, &rev, s->reference); |
|
|
|
setup_revisions(0, NULL, &rev, |
|
|
|
|
|
|
|
s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference); |
|
|
|
rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK; |
|
|
|
rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK; |
|
|
|
rev.diffopt.format_callback = wt_status_print_updated_cb; |
|
|
|
rev.diffopt.format_callback = wt_status_print_updated_cb; |
|
|
|
rev.diffopt.format_callback_data = s; |
|
|
|
rev.diffopt.format_callback_data = s; |
|
|
@ -298,7 +279,8 @@ static void wt_status_print_verbose(struct wt_status *s) |
|
|
|
struct rev_info rev; |
|
|
|
struct rev_info rev; |
|
|
|
|
|
|
|
|
|
|
|
init_revisions(&rev, NULL); |
|
|
|
init_revisions(&rev, NULL); |
|
|
|
setup_revisions(0, NULL, &rev, s->reference); |
|
|
|
setup_revisions(0, NULL, &rev, |
|
|
|
|
|
|
|
s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference); |
|
|
|
rev.diffopt.output_format |= DIFF_FORMAT_PATCH; |
|
|
|
rev.diffopt.output_format |= DIFF_FORMAT_PATCH; |
|
|
|
rev.diffopt.detect_rename = 1; |
|
|
|
rev.diffopt.detect_rename = 1; |
|
|
|
DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); |
|
|
|
DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); |
|
|
@ -360,12 +342,9 @@ void wt_status_print(struct wt_status *s) |
|
|
|
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER), "#"); |
|
|
|
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER), "#"); |
|
|
|
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER), "# Initial commit"); |
|
|
|
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER), "# Initial commit"); |
|
|
|
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER), "#"); |
|
|
|
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER), "#"); |
|
|
|
wt_status_print_initial(s); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
wt_status_print_updated(s); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wt_status_print_updated(s); |
|
|
|
wt_status_print_changed(s); |
|
|
|
wt_status_print_changed(s); |
|
|
|
if (wt_status_submodule_summary) |
|
|
|
if (wt_status_submodule_summary) |
|
|
|
wt_status_print_submodule_summary(s); |
|
|
|
wt_status_print_submodule_summary(s); |
|
|
@ -374,7 +353,7 @@ void wt_status_print(struct wt_status *s) |
|
|
|
else if (s->commitable) |
|
|
|
else if (s->commitable) |
|
|
|
fprintf(s->fp, "# Untracked files not listed (use -u option to show untracked files)\n"); |
|
|
|
fprintf(s->fp, "# Untracked files not listed (use -u option to show untracked files)\n"); |
|
|
|
|
|
|
|
|
|
|
|
if (s->verbose && !s->is_initial) |
|
|
|
if (s->verbose) |
|
|
|
wt_status_print_verbose(s); |
|
|
|
wt_status_print_verbose(s); |
|
|
|
if (!s->commitable) { |
|
|
|
if (!s->commitable) { |
|
|
|
if (s->amend) |
|
|
|
if (s->amend) |
|
|
|