{"thread":{"id":"60418","subject":"[PATCH v3] builtin/branch.c: adjust error messages to coding guidelines","startedAt":"2023-10-23T14:57:40Z","lastAt":"2023-10-23T20:20:07Z","messageCount":5,"participants":["Isoken June Ibizugbe","Dragan Simic","Rubén Justo","Junio C Hamano"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"483679","messageId":"20231023145708.4029-1-isokenjune@gmail.com","threadId":"60418","inReplyTo":null,"subject":"[PATCH v3] builtin/branch.c: adjust error messages to coding guidelines","fromName":"Isoken June Ibizugbe","fromEmail":"isokenjune@gmail.com","sentAt":"2023-10-23T14:57:08Z","receivedAt":"2023-10-23T14:57:40Z","isPatch":true,"sender":{"key":"isokenjune@gmail.com","avatar":"https://avatars.githubusercontent.com/u/127752393?v=4"},"body":"As per the CodingGuidelines document, it is recommended that error messages such as die(), error() and warning(),\nshould start with a lowercase letter and should not end with a period.\n\nThis patch adjusts tests to match updated messages.\n\nSigned-off-by: Isoken June Ibizugbe <isokenjune@gmail.com>\n---\n builtin/branch.c          | 66 +++++++++++++++++++--------------------\n t/t2407-worktree-heads.sh |  2 +-\n t/t3200-branch.sh         | 16 +++++-----\n t/t3202-show-branch.sh    | 10 +++---\n 4 files changed, 47 insertions(+), 47 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 2ec190b14a..e7ee9bd0f1 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -173,11 +173,11 @@ static int branch_merged(int kind, const char *name,\n \t    (head_rev ? repo_in_merge_bases(the_repository, rev, head_rev) : 0) != merged) {\n \t\tif (merged)\n \t\t\twarning(_(\"deleting branch '%s' that has been merged to\\n\"\n-\t\t\t\t\"         '%s', but not yet merged to HEAD.\"),\n+\t\t\t\t\"         '%s', but not yet merged to HEAD\"),\n \t\t\t\tname, reference_name);\n \t\telse\n \t\t\twarning(_(\"not deleting branch '%s' that is not yet merged to\\n\"\n-\t\t\t\t\"         '%s', even though it is merged to HEAD.\"),\n+\t\t\t\t\"         '%s', even though it is merged to HEAD\"),\n \t\t\t\tname, reference_name);\n \t}\n \tfree(reference_name_to_free);\n@@ -190,13 +190,13 @@ static int check_branch_commit(const char *branchname, const char *refname,\n {\n \tstruct commit *rev = lookup_commit_reference(the_repository, oid);\n \tif (!force && !rev) {\n-\t\terror(_(\"Couldn't look up commit object for '%s'\"), refname);\n+\t\terror(_(\"couldn't look up commit object for '%s'\"), refname);\n \t\treturn -1;\n \t}\n \tif (!force && !branch_merged(kinds, branchname, rev, head_rev)) {\n-\t\terror(_(\"The branch '%s' is not fully merged.\\n\"\n+\t\terror(_(\"the branch '%s' is not fully merged.\\n\"\n \t\t      \"If you are sure you want to delete it, \"\n-\t\t      \"run 'git branch -D %s'.\"), branchname, branchname);\n+\t\t      \"run 'git branch -D %s'\"), branchname, branchname);\n \t\treturn -1;\n \t}\n \treturn 0;\n@@ -207,7 +207,7 @@ static void delete_branch_config(const char *branchname)\n \tstruct strbuf buf = STRBUF_INIT;\n \tstrbuf_addf(&buf, \"branch.%s\", branchname);\n \tif (git_config_rename_section(buf.buf, NULL) < 0)\n-\t\twarning(_(\"Update of config-file failed\"));\n+\t\twarning(_(\"update of config-file failed\"));\n \tstrbuf_release(&buf);\n }\n \n@@ -260,7 +260,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,\n \t\tif (kinds == FILTER_REFS_BRANCHES) {\n \t\t\tconst char *path;\n \t\t\tif ((path = branch_checked_out(name))) {\n-\t\t\t\terror(_(\"Cannot delete branch '%s' \"\n+\t\t\t\terror(_(\"cannot delete branch '%s' \"\n \t\t\t\t\t\"used by worktree at '%s'\"),\n \t\t\t\t      bname.buf, path);\n \t\t\t\tret = 1;\n@@ -275,7 +275,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,\n \t\t\t\t\t&oid, &flags);\n \t\tif (!target) {\n \t\t\tif (remote_branch) {\n-\t\t\t\terror(_(\"remote-tracking branch '%s' not found.\"), bname.buf);\n+\t\t\t\terror(_(\"remote-tracking branch '%s' not found\"), bname.buf);\n \t\t\t} else {\n \t\t\t\tchar *virtual_name = mkpathdup(fmt_remotes, bname.buf);\n \t\t\t\tchar *virtual_target = resolve_refdup(virtual_name,\n@@ -290,7 +290,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,\n \t\t\t\t\t\t\"Did you forget --remote?\"),\n \t\t\t\t\t\tbname.buf);\n \t\t\t\telse\n-\t\t\t\t\terror(_(\"branch '%s' not found.\"), bname.buf);\n+\t\t\t\t\terror(_(\"branch '%s' not found\"), bname.buf);\n \t\t\t\tFREE_AND_NULL(virtual_target);\n \t\t\t}\n \t\t\tret = 1;\n@@ -518,11 +518,11 @@ static void reject_rebase_or_bisect_branch(struct worktree **worktrees,\n \t\t\tcontinue;\n \n \t\tif (is_worktree_being_rebased(wt, target))\n-\t\t\tdie(_(\"Branch %s is being rebased at %s\"),\n+\t\t\tdie(_(\"branch %s is being rebased at %s\"),\n \t\t\t    target, wt->path);\n \n \t\tif (is_worktree_being_bisected(wt, target))\n-\t\t\tdie(_(\"Branch %s is being bisected at %s\"),\n+\t\t\tdie(_(\"branch %s is being bisected at %s\"),\n \t\t\t    target, wt->path);\n \t}\n }\n@@ -578,7 +578,7 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int\n \t\tif (ref_exists(oldref.buf))\n \t\t\trecovery = 1;\n \t\telse\n-\t\t\tdie(_(\"Invalid branch name: '%s'\"), oldname);\n+\t\t\tdie(_(\"invalid branch name: '%s'\"), oldname);\n \t}\n \n \tfor (int i = 0; worktrees[i]; i++) {\n@@ -594,9 +594,9 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int\n \n \tif ((copy || !(oldref_usage & IS_HEAD)) && !ref_exists(oldref.buf)) {\n \t\tif (oldref_usage & IS_HEAD)\n-\t\t\tdie(_(\"No commit on branch '%s' yet.\"), oldname);\n+\t\t\tdie(_(\"no commit on branch '%s' yet\"), oldname);\n \t\telse\n-\t\t\tdie(_(\"No branch named '%s'.\"), oldname);\n+\t\t\tdie(_(\"no branch named '%s'\"), oldname);\n \t}\n \n \t/*\n@@ -624,32 +624,32 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int\n \n \tif (!copy && !(oldref_usage & IS_ORPHAN) &&\n \t    rename_ref(oldref.buf, newref.buf, logmsg.buf))\n-\t\tdie(_(\"Branch rename failed\"));\n+\t\tdie(_(\"branch rename failed\"));\n \tif (copy && copy_existing_ref(oldref.buf, newref.buf, logmsg.buf))\n-\t\tdie(_(\"Branch copy failed\"));\n+\t\tdie(_(\"branch copy failed\"));\n \n \tif (recovery) {\n \t\tif (copy)\n-\t\t\twarning(_(\"Created a copy of a misnamed branch '%s'\"),\n+\t\t\twarning(_(\"created a copy of a misnamed branch '%s'\"),\n \t\t\t\tinterpreted_oldname);\n \t\telse\n-\t\t\twarning(_(\"Renamed a misnamed branch '%s' away\"),\n+\t\t\twarning(_(\"renamed a misnamed branch '%s' away\"),\n \t\t\t\tinterpreted_oldname);\n \t}\n \n \tif (!copy && (oldref_usage & IS_HEAD) &&\n \t    replace_each_worktree_head_symref(worktrees, oldref.buf, newref.buf,\n \t\t\t\t\t      logmsg.buf))\n-\t\tdie(_(\"Branch renamed to %s, but HEAD is not updated!\"), newname);\n+\t\tdie(_(\"branch renamed to %s, but HEAD is not updated\"), newname);\n \n \tstrbuf_release(&logmsg);\n \n \tstrbuf_addf(&oldsection, \"branch.%s\", interpreted_oldname);\n \tstrbuf_addf(&newsection, \"branch.%s\", interpreted_newname);\n \tif (!copy && git_config_rename_section(oldsection.buf, newsection.buf) < 0)\n-\t\tdie(_(\"Branch is renamed, but update of config-file failed\"));\n+\t\tdie(_(\"branch is renamed, but update of config-file failed\"));\n \tif (copy && strcmp(interpreted_oldname, interpreted_newname) && git_config_copy_section(oldsection.buf, newsection.buf) < 0)\n-\t\tdie(_(\"Branch is copied, but update of config-file failed\"));\n+\t\tdie(_(\"branch is copied, but update of config-file failed\"));\n \tstrbuf_release(&oldref);\n \tstrbuf_release(&newref);\n \tstrbuf_release(&oldsection);\n@@ -773,7 +773,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \n \thead = resolve_refdup(\"HEAD\", 0, &head_oid, NULL);\n \tif (!head)\n-\t\tdie(_(\"Failed to resolve HEAD as a valid ref.\"));\n+\t\tdie(_(\"failed to resolve HEAD as a valid ref\"));\n \tif (!strcmp(head, \"HEAD\"))\n \t\tfilter.detached = 1;\n \telse if (!skip_prefix(head, \"refs/heads/\", &head))\n@@ -866,7 +866,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \n \t\tif (!argc) {\n \t\t\tif (filter.detached)\n-\t\t\t\tdie(_(\"Cannot give description to detached HEAD\"));\n+\t\t\t\tdie(_(\"cannot give description to detached HEAD\"));\n \t\t\tbranch_name = head;\n \t\t} else if (argc == 1) {\n \t\t\tstrbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);\n@@ -878,8 +878,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tstrbuf_addf(&branch_ref, \"refs/heads/%s\", branch_name);\n \t\tif (!ref_exists(branch_ref.buf))\n \t\t\terror((!argc || branch_checked_out(branch_ref.buf))\n-\t\t\t      ? _(\"No commit on branch '%s' yet.\")\n-\t\t\t      : _(\"No branch named '%s'.\"),\n+\t\t\t      ? _(\"no commit on branch '%s' yet\")\n+\t\t\t      : _(\"no branch named '%s'\"),\n \t\t\t      branch_name);\n \t\telse if (!edit_branch_description(branch_name))\n \t\t\tret = 0; /* happy */\n@@ -892,8 +892,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tif (!argc)\n \t\t\tdie(_(\"branch name required\"));\n \t\telse if ((argc == 1) && filter.detached)\n-\t\t\tdie(copy? _(\"cannot copy the current branch while not on any.\")\n-\t\t\t\t: _(\"cannot rename the current branch while not on any.\"));\n+\t\t\tdie(copy? _(\"cannot copy the current branch while not on any\")\n+\t\t\t\t: _(\"cannot rename the current branch while not on any\"));\n \t\telse if (argc == 1)\n \t\t\tcopy_or_rename_branch(head, argv[0], copy, copy + rename > 1);\n \t\telse if (argc == 2)\n@@ -916,14 +916,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tif (!branch) {\n \t\t\tif (!argc || !strcmp(argv[0], \"HEAD\"))\n \t\t\t\tdie(_(\"could not set upstream of HEAD to %s when \"\n-\t\t\t\t      \"it does not point to any branch.\"),\n+\t\t\t\t      \"it does not point to any branch\"),\n \t\t\t\t    new_upstream);\n \t\t\tdie(_(\"no such branch '%s'\"), argv[0]);\n \t\t}\n \n \t\tif (!ref_exists(branch->refname)) {\n \t\t\tif (!argc || branch_checked_out(branch->refname))\n-\t\t\t\tdie(_(\"No commit on branch '%s' yet.\"), branch->name);\n+\t\t\t\tdie(_(\"no commit on branch '%s' yet\"), branch->name);\n \t\t\tdie(_(\"branch '%s' does not exist\"), branch->name);\n \t\t}\n \n@@ -946,12 +946,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tif (!branch) {\n \t\t\tif (!argc || !strcmp(argv[0], \"HEAD\"))\n \t\t\t\tdie(_(\"could not unset upstream of HEAD when \"\n-\t\t\t\t      \"it does not point to any branch.\"));\n+\t\t\t\t      \"it does not point to any branch\"));\n \t\t\tdie(_(\"no such branch '%s'\"), argv[0]);\n \t\t}\n \n \t\tif (!branch_has_merge_config(branch))\n-\t\t\tdie(_(\"Branch '%s' has no upstream information\"), branch->name);\n+\t\t\tdie(_(\"branch '%s' has no upstream information\"), branch->name);\n \n \t\tstrbuf_reset(&buf);\n \t\tstrbuf_addf(&buf, \"branch.%s.remote\", branch->name);\n@@ -965,11 +965,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tconst char *start_name = argc == 2 ? argv[1] : head;\n \n \t\tif (filter.kind != FILTER_REFS_BRANCHES)\n-\t\t\tdie(_(\"The -a, and -r, options to 'git branch' do not take a branch name.\\n\"\n+\t\t\tdie(_(\"the -a, and -r, options to 'git branch' do not take a branch name.\\n\"\n \t\t\t\t  \"Did you mean to use: -a|-r --list <pattern>?\"));\n \n \t\tif (track == BRANCH_TRACK_OVERRIDE)\n-\t\t\tdie(_(\"the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead.\"));\n+\t\t\tdie(_(\"the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead\"));\n \n \t\tif (recurse_submodules) {\n \t\t\tcreate_branches_recursively(the_repository, branch_name,\ndiff --git a/t/t2407-worktree-heads.sh b/t/t2407-worktree-heads.sh\nindex 469443d8ae..f6835c91dc 100755\n--- a/t/t2407-worktree-heads.sh\n+++ b/t/t2407-worktree-heads.sh\n@@ -45,7 +45,7 @@ test_expect_success 'refuse to overwrite: checked out in worktree' '\n \t\tgrep \"cannot force update the branch\" err &&\n \n \t\ttest_must_fail git branch -D wt-$i 2>err &&\n-\t\tgrep \"Cannot delete branch\" err || return 1\n+\t\tgrep \"cannot delete branch\" err || return 1\n \tdone\n '\n \ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 080e4f24a6..3182abde27 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -291,10 +291,10 @@ test_expect_success 'git branch -M topic topic should work when main is checked\n test_expect_success 'git branch -M and -C fail on detached HEAD' '\n \tgit checkout HEAD^{} &&\n \ttest_when_finished git checkout - &&\n-\techo \"fatal: cannot rename the current branch while not on any.\" >expect &&\n+\techo \"fatal: cannot rename the current branch while not on any\" >expect &&\n \ttest_must_fail git branch -M must-fail 2>err &&\n \ttest_cmp expect err &&\n-\techo \"fatal: cannot copy the current branch while not on any.\" >expect &&\n+\techo \"fatal: cannot copy the current branch while not on any\" >expect &&\n \ttest_must_fail git branch -C must-fail 2>err &&\n \ttest_cmp expect err\n '\n@@ -943,7 +943,7 @@ test_expect_success 'deleting currently checked out branch fails' '\n \tgit worktree add -b my7 my7 &&\n \ttest_must_fail git -C my7 branch -d my7 &&\n \ttest_must_fail git branch -d my7 2>actual &&\n-\tgrep \"^error: Cannot delete branch .my7. used by worktree at \" actual &&\n+\tgrep \"^error: cannot delete branch .my7. used by worktree at \" actual &&\n \trm -r my7 &&\n \tgit worktree prune\n '\n@@ -954,7 +954,7 @@ test_expect_success 'deleting in-use branch fails' '\n \tgit -C my7 bisect start HEAD HEAD~2 &&\n \ttest_must_fail git -C my7 branch -d my7 &&\n \ttest_must_fail git branch -d my7 2>actual &&\n-\tgrep \"^error: Cannot delete branch .my7. used by worktree at \" actual &&\n+\tgrep \"^error: cannot delete branch .my7. used by worktree at \" actual &&\n \trm -r my7 &&\n \tgit worktree prune\n '\n@@ -1024,7 +1024,7 @@ test_expect_success '--set-upstream-to fails on multiple branches' '\n test_expect_success '--set-upstream-to fails on detached HEAD' '\n \tgit checkout HEAD^{} &&\n \ttest_when_finished git checkout - &&\n-\techo \"fatal: could not set upstream of HEAD to main when it does not point to any branch.\" >expect &&\n+\techo \"fatal: could not set upstream of HEAD to main when it does not point to any branch\" >expect &&\n \ttest_must_fail git branch --set-upstream-to main 2>err &&\n \ttest_cmp expect err\n '\n@@ -1072,7 +1072,7 @@ test_expect_success 'use --set-upstream-to modify a particular branch' '\n '\n \n test_expect_success '--unset-upstream should fail if given a non-existent branch' '\n-\techo \"fatal: Branch '\"'\"'i-dont-exist'\"'\"' has no upstream information\" >expect &&\n+\techo \"fatal: branch '\"'\"'i-dont-exist'\"'\"' has no upstream information\" >expect &&\n \ttest_must_fail git branch --unset-upstream i-dont-exist 2>err &&\n \ttest_cmp expect err\n '\n@@ -1094,7 +1094,7 @@ test_expect_success 'test --unset-upstream on HEAD' '\n \ttest_must_fail git config branch.main.remote &&\n \ttest_must_fail git config branch.main.merge &&\n \t# fail for a branch without upstream set\n-\techo \"fatal: Branch '\"'\"'main'\"'\"' has no upstream information\" >expect &&\n+\techo \"fatal: branch '\"'\"'main'\"'\"' has no upstream information\" >expect &&\n \ttest_must_fail git branch --unset-upstream 2>err &&\n \ttest_cmp expect err\n '\n@@ -1108,7 +1108,7 @@ test_expect_success '--unset-upstream should fail on multiple branches' '\n test_expect_success '--unset-upstream should fail on detached HEAD' '\n \tgit checkout HEAD^{} &&\n \ttest_when_finished git checkout - &&\n-\techo \"fatal: could not unset upstream of HEAD when it does not point to any branch.\" >expect &&\n+\techo \"fatal: could not unset upstream of HEAD when it does not point to any branch\" >expect &&\n \ttest_must_fail git branch --unset-upstream 2>err &&\n \ttest_cmp expect err\n '\ndiff --git a/t/t3202-show-branch.sh b/t/t3202-show-branch.sh\nindex b17f388f56..2cdb834b37 100755\n--- a/t/t3202-show-branch.sh\n+++ b/t/t3202-show-branch.sh\n@@ -10,7 +10,7 @@ GIT_TEST_DATE_NOW=1251660000; export GIT_TEST_DATE_NOW\n test_expect_success 'error descriptions on empty repository' '\n \tcurrent=$(git branch --show-current) &&\n \tcat >expect <<-EOF &&\n-\terror: No commit on branch '\\''$current'\\'' yet.\n+\terror: no commit on branch '\\''$current'\\'' yet\n \tEOF\n \ttest_must_fail git branch --edit-description 2>actual &&\n \ttest_cmp expect actual &&\n@@ -21,7 +21,7 @@ test_expect_success 'error descriptions on empty repository' '\n test_expect_success 'fatal descriptions on empty repository' '\n \tcurrent=$(git branch --show-current) &&\n \tcat >expect <<-EOF &&\n-\tfatal: No commit on branch '\\''$current'\\'' yet.\n+\tfatal: no commit on branch '\\''$current'\\'' yet\n \tEOF\n \ttest_must_fail git branch --set-upstream-to=non-existent 2>actual &&\n \ttest_cmp expect actual &&\n@@ -224,7 +224,7 @@ done\n \n test_expect_success 'error descriptions on non-existent branch' '\n \tcat >expect <<-EOF &&\n-\terror: No branch named '\\''non-existent'\\'.'\n+\terror: no branch named '\\''non-existent'\\''\n \tEOF\n \ttest_must_fail git branch --edit-description non-existent 2>actual &&\n \ttest_cmp expect actual\n@@ -238,7 +238,7 @@ test_expect_success 'fatal descriptions on non-existent branch' '\n \ttest_cmp expect actual &&\n \n \tcat >expect <<-EOF &&\n-\tfatal: No branch named '\\''non-existent'\\''.\n+\tfatal: no branch named '\\''non-existent'\\''\n \tEOF\n \ttest_must_fail git branch -c non-existent new-branch 2>actual &&\n \ttest_cmp expect actual &&\n@@ -253,7 +253,7 @@ test_expect_success 'error descriptions on orphan branch' '\n \ttest_branch_op_in_wt() {\n \t\ttest_orphan_error() {\n \t\t\ttest_must_fail git $* 2>actual &&\n-\t\t\ttest_i18ngrep \"No commit on branch .orphan-branch. yet.$\" actual\n+\t\t\ttest_i18ngrep \"no commit on branch .orphan-branch. yet$\" actual\n \t\t} &&\n \t\ttest_orphan_error -C wt branch $1 $2 &&                # implicit branch\n \t\ttest_orphan_error -C wt branch $1 orphan-branch $2 &&  # explicit branch\n-- \n2.42.0.346.g24618a8a3e.dirty\n\n"},{"id":"483680","messageId":"39fd1327b2ae4f73689d70561a2f738d@manjaro.org","threadId":"60418","inReplyTo":"20231023145708.4029-1-isokenjune@gmail.com","subject":"Re: [PATCH v3] builtin/branch.c: adjust error messages to coding guidelines","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2023-10-23T15:05:31Z","receivedAt":"2023-10-23T15:05:36Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2023-10-23 16:57, Isoken June Ibizugbe wrote:\n> As per the CodingGuidelines document, it is recommended that error\n> messages such as die(), error() and warning(),\n> should start with a lowercase letter and should not end with a period.\n> \n> This patch adjusts tests to match updated messages.\n> \n> Signed-off-by: Isoken June Ibizugbe <isokenjune@gmail.com>\n\nPlease, wrap the commit comment at the column 78.  That's how it works \nnearly everywhere.\n\n> ---\n>  builtin/branch.c          | 66 +++++++++++++++++++--------------------\n>  t/t2407-worktree-heads.sh |  2 +-\n>  t/t3200-branch.sh         | 16 +++++-----\n>  t/t3202-show-branch.sh    | 10 +++---\n>  4 files changed, 47 insertions(+), 47 deletions(-)\n> \n> diff --git a/builtin/branch.c b/builtin/branch.c\n> index 2ec190b14a..e7ee9bd0f1 100644\n> --- a/builtin/branch.c\n> +++ b/builtin/branch.c\n> @@ -173,11 +173,11 @@ static int branch_merged(int kind, const char \n> *name,\n>  \t    (head_rev ? repo_in_merge_bases(the_repository, rev, head_rev) :\n> 0) != merged) {\n>  \t\tif (merged)\n>  \t\t\twarning(_(\"deleting branch '%s' that has been merged to\\n\"\n> -\t\t\t\t\"         '%s', but not yet merged to HEAD.\"),\n> +\t\t\t\t\"         '%s', but not yet merged to HEAD\"),\n>  \t\t\t\tname, reference_name);\n>  \t\telse\n>  \t\t\twarning(_(\"not deleting branch '%s' that is not yet merged to\\n\"\n> -\t\t\t\t\"         '%s', even though it is merged to HEAD.\"),\n> +\t\t\t\t\"         '%s', even though it is merged to HEAD\"),\n>  \t\t\t\tname, reference_name);\n>  \t}\n>  \tfree(reference_name_to_free);\n> @@ -190,13 +190,13 @@ static int check_branch_commit(const char\n> *branchname, const char *refname,\n>  {\n>  \tstruct commit *rev = lookup_commit_reference(the_repository, oid);\n>  \tif (!force && !rev) {\n> -\t\terror(_(\"Couldn't look up commit object for '%s'\"), refname);\n> +\t\terror(_(\"couldn't look up commit object for '%s'\"), refname);\n>  \t\treturn -1;\n>  \t}\n>  \tif (!force && !branch_merged(kinds, branchname, rev, head_rev)) {\n> -\t\terror(_(\"The branch '%s' is not fully merged.\\n\"\n> +\t\terror(_(\"the branch '%s' is not fully merged.\\n\"\n>  \t\t      \"If you are sure you want to delete it, \"\n> -\t\t      \"run 'git branch -D %s'.\"), branchname, branchname);\n> +\t\t      \"run 'git branch -D %s'\"), branchname, branchname);\n>  \t\treturn -1;\n>  \t}\n>  \treturn 0;\n> @@ -207,7 +207,7 @@ static void delete_branch_config(const char \n> *branchname)\n>  \tstruct strbuf buf = STRBUF_INIT;\n>  \tstrbuf_addf(&buf, \"branch.%s\", branchname);\n>  \tif (git_config_rename_section(buf.buf, NULL) < 0)\n> -\t\twarning(_(\"Update of config-file failed\"));\n> +\t\twarning(_(\"update of config-file failed\"));\n>  \tstrbuf_release(&buf);\n>  }\n> \n> @@ -260,7 +260,7 @@ static int delete_branches(int argc, const char\n> **argv, int force, int kinds,\n>  \t\tif (kinds == FILTER_REFS_BRANCHES) {\n>  \t\t\tconst char *path;\n>  \t\t\tif ((path = branch_checked_out(name))) {\n> -\t\t\t\terror(_(\"Cannot delete branch '%s' \"\n> +\t\t\t\terror(_(\"cannot delete branch '%s' \"\n>  \t\t\t\t\t\"used by worktree at '%s'\"),\n>  \t\t\t\t      bname.buf, path);\n>  \t\t\t\tret = 1;\n> @@ -275,7 +275,7 @@ static int delete_branches(int argc, const char\n> **argv, int force, int kinds,\n>  \t\t\t\t\t&oid, &flags);\n>  \t\tif (!target) {\n>  \t\t\tif (remote_branch) {\n> -\t\t\t\terror(_(\"remote-tracking branch '%s' not found.\"), bname.buf);\n> +\t\t\t\terror(_(\"remote-tracking branch '%s' not found\"), bname.buf);\n>  \t\t\t} else {\n>  \t\t\t\tchar *virtual_name = mkpathdup(fmt_remotes, bname.buf);\n>  \t\t\t\tchar *virtual_target = resolve_refdup(virtual_name,\n> @@ -290,7 +290,7 @@ static int delete_branches(int argc, const char\n> **argv, int force, int kinds,\n>  \t\t\t\t\t\t\"Did you forget --remote?\"),\n>  \t\t\t\t\t\tbname.buf);\n>  \t\t\t\telse\n> -\t\t\t\t\terror(_(\"branch '%s' not found.\"), bname.buf);\n> +\t\t\t\t\terror(_(\"branch '%s' not found\"), bname.buf);\n>  \t\t\t\tFREE_AND_NULL(virtual_target);\n>  \t\t\t}\n>  \t\t\tret = 1;\n> @@ -518,11 +518,11 @@ static void\n> reject_rebase_or_bisect_branch(struct worktree **worktrees,\n>  \t\t\tcontinue;\n> \n>  \t\tif (is_worktree_being_rebased(wt, target))\n> -\t\t\tdie(_(\"Branch %s is being rebased at %s\"),\n> +\t\t\tdie(_(\"branch %s is being rebased at %s\"),\n>  \t\t\t    target, wt->path);\n> \n>  \t\tif (is_worktree_being_bisected(wt, target))\n> -\t\t\tdie(_(\"Branch %s is being bisected at %s\"),\n> +\t\t\tdie(_(\"branch %s is being bisected at %s\"),\n>  \t\t\t    target, wt->path);\n>  \t}\n>  }\n> @@ -578,7 +578,7 @@ static void copy_or_rename_branch(const char\n> *oldname, const char *newname, int\n>  \t\tif (ref_exists(oldref.buf))\n>  \t\t\trecovery = 1;\n>  \t\telse\n> -\t\t\tdie(_(\"Invalid branch name: '%s'\"), oldname);\n> +\t\t\tdie(_(\"invalid branch name: '%s'\"), oldname);\n>  \t}\n> \n>  \tfor (int i = 0; worktrees[i]; i++) {\n> @@ -594,9 +594,9 @@ static void copy_or_rename_branch(const char\n> *oldname, const char *newname, int\n> \n>  \tif ((copy || !(oldref_usage & IS_HEAD)) && !ref_exists(oldref.buf)) {\n>  \t\tif (oldref_usage & IS_HEAD)\n> -\t\t\tdie(_(\"No commit on branch '%s' yet.\"), oldname);\n> +\t\t\tdie(_(\"no commit on branch '%s' yet\"), oldname);\n>  \t\telse\n> -\t\t\tdie(_(\"No branch named '%s'.\"), oldname);\n> +\t\t\tdie(_(\"no branch named '%s'\"), oldname);\n>  \t}\n> \n>  \t/*\n> @@ -624,32 +624,32 @@ static void copy_or_rename_branch(const char\n> *oldname, const char *newname, int\n> \n>  \tif (!copy && !(oldref_usage & IS_ORPHAN) &&\n>  \t    rename_ref(oldref.buf, newref.buf, logmsg.buf))\n> -\t\tdie(_(\"Branch rename failed\"));\n> +\t\tdie(_(\"branch rename failed\"));\n>  \tif (copy && copy_existing_ref(oldref.buf, newref.buf, logmsg.buf))\n> -\t\tdie(_(\"Branch copy failed\"));\n> +\t\tdie(_(\"branch copy failed\"));\n> \n>  \tif (recovery) {\n>  \t\tif (copy)\n> -\t\t\twarning(_(\"Created a copy of a misnamed branch '%s'\"),\n> +\t\t\twarning(_(\"created a copy of a misnamed branch '%s'\"),\n>  \t\t\t\tinterpreted_oldname);\n>  \t\telse\n> -\t\t\twarning(_(\"Renamed a misnamed branch '%s' away\"),\n> +\t\t\twarning(_(\"renamed a misnamed branch '%s' away\"),\n>  \t\t\t\tinterpreted_oldname);\n>  \t}\n> \n>  \tif (!copy && (oldref_usage & IS_HEAD) &&\n>  \t    replace_each_worktree_head_symref(worktrees, oldref.buf, \n> newref.buf,\n>  \t\t\t\t\t      logmsg.buf))\n> -\t\tdie(_(\"Branch renamed to %s, but HEAD is not updated!\"), newname);\n> +\t\tdie(_(\"branch renamed to %s, but HEAD is not updated\"), newname);\n> \n>  \tstrbuf_release(&logmsg);\n> \n>  \tstrbuf_addf(&oldsection, \"branch.%s\", interpreted_oldname);\n>  \tstrbuf_addf(&newsection, \"branch.%s\", interpreted_newname);\n>  \tif (!copy && git_config_rename_section(oldsection.buf, \n> newsection.buf) < 0)\n> -\t\tdie(_(\"Branch is renamed, but update of config-file failed\"));\n> +\t\tdie(_(\"branch is renamed, but update of config-file failed\"));\n>  \tif (copy && strcmp(interpreted_oldname, interpreted_newname) &&\n> git_config_copy_section(oldsection.buf, newsection.buf) < 0)\n> -\t\tdie(_(\"Branch is copied, but update of config-file failed\"));\n> +\t\tdie(_(\"branch is copied, but update of config-file failed\"));\n>  \tstrbuf_release(&oldref);\n>  \tstrbuf_release(&newref);\n>  \tstrbuf_release(&oldsection);\n> @@ -773,7 +773,7 @@ int cmd_branch(int argc, const char **argv, const\n> char *prefix)\n> \n>  \thead = resolve_refdup(\"HEAD\", 0, &head_oid, NULL);\n>  \tif (!head)\n> -\t\tdie(_(\"Failed to resolve HEAD as a valid ref.\"));\n> +\t\tdie(_(\"failed to resolve HEAD as a valid ref\"));\n>  \tif (!strcmp(head, \"HEAD\"))\n>  \t\tfilter.detached = 1;\n>  \telse if (!skip_prefix(head, \"refs/heads/\", &head))\n> @@ -866,7 +866,7 @@ int cmd_branch(int argc, const char **argv, const\n> char *prefix)\n> \n>  \t\tif (!argc) {\n>  \t\t\tif (filter.detached)\n> -\t\t\t\tdie(_(\"Cannot give description to detached HEAD\"));\n> +\t\t\t\tdie(_(\"cannot give description to detached HEAD\"));\n>  \t\t\tbranch_name = head;\n>  \t\t} else if (argc == 1) {\n>  \t\t\tstrbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);\n> @@ -878,8 +878,8 @@ int cmd_branch(int argc, const char **argv, const\n> char *prefix)\n>  \t\tstrbuf_addf(&branch_ref, \"refs/heads/%s\", branch_name);\n>  \t\tif (!ref_exists(branch_ref.buf))\n>  \t\t\terror((!argc || branch_checked_out(branch_ref.buf))\n> -\t\t\t      ? _(\"No commit on branch '%s' yet.\")\n> -\t\t\t      : _(\"No branch named '%s'.\"),\n> +\t\t\t      ? _(\"no commit on branch '%s' yet\")\n> +\t\t\t      : _(\"no branch named '%s'\"),\n>  \t\t\t      branch_name);\n>  \t\telse if (!edit_branch_description(branch_name))\n>  \t\t\tret = 0; /* happy */\n> @@ -892,8 +892,8 @@ int cmd_branch(int argc, const char **argv, const\n> char *prefix)\n>  \t\tif (!argc)\n>  \t\t\tdie(_(\"branch name required\"));\n>  \t\telse if ((argc == 1) && filter.detached)\n> -\t\t\tdie(copy? _(\"cannot copy the current branch while not on any.\")\n> -\t\t\t\t: _(\"cannot rename the current branch while not on any.\"));\n> +\t\t\tdie(copy? _(\"cannot copy the current branch while not on any\")\n> +\t\t\t\t: _(\"cannot rename the current branch while not on any\"));\n>  \t\telse if (argc == 1)\n>  \t\t\tcopy_or_rename_branch(head, argv[0], copy, copy + rename > 1);\n>  \t\telse if (argc == 2)\n> @@ -916,14 +916,14 @@ int cmd_branch(int argc, const char **argv,\n> const char *prefix)\n>  \t\tif (!branch) {\n>  \t\t\tif (!argc || !strcmp(argv[0], \"HEAD\"))\n>  \t\t\t\tdie(_(\"could not set upstream of HEAD to %s when \"\n> -\t\t\t\t      \"it does not point to any branch.\"),\n> +\t\t\t\t      \"it does not point to any branch\"),\n>  \t\t\t\t    new_upstream);\n>  \t\t\tdie(_(\"no such branch '%s'\"), argv[0]);\n>  \t\t}\n> \n>  \t\tif (!ref_exists(branch->refname)) {\n>  \t\t\tif (!argc || branch_checked_out(branch->refname))\n> -\t\t\t\tdie(_(\"No commit on branch '%s' yet.\"), branch->name);\n> +\t\t\t\tdie(_(\"no commit on branch '%s' yet\"), branch->name);\n>  \t\t\tdie(_(\"branch '%s' does not exist\"), branch->name);\n>  \t\t}\n> \n> @@ -946,12 +946,12 @@ int cmd_branch(int argc, const char **argv,\n> const char *prefix)\n>  \t\tif (!branch) {\n>  \t\t\tif (!argc || !strcmp(argv[0], \"HEAD\"))\n>  \t\t\t\tdie(_(\"could not unset upstream of HEAD when \"\n> -\t\t\t\t      \"it does not point to any branch.\"));\n> +\t\t\t\t      \"it does not point to any branch\"));\n>  \t\t\tdie(_(\"no such branch '%s'\"), argv[0]);\n>  \t\t}\n> \n>  \t\tif (!branch_has_merge_config(branch))\n> -\t\t\tdie(_(\"Branch '%s' has no upstream information\"), branch->name);\n> +\t\t\tdie(_(\"branch '%s' has no upstream information\"), branch->name);\n> \n>  \t\tstrbuf_reset(&buf);\n>  \t\tstrbuf_addf(&buf, \"branch.%s.remote\", branch->name);\n> @@ -965,11 +965,11 @@ int cmd_branch(int argc, const char **argv,\n> const char *prefix)\n>  \t\tconst char *start_name = argc == 2 ? argv[1] : head;\n> \n>  \t\tif (filter.kind != FILTER_REFS_BRANCHES)\n> -\t\t\tdie(_(\"The -a, and -r, options to 'git branch' do not take a branch \n> name.\\n\"\n> +\t\t\tdie(_(\"the -a, and -r, options to 'git branch' do not take a branch \n> name.\\n\"\n>  \t\t\t\t  \"Did you mean to use: -a|-r --list <pattern>?\"));\n> \n>  \t\tif (track == BRANCH_TRACK_OVERRIDE)\n> -\t\t\tdie(_(\"the '--set-upstream' option is no longer supported. Please\n> use '--track' or '--set-upstream-to' instead.\"));\n> +\t\t\tdie(_(\"the '--set-upstream' option is no longer supported. Please\n> use '--track' or '--set-upstream-to' instead\"));\n> \n>  \t\tif (recurse_submodules) {\n>  \t\t\tcreate_branches_recursively(the_repository, branch_name,\n> diff --git a/t/t2407-worktree-heads.sh b/t/t2407-worktree-heads.sh\n> index 469443d8ae..f6835c91dc 100755\n> --- a/t/t2407-worktree-heads.sh\n> +++ b/t/t2407-worktree-heads.sh\n> @@ -45,7 +45,7 @@ test_expect_success 'refuse to overwrite: checked\n> out in worktree' '\n>  \t\tgrep \"cannot force update the branch\" err &&\n> \n>  \t\ttest_must_fail git branch -D wt-$i 2>err &&\n> -\t\tgrep \"Cannot delete branch\" err || return 1\n> +\t\tgrep \"cannot delete branch\" err || return 1\n>  \tdone\n>  '\n> \n> diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\n> index 080e4f24a6..3182abde27 100755\n> --- a/t/t3200-branch.sh\n> +++ b/t/t3200-branch.sh\n> @@ -291,10 +291,10 @@ test_expect_success 'git branch -M topic topic\n> should work when main is checked\n>  test_expect_success 'git branch -M and -C fail on detached HEAD' '\n>  \tgit checkout HEAD^{} &&\n>  \ttest_when_finished git checkout - &&\n> -\techo \"fatal: cannot rename the current branch while not on any.\" \n> >expect &&\n> +\techo \"fatal: cannot rename the current branch while not on any\" \n> >expect &&\n>  \ttest_must_fail git branch -M must-fail 2>err &&\n>  \ttest_cmp expect err &&\n> -\techo \"fatal: cannot copy the current branch while not on any.\" \n> >expect &&\n> +\techo \"fatal: cannot copy the current branch while not on any\" >expect \n> &&\n>  \ttest_must_fail git branch -C must-fail 2>err &&\n>  \ttest_cmp expect err\n>  '\n> @@ -943,7 +943,7 @@ test_expect_success 'deleting currently checked\n> out branch fails' '\n>  \tgit worktree add -b my7 my7 &&\n>  \ttest_must_fail git -C my7 branch -d my7 &&\n>  \ttest_must_fail git branch -d my7 2>actual &&\n> -\tgrep \"^error: Cannot delete branch .my7. used by worktree at \" actual \n> &&\n> +\tgrep \"^error: cannot delete branch .my7. used by worktree at \" actual \n> &&\n>  \trm -r my7 &&\n>  \tgit worktree prune\n>  '\n> @@ -954,7 +954,7 @@ test_expect_success 'deleting in-use branch fails' \n> '\n>  \tgit -C my7 bisect start HEAD HEAD~2 &&\n>  \ttest_must_fail git -C my7 branch -d my7 &&\n>  \ttest_must_fail git branch -d my7 2>actual &&\n> -\tgrep \"^error: Cannot delete branch .my7. used by worktree at \" actual \n> &&\n> +\tgrep \"^error: cannot delete branch .my7. used by worktree at \" actual \n> &&\n>  \trm -r my7 &&\n>  \tgit worktree prune\n>  '\n> @@ -1024,7 +1024,7 @@ test_expect_success '--set-upstream-to fails on\n> multiple branches' '\n>  test_expect_success '--set-upstream-to fails on detached HEAD' '\n>  \tgit checkout HEAD^{} &&\n>  \ttest_when_finished git checkout - &&\n> -\techo \"fatal: could not set upstream of HEAD to main when it does not\n> point to any branch.\" >expect &&\n> +\techo \"fatal: could not set upstream of HEAD to main when it does not\n> point to any branch\" >expect &&\n>  \ttest_must_fail git branch --set-upstream-to main 2>err &&\n>  \ttest_cmp expect err\n>  '\n> @@ -1072,7 +1072,7 @@ test_expect_success 'use --set-upstream-to\n> modify a particular branch' '\n>  '\n> \n>  test_expect_success '--unset-upstream should fail if given a\n> non-existent branch' '\n> -\techo \"fatal: Branch '\"'\"'i-dont-exist'\"'\"' has no upstream\n> information\" >expect &&\n> +\techo \"fatal: branch '\"'\"'i-dont-exist'\"'\"' has no upstream\n> information\" >expect &&\n>  \ttest_must_fail git branch --unset-upstream i-dont-exist 2>err &&\n>  \ttest_cmp expect err\n>  '\n> @@ -1094,7 +1094,7 @@ test_expect_success 'test --unset-upstream on \n> HEAD' '\n>  \ttest_must_fail git config branch.main.remote &&\n>  \ttest_must_fail git config branch.main.merge &&\n>  \t# fail for a branch without upstream set\n> -\techo \"fatal: Branch '\"'\"'main'\"'\"' has no upstream information\" \n> >expect &&\n> +\techo \"fatal: branch '\"'\"'main'\"'\"' has no upstream information\" \n> >expect &&\n>  \ttest_must_fail git branch --unset-upstream 2>err &&\n>  \ttest_cmp expect err\n>  '\n> @@ -1108,7 +1108,7 @@ test_expect_success '--unset-upstream should\n> fail on multiple branches' '\n>  test_expect_success '--unset-upstream should fail on detached HEAD' '\n>  \tgit checkout HEAD^{} &&\n>  \ttest_when_finished git checkout - &&\n> -\techo \"fatal: could not unset upstream of HEAD when it does not point\n> to any branch.\" >expect &&\n> +\techo \"fatal: could not unset upstream of HEAD when it does not point\n> to any branch\" >expect &&\n>  \ttest_must_fail git branch --unset-upstream 2>err &&\n>  \ttest_cmp expect err\n>  '\n> diff --git a/t/t3202-show-branch.sh b/t/t3202-show-branch.sh\n> index b17f388f56..2cdb834b37 100755\n> --- a/t/t3202-show-branch.sh\n> +++ b/t/t3202-show-branch.sh\n> @@ -10,7 +10,7 @@ GIT_TEST_DATE_NOW=1251660000; export \n> GIT_TEST_DATE_NOW\n>  test_expect_success 'error descriptions on empty repository' '\n>  \tcurrent=$(git branch --show-current) &&\n>  \tcat >expect <<-EOF &&\n> -\terror: No commit on branch '\\''$current'\\'' yet.\n> +\terror: no commit on branch '\\''$current'\\'' yet\n>  \tEOF\n>  \ttest_must_fail git branch --edit-description 2>actual &&\n>  \ttest_cmp expect actual &&\n> @@ -21,7 +21,7 @@ test_expect_success 'error descriptions on empty \n> repository' '\n>  test_expect_success 'fatal descriptions on empty repository' '\n>  \tcurrent=$(git branch --show-current) &&\n>  \tcat >expect <<-EOF &&\n> -\tfatal: No commit on branch '\\''$current'\\'' yet.\n> +\tfatal: no commit on branch '\\''$current'\\'' yet\n>  \tEOF\n>  \ttest_must_fail git branch --set-upstream-to=non-existent 2>actual &&\n>  \ttest_cmp expect actual &&\n> @@ -224,7 +224,7 @@ done\n> \n>  test_expect_success 'error descriptions on non-existent branch' '\n>  \tcat >expect <<-EOF &&\n> -\terror: No branch named '\\''non-existent'\\'.'\n> +\terror: no branch named '\\''non-existent'\\''\n>  \tEOF\n>  \ttest_must_fail git branch --edit-description non-existent 2>actual &&\n>  \ttest_cmp expect actual\n> @@ -238,7 +238,7 @@ test_expect_success 'fatal descriptions on\n> non-existent branch' '\n>  \ttest_cmp expect actual &&\n> \n>  \tcat >expect <<-EOF &&\n> -\tfatal: No branch named '\\''non-existent'\\''.\n> +\tfatal: no branch named '\\''non-existent'\\''\n>  \tEOF\n>  \ttest_must_fail git branch -c non-existent new-branch 2>actual &&\n>  \ttest_cmp expect actual &&\n> @@ -253,7 +253,7 @@ test_expect_success 'error descriptions on orphan \n> branch' '\n>  \ttest_branch_op_in_wt() {\n>  \t\ttest_orphan_error() {\n>  \t\t\ttest_must_fail git $* 2>actual &&\n> -\t\t\ttest_i18ngrep \"No commit on branch .orphan-branch. yet.$\" actual\n> +\t\t\ttest_i18ngrep \"no commit on branch .orphan-branch. yet$\" actual\n>  \t\t} &&\n>  \t\ttest_orphan_error -C wt branch $1 $2 &&                # implicit \n> branch\n>  \t\ttest_orphan_error -C wt branch $1 orphan-branch $2 &&  # explicit \n> branch\n"},{"id":"483683","messageId":"20231023160656.4341-1-isokenjune@gmail.com","threadId":"60418","inReplyTo":"39fd1327b2ae4f73689d70561a2f738d@manjaro.org","subject":"[PATCH v3] builtin/branch.c: adjust error messages to coding guidelines","fromName":"Isoken June Ibizugbe","fromEmail":"isokenjune@gmail.com","sentAt":"2023-10-23T16:06:56Z","receivedAt":"2023-10-23T16:07:53Z","isPatch":true,"sender":{"key":"isokenjune@gmail.com","avatar":"https://avatars.githubusercontent.com/u/127752393?v=4"},"body":"As per the CodingGuidelines document, it is recommended that error messages\nsuch as die(), error() and warning(), should start with a lowercase letter\nand should not end with a period.\n\nThis patch adjusts tests to match updated messages.\n\nSigned-off-by: Isoken June Ibizugbe <isokenjune@gmail.com>\n---\n builtin/branch.c          | 66 +++++++++++++++++++--------------------\n t/t2407-worktree-heads.sh |  2 +-\n t/t3200-branch.sh         | 16 +++++-----\n t/t3202-show-branch.sh    | 10 +++---\n 4 files changed, 47 insertions(+), 47 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 2ec190b14a..e7ee9bd0f1 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -173,11 +173,11 @@ static int branch_merged(int kind, const char *name,\n \t    (head_rev ? repo_in_merge_bases(the_repository, rev, head_rev) : 0) != merged) {\n \t\tif (merged)\n \t\t\twarning(_(\"deleting branch '%s' that has been merged to\\n\"\n-\t\t\t\t\"         '%s', but not yet merged to HEAD.\"),\n+\t\t\t\t\"         '%s', but not yet merged to HEAD\"),\n \t\t\t\tname, reference_name);\n \t\telse\n \t\t\twarning(_(\"not deleting branch '%s' that is not yet merged to\\n\"\n-\t\t\t\t\"         '%s', even though it is merged to HEAD.\"),\n+\t\t\t\t\"         '%s', even though it is merged to HEAD\"),\n \t\t\t\tname, reference_name);\n \t}\n \tfree(reference_name_to_free);\n@@ -190,13 +190,13 @@ static int check_branch_commit(const char *branchname, const char *refname,\n {\n \tstruct commit *rev = lookup_commit_reference(the_repository, oid);\n \tif (!force && !rev) {\n-\t\terror(_(\"Couldn't look up commit object for '%s'\"), refname);\n+\t\terror(_(\"couldn't look up commit object for '%s'\"), refname);\n \t\treturn -1;\n \t}\n \tif (!force && !branch_merged(kinds, branchname, rev, head_rev)) {\n-\t\terror(_(\"The branch '%s' is not fully merged.\\n\"\n+\t\terror(_(\"the branch '%s' is not fully merged.\\n\"\n \t\t      \"If you are sure you want to delete it, \"\n-\t\t      \"run 'git branch -D %s'.\"), branchname, branchname);\n+\t\t      \"run 'git branch -D %s'\"), branchname, branchname);\n \t\treturn -1;\n \t}\n \treturn 0;\n@@ -207,7 +207,7 @@ static void delete_branch_config(const char *branchname)\n \tstruct strbuf buf = STRBUF_INIT;\n \tstrbuf_addf(&buf, \"branch.%s\", branchname);\n \tif (git_config_rename_section(buf.buf, NULL) < 0)\n-\t\twarning(_(\"Update of config-file failed\"));\n+\t\twarning(_(\"update of config-file failed\"));\n \tstrbuf_release(&buf);\n }\n \n@@ -260,7 +260,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,\n \t\tif (kinds == FILTER_REFS_BRANCHES) {\n \t\t\tconst char *path;\n \t\t\tif ((path = branch_checked_out(name))) {\n-\t\t\t\terror(_(\"Cannot delete branch '%s' \"\n+\t\t\t\terror(_(\"cannot delete branch '%s' \"\n \t\t\t\t\t\"used by worktree at '%s'\"),\n \t\t\t\t      bname.buf, path);\n \t\t\t\tret = 1;\n@@ -275,7 +275,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,\n \t\t\t\t\t&oid, &flags);\n \t\tif (!target) {\n \t\t\tif (remote_branch) {\n-\t\t\t\terror(_(\"remote-tracking branch '%s' not found.\"), bname.buf);\n+\t\t\t\terror(_(\"remote-tracking branch '%s' not found\"), bname.buf);\n \t\t\t} else {\n \t\t\t\tchar *virtual_name = mkpathdup(fmt_remotes, bname.buf);\n \t\t\t\tchar *virtual_target = resolve_refdup(virtual_name,\n@@ -290,7 +290,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,\n \t\t\t\t\t\t\"Did you forget --remote?\"),\n \t\t\t\t\t\tbname.buf);\n \t\t\t\telse\n-\t\t\t\t\terror(_(\"branch '%s' not found.\"), bname.buf);\n+\t\t\t\t\terror(_(\"branch '%s' not found\"), bname.buf);\n \t\t\t\tFREE_AND_NULL(virtual_target);\n \t\t\t}\n \t\t\tret = 1;\n@@ -518,11 +518,11 @@ static void reject_rebase_or_bisect_branch(struct worktree **worktrees,\n \t\t\tcontinue;\n \n \t\tif (is_worktree_being_rebased(wt, target))\n-\t\t\tdie(_(\"Branch %s is being rebased at %s\"),\n+\t\t\tdie(_(\"branch %s is being rebased at %s\"),\n \t\t\t    target, wt->path);\n \n \t\tif (is_worktree_being_bisected(wt, target))\n-\t\t\tdie(_(\"Branch %s is being bisected at %s\"),\n+\t\t\tdie(_(\"branch %s is being bisected at %s\"),\n \t\t\t    target, wt->path);\n \t}\n }\n@@ -578,7 +578,7 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int\n \t\tif (ref_exists(oldref.buf))\n \t\t\trecovery = 1;\n \t\telse\n-\t\t\tdie(_(\"Invalid branch name: '%s'\"), oldname);\n+\t\t\tdie(_(\"invalid branch name: '%s'\"), oldname);\n \t}\n \n \tfor (int i = 0; worktrees[i]; i++) {\n@@ -594,9 +594,9 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int\n \n \tif ((copy || !(oldref_usage & IS_HEAD)) && !ref_exists(oldref.buf)) {\n \t\tif (oldref_usage & IS_HEAD)\n-\t\t\tdie(_(\"No commit on branch '%s' yet.\"), oldname);\n+\t\t\tdie(_(\"no commit on branch '%s' yet\"), oldname);\n \t\telse\n-\t\t\tdie(_(\"No branch named '%s'.\"), oldname);\n+\t\t\tdie(_(\"no branch named '%s'\"), oldname);\n \t}\n \n \t/*\n@@ -624,32 +624,32 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int\n \n \tif (!copy && !(oldref_usage & IS_ORPHAN) &&\n \t    rename_ref(oldref.buf, newref.buf, logmsg.buf))\n-\t\tdie(_(\"Branch rename failed\"));\n+\t\tdie(_(\"branch rename failed\"));\n \tif (copy && copy_existing_ref(oldref.buf, newref.buf, logmsg.buf))\n-\t\tdie(_(\"Branch copy failed\"));\n+\t\tdie(_(\"branch copy failed\"));\n \n \tif (recovery) {\n \t\tif (copy)\n-\t\t\twarning(_(\"Created a copy of a misnamed branch '%s'\"),\n+\t\t\twarning(_(\"created a copy of a misnamed branch '%s'\"),\n \t\t\t\tinterpreted_oldname);\n \t\telse\n-\t\t\twarning(_(\"Renamed a misnamed branch '%s' away\"),\n+\t\t\twarning(_(\"renamed a misnamed branch '%s' away\"),\n \t\t\t\tinterpreted_oldname);\n \t}\n \n \tif (!copy && (oldref_usage & IS_HEAD) &&\n \t    replace_each_worktree_head_symref(worktrees, oldref.buf, newref.buf,\n \t\t\t\t\t      logmsg.buf))\n-\t\tdie(_(\"Branch renamed to %s, but HEAD is not updated!\"), newname);\n+\t\tdie(_(\"branch renamed to %s, but HEAD is not updated\"), newname);\n \n \tstrbuf_release(&logmsg);\n \n \tstrbuf_addf(&oldsection, \"branch.%s\", interpreted_oldname);\n \tstrbuf_addf(&newsection, \"branch.%s\", interpreted_newname);\n \tif (!copy && git_config_rename_section(oldsection.buf, newsection.buf) < 0)\n-\t\tdie(_(\"Branch is renamed, but update of config-file failed\"));\n+\t\tdie(_(\"branch is renamed, but update of config-file failed\"));\n \tif (copy && strcmp(interpreted_oldname, interpreted_newname) && git_config_copy_section(oldsection.buf, newsection.buf) < 0)\n-\t\tdie(_(\"Branch is copied, but update of config-file failed\"));\n+\t\tdie(_(\"branch is copied, but update of config-file failed\"));\n \tstrbuf_release(&oldref);\n \tstrbuf_release(&newref);\n \tstrbuf_release(&oldsection);\n@@ -773,7 +773,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \n \thead = resolve_refdup(\"HEAD\", 0, &head_oid, NULL);\n \tif (!head)\n-\t\tdie(_(\"Failed to resolve HEAD as a valid ref.\"));\n+\t\tdie(_(\"failed to resolve HEAD as a valid ref\"));\n \tif (!strcmp(head, \"HEAD\"))\n \t\tfilter.detached = 1;\n \telse if (!skip_prefix(head, \"refs/heads/\", &head))\n@@ -866,7 +866,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \n \t\tif (!argc) {\n \t\t\tif (filter.detached)\n-\t\t\t\tdie(_(\"Cannot give description to detached HEAD\"));\n+\t\t\t\tdie(_(\"cannot give description to detached HEAD\"));\n \t\t\tbranch_name = head;\n \t\t} else if (argc == 1) {\n \t\t\tstrbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);\n@@ -878,8 +878,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tstrbuf_addf(&branch_ref, \"refs/heads/%s\", branch_name);\n \t\tif (!ref_exists(branch_ref.buf))\n \t\t\terror((!argc || branch_checked_out(branch_ref.buf))\n-\t\t\t      ? _(\"No commit on branch '%s' yet.\")\n-\t\t\t      : _(\"No branch named '%s'.\"),\n+\t\t\t      ? _(\"no commit on branch '%s' yet\")\n+\t\t\t      : _(\"no branch named '%s'\"),\n \t\t\t      branch_name);\n \t\telse if (!edit_branch_description(branch_name))\n \t\t\tret = 0; /* happy */\n@@ -892,8 +892,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tif (!argc)\n \t\t\tdie(_(\"branch name required\"));\n \t\telse if ((argc == 1) && filter.detached)\n-\t\t\tdie(copy? _(\"cannot copy the current branch while not on any.\")\n-\t\t\t\t: _(\"cannot rename the current branch while not on any.\"));\n+\t\t\tdie(copy? _(\"cannot copy the current branch while not on any\")\n+\t\t\t\t: _(\"cannot rename the current branch while not on any\"));\n \t\telse if (argc == 1)\n \t\t\tcopy_or_rename_branch(head, argv[0], copy, copy + rename > 1);\n \t\telse if (argc == 2)\n@@ -916,14 +916,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tif (!branch) {\n \t\t\tif (!argc || !strcmp(argv[0], \"HEAD\"))\n \t\t\t\tdie(_(\"could not set upstream of HEAD to %s when \"\n-\t\t\t\t      \"it does not point to any branch.\"),\n+\t\t\t\t      \"it does not point to any branch\"),\n \t\t\t\t    new_upstream);\n \t\t\tdie(_(\"no such branch '%s'\"), argv[0]);\n \t\t}\n \n \t\tif (!ref_exists(branch->refname)) {\n \t\t\tif (!argc || branch_checked_out(branch->refname))\n-\t\t\t\tdie(_(\"No commit on branch '%s' yet.\"), branch->name);\n+\t\t\t\tdie(_(\"no commit on branch '%s' yet\"), branch->name);\n \t\t\tdie(_(\"branch '%s' does not exist\"), branch->name);\n \t\t}\n \n@@ -946,12 +946,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tif (!branch) {\n \t\t\tif (!argc || !strcmp(argv[0], \"HEAD\"))\n \t\t\t\tdie(_(\"could not unset upstream of HEAD when \"\n-\t\t\t\t      \"it does not point to any branch.\"));\n+\t\t\t\t      \"it does not point to any branch\"));\n \t\t\tdie(_(\"no such branch '%s'\"), argv[0]);\n \t\t}\n \n \t\tif (!branch_has_merge_config(branch))\n-\t\t\tdie(_(\"Branch '%s' has no upstream information\"), branch->name);\n+\t\t\tdie(_(\"branch '%s' has no upstream information\"), branch->name);\n \n \t\tstrbuf_reset(&buf);\n \t\tstrbuf_addf(&buf, \"branch.%s.remote\", branch->name);\n@@ -965,11 +965,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tconst char *start_name = argc == 2 ? argv[1] : head;\n \n \t\tif (filter.kind != FILTER_REFS_BRANCHES)\n-\t\t\tdie(_(\"The -a, and -r, options to 'git branch' do not take a branch name.\\n\"\n+\t\t\tdie(_(\"the -a, and -r, options to 'git branch' do not take a branch name.\\n\"\n \t\t\t\t  \"Did you mean to use: -a|-r --list <pattern>?\"));\n \n \t\tif (track == BRANCH_TRACK_OVERRIDE)\n-\t\t\tdie(_(\"the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead.\"));\n+\t\t\tdie(_(\"the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead\"));\n \n \t\tif (recurse_submodules) {\n \t\t\tcreate_branches_recursively(the_repository, branch_name,\ndiff --git a/t/t2407-worktree-heads.sh b/t/t2407-worktree-heads.sh\nindex 469443d8ae..f6835c91dc 100755\n--- a/t/t2407-worktree-heads.sh\n+++ b/t/t2407-worktree-heads.sh\n@@ -45,7 +45,7 @@ test_expect_success 'refuse to overwrite: checked out in worktree' '\n \t\tgrep \"cannot force update the branch\" err &&\n \n \t\ttest_must_fail git branch -D wt-$i 2>err &&\n-\t\tgrep \"Cannot delete branch\" err || return 1\n+\t\tgrep \"cannot delete branch\" err || return 1\n \tdone\n '\n \ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 080e4f24a6..3182abde27 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -291,10 +291,10 @@ test_expect_success 'git branch -M topic topic should work when main is checked\n test_expect_success 'git branch -M and -C fail on detached HEAD' '\n \tgit checkout HEAD^{} &&\n \ttest_when_finished git checkout - &&\n-\techo \"fatal: cannot rename the current branch while not on any.\" >expect &&\n+\techo \"fatal: cannot rename the current branch while not on any\" >expect &&\n \ttest_must_fail git branch -M must-fail 2>err &&\n \ttest_cmp expect err &&\n-\techo \"fatal: cannot copy the current branch while not on any.\" >expect &&\n+\techo \"fatal: cannot copy the current branch while not on any\" >expect &&\n \ttest_must_fail git branch -C must-fail 2>err &&\n \ttest_cmp expect err\n '\n@@ -943,7 +943,7 @@ test_expect_success 'deleting currently checked out branch fails' '\n \tgit worktree add -b my7 my7 &&\n \ttest_must_fail git -C my7 branch -d my7 &&\n \ttest_must_fail git branch -d my7 2>actual &&\n-\tgrep \"^error: Cannot delete branch .my7. used by worktree at \" actual &&\n+\tgrep \"^error: cannot delete branch .my7. used by worktree at \" actual &&\n \trm -r my7 &&\n \tgit worktree prune\n '\n@@ -954,7 +954,7 @@ test_expect_success 'deleting in-use branch fails' '\n \tgit -C my7 bisect start HEAD HEAD~2 &&\n \ttest_must_fail git -C my7 branch -d my7 &&\n \ttest_must_fail git branch -d my7 2>actual &&\n-\tgrep \"^error: Cannot delete branch .my7. used by worktree at \" actual &&\n+\tgrep \"^error: cannot delete branch .my7. used by worktree at \" actual &&\n \trm -r my7 &&\n \tgit worktree prune\n '\n@@ -1024,7 +1024,7 @@ test_expect_success '--set-upstream-to fails on multiple branches' '\n test_expect_success '--set-upstream-to fails on detached HEAD' '\n \tgit checkout HEAD^{} &&\n \ttest_when_finished git checkout - &&\n-\techo \"fatal: could not set upstream of HEAD to main when it does not point to any branch.\" >expect &&\n+\techo \"fatal: could not set upstream of HEAD to main when it does not point to any branch\" >expect &&\n \ttest_must_fail git branch --set-upstream-to main 2>err &&\n \ttest_cmp expect err\n '\n@@ -1072,7 +1072,7 @@ test_expect_success 'use --set-upstream-to modify a particular branch' '\n '\n \n test_expect_success '--unset-upstream should fail if given a non-existent branch' '\n-\techo \"fatal: Branch '\"'\"'i-dont-exist'\"'\"' has no upstream information\" >expect &&\n+\techo \"fatal: branch '\"'\"'i-dont-exist'\"'\"' has no upstream information\" >expect &&\n \ttest_must_fail git branch --unset-upstream i-dont-exist 2>err &&\n \ttest_cmp expect err\n '\n@@ -1094,7 +1094,7 @@ test_expect_success 'test --unset-upstream on HEAD' '\n \ttest_must_fail git config branch.main.remote &&\n \ttest_must_fail git config branch.main.merge &&\n \t# fail for a branch without upstream set\n-\techo \"fatal: Branch '\"'\"'main'\"'\"' has no upstream information\" >expect &&\n+\techo \"fatal: branch '\"'\"'main'\"'\"' has no upstream information\" >expect &&\n \ttest_must_fail git branch --unset-upstream 2>err &&\n \ttest_cmp expect err\n '\n@@ -1108,7 +1108,7 @@ test_expect_success '--unset-upstream should fail on multiple branches' '\n test_expect_success '--unset-upstream should fail on detached HEAD' '\n \tgit checkout HEAD^{} &&\n \ttest_when_finished git checkout - &&\n-\techo \"fatal: could not unset upstream of HEAD when it does not point to any branch.\" >expect &&\n+\techo \"fatal: could not unset upstream of HEAD when it does not point to any branch\" >expect &&\n \ttest_must_fail git branch --unset-upstream 2>err &&\n \ttest_cmp expect err\n '\ndiff --git a/t/t3202-show-branch.sh b/t/t3202-show-branch.sh\nindex b17f388f56..2cdb834b37 100755\n--- a/t/t3202-show-branch.sh\n+++ b/t/t3202-show-branch.sh\n@@ -10,7 +10,7 @@ GIT_TEST_DATE_NOW=1251660000; export GIT_TEST_DATE_NOW\n test_expect_success 'error descriptions on empty repository' '\n \tcurrent=$(git branch --show-current) &&\n \tcat >expect <<-EOF &&\n-\terror: No commit on branch '\\''$current'\\'' yet.\n+\terror: no commit on branch '\\''$current'\\'' yet\n \tEOF\n \ttest_must_fail git branch --edit-description 2>actual &&\n \ttest_cmp expect actual &&\n@@ -21,7 +21,7 @@ test_expect_success 'error descriptions on empty repository' '\n test_expect_success 'fatal descriptions on empty repository' '\n \tcurrent=$(git branch --show-current) &&\n \tcat >expect <<-EOF &&\n-\tfatal: No commit on branch '\\''$current'\\'' yet.\n+\tfatal: no commit on branch '\\''$current'\\'' yet\n \tEOF\n \ttest_must_fail git branch --set-upstream-to=non-existent 2>actual &&\n \ttest_cmp expect actual &&\n@@ -224,7 +224,7 @@ done\n \n test_expect_success 'error descriptions on non-existent branch' '\n \tcat >expect <<-EOF &&\n-\terror: No branch named '\\''non-existent'\\'.'\n+\terror: no branch named '\\''non-existent'\\''\n \tEOF\n \ttest_must_fail git branch --edit-description non-existent 2>actual &&\n \ttest_cmp expect actual\n@@ -238,7 +238,7 @@ test_expect_success 'fatal descriptions on non-existent branch' '\n \ttest_cmp expect actual &&\n \n \tcat >expect <<-EOF &&\n-\tfatal: No branch named '\\''non-existent'\\''.\n+\tfatal: no branch named '\\''non-existent'\\''\n \tEOF\n \ttest_must_fail git branch -c non-existent new-branch 2>actual &&\n \ttest_cmp expect actual &&\n@@ -253,7 +253,7 @@ test_expect_success 'error descriptions on orphan branch' '\n \ttest_branch_op_in_wt() {\n \t\ttest_orphan_error() {\n \t\t\ttest_must_fail git $* 2>actual &&\n-\t\t\ttest_i18ngrep \"No commit on branch .orphan-branch. yet.$\" actual\n+\t\t\ttest_i18ngrep \"no commit on branch .orphan-branch. yet$\" actual\n \t\t} &&\n \t\ttest_orphan_error -C wt branch $1 $2 &&                # implicit branch\n \t\ttest_orphan_error -C wt branch $1 orphan-branch $2 &&  # explicit branch\n-- \n2.42.0.346.g24618a8a3e.dirty\n\n"},{"id":"483719","messageId":"14df596a-d0ef-46aa-97c6-3c9f0da1975f@gmail.com","threadId":"60418","inReplyTo":"20231023160656.4341-1-isokenjune@gmail.com","subject":"Re: [PATCH v3] builtin/branch.c: adjust error messages to coding guidelines","fromName":"Rubén Justo","fromEmail":"rjusto@gmail.com","sentAt":"2023-10-23T20:17:33Z","receivedAt":"2023-10-23T20:17:39Z","isPatch":true,"sender":{"key":"rjusto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5685487?v=4"},"body":"On 23-oct-2023 17:06:56, Isoken June Ibizugbe wrote:\n\nJust for reference, to avoid confusion, this is technically the fourth\nversion.\n\n> As per the CodingGuidelines document, it is recommended that error messages\n> such as die(), error() and warning(), should start with a lowercase letter\n> and should not end with a period.\n> \n> This patch adjusts tests to match updated messages.\n> \n> Signed-off-by: Isoken June Ibizugbe <isokenjune@gmail.com>\n> ---\n\nIt is often convenient to include here, after this three dash line, a\ndescription of the changes introduced in the new iteration.\n\nIn this particular case, a range-diff is very helpful.\n\nThis is the range-diff with v2:\n\n1:  a4e8bb1b4c ! 1:  c4ae0c1cce builtin/branch.c: adjust error messages to coding guidelines\n    @@ Metadata\n      ## Commit message ##\n         builtin/branch.c: adjust error messages to coding guidelines\n     \n    -    As per the CodingGuidelines document, it is recommended that a single-line\n    -    message provided to error messages such as die(), error() and warning(),\n    -    should start with a lowercase letter and should not end with a period.\n    -    Also this patch fixes the tests broken by the changes.\n    +    As per the CodingGuidelines document, it is recommended that error messages\n    +    such as die(), error() and warning(), should start with a lowercase letter\n    +    and should not end with a period.\n    +\n    +    This patch adjusts tests to match updated messages.\n     \n         Signed-off-by: Isoken June Ibizugbe <isokenjune@gmail.com>\n\nAs we can see, the only difference is in the commit message.\n\nThe new wording is better; it avoids the distraction introduced in v2.\n\nAnd, as Dragan suggested about /the other v3/, the wrapping is correct. \n\nThe rest of the patch is equal to the previous iteration (v2), which\nalready seemed correct to me.\n\nThank you.\n"},{"id":"483721","messageId":"xmqqmsw9m6qa.fsf@gitster.g","threadId":"60418","inReplyTo":"14df596a-d0ef-46aa-97c6-3c9f0da1975f@gmail.com","subject":"Re: [PATCH v3] builtin/branch.c: adjust error messages to coding guidelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-23T20:19:57Z","receivedAt":"2023-10-23T20:20:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Rubén Justo <rjusto@gmail.com> writes:\n\n> The rest of the patch is equal to the previous iteration (v2), which\n> already seemed correct to me.\n>\n> Thank you.\n\nThanks, all.  Let's declare a victory and mark the topic to be\nmerged to 'next'.\n\n"}]}