Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix): Make all die() error messages lowercase #1199

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions abspath.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static char *strbuf_realpath_1(struct strbuf *resolved, const char *path,

if (!*path) {
if (flags & REALPATH_DIE_ON_ERROR)
die("The empty string is not a valid path");
die("the empty string is not a valid path");
else
goto error_out;
}
Expand Down Expand Up @@ -141,7 +141,7 @@ static char *strbuf_realpath_1(struct strbuf *resolved, const char *path,
errno = ELOOP;

if (flags & REALPATH_DIE_ON_ERROR)
die("More than %d nested symlinks "
die("more than %d nested symlinks "
"on path '%s'", MAXSYMLINKS, path);
else
goto error_out;
Expand Down
6 changes: 3 additions & 3 deletions advice.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,20 @@ int error_resolve_conflict(const char *me)
void NORETURN die_resolve_conflict(const char *me)
{
error_resolve_conflict(me);
die(_("Exiting because of an unresolved conflict."));
die(_("exiting because of an unresolved conflict."));
}

void NORETURN die_conclude_merge(void)
{
error(_("You have not concluded your merge (MERGE_HEAD exists)."));
if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
advise(_("Please, commit your changes before merging."));
die(_("Exiting because of unfinished merge."));
die(_("exiting because of unfinished merge."));
}

void NORETURN die_ff_impossible(void)
{
die(_("Not possible to fast-forward, aborting."));
die(_("not possible to fast-forward, aborting."));
}

void advise_on_updating_sparse_paths(struct string_list *pathspec_list)
Expand Down
12 changes: 6 additions & 6 deletions archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ static int add_file_cb(const struct option *opt, const char *arg, int unset)
item->util = info = xmalloc(sizeof(*info));
info->base = xstrdup_or_null(base);
if (stat(path, &info->stat))
die(_("File not found: %s"), path);
die(_("file not found: %s"), path);
if (!S_ISREG(info->stat.st_mode))
die(_("Not a regular file: %s"), path);
die(_("not a regular file: %s"), path);
return 0;
}

Expand Down Expand Up @@ -575,11 +575,11 @@ static int parse_archive_args(int argc, const char **argv,
argc = parse_options(argc, argv, NULL, opts, archive_usage, 0);

if (remote)
die(_("Unexpected option --remote"));
die(_("unexpected option --remote"));
if (exec)
die(_("the option '%s' requires '%s'"), "--exec", "--remote");
if (output)
die(_("Unexpected option --output"));
die(_("unexpected option --output"));
if (is_remote && args->extra_files.nr)
die(_("options '%s' and '%s' cannot be used together"), "--add-file", "--remote");

Expand All @@ -603,7 +603,7 @@ static int parse_archive_args(int argc, const char **argv,
usage_with_options(archive_usage, opts);
*ar = lookup_archiver(format);
if (!*ar || (is_remote && !((*ar)->flags & ARCHIVER_REMOTE)))
die(_("Unknown archive format '%s'"), format);
die(_("unknown archive format '%s'"), format);

args->compression_level = Z_DEFAULT_COMPRESSION;
if (compression_level != -1) {
Expand All @@ -612,7 +612,7 @@ static int parse_archive_args(int argc, const char **argv,
if (levels_ok && (compression_level <= 9 || high_ok))
args->compression_level = compression_level;
else {
die(_("Argument not supported for format '%s': -%d"),
die(_("argument not supported for format '%s': -%d"),
format, compression_level);
}
}
Expand Down
4 changes: 2 additions & 2 deletions bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static void read_bisect_paths(struct strvec *array)
while (strbuf_getline_lf(&str, fp) != EOF) {
strbuf_trim(&str);
if (sq_dequote_to_strvec(str.buf, array))
die(_("Badly quoted content in file '%s': %s"),
die(_("badly quoted content in file '%s': %s"),
filename, str.buf);
}

Expand Down Expand Up @@ -762,7 +762,7 @@ static struct commit *get_commit_reference(struct repository *r,
{
struct commit *c = lookup_commit_reference(r, oid);
if (!c)
die(_("Not a valid commit name %s"), oid_to_hex(oid));
die(_("not a valid commit name %s"), oid_to_hex(oid));
return c;
}

Expand Down
12 changes: 6 additions & 6 deletions blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ static void fill_origin_blob(struct diff_options *opt,
file->size = file_size;

if (!file->ptr)
die("Cannot read blob %s for path %s",
die("cannot read blob %s for path %s",
oid_to_hex(&o->blob_oid),
o->path);
o->file = *file;
Expand Down Expand Up @@ -2667,9 +2667,9 @@ static struct commit *find_single_final(struct rev_info *revs,
continue;
obj = deref_tag(revs->repo, obj, NULL, 0);
if (!obj || obj->type != OBJ_COMMIT)
die("Non commit %s?", revs->pending.objects[i].name);
die("non commit %s?", revs->pending.objects[i].name);
if (found)
die("More than one commit to dig from %s and %s?",
die("more than one commit to dig from %s and %s?",
revs->pending.objects[i].name, name);
found = (struct commit *)obj;
name = revs->pending.objects[i].name;
Expand Down Expand Up @@ -2734,9 +2734,9 @@ static struct commit *find_single_initial(struct rev_info *revs,
continue;
obj = deref_tag(revs->repo, obj, NULL, 0);
if (!obj || obj->type != OBJ_COMMIT)
die("Non commit %s?", revs->pending.objects[i].name);
die("non commit %s?", revs->pending.objects[i].name);
if (found)
die("More than one commit to dig up from, %s and %s?",
die("more than one commit to dig up from, %s and %s?",
revs->pending.objects[i].name, name);
found = (struct commit *) obj;
name = revs->pending.objects[i].name;
Expand All @@ -2745,7 +2745,7 @@ static struct commit *find_single_initial(struct rev_info *revs,
if (!name)
found = dwim_reverse_initial(revs, &name);
if (!name)
die("No commit to dig up from?");
die("no commit to dig up from?");

if (name_p)
*name_p = xstrdup(name);
Expand Down
12 changes: 6 additions & 6 deletions builtin/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static int refresh(int verbose, const struct pathspec *pathspec)

seen = xcalloc(pathspec->nr, 1);
refresh_index(&the_index, flags, pathspec, seen,
_("Unstaged changes after refreshing the index:"));
_("unstaged changes after refreshing the index:"));
for (i = 0; i < pathspec->nr; i++) {
if (!seen[i]) {
const char *path = pathspec->items[i].original;
Expand Down Expand Up @@ -309,7 +309,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */

if (read_cache() < 0)
die(_("Could not read the index"));
die(_("could not read the index"));

repo_init_revisions(the_repository, &rev, prefix);
rev.diffopt.context = 7;
Expand All @@ -322,21 +322,21 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
rev.diffopt.file = xfdopen(out, "w");
rev.diffopt.close_file = 1;
if (run_diff_files(&rev, 0))
die(_("Could not write patch"));
die(_("could not write patch"));

if (launch_editor(file, NULL, NULL))
die(_("editing patch failed"));

if (stat(file, &st))
die_errno(_("Could not stat '%s'"), file);
if (!st.st_size)
die(_("Empty patch. Aborted."));
die(_("empty patch. Aborted."));

child.git_cmd = 1;
strvec_pushl(&child.args, "apply", "--recount", "--cached", file,
NULL);
if (run_command(&child))
die(_("Could not apply '%s'"), file);
die(_("could not apply '%s'"), file);

unlink(file);
free(file);
Expand Down Expand Up @@ -687,7 +687,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
finish:
if (write_locked_index(&the_index, &lock_file,
COMMIT_LOCK | SKIP_IF_UNCHANGED))
die(_("Unable to write new index file"));
die(_("unable to write new index file"));

dir_clear(&dir);
UNLEAK(pathspec);
Expand Down
10 changes: 5 additions & 5 deletions builtin/am.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ static void am_setup(struct am_state *state, enum patch_format patch_format,

if (split_mail(state, patch_format, paths, keep_cr) < 0) {
am_destroy(state);
die(_("Failed to split patches."));
die(_("failed to split patches."));
}

if (state->rebasing)
Expand Down Expand Up @@ -1783,7 +1783,7 @@ static void am_run(struct am_state *state, int resume)

if (repo_index_has_changes(the_repository, NULL, &sb)) {
write_state_bool(state, "dirtyindex", 1);
die(_("Dirty index: cannot apply patches (dirty: %s)"), sb.buf);
die(_("dirty index: cannot apply patches (dirty: %s)"), sb.buf);
}

strbuf_release(&sb);
Expand Down Expand Up @@ -2487,13 +2487,13 @@ int cmd_am(int argc, const char **argv, const char *prefix)
return 0;
}

die(_("Stray %s directory found.\n"
"Use \"git am --abort\" to remove it."),
die(_("stray %s directory found.\n"
"use \"git am --abort\" to remove it."),
state.dir);
}

if (resume.mode)
die(_("Resolve operation not in progress, we are not resuming."));
die(_("resolve operation not in progress, we are not resuming."));

for (i = 0; i < argc; i++) {
if (is_absolute_path(argv[i]) || !prefix)
Expand Down
2 changes: 1 addition & 1 deletion builtin/archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static int run_remote_archiver(int argc, const char **argv,

_remote = remote_get(remote);
if (!_remote->url[0])
die(_("git archive: Remote with no URL"));
die(_("git archive: remote with no URL"));
transport = transport_get(_remote, _remote->url[0]);
transport_connect(transport, "git-upload-archive", exec, fd);

Expand Down
2 changes: 1 addition & 1 deletion builtin/bisect--helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, const char **a

commit = lookup_commit_reference(the_repository, &oid);
if (!commit)
die(_("Bad rev input (not a commit): %s"), *argv);
die(_("bad rev input (not a commit): %s"), *argv);

oid_array_append(&revs, &commit->object.oid);
}
Expand Down
2 changes: 1 addition & 1 deletion builtin/blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ static void sanity_check_on_fail(struct blame_scoreboard *sb, int baa)
int opt = OUTPUT_SHOW_SCORE | OUTPUT_SHOW_NUMBER | OUTPUT_SHOW_NAME;
find_alignment(sb, &opt);
output(sb, opt);
die("Baa %d!", baa);
die("baa %d!", baa);
}

static unsigned parse_score(const char *arg)
Expand Down
40 changes: 20 additions & 20 deletions builtin/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
if (!force) {
head_rev = lookup_commit_reference(the_repository, &head_oid);
if (!head_rev)
die(_("Couldn't look up commit object for HEAD"));
die(_("couldn't look up commit object for HEAD"));
}

worktrees = get_worktrees();
Expand Down Expand Up @@ -506,11 +506,11 @@ static void reject_rebase_or_bisect_branch(const char *target)
continue;

if (is_worktree_being_rebased(wt, target))
die(_("Branch %s is being rebased at %s"),
die(_("branch %s is being rebased at %s"),
target, wt->path);

if (is_worktree_being_bisected(wt, target))
die(_("Branch %s is being bisected at %s"),
die(_("branch %s is being bisected at %s"),
target, wt->path);
}

Expand Down Expand Up @@ -540,7 +540,7 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
if (ref_exists(oldref.buf))
recovery = 1;
else
die(_("Invalid branch name: '%s'"), oldname);
die(_("invalid branch name: '%s'"), oldname);
}

/*
Expand All @@ -560,31 +560,31 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
}

if (copy)
strbuf_addf(&logmsg, "Branch: copied %s to %s",
strbuf_addf(&logmsg, "branch: copied %s to %s",
oldref.buf, newref.buf);
else
strbuf_addf(&logmsg, "Branch: renamed %s to %s",
strbuf_addf(&logmsg, "branch: renamed %s to %s",
oldref.buf, newref.buf);

if (!copy &&
(!head || strcmp(oldname, head) || !is_null_oid(&head_oid)) &&
rename_ref(oldref.buf, newref.buf, logmsg.buf))
die(_("Branch rename failed"));
die(_("branch rename failed"));
if (copy && copy_existing_ref(oldref.buf, newref.buf, logmsg.buf))
die(_("Branch copy failed"));
die(_("branch copy failed"));

if (recovery) {
if (copy)
warning(_("Created a copy of a misnamed branch '%s'"),
warning(_("created a copy of a misnamed branch '%s'"),
interpreted_oldname);
else
warning(_("Renamed a misnamed branch '%s' away"),
warning(_("renamed a misnamed branch '%s' away"),
interpreted_oldname);
}

if (!copy &&
replace_each_worktree_head_symref(oldref.buf, newref.buf, logmsg.buf))
die(_("Branch renamed to %s, but HEAD is not updated!"), newname);
die(_("branch renamed to %s, but HEAD is not updated!"), newname);

strbuf_release(&logmsg);

Expand All @@ -593,9 +593,9 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
strbuf_addf(&newsection, "branch.%s", interpreted_newname);
strbuf_release(&newref);
if (!copy && git_config_rename_section(oldsection.buf, newsection.buf) < 0)
die(_("Branch is renamed, but update of config-file failed"));
die(_("branch is renamed, but update of config-file failed"));
if (copy && strcmp(oldname, newname) && git_config_copy_section(oldsection.buf, newsection.buf) < 0)
die(_("Branch is copied, but update of config-file failed"));
die(_("branch is copied, but update of config-file failed"));
strbuf_release(&oldsection);
strbuf_release(&newsection);
}
Expand All @@ -611,9 +611,9 @@ static int edit_branch_description(const char *branch_name)
if (!buf.len || buf.buf[buf.len-1] != '\n')
strbuf_addch(&buf, '\n');
strbuf_commented_addf(&buf,
_("Please edit the description for the branch\n"
_("please edit the description for the branch\n"
" %s\n"
"Lines starting with '%c' will be stripped.\n"),
"lines starting with '%c' will be stripped.\n"),
branch_name, comment_line_char);
write_file_buf(edit_description(), buf.buf, buf.len);
strbuf_reset(&buf);
Expand Down Expand Up @@ -711,7 +711,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)

head = resolve_refdup("HEAD", 0, &head_oid, NULL);
if (!head)
die(_("Failed to resolve HEAD as a valid ref."));
die(_("failed to resolve HEAD as a valid ref."));
if (!strcmp(head, "HEAD"))
filter.detached = 1;
else if (!skip_prefix(head, "refs/heads/", &head))
Expand Down Expand Up @@ -799,7 +799,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)

if (!argc) {
if (filter.detached)
die(_("Cannot give description to detached HEAD"));
die(_("cannot give description to detached HEAD"));
branch_name = head;
} else if (argc == 1)
branch_name = argv[0];
Expand All @@ -811,10 +811,10 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
strbuf_release(&branch_ref);

if (!argc)
return error(_("No commit on branch '%s' yet."),
return error(_("no commit on branch '%s' yet."),
branch_name);
else
return error(_("No branch named '%s'."),
return error(_("no branch named '%s'."),
branch_name);
}
strbuf_release(&branch_ref);
Expand Down Expand Up @@ -874,7 +874,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
}

if (!branch_has_merge_config(branch))
die(_("Branch '%s' has no upstream information"), branch->name);
die(_("branch '%s' has no upstream information"), branch->name);

strbuf_addf(&buf, "branch.%s.remote", branch->name);
git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
Expand Down