current="$(git-rev-parse --verify HEAD)"
else
if [ -z "$(git-ls-files)" ]; then
- echo >&2 Nothing to commit
+ echo >&2 'nothing to commit (use "git add file1 file2" to include for commit)'
exit 1
fi
PARENTS=""
"\033[31m", /* WT_STATUS_CHANGED: red */
"\033[31m", /* WT_STATUS_UNTRACKED: red */
};
+static const char* use_add_msg = "use \"git add file1 file2\" to include for commit";
static int parse_status_slot(const char *var, int offset)
{
{
int i;
if (q->nr)
- wt_status_print_header("Changed but not updated",
- "use git-add on files to include for commit");
+ wt_status_print_header("Changed but not updated", use_add_msg);
for (i = 0; i < q->nr; i++)
wt_status_print_filepair(WT_STATUS_CHANGED, q->queue[i]);
if (q->nr)
continue;
}
if (!shown_header) {
- wt_status_print_header("Untracked files",
- "use \"git add\" to add to commit");
+ wt_status_print_header("Untracked files", use_add_msg);
shown_header = 1;
}
color_printf(color(WT_STATUS_HEADER), "#\t");
if (s->verbose && !s->is_initial)
wt_status_print_verbose(s);
if (!s->commitable)
- printf("%s\n", s->amend ? "# No changes" : "nothing to commit");
+ printf("%s (%s)\n",
+ s->amend ? "# No changes" : "nothing to commit",
+ use_add_msg);
}
int git_status_config(const char *k, const char *v)