Skip to content

Commit 7e44c93

Browse files
committed
'git foo' program identifies itself without dash in die() messages
This is a mechanical conversion of all '*.c' files with: s/((?:die|error|warning)\("git)-(\S+:)/$1 $2/; The result was manually inspected and no false positive was found. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 34baebc commit 7e44c93

15 files changed

+52
-52
lines changed

builtin-apply.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,17 +506,17 @@ static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name,
506506
name = orig_name;
507507
len = strlen(name);
508508
if (isnull)
509-
die("git-apply: bad git-diff - expected /dev/null, got %s on line %d", name, linenr);
509+
die("git apply: bad git-diff - expected /dev/null, got %s on line %d", name, linenr);
510510
another = find_name(line, NULL, p_value, TERM_TAB);
511511
if (!another || memcmp(another, name, len))
512-
die("git-apply: bad git-diff - inconsistent %s filename on line %d", oldnew, linenr);
512+
die("git apply: bad git-diff - inconsistent %s filename on line %d", oldnew, linenr);
513513
free(another);
514514
return orig_name;
515515
}
516516
else {
517517
/* expect "/dev/null" */
518518
if (memcmp("/dev/null", line, 9) || line[9] != '\n')
519-
die("git-apply: bad git-diff - expected /dev/null on line %d", linenr);
519+
die("git apply: bad git-diff - expected /dev/null on line %d", linenr);
520520
return NULL;
521521
}
522522
}

builtin-checkout-index.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
258258
const char *p;
259259

260260
if (all)
261-
die("git-checkout-index: don't mix '--all' and explicit filenames");
261+
die("git checkout-index: don't mix '--all' and explicit filenames");
262262
if (read_from_stdin)
263-
die("git-checkout-index: don't mix '--stdin' and explicit filenames");
263+
die("git checkout-index: don't mix '--stdin' and explicit filenames");
264264
p = prefix_path(prefix, prefix_length, arg);
265265
checkout_file(p, prefix_length);
266266
if (p < arg || p > arg + strlen(arg))
@@ -271,7 +271,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
271271
struct strbuf buf, nbuf;
272272

273273
if (all)
274-
die("git-checkout-index: don't mix '--all' and '--stdin'");
274+
die("git checkout-index: don't mix '--all' and '--stdin'");
275275

276276
strbuf_init(&buf, 0);
277277
strbuf_init(&nbuf, 0);

builtin-commit-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
118118
}
119119

120120
if (strbuf_read(&buffer, 0, 0) < 0)
121-
die("git-commit-tree: read returned %s", strerror(errno));
121+
die("git commit-tree: read returned %s", strerror(errno));
122122

123123
if (!commit_tree(buffer.buf, tree_sha1, parents, commit_sha1)) {
124124
printf("%s\n", sha1_to_hex(commit_sha1));

builtin-fetch-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ static struct ref *do_fetch_pack(int fd[2],
609609
fprintf(stderr, "warning: no common commits\n");
610610

611611
if (get_pack(fd, pack_lockfile))
612-
die("git-fetch-pack: fetch failed.");
612+
die("git fetch-pack: fetch failed.");
613613

614614
all_done:
615615
return ref;

builtin-grep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
774774
/* Make sure we do not get outside of paths */
775775
for (i = 0; paths[i]; i++)
776776
if (strncmp(prefix, paths[i], opt.prefix_length))
777-
die("git-grep: cannot generate relative filenames containing '..'");
777+
die("git grep: cannot generate relative filenames containing '..'");
778778
}
779779
}
780780
else if (prefix) {

builtin-ls-files.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static void show_dir_entry(const char *tag, struct dir_entry *ent)
7878
int offset = prefix_offset;
7979

8080
if (len >= ent->len)
81-
die("git-ls-files: internal error - directory entry not superset of prefix");
81+
die("git ls-files: internal error - directory entry not superset of prefix");
8282

8383
if (pathspec && !pathspec_match(pathspec, ps_matched, ent->name, len))
8484
return;
@@ -183,7 +183,7 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce)
183183
int offset = prefix_offset;
184184

185185
if (len >= ce_namelen(ce))
186-
die("git-ls-files: internal error - cache entry not superset of prefix");
186+
die("git ls-files: internal error - cache entry not superset of prefix");
187187

188188
if (pathspec && !pathspec_match(pathspec, ps_matched, ce->name, len))
189189
return;
@@ -319,7 +319,7 @@ static const char *verify_pathspec(const char *prefix)
319319
}
320320

321321
if (prefix_offset > max || memcmp(prev, prefix, prefix_offset))
322-
die("git-ls-files: cannot generate relative filenames containing '..'");
322+
die("git ls-files: cannot generate relative filenames containing '..'");
323323

324324
prefix_len = max;
325325
return max ? xmemdupz(prev, max) : NULL;

builtin-rm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
221221
printf("rm '%s'\n", path);
222222

223223
if (remove_file_from_cache(path))
224-
die("git-rm: unable to remove %s", path);
224+
die("git rm: unable to remove %s", path);
225225
}
226226

227227
if (show_only)
@@ -244,7 +244,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
244244
continue;
245245
}
246246
if (!removed)
247-
die("git-rm: %s: %s", path, strerror(errno));
247+
die("git rm: %s: %s", path, strerror(errno));
248248
}
249249
}
250250

builtin-show-ref.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int show_ref(const char *refname, const unsigned char *sha1, int flag, vo
6262
* ref points at a nonexistent object.
6363
*/
6464
if (!has_sha1_file(sha1))
65-
die("git-show-ref: bad ref %s (%s)", refname,
65+
die("git show-ref: bad ref %s (%s)", refname,
6666
sha1_to_hex(sha1));
6767

6868
if (quiet)
@@ -82,12 +82,12 @@ static int show_ref(const char *refname, const unsigned char *sha1, int flag, vo
8282
else {
8383
obj = parse_object(sha1);
8484
if (!obj)
85-
die("git-show-ref: bad ref %s (%s)", refname,
85+
die("git show-ref: bad ref %s (%s)", refname,
8686
sha1_to_hex(sha1));
8787
if (obj->type == OBJ_TAG) {
8888
obj = deref_tag(obj, refname, 0);
8989
if (!obj)
90-
die("git-show-ref: bad tag at ref %s (%s)", refname,
90+
die("git show-ref: bad tag at ref %s (%s)", refname,
9191
sha1_to_hex(sha1));
9292
hex = find_unique_abbrev(obj->sha1, abbrev);
9393
printf("%s %s^{}\n", hex, refname);

builtin-tar-tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix)
7676

7777
n = read_in_full(0, buffer, HEADERSIZE);
7878
if (n < HEADERSIZE)
79-
die("git-get-tar-commit-id: read error");
79+
die("git get-tar-commit-id: read error");
8080
if (header->typeflag[0] != 'g')
8181
return 1;
8282
if (memcmp(content, "52 comment=", 11))
8383
return 1;
8484

8585
n = write_in_full(1, content + 11, 41);
8686
if (n < 41)
87-
die("git-get-tar-commit-id: write error");
87+
die("git get-tar-commit-id: write error");
8888

8989
return 0;
9090
}

builtin-update-index.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static void chmod_path(int flip, const char *path)
262262
report("chmod %cx '%s'", flip, path);
263263
return;
264264
fail:
265-
die("git-update-index: cannot chmod %cx '%s'", flip, path);
265+
die("git update-index: cannot chmod %cx '%s'", flip, path);
266266
}
267267

268268
static void update_one(const char *path, const char *prefix, int prefix_length)
@@ -280,7 +280,7 @@ static void update_one(const char *path, const char *prefix, int prefix_length)
280280

281281
if (force_remove) {
282282
if (remove_file_from_cache(p))
283-
die("git-update-index: unable to remove %s", path);
283+
die("git update-index: unable to remove %s", path);
284284
report("remove '%s'", path);
285285
goto free_return;
286286
}
@@ -351,7 +351,7 @@ static void read_index_info(int line_termination)
351351
if (line_termination && path_name[0] == '"') {
352352
strbuf_reset(&uq);
353353
if (unquote_c_style(&uq, path_name, NULL)) {
354-
die("git-update-index: bad quoting of path name");
354+
die("git update-index: bad quoting of path name");
355355
}
356356
path_name = uq.buf;
357357
}
@@ -364,7 +364,7 @@ static void read_index_info(int line_termination)
364364
if (!mode) {
365365
/* mode == 0 means there is no such path -- remove */
366366
if (remove_file_from_cache(path_name))
367-
die("git-update-index: unable to remove %s",
367+
die("git update-index: unable to remove %s",
368368
ptr);
369369
}
370370
else {
@@ -374,7 +374,7 @@ static void read_index_info(int line_termination)
374374
*/
375375
ptr[-42] = ptr[-1] = 0;
376376
if (add_cacheinfo(mode, sha1, path_name, stage))
377-
die("git-update-index: unable to update %s",
377+
die("git update-index: unable to update %s",
378378
path_name);
379379
}
380380
continue;
@@ -626,20 +626,20 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
626626
unsigned int mode;
627627

628628
if (i+3 >= argc)
629-
die("git-update-index: --cacheinfo <mode> <sha1> <path>");
629+
die("git update-index: --cacheinfo <mode> <sha1> <path>");
630630

631631
if (strtoul_ui(argv[i+1], 8, &mode) ||
632632
get_sha1_hex(argv[i+2], sha1) ||
633633
add_cacheinfo(mode, sha1, argv[i+3], 0))
634-
die("git-update-index: --cacheinfo"
634+
die("git update-index: --cacheinfo"
635635
" cannot add %s", argv[i+3]);
636636
i += 3;
637637
continue;
638638
}
639639
if (!strcmp(path, "--chmod=-x") ||
640640
!strcmp(path, "--chmod=+x")) {
641641
if (argc <= i+1)
642-
die("git-update-index: %s <path>", path);
642+
die("git update-index: %s <path>", path);
643643
set_executable_bit = path[8];
644644
continue;
645645
}

0 commit comments

Comments
 (0)