]> git.ipfire.org Git - thirdparty/git.git/blame - wt-status.c
Make git_status_config() file scope static to builtin-commit.c
[thirdparty/git.git] / wt-status.c
CommitLineData
85023577 1#include "cache.h"
c91f0d92 2#include "wt-status.h"
c91f0d92
JK
3#include "object.h"
4#include "dir.h"
5#include "commit.h"
6#include "diff.h"
7#include "revision.h"
8#include "diffcore.h"
a734d0b1 9#include "quote.h"
ac8d5afc 10#include "run-command.h"
b6975ab5 11#include "remote.h"
c91f0d92 12
23900a96 13static char default_wt_status_colors[][COLOR_MAXLEN] = {
dc6ebd4c
AL
14 GIT_COLOR_NORMAL, /* WT_STATUS_HEADER */
15 GIT_COLOR_GREEN, /* WT_STATUS_UPDATED */
16 GIT_COLOR_RED, /* WT_STATUS_CHANGED */
17 GIT_COLOR_RED, /* WT_STATUS_UNTRACKED */
18 GIT_COLOR_RED, /* WT_STATUS_NOBRANCH */
4d4d5726 19 GIT_COLOR_RED, /* WT_STATUS_UNMERGED */
c91f0d92 20};
4d229653 21
d249b098 22static const char *color(int slot, struct wt_status *s)
c91f0d92 23{
23900a96 24 return s->use_color > 0 ? s->color_palette[slot] : "";
c91f0d92
JK
25}
26
27void wt_status_prepare(struct wt_status *s)
28{
29 unsigned char sha1[20];
30 const char *head;
31
cc46a743 32 memset(s, 0, sizeof(*s));
23900a96
JH
33 memcpy(s->color_palette, default_wt_status_colors,
34 sizeof(default_wt_status_colors));
d249b098
JH
35 s->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES;
36 s->use_color = -1;
37 s->relative_paths = 1;
8da19775 38 head = resolve_ref("HEAD", sha1, 0, NULL);
f62363fb 39 s->branch = head ? xstrdup(head) : NULL;
c91f0d92 40 s->reference = "HEAD";
f26a0012 41 s->fp = stdout;
0f729f21 42 s->index_file = get_index_file();
50b7e70f 43 s->change.strdup_strings = 1;
c91f0d92
JK
44}
45
4d4d5726
JH
46static void wt_status_print_unmerged_header(struct wt_status *s)
47{
d249b098 48 const char *c = color(WT_STATUS_HEADER, s);
4d4d5726
JH
49 color_fprintf_ln(s->fp, c, "# Unmerged paths:");
50 if (!s->is_initial)
51 color_fprintf_ln(s->fp, c, "# (use \"git reset %s <file>...\" to unstage)", s->reference);
52 else
53 color_fprintf_ln(s->fp, c, "# (use \"git rm --cached <file>...\" to unstage)");
54 color_fprintf_ln(s->fp, c, "# (use \"git add <file>...\" to mark resolution)");
55 color_fprintf_ln(s->fp, c, "#");
56}
57
f26a0012 58static void wt_status_print_cached_header(struct wt_status *s)
3c1eb9cb 59{
d249b098 60 const char *c = color(WT_STATUS_HEADER, s);
f26a0012 61 color_fprintf_ln(s->fp, c, "# Changes to be committed:");
ff58b9aa 62 if (!s->is_initial) {
f26a0012 63 color_fprintf_ln(s->fp, c, "# (use \"git reset %s <file>...\" to unstage)", s->reference);
3c1eb9cb 64 } else {
f26a0012 65 color_fprintf_ln(s->fp, c, "# (use \"git rm --cached <file>...\" to unstage)");
3c1eb9cb 66 }
f26a0012 67 color_fprintf_ln(s->fp, c, "#");
3c1eb9cb
JR
68}
69
bb914b14
AM
70static void wt_status_print_dirty_header(struct wt_status *s,
71 int has_deleted)
c91f0d92 72{
d249b098 73 const char *c = color(WT_STATUS_HEADER, s);
bb914b14
AM
74 color_fprintf_ln(s->fp, c, "# Changed but not updated:");
75 if (!has_deleted)
76 color_fprintf_ln(s->fp, c, "# (use \"git add <file>...\" to update what will be committed)");
77 else
78 color_fprintf_ln(s->fp, c, "# (use \"git add/rm <file>...\" to update what will be committed)");
4d6e4c4d 79 color_fprintf_ln(s->fp, c, "# (use \"git checkout -- <file>...\" to discard changes in working directory)");
bb914b14
AM
80 color_fprintf_ln(s->fp, c, "#");
81}
82
83static void wt_status_print_untracked_header(struct wt_status *s)
84{
d249b098 85 const char *c = color(WT_STATUS_HEADER, s);
bb914b14
AM
86 color_fprintf_ln(s->fp, c, "# Untracked files:");
87 color_fprintf_ln(s->fp, c, "# (use \"git add <file>...\" to include in what will be committed)");
f26a0012 88 color_fprintf_ln(s->fp, c, "#");
c91f0d92
JK
89}
90
f26a0012 91static void wt_status_print_trailer(struct wt_status *s)
c91f0d92 92{
d249b098 93 color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
c91f0d92
JK
94}
95
a734d0b1 96#define quote_path quote_path_relative
3a946802 97
4d4d5726
JH
98static void wt_status_print_unmerged_data(struct wt_status *s,
99 struct string_list_item *it)
100{
d249b098 101 const char *c = color(WT_STATUS_UNMERGED, s);
4d4d5726
JH
102 struct wt_status_change_data *d = it->util;
103 struct strbuf onebuf = STRBUF_INIT;
104 const char *one, *how = "bug";
105
106 one = quote_path(it->string, -1, &onebuf, s->prefix);
d249b098 107 color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
4d4d5726
JH
108 switch (d->stagemask) {
109 case 1: how = "both deleted:"; break;
110 case 2: how = "added by us:"; break;
111 case 3: how = "deleted by them:"; break;
112 case 4: how = "added by them:"; break;
113 case 5: how = "deleted by us:"; break;
114 case 6: how = "both added:"; break;
115 case 7: how = "both modified:"; break;
116 }
117 color_fprintf(s->fp, c, "%-20s%s\n", how, one);
118 strbuf_release(&onebuf);
119}
120
50b7e70f
JH
121static void wt_status_print_change_data(struct wt_status *s,
122 int change_type,
123 struct string_list_item *it)
c91f0d92 124{
50b7e70f 125 struct wt_status_change_data *d = it->util;
d249b098 126 const char *c = color(change_type, s);
50b7e70f
JH
127 int status = status;
128 char *one_name;
129 char *two_name;
3a946802 130 const char *one, *two;
f285a2d7 131 struct strbuf onebuf = STRBUF_INIT, twobuf = STRBUF_INIT;
3a946802 132
50b7e70f
JH
133 one_name = two_name = it->string;
134 switch (change_type) {
135 case WT_STATUS_UPDATED:
136 status = d->index_status;
137 if (d->head_path)
138 one_name = d->head_path;
139 break;
140 case WT_STATUS_CHANGED:
141 status = d->worktree_status;
142 break;
143 }
144
145 one = quote_path(one_name, -1, &onebuf, s->prefix);
146 two = quote_path(two_name, -1, &twobuf, s->prefix);
3a946802 147
d249b098 148 color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
50b7e70f 149 switch (status) {
c91f0d92 150 case DIFF_STATUS_ADDED:
f26a0012 151 color_fprintf(s->fp, c, "new file: %s", one);
3a946802 152 break;
c91f0d92 153 case DIFF_STATUS_COPIED:
f26a0012 154 color_fprintf(s->fp, c, "copied: %s -> %s", one, two);
c91f0d92
JK
155 break;
156 case DIFF_STATUS_DELETED:
f26a0012 157 color_fprintf(s->fp, c, "deleted: %s", one);
3a946802 158 break;
c91f0d92 159 case DIFF_STATUS_MODIFIED:
f26a0012 160 color_fprintf(s->fp, c, "modified: %s", one);
3a946802 161 break;
c91f0d92 162 case DIFF_STATUS_RENAMED:
f26a0012 163 color_fprintf(s->fp, c, "renamed: %s -> %s", one, two);
c91f0d92
JK
164 break;
165 case DIFF_STATUS_TYPE_CHANGED:
f26a0012 166 color_fprintf(s->fp, c, "typechange: %s", one);
3a946802 167 break;
c91f0d92 168 case DIFF_STATUS_UNKNOWN:
f26a0012 169 color_fprintf(s->fp, c, "unknown: %s", one);
3a946802 170 break;
c91f0d92 171 case DIFF_STATUS_UNMERGED:
f26a0012 172 color_fprintf(s->fp, c, "unmerged: %s", one);
3a946802 173 break;
c91f0d92 174 default:
50b7e70f 175 die("bug: unhandled diff status %c", status);
c91f0d92 176 }
f26a0012 177 fprintf(s->fp, "\n");
367c9886
JS
178 strbuf_release(&onebuf);
179 strbuf_release(&twobuf);
c91f0d92
JK
180}
181
50b7e70f
JH
182static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
183 struct diff_options *options,
184 void *data)
c91f0d92
JK
185{
186 struct wt_status *s = data;
c91f0d92 187 int i;
50b7e70f
JH
188
189 if (!q->nr)
190 return;
191 s->workdir_dirty = 1;
c91f0d92 192 for (i = 0; i < q->nr; i++) {
50b7e70f
JH
193 struct diff_filepair *p;
194 struct string_list_item *it;
195 struct wt_status_change_data *d;
196
197 p = q->queue[i];
198 it = string_list_insert(p->one->path, &s->change);
199 d = it->util;
200 if (!d) {
201 d = xcalloc(1, sizeof(*d));
202 it->util = d;
c91f0d92 203 }
50b7e70f
JH
204 if (!d->worktree_status)
205 d->worktree_status = p->status;
c91f0d92 206 }
c91f0d92
JK
207}
208
4d4d5726
JH
209static int unmerged_mask(const char *path)
210{
211 int pos, mask;
212 struct cache_entry *ce;
213
214 pos = cache_name_pos(path, strlen(path));
215 if (0 <= pos)
216 return 0;
217
218 mask = 0;
219 pos = -pos-1;
220 while (pos < active_nr) {
221 ce = active_cache[pos++];
222 if (strcmp(ce->name, path) || !ce_stage(ce))
223 break;
224 mask |= (1 << (ce_stage(ce) - 1));
225 }
226 return mask;
227}
228
50b7e70f
JH
229static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
230 struct diff_options *options,
231 void *data)
c91f0d92 232{
6e458bf6 233 struct wt_status *s = data;
c91f0d92 234 int i;
50b7e70f
JH
235
236 for (i = 0; i < q->nr; i++) {
237 struct diff_filepair *p;
238 struct string_list_item *it;
239 struct wt_status_change_data *d;
240
241 p = q->queue[i];
242 it = string_list_insert(p->two->path, &s->change);
243 d = it->util;
244 if (!d) {
245 d = xcalloc(1, sizeof(*d));
246 it->util = d;
247 }
248 if (!d->index_status)
249 d->index_status = p->status;
250 switch (p->status) {
251 case DIFF_STATUS_COPIED:
252 case DIFF_STATUS_RENAMED:
253 d->head_path = xstrdup(p->one->path);
254 break;
4d4d5726
JH
255 case DIFF_STATUS_UNMERGED:
256 d->stagemask = unmerged_mask(p->two->path);
257 break;
50b7e70f 258 }
6e458bf6 259 }
c91f0d92
JK
260}
261
50b7e70f 262static void wt_status_collect_changes_worktree(struct wt_status *s)
c91f0d92
JK
263{
264 struct rev_info rev;
50b7e70f
JH
265
266 init_revisions(&rev, NULL);
267 setup_revisions(0, NULL, &rev, NULL);
268 rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
269 rev.diffopt.format_callback = wt_status_collect_changed_cb;
270 rev.diffopt.format_callback_data = s;
271 run_diff_files(&rev, 0);
272}
273
274static void wt_status_collect_changes_index(struct wt_status *s)
275{
276 struct rev_info rev;
277
c91f0d92 278 init_revisions(&rev, NULL);
c1e255b7
JK
279 setup_revisions(0, NULL, &rev,
280 s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference);
c91f0d92 281 rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
50b7e70f 282 rev.diffopt.format_callback = wt_status_collect_updated_cb;
c91f0d92
JK
283 rev.diffopt.format_callback_data = s;
284 rev.diffopt.detect_rename = 1;
50705915 285 rev.diffopt.rename_limit = 200;
f714fb84 286 rev.diffopt.break_opt = 0;
c91f0d92
JK
287 run_diff_index(&rev, 1);
288}
289
50b7e70f
JH
290static void wt_status_collect_changes_initial(struct wt_status *s)
291{
292 int i;
293
294 for (i = 0; i < active_nr; i++) {
295 struct string_list_item *it;
296 struct wt_status_change_data *d;
297 struct cache_entry *ce = active_cache[i];
298
299 it = string_list_insert(ce->name, &s->change);
300 d = it->util;
301 if (!d) {
302 d = xcalloc(1, sizeof(*d));
303 it->util = d;
304 }
4d4d5726 305 if (ce_stage(ce)) {
50b7e70f 306 d->index_status = DIFF_STATUS_UNMERGED;
4d4d5726
JH
307 d->stagemask |= (1 << (ce_stage(ce) - 1));
308 }
50b7e70f
JH
309 else
310 d->index_status = DIFF_STATUS_ADDED;
311 }
312}
313
314void wt_status_collect_changes(struct wt_status *s)
315{
316 wt_status_collect_changes_worktree(s);
317
318 if (s->is_initial)
319 wt_status_collect_changes_initial(s);
320 else
321 wt_status_collect_changes_index(s);
322}
323
4d4d5726
JH
324static void wt_status_print_unmerged(struct wt_status *s)
325{
326 int shown_header = 0;
327 int i;
328
329 for (i = 0; i < s->change.nr; i++) {
330 struct wt_status_change_data *d;
331 struct string_list_item *it;
332 it = &(s->change.items[i]);
333 d = it->util;
334 if (!d->stagemask)
335 continue;
336 if (!shown_header) {
337 wt_status_print_unmerged_header(s);
338 shown_header = 1;
339 }
340 wt_status_print_unmerged_data(s, it);
341 }
342 if (shown_header)
343 wt_status_print_trailer(s);
344
345}
346
50b7e70f
JH
347static void wt_status_print_updated(struct wt_status *s)
348{
349 int shown_header = 0;
350 int i;
351
352 for (i = 0; i < s->change.nr; i++) {
353 struct wt_status_change_data *d;
354 struct string_list_item *it;
355 it = &(s->change.items[i]);
356 d = it->util;
357 if (!d->index_status ||
358 d->index_status == DIFF_STATUS_UNMERGED)
359 continue;
360 if (!shown_header) {
361 wt_status_print_cached_header(s);
362 s->commitable = 1;
363 shown_header = 1;
364 }
365 wt_status_print_change_data(s, WT_STATUS_UPDATED, it);
366 }
367 if (shown_header)
368 wt_status_print_trailer(s);
369}
370
371/*
372 * -1 : has delete
373 * 0 : no change
374 * 1 : some change but no delete
375 */
376static int wt_status_check_worktree_changes(struct wt_status *s)
377{
378 int i;
379 int changes = 0;
380
381 for (i = 0; i < s->change.nr; i++) {
382 struct wt_status_change_data *d;
383 d = s->change.items[i].util;
4d4d5726
JH
384 if (!d->worktree_status ||
385 d->worktree_status == DIFF_STATUS_UNMERGED)
50b7e70f
JH
386 continue;
387 changes = 1;
388 if (d->worktree_status == DIFF_STATUS_DELETED)
389 return -1;
390 }
391 return changes;
392}
393
c91f0d92
JK
394static void wt_status_print_changed(struct wt_status *s)
395{
50b7e70f
JH
396 int i;
397 int worktree_changes = wt_status_check_worktree_changes(s);
398
399 if (!worktree_changes)
400 return;
401
402 wt_status_print_dirty_header(s, worktree_changes < 0);
403
404 for (i = 0; i < s->change.nr; i++) {
405 struct wt_status_change_data *d;
406 struct string_list_item *it;
407 it = &(s->change.items[i]);
408 d = it->util;
4d4d5726
JH
409 if (!d->worktree_status ||
410 d->worktree_status == DIFF_STATUS_UNMERGED)
50b7e70f
JH
411 continue;
412 wt_status_print_change_data(s, WT_STATUS_CHANGED, it);
413 }
414 wt_status_print_trailer(s);
c91f0d92
JK
415}
416
ac8d5afc
PY
417static void wt_status_print_submodule_summary(struct wt_status *s)
418{
419 struct child_process sm_summary;
420 char summary_limit[64];
421 char index[PATH_MAX];
422 const char *env[] = { index, NULL };
423 const char *argv[] = {
424 "submodule",
425 "summary",
426 "--cached",
427 "--for-status",
428 "--summary-limit",
429 summary_limit,
430 s->amend ? "HEAD^" : "HEAD",
431 NULL
432 };
433
d249b098 434 sprintf(summary_limit, "%d", s->submodule_summary);
ac8d5afc
PY
435 snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", s->index_file);
436
437 memset(&sm_summary, 0, sizeof(sm_summary));
438 sm_summary.argv = argv;
439 sm_summary.env = env;
440 sm_summary.git_cmd = 1;
441 sm_summary.no_stdin = 1;
442 fflush(s->fp);
443 sm_summary.out = dup(fileno(s->fp)); /* run_command closes it */
444 run_command(&sm_summary);
445}
446
6e458bf6 447static void wt_status_print_untracked(struct wt_status *s)
c91f0d92
JK
448{
449 struct dir_struct dir;
c91f0d92
JK
450 int i;
451 int shown_header = 0;
f285a2d7 452 struct strbuf buf = STRBUF_INIT;
c91f0d92
JK
453
454 memset(&dir, 0, sizeof(dir));
d249b098 455 if (s->show_untracked_files != SHOW_ALL_UNTRACKED_FILES)
7c4c97c0
JS
456 dir.flags |=
457 DIR_SHOW_OTHER_DIRECTORIES | DIR_HIDE_EMPTY_DIRECTORIES;
039bc64e 458 setup_standard_excludes(&dir);
c91f0d92 459
1d8842d9 460 fill_directory(&dir, NULL);
c91f0d92 461 for(i = 0; i < dir.nr; i++) {
c91f0d92 462 struct dir_entry *ent = dir.entries[i];
98fa4738
JK
463 if (!cache_name_is_other(ent->name, ent->len))
464 continue;
c91f0d92 465 if (!shown_header) {
2a3a3c24 466 s->workdir_untracked = 1;
bb914b14 467 wt_status_print_untracked_header(s);
c91f0d92
JK
468 shown_header = 1;
469 }
d249b098
JH
470 color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
471 color_fprintf_ln(s->fp, color(WT_STATUS_UNTRACKED, s), "%s",
367c9886
JS
472 quote_path(ent->name, ent->len,
473 &buf, s->prefix));
c91f0d92 474 }
367c9886 475 strbuf_release(&buf);
c91f0d92
JK
476}
477
478static void wt_status_print_verbose(struct wt_status *s)
479{
480 struct rev_info rev;
99a12694 481
c91f0d92 482 init_revisions(&rev, NULL);
5ec11af6 483 DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
1324fb6f
JK
484 setup_revisions(0, NULL, &rev,
485 s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference);
c91f0d92
JK
486 rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
487 rev.diffopt.detect_rename = 1;
4ba0cb27
KH
488 rev.diffopt.file = s->fp;
489 rev.diffopt.close_file = 0;
4f672ad6
JK
490 /*
491 * If we're not going to stdout, then we definitely don't
492 * want color, since we are going to the commit message
493 * file (and even the "auto" setting won't work, since it
494 * will have checked isatty on stdout).
495 */
496 if (s->fp != stdout)
497 DIFF_OPT_CLR(&rev.diffopt, COLOR_DIFF);
c91f0d92
JK
498 run_diff_index(&rev, 1);
499}
500
b6975ab5
JH
501static void wt_status_print_tracking(struct wt_status *s)
502{
503 struct strbuf sb = STRBUF_INIT;
504 const char *cp, *ep;
505 struct branch *branch;
506
507 assert(s->branch && !s->is_initial);
508 if (prefixcmp(s->branch, "refs/heads/"))
509 return;
510 branch = branch_get(s->branch + 11);
511 if (!format_tracking_info(branch, &sb))
512 return;
513
514 for (cp = sb.buf; (ep = strchr(cp, '\n')) != NULL; cp = ep + 1)
d249b098 515 color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s),
b6975ab5 516 "# %.*s", (int)(ep - cp), cp);
d249b098 517 color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
b6975ab5
JH
518}
519
c91f0d92
JK
520void wt_status_print(struct wt_status *s)
521{
98bf8a47 522 unsigned char sha1[20];
d249b098 523 const char *branch_color = color(WT_STATUS_HEADER, s);
98bf8a47 524
950ce2e2 525 s->is_initial = get_sha1(s->reference, sha1) ? 1 : 0;
bda324cf
JH
526 if (s->branch) {
527 const char *on_what = "On branch ";
528 const char *branch_name = s->branch;
cc44c765 529 if (!prefixcmp(branch_name, "refs/heads/"))
bda324cf
JH
530 branch_name += 11;
531 else if (!strcmp(branch_name, "HEAD")) {
532 branch_name = "";
d249b098 533 branch_color = color(WT_STATUS_NOBRANCH, s);
bda324cf
JH
534 on_what = "Not currently on any branch.";
535 }
d249b098 536 color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "# ");
950ce2e2 537 color_fprintf_ln(s->fp, branch_color, "%s%s", on_what, branch_name);
b6975ab5
JH
538 if (!s->is_initial)
539 wt_status_print_tracking(s);
bda324cf 540 }
c91f0d92 541
50b7e70f
JH
542 wt_status_collect_changes(s);
543
c91f0d92 544 if (s->is_initial) {
d249b098
JH
545 color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
546 color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "# Initial commit");
547 color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
c91f0d92
JK
548 }
549
4d4d5726 550 wt_status_print_unmerged(s);
c1e255b7 551 wt_status_print_updated(s);
c91f0d92 552 wt_status_print_changed(s);
d249b098 553 if (s->submodule_summary)
ac8d5afc 554 wt_status_print_submodule_summary(s);
d249b098 555 if (s->show_untracked_files)
6c2ce048
MSO
556 wt_status_print_untracked(s);
557 else if (s->commitable)
558 fprintf(s->fp, "# Untracked files not listed (use -u option to show untracked files)\n");
c91f0d92 559
1324fb6f 560 if (s->verbose)
c91f0d92 561 wt_status_print_verbose(s);
6e458bf6
JR
562 if (!s->commitable) {
563 if (s->amend)
f26a0012 564 fprintf(s->fp, "# No changes\n");
37d07f8f
JH
565 else if (s->nowarn)
566 ; /* nothing */
2a3a3c24 567 else if (s->workdir_dirty)
dcbc7bbe 568 printf("no changes added to commit (use \"git add\" and/or \"git commit -a\")\n");
2a3a3c24
JR
569 else if (s->workdir_untracked)
570 printf("nothing added to commit but untracked files present (use \"git add\" to track)\n");
571 else if (s->is_initial)
572 printf("nothing to commit (create/copy files and use \"git add\" to track)\n");
d249b098 573 else if (!s->show_untracked_files)
6c2ce048 574 printf("nothing to commit (use -u to show untracked files)\n");
2a3a3c24
JR
575 else
576 printf("nothing to commit (working directory clean)\n");
6e458bf6 577 }
c91f0d92 578}