Skip to content

Commit 66996be

Browse files
anderskgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent abe6bb3 commit 66996be

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

builtin/fetch.c

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ static struct ref *get_ref_map(struct remote *remote,
552552
for (i = 0; i < fetch_refspec->nr; i++)
553553
get_fetch_map(ref_map, &fetch_refspec->items[i], &oref_tail, 1);
554554
} 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)");
556556
} else {
557557
/* Use the defaults */
558558
struct branch *branch = branch_get(NULL);
@@ -583,7 +583,7 @@ static struct ref *get_ref_map(struct remote *remote,
583583
} else if (!prefetch) {
584584
ref_map = get_remote_ref(remote_refs, "HEAD");
585585
if (!ref_map)
586-
die(_("Couldn't find remote ref HEAD"));
586+
die(_("couldn't find remote ref HEAD"));
587587
ref_map->fetch_head_status = FETCH_HEAD_MERGE;
588588
tail = &ref_map->next;
589589
}
@@ -1067,13 +1067,13 @@ static void close_fetch_head(struct fetch_head *fetch_head)
10671067
}
10681068

10691069
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'");
10731073
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"
10751075
"'--no-show-forced-updates' or run 'git config fetch.showForcedUpdates false'\n"
1076-
" to avoid this check.\n");
1076+
"to avoid this check\n");
10771077

10781078
static int store_updated_refs(const char *raw_url, const char *remote_name,
10791079
int connectivity_checked, struct ref *ref_map)
@@ -1395,8 +1395,9 @@ static void check_not_current_branch(struct ref *ref_map)
13951395
for (; ref_map; ref_map = ref_map->next)
13961396
if (ref_map->peer_ref && !strcmp(current_branch->refname,
13971397
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);
14001401
}
14011402

14021403
static int truncate_fetch_head(void)
@@ -1414,10 +1415,10 @@ static void set_option(struct transport *transport, const char *name, const char
14141415
{
14151416
int r = transport_set_option(transport, name, value);
14161417
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"),
14181419
name, value, transport->url);
14191420
if (r > 0)
1420-
warning(_("Option \"%s\" is ignored for %s\n"),
1421+
warning(_("option \"%s\" is ignored for %s\n"),
14211422
name, transport->url);
14221423
}
14231424

@@ -1451,7 +1452,7 @@ static void add_negotiation_tips(struct git_transport_options *smart_options)
14511452
old_nr = oids->nr;
14521453
for_each_glob_ref(add_oid, s, oids);
14531454
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",
14551456
s);
14561457
}
14571458
smart_options->negotiation_tips = oids;
@@ -1489,7 +1490,7 @@ static struct transport *prepare_transport(struct remote *remote, int deepen)
14891490
if (transport->smart_options)
14901491
add_negotiation_tips(transport->smart_options);
14911492
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");
14931494
}
14941495
return transport;
14951496
}
@@ -1651,8 +1652,8 @@ static int do_fetch(struct transport *transport,
16511652
else
16521653
warning(_("unknown branch type"));
16531654
} 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"));
16561657
}
16571658
}
16581659
skip:
@@ -1790,7 +1791,7 @@ static int fetch_failed_to_start(struct strbuf *out, void *cb, void *task_cb)
17901791
struct parallel_fetch_state *state = cb;
17911792
const char *remote = task_cb;
17921793

1793-
state->result = error(_("Could not fetch %s"), remote);
1794+
state->result = error(_("could not fetch %s"), remote);
17941795

17951796
return 0;
17961797
}
@@ -1845,7 +1846,7 @@ static int fetch_multiple(struct string_list *list, int max_children)
18451846
if (verbosity >= 0)
18461847
printf(_("Fetching %s\n"), name);
18471848
if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
1848-
error(_("Could not fetch %s"), name);
1849+
error(_("could not fetch %s"), name);
18491850
result = 1;
18501851
}
18511852
strvec_pop(&argv);
@@ -1906,8 +1907,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
19061907
int remote_via_config = remote_is_configured(remote, 0);
19071908

19081909
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"));
19111912

19121913
gtransport = prepare_transport(remote, 1);
19131914

@@ -1942,7 +1943,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
19421943
if (!strcmp(argv[i], "tag")) {
19431944
i++;
19441945
if (i >= argc)
1945-
die(_("You need to specify a tag name."));
1946+
die(_("you need to specify a tag name"));
19461947

19471948
refspec_appendf(&rs, "refs/tags/%s:refs/tags/%s",
19481949
argv[i], argv[i]);
@@ -2010,7 +2011,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
20102011

20112012
if (deepen_relative) {
20122013
if (deepen_relative < 0)
2013-
die(_("Negative depth in --deepen is not supported"));
2014+
die(_("negative depth in --deepen is not supported"));
20142015
if (depth)
20152016
die(_("--deepen and --depth are mutually exclusive"));
20162017
depth = xstrfmt("%d", deepen_relative);
@@ -2047,14 +2048,15 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
20472048
/* All arguments are assumed to be remotes or groups */
20482049
for (i = 0; i < argc; i++)
20492050
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]);
20512053
} else {
20522054
/* Single remote or group */
20532055
(void) add_remote_or_group(argv[0], &list);
20542056
if (list.nr > 1) {
20552057
/* More than one remote */
20562058
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"));
20582060
} else {
20592061
/* Zero or one remotes */
20602062
remote = remote_get(argv[0]);
@@ -2075,7 +2077,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
20752077
if (gtransport->smart_options) {
20762078
gtransport->smart_options->acked_commits = &acked_commits;
20772079
} else {
2078-
warning(_("Protocol does not support --negotiate-only, exiting."));
2080+
warning(_("protocol does not support --negotiate-only, exiting"));
20792081
return 1;
20802082
}
20812083
if (server_options.nr)

0 commit comments

Comments
 (0)