From: Junio C Hamano Date: Thu, 25 Apr 2019 07:41:13 +0000 (+0900) Subject: Merge branch 'nd/commit-a-with-paths-msg-update' X-Git-Tag: v2.22.0-rc0~69 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e313c768e0daf78da2d9e23967dc6625e9db0837?ds=inline;hp=-c Merge branch 'nd/commit-a-with-paths-msg-update' The message given when "git commit -a " errors out has been updated. * nd/commit-a-with-paths-msg-update: commit: improve error message in "-a " case --- e313c768e0daf78da2d9e23967dc6625e9db0837 diff --combined builtin/commit.c index a138ff85b0,48ddccaa37..833ecb316a --- a/builtin/commit.c +++ b/builtin/commit.c @@@ -235,7 -235,7 +235,7 @@@ static int commit_index_files(void * and return the paths that match the given pattern in list. */ static int list_paths(struct string_list *list, const char *with_tree, - const char *prefix, const struct pathspec *pattern) + const struct pathspec *pattern) { int i, ret; char *m; @@@ -264,7 -264,7 +264,7 @@@ item->util = item; /* better a valid pointer than a fake one */ } - ret = report_path_error(m, pattern, prefix); + ret = report_path_error(m, pattern); free(m); return ret; } @@@ -454,7 -454,7 +454,7 @@@ static const char *prepare_index(int ar die(_("cannot do a partial commit during a cherry-pick.")); } - if (list_paths(&partial, !current_head ? NULL : "HEAD", prefix, &pathspec)) + if (list_paths(&partial, !current_head ? NULL : "HEAD", &pathspec)) exit(1); discard_cache(); @@@ -609,8 -609,7 +609,8 @@@ static void determine_author_info(struc set_ident_var(&date, strbuf_detach(&date_buf, NULL)); } - strbuf_addstr(author_ident, fmt_ident(name, email, date, IDENT_STRICT)); + strbuf_addstr(author_ident, fmt_ident(name, email, WANT_AUTHOR_IDENT, date, + IDENT_STRICT)); assert_split_ident(&author, author_ident); export_one("GIT_AUTHOR_NAME", author.name_begin, author.name_end, 0); export_one("GIT_AUTHOR_EMAIL", author.mail_begin, author.mail_end, 0); @@@ -1039,10 -1038,6 +1039,10 @@@ static void handle_untracked_files_arg( s->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES; else if (!strcmp(untracked_files_arg, "all")) s->show_untracked_files = SHOW_ALL_UNTRACKED_FILES; + /* + * Please update $__git_untracked_file_modes in + * git-completion.bash when you add new options + */ else die(_("Invalid untracked files mode '%s'"), untracked_files_arg); } @@@ -1184,17 -1179,14 +1184,18 @@@ static int parse_and_validate_options(i else if (!strcmp(cleanup_arg, "scissors")) cleanup_mode = use_editor ? COMMIT_MSG_CLEANUP_SCISSORS : COMMIT_MSG_CLEANUP_SPACE; + /* + * Please update _git_commit() in git-completion.bash when you + * add new options. + */ else die(_("Invalid cleanup mode %s"), cleanup_arg); handle_untracked_files_arg(s); if (all && argc > 0) - die(_("Paths with -a does not make sense.")); + die(_("paths '%s ...' with -a does not make sense"), + argv[0]); if (status_format != STATUS_FORMAT_NONE) dry_run = 1;