@matheusbsbs / matheus-bagliano / commits / 05207a2881
Fork 0

Start conforming code to "git subcmd" style part 2

User notifications are presented as 'git cmd', and code comments are presented as '"cmd"' or 'git's cmd', rather than 'git-cmd'. Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Heikki Orsila committed Sep 9, 2008 at 13:28 UTC 05207a28818623e417b69f337a9e8604d799d09d
5 files changed +14 -14
builtin-checkout-index.c
+7 -7
@@ -5,26 +5,26 @@
5 *
6 * Careful: order of argument flags does matter. For example,
7 *
8 - * git-checkout-index -a -f file.c
8 + * git checkout-index -a -f file.c
9 *
10 * Will first check out all files listed in the cache (but not
11 * overwrite any old ones), and then force-checkout "file.c" a
12 * second time (ie that one _will_ overwrite any old contents
13 * with the same filename).
14 *
15 - * Also, just doing "git-checkout-index" does nothing. You probably
16 - * meant "git-checkout-index -a". And if you want to force it, you
17 - * want "git-checkout-index -f -a".
15 + * Also, just doing "git checkout-index" does nothing. You probably
16 + * meant "git checkout-index -a". And if you want to force it, you
17 + * want "git checkout-index -f -a".
18 *
19 * Intuitiveness is not the goal here. Repeatability is. The
20 * reason for the "no arguments means no work" thing is that
21 * from scripts you are supposed to be able to do things like
22 *
23 - * find . -name '*.h' -print0 | xargs -0 git-checkout-index -f --
23 + * find . -name '*.h' -print0 | xargs -0 git checkout-index -f --
24 *
25 * or:
26 *
27 - * find . -name '*.h' -print0 | git-checkout-index -f -z --stdin
27 + * find . -name '*.h' -print0 | git checkout-index -f -z --stdin
28 *
29 * which will force all existing *.h files to be replaced with
30 * their cached copies. If an empty command line implied "all",
@@ -107,7 +107,7 @@ static int checkout_file(const char *name, int prefix_length)
107 }
108
109 if (!state.quiet) {
110 - fprintf(stderr, "git-checkout-index: %s ", name);
110 + fprintf(stderr, "git checkout-index: %s ", name);
111 if (!has_same_name)
112 fprintf(stderr, "is not in the cache");
113 else if (checkout_stage)
builtin-commit-tree.c
+1 -1
@@ -24,7 +24,7 @@ static void check_valid(unsigned char *sha1, enum object_type expect)
24 typename(expect));
25 }
26
27 -static const char commit_tree_usage[] = "git-commit-tree <sha1> [-p <sha1>]* < changelog";
27 +static const char commit_tree_usage[] = "git commit-tree <sha1> [-p <sha1>]* < changelog";
28
29 static void new_parent(struct commit *parent, struct commit_list **parents_p)
30 {
builtin-fetch-pack.c
+1 -1
@@ -750,7 +750,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
750 if (!ret && nr_heads) {
751 /* If the heads to pull were given, we should have
752 * consumed all of them by matching the remote.
753 - * Otherwise, 'git-fetch remote no-such-ref' would
753 + * Otherwise, 'git fetch remote no-such-ref' would
754 * silently succeed without issuing an error.
755 */
756 for (i = 0; i < nr_heads; i++)
builtin-fetch.c
+3 -3
@@ -86,10 +86,10 @@ static void add_merge_config(struct ref **head,
86 /*
87 * Not fetched to a tracking branch? We need to fetch
88 * it anyway to allow this branch's "branch.$name.merge"
89 - * to be honored by git-pull, but we do not have to
89 + * to be honored by 'git pull', but we do not have to
90 * fail if branch.$name.merge is misconfigured to point
91 * at a nonexisting branch. If we were indeed called by
92 - * git-pull, it will notice the misconfiguration because
92 + * 'git pull', it will notice the misconfiguration because
93 * there is no entry in the resulting FETCH_HEAD marked
94 * for merging.
95 */
@@ -396,7 +396,7 @@ static int store_updated_refs(const char *url, const char *remote_name,
396 * The refs we are going to fetch are in to_fetch (nr_heads in
397 * total). If running
398 *
399 - * $ git-rev-list --objects to_fetch[0] to_fetch[1] ... --not --all
399 + * $ git rev-list --objects to_fetch[0] to_fetch[1] ... --not --all
400 *
401 * does not error out, that means everything reachable from the
402 * refs we are going to fetch exists and is connected to some of
builtin-http-fetch.c
+2 -2
@@ -42,7 +42,7 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix)
42 arg++;
43 }
44 if (argc < arg + 2 - commits_on_stdin) {
45 - usage("git-http-fetch [-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url");
45 + usage("git http-fetch [-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url");
46 return 1;
47 }
48 if (commits_on_stdin) {
@@ -75,7 +75,7 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix)
75 fprintf(stderr,
76 "Some loose object were found to be corrupt, but they might be just\n"
77 "a false '404 Not Found' error message sent with incorrect HTTP\n"
78 -"status code. Suggest running git-fsck.\n");
78 +"status code. Suggest running 'git fsck'.\n");
79 }
80
81 walker_free(walker);