Skip to content

Commit 7435e7e

Browse files
anderskgitster
authored andcommitted
branch: 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 c25edee commit 7435e7e

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

branch.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int install_branch_config(int flag, const char *local, const char *origin, const
6464
if (skip_prefix(remote, "refs/heads/", &shortname)
6565
&& !strcmp(local, shortname)
6666
&& !origin) {
67-
warning(_("Not setting branch %s as its own upstream."),
67+
warning(_("not setting branch %s as its own upstream"),
6868
local);
6969
return 0;
7070
}
@@ -116,7 +116,7 @@ int install_branch_config(int flag, const char *local, const char *origin, const
116116

117117
out_err:
118118
strbuf_release(&key);
119-
error(_("Unable to write upstream branch configuration"));
119+
error(_("unable to write upstream branch configuration"));
120120

121121
advise(_(tracking_advice),
122122
origin ? origin : "",
@@ -153,7 +153,7 @@ static void setup_tracking(const char *new_ref, const char *orig_ref,
153153
}
154154

155155
if (tracking.matches > 1)
156-
die(_("Not tracking: ambiguous information for ref %s"),
156+
die(_("not tracking: ambiguous information for ref %s"),
157157
orig_ref);
158158

159159
if (install_branch_config(config_flags, new_ref, tracking.remote,
@@ -186,7 +186,7 @@ int read_branch_desc(struct strbuf *buf, const char *branch_name)
186186
int validate_branchname(const char *name, struct strbuf *ref)
187187
{
188188
if (strbuf_check_branch_ref(ref, name))
189-
die(_("'%s' is not a valid branch name."), name);
189+
die(_("'%s' is not a valid branch name"), name);
190190

191191
return ref_exists(ref->buf);
192192
}
@@ -205,12 +205,12 @@ int validate_new_branchname(const char *name, struct strbuf *ref, int force)
205205
return 0;
206206

207207
if (!force)
208-
die(_("A branch named '%s' already exists."),
208+
die(_("a branch named '%s' already exists"),
209209
ref->buf + strlen("refs/heads/"));
210210

211211
head = resolve_ref_unsafe("HEAD", 0, NULL, NULL);
212212
if (!is_bare_repository() && head && !strcmp(head, ref->buf))
213-
die(_("Cannot force update the current branch."));
213+
die(_("cannot force update the current branch"));
214214

215215
return 1;
216216
}
@@ -230,7 +230,7 @@ static int validate_remote_tracking_branch(char *ref)
230230
}
231231

232232
static const char upstream_not_branch[] =
233-
N_("Cannot setup tracking information; starting point '%s' is not a branch.");
233+
N_("cannot set up tracking information; starting point '%s' is not a branch");
234234
static const char upstream_missing[] =
235235
N_("the requested upstream branch '%s' does not exist");
236236
static const char upstream_advice[] =
@@ -278,7 +278,7 @@ void create_branch(struct repository *r,
278278
}
279279
die(_(upstream_missing), start_name);
280280
}
281-
die(_("Not a valid object name: '%s'."), start_name);
281+
die(_("not a valid object name: '%s'"), start_name);
282282
}
283283

284284
switch (dwim_ref(start_name, strlen(start_name), &oid, &real_ref, 0)) {
@@ -298,12 +298,12 @@ void create_branch(struct repository *r,
298298
}
299299
break;
300300
default:
301-
die(_("Ambiguous object name: '%s'."), start_name);
301+
die(_("ambiguous object name: '%s'"), start_name);
302302
break;
303303
}
304304

305305
if ((commit = lookup_commit_reference(r, &oid)) == NULL)
306-
die(_("Not a valid branch point: '%s'."), start_name);
306+
die(_("not a valid branch point: '%s'"), start_name);
307307
oidcpy(&oid, &commit->object.oid);
308308

309309
if (reflog)

t/t2018-checkout-branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ test_expect_success 'checkout -b to an existing branch fails' '
148148
test_expect_success 'checkout -b to @{-1} fails with the right branch name' '
149149
git checkout branch1 &&
150150
git checkout branch2 &&
151-
echo >expect "fatal: A branch named '\''branch1'\'' already exists." &&
151+
echo >expect "fatal: a branch named '\''branch1'\'' already exists" &&
152152
test_must_fail git checkout -b @{-1} 2>actual &&
153153
test_cmp expect actual
154154
'

t/t3200-branch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ test_expect_success '--set-upstream-to fails on a missing src branch' '
888888
'
889889

890890
test_expect_success '--set-upstream-to fails on a non-ref' '
891-
echo "fatal: Cannot setup tracking information; starting point '"'"'HEAD^{}'"'"' is not a branch." >expect &&
891+
echo "fatal: cannot set up tracking information; starting point '"'"'HEAD^{}'"'"' is not a branch" >expect &&
892892
test_must_fail git branch --set-upstream-to HEAD^{} 2>err &&
893893
test_cmp expect err
894894
'
@@ -975,7 +975,7 @@ test_expect_success 'disabled option --set-upstream fails' '
975975
test_expect_success '--set-upstream-to notices an error to set branch as own upstream' '
976976
git branch --set-upstream-to refs/heads/my13 my13 2>actual &&
977977
cat >expect <<-\EOF &&
978-
warning: Not setting branch my13 as its own upstream.
978+
warning: not setting branch my13 as its own upstream
979979
EOF
980980
test_expect_code 1 git config branch.my13.remote &&
981981
test_expect_code 1 git config branch.my13.merge &&

0 commit comments

Comments
 (0)