Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-14 23:54:19 +0300
committerJunio C Hamano <gitster@pobox.com>2020-02-14 23:54:19 +0300
commitdaef1b300b07c3d17d47c3bf01ebde28b62ff3fe (patch)
tree3907573bbdd40095398e9cd159d3e971d4233a18 /builtin/add.c
parentd8437c57fa0752716dde2d3747e7c22bf7ce2e41 (diff)
parent887a0fd57336dc5ff3ac28b6de0be91278e9e179 (diff)
Merge branch 'hw/advice-add-nothing'
Two help messages given when "git add" notices the user gave it nothing to add have been updated to use advise() API. * hw/advice-add-nothing: add: change advice config variables used by the add API add: use advise function to display hints
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/add.c b/builtin/add.c
index f7e627f3b9b..18a0881ecf9 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -406,7 +406,10 @@ static int add_files(struct dir_struct *dir, int flags)
fprintf(stderr, _(ignore_error));
for (i = 0; i < dir->ignored_nr; i++)
fprintf(stderr, "%s\n", dir->ignored[i]->name);
- fprintf(stderr, _("Use -f if you really want to add them.\n"));
+ if (advice_add_ignored_file)
+ advise(_("Use -f if you really want to add them.\n"
+ "Turn this message off by running\n"
+ "\"git config advice.addIgnoredFile false\""));
exit_status = 1;
}
@@ -507,7 +510,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
if (require_pathspec && pathspec.nr == 0) {
fprintf(stderr, _("Nothing specified, nothing added.\n"));
- fprintf(stderr, _("Maybe you wanted to say 'git add .'?\n"));
+ if (advice_add_empty_pathspec)
+ advise( _("Maybe you wanted to say 'git add .'?\n"
+ "Turn this message off by running\n"
+ "\"git config advice.addEmptyPathspec false\""));
return 0;
}