fetch: lowercase error messages

Documentation/CodingGuidelines says “do not end error messages with a full stop” and “do not capitalize the first word”. Clean up existing messages, some of which we will be touching in later steps in the series, that deviate from these rules in this file, as a preparation for the main part of the topic. Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Anders Kaseorg committed Dec 1, 2021 at 14:15 UTC 66996bea9b6423d8ba9d676e2325323e3179975f
1 file changed +26 -24
builtin/fetch.c
+26 -24
@@ -552,7 +552,7 @@ static struct ref *get_ref_map(struct remote *remote,
552 for (i = 0; i < fetch_refspec->nr; i++)
553 get_fetch_map(ref_map, &fetch_refspec->items[i], &oref_tail, 1);
554 } else if (refmap.nr) {
555 - die("--refmap option is only meaningful with command-line refspec(s).");
555 + die("--refmap option is only meaningful with command-line refspec(s)");
556 } else {
557 /* Use the defaults */
558 struct branch *branch = branch_get(NULL);
@@ -583,7 +583,7 @@ static struct ref *get_ref_map(struct remote *remote,
583 } else if (!prefetch) {
584 ref_map = get_remote_ref(remote_refs, "HEAD");
585 if (!ref_map)
586 - die(_("Couldn't find remote ref HEAD"));
586 + die(_("couldn't find remote ref HEAD"));
587 ref_map->fetch_head_status = FETCH_HEAD_MERGE;
588 tail = &ref_map->next;
589 }
@@ -1067,13 +1067,13 @@ static void close_fetch_head(struct fetch_head *fetch_head)
1067 }
1068
1069 static const char warn_show_forced_updates[] =
1070 -N_("Fetch normally indicates which branches had a forced update,\n"
1071 - "but that check has been disabled. To re-enable, use '--show-forced-updates'\n"
1072 - "flag or run 'git config fetch.showForcedUpdates true'.");
1070 +N_("fetch normally indicates which branches had a forced update,\n"
1071 + "but that check has been disabled; to re-enable, use '--show-forced-updates'\n"
1072 + "flag or run 'git config fetch.showForcedUpdates true'");
1073 static const char warn_time_show_forced_updates[] =
1074 -N_("It took %.2f seconds to check forced updates. You can use\n"
1074 +N_("it took %.2f seconds to check forced updates; you can use\n"
1075 "'--no-show-forced-updates' or run 'git config fetch.showForcedUpdates false'\n"
1076 - " to avoid this check.\n");
1076 + "to avoid this check\n");
1077
1078 static int store_updated_refs(const char *raw_url, const char *remote_name,
1079 int connectivity_checked, struct ref *ref_map)
@@ -1395,8 +1395,9 @@ static void check_not_current_branch(struct ref *ref_map)
1395 for (; ref_map; ref_map = ref_map->next)
1396 if (ref_map->peer_ref && !strcmp(current_branch->refname,
1397 ref_map->peer_ref->name))
1398 - die(_("Refusing to fetch into current branch %s "
1399 - "of non-bare repository"), current_branch->refname);
1398 + die(_("refusing to fetch into current branch %s "
1399 + "of non-bare repository"),
1400 + current_branch->refname);
1401 }
1402
1403 static int truncate_fetch_head(void)
@@ -1414,10 +1415,10 @@ static void set_option(struct transport *transport, const char *name, const char
1415 {
1416 int r = transport_set_option(transport, name, value);
1417 if (r < 0)
1417 - die(_("Option \"%s\" value \"%s\" is not valid for %s"),
1418 + die(_("option \"%s\" value \"%s\" is not valid for %s"),
1419 name, value, transport->url);
1420 if (r > 0)
1420 - warning(_("Option \"%s\" is ignored for %s\n"),
1421 + warning(_("option \"%s\" is ignored for %s\n"),
1422 name, transport->url);
1423 }
1424
@@ -1451,7 +1452,7 @@ static void add_negotiation_tips(struct git_transport_options *smart_options)
1452 old_nr = oids->nr;
1453 for_each_glob_ref(add_oid, s, oids);
1454 if (old_nr == oids->nr)
1454 - warning("Ignoring --negotiation-tip=%s because it does not match any refs",
1455 + warning("ignoring --negotiation-tip=%s because it does not match any refs",
1456 s);
1457 }
1458 smart_options->negotiation_tips = oids;
@@ -1489,7 +1490,7 @@ static struct transport *prepare_transport(struct remote *remote, int deepen)
1490 if (transport->smart_options)
1491 add_negotiation_tips(transport->smart_options);
1492 else
1492 - warning("Ignoring --negotiation-tip because the protocol does not support it.");
1493 + warning("ignoring --negotiation-tip because the protocol does not support it");
1494 }
1495 return transport;
1496 }
@@ -1651,8 +1652,8 @@ static int do_fetch(struct transport *transport,
1652 else
1653 warning(_("unknown branch type"));
1654 } else {
1654 - warning(_("no source branch found.\n"
1655 - "you need to specify exactly one branch with the --set-upstream option."));
1655 + warning(_("no source branch found;\n"
1656 + "you need to specify exactly one branch with the --set-upstream option"));
1657 }
1658 }
1659 skip:
@@ -1790,7 +1791,7 @@ static int fetch_failed_to_start(struct strbuf *out, void *cb, void *task_cb)
1791 struct parallel_fetch_state *state = cb;
1792 const char *remote = task_cb;
1793
1793 - state->result = error(_("Could not fetch %s"), remote);
1794 + state->result = error(_("could not fetch %s"), remote);
1795
1796 return 0;
1797 }
@@ -1845,7 +1846,7 @@ static int fetch_multiple(struct string_list *list, int max_children)
1846 if (verbosity >= 0)
1847 printf(_("Fetching %s\n"), name);
1848 if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
1848 - error(_("Could not fetch %s"), name);
1849 + error(_("could not fetch %s"), name);
1850 result = 1;
1851 }
1852 strvec_pop(&argv);
@@ -1906,8 +1907,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
1907 int remote_via_config = remote_is_configured(remote, 0);
1908
1909 if (!remote)
1909 - die(_("No remote repository specified. Please, specify either a URL or a\n"
1910 - "remote name from which new revisions should be fetched."));
1910 + die(_("no remote repository specified; please specify either a URL or a\n"
1911 + "remote name from which new revisions should be fetched"));
1912
1913 gtransport = prepare_transport(remote, 1);
1914
@@ -1942,7 +1943,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
1943 if (!strcmp(argv[i], "tag")) {
1944 i++;
1945 if (i >= argc)
1945 - die(_("You need to specify a tag name."));
1946 + die(_("you need to specify a tag name"));
1947
1948 refspec_appendf(&rs, "refs/tags/%s:refs/tags/%s",
1949 argv[i], argv[i]);
@@ -2010,7 +2011,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
2011
2012 if (deepen_relative) {
2013 if (deepen_relative < 0)
2013 - die(_("Negative depth in --deepen is not supported"));
2014 + die(_("negative depth in --deepen is not supported"));
2015 if (depth)
2016 die(_("--deepen and --depth are mutually exclusive"));
2017 depth = xstrfmt("%d", deepen_relative);
@@ -2047,14 +2048,15 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
2048 /* All arguments are assumed to be remotes or groups */
2049 for (i = 0; i < argc; i++)
2050 if (!add_remote_or_group(argv[i], &list))
2050 - die(_("No such remote or remote group: %s"), argv[i]);
2051 + die(_("no such remote or remote group: %s"),
2052 + argv[i]);
2053 } else {
2054 /* Single remote or group */
2055 (void) add_remote_or_group(argv[0], &list);
2056 if (list.nr > 1) {
2057 /* More than one remote */
2058 if (argc > 1)
2057 - die(_("Fetching a group and specifying refspecs does not make sense"));
2059 + die(_("fetching a group and specifying refspecs does not make sense"));
2060 } else {
2061 /* Zero or one remotes */
2062 remote = remote_get(argv[0]);
@@ -2075,7 +2077,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
2077 if (gtransport->smart_options) {
2078 gtransport->smart_options->acked_commits = &acked_commits;
2079 } else {
2078 - warning(_("Protocol does not support --negotiate-only, exiting."));
2080 + warning(_("protocol does not support --negotiate-only, exiting"));
2081 return 1;
2082 }
2083 if (server_options.nr)