MCPcopy Create free account
hub / github.com/git/git / wt_longstatus_print_verbose

Function wt_longstatus_print_verbose

wt-status.c:1161–1215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1159}
1160
1161static void wt_longstatus_print_verbose(struct wt_status *s)
1162{
1163 struct rev_info rev;
1164 struct setup_revision_opt opt;
1165 int dirty_submodules;
1166 const char *c = color(WT_STATUS_HEADER, s);
1167
1168 repo_init_revisions(s->repo, &rev, NULL);
1169 rev.diffopt.flags.allow_textconv = 1;
1170 rev.diffopt.ita_invisible_in_index = 1;
1171
1172 memset(&opt, 0, sizeof(opt));
1173 opt.def = s->is_initial ? empty_tree_oid_hex(s->repo->hash_algo) : s->reference;
1174 setup_revisions(0, NULL, &rev, &opt);
1175
1176 rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
1177 rev.diffopt.detect_rename = s->detect_rename >= 0 ? s->detect_rename : rev.diffopt.detect_rename;
1178 rev.diffopt.rename_limit = s->rename_limit >= 0 ? s->rename_limit : rev.diffopt.rename_limit;
1179 rev.diffopt.rename_score = s->rename_score >= 0 ? s->rename_score : rev.diffopt.rename_score;
1180 rev.diffopt.file = s->fp;
1181 rev.diffopt.close_file = 0;
1182 /*
1183 * If we're not going to stdout, then we definitely don't
1184 * want color, since we are going to the commit message
1185 * file (and even the "auto" setting won't work, since it
1186 * will have checked isatty on stdout). But we then do want
1187 * to insert the scissor line here to reliably remove the
1188 * diff before committing, if we didn't already include one
1189 * before.
1190 */
1191 if (s->fp != stdout) {
1192 rev.diffopt.use_color = GIT_COLOR_NEVER;
1193 wt_status_add_cut_line(s);
1194 }
1195 if (s->verbose > 1 && s->committable) {
1196 /* print_updated() printed a header, so do we */
1197 if (s->fp != stdout)
1198 wt_longstatus_print_trailer(s);
1199 status_printf_ln(s, c, _("Changes to be committed:"));
1200 rev.diffopt.a_prefix = "c/";
1201 rev.diffopt.b_prefix = "i/";
1202 } /* else use prefix as per user config */
1203 run_diff_index(&rev, DIFF_INDEX_CACHED);
1204 if (s->verbose > 1 &&
1205 wt_status_check_worktree_changes(s, &dirty_submodules)) {
1206 status_printf_ln(s, c,
1207 "--------------------------------------------------");
1208 status_printf_ln(s, c, _("Changes not staged for commit:"));
1209 setup_work_tree(the_repository);
1210 rev.diffopt.a_prefix = "i/";
1211 rev.diffopt.b_prefix = "w/";
1212 run_diff_files(&rev, 0);
1213 }
1214 release_revisions(&rev);
1215}
1216
1217static void wt_longstatus_print_tracking(struct wt_status *s)
1218{

Callers 1

wt_longstatus_printFunction · 0.85

Calls 12

repo_init_revisionsFunction · 0.85
empty_tree_oid_hexFunction · 0.85
setup_revisionsFunction · 0.85
wt_status_add_cut_lineFunction · 0.85
status_printf_lnFunction · 0.85
run_diff_indexFunction · 0.85
setup_work_treeFunction · 0.85
run_diff_filesFunction · 0.85
release_revisionsFunction · 0.85
colorFunction · 0.70

Tested by

no test coverage detected