Skip to content

Commit

Permalink
[PATCH] Unify usage strings declaration
Browse files Browse the repository at this point in the history
All usage strings are now declared as static const char [].

This is carried over from my old git-pb branch.

Signed-off-by: Petr Baudis <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Jul 30, 2005
1 parent 0b124bb commit 4d1f119
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion checkout-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static int checkout_all(void)
return 0;
}

static const char *checkout_cache_usage =
static const char checkout_cache_usage[] =
"git-checkout-cache [-u] [-q] [-a] [-f] [-n] [--prefix=<string>] [--] <file>...";

int main(int argc, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion commit-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void check_valid(unsigned char *sha1, const char *expect)
#define MAXPARENT (16)
static unsigned char parent_sha1[MAXPARENT][20];

static char *commit_tree_usage = "git-commit-tree <sha1> [-p <sha1>]* < changelog";
static const char commit_tree_usage[] = "git-commit-tree <sha1> [-p <sha1>]* < changelog";

static int new_parent(int idx)
{
Expand Down
2 changes: 1 addition & 1 deletion diff-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static void mark_merge_entries(void)
}
}

static char *diff_cache_usage =
static const char diff_cache_usage[] =
"git-diff-cache [-m] [--cached] "
"[<common diff options>] <tree-ish> [<path>...]"
COMMON_DIFF_OPTIONS_HELP;
Expand Down
2 changes: 1 addition & 1 deletion diff-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "cache.h"
#include "diff.h"

static const char *diff_files_usage =
static const char diff_files_usage[] =
"git-diff-files [-q] "
"[<common diff options>] [<path>...]"
COMMON_DIFF_OPTIONS_HELP;
Expand Down
2 changes: 1 addition & 1 deletion diff-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void flush_them(int ac, const char **av)
diff_flush(DIFF_FORMAT_PATCH, '\n');
}

static const char *diff_helper_usage =
static const char diff_helper_usage[] =
"git-diff-helper [-z] [-O<orderfile>] [-S<string>] [--pickaxe-all] [<path>...]";

int main(int ac, const char **av) {
Expand Down
2 changes: 1 addition & 1 deletion diff-stages.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static int diff_break_opt = -1;
static const char *orderfile = NULL;
static const char *diff_filter = NULL;

static char *diff_stages_usage =
static const char diff_stages_usage[] =
"git-diff-stages [<common diff options>] <stage1> <stage2> [<path>...]"
COMMON_DIFF_OPTIONS_HELP;

Expand Down
2 changes: 1 addition & 1 deletion diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static int diff_tree_stdin(char *line)
return diff_tree_commit(commit, line);
}

static char *diff_tree_usage =
static const char diff_tree_usage[] =
"git-diff-tree [--stdin] [-m] [-s] [-v] [--pretty] [-t] "
"[<common diff options>] <tree-ish> <tree-ish>"
COMMON_DIFF_OPTIONS_HELP;
Expand Down
2 changes: 1 addition & 1 deletion hash-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void hash_object(const char *path, const char *type, int write_object)
printf("%s\n", sha1_to_hex(sha1));
}

static const char *hash_object_usage =
static const char hash_object_usage[] =
"git-hash-object [-t <type>] [-w] <file>...";

int main(int argc, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion local-pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int fetch_ref(char *ref, unsigned char *sha1)
return 0;
}

static const char *local_pull_usage =
static const char local_pull_usage[] =
"git-local-pull [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [-l] [-s] [-n] commit-id path";

/*
Expand Down
3 changes: 1 addition & 2 deletions ls-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,10 @@ static void show_files(void)
}
}

static const char *ls_files_usage =
static const char ls_files_usage[] =
"git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed])* "
"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
"[ --exclude-per-directory=<filename> ]";
;

int main(int argc, char **argv)
{
Expand Down
2 changes: 1 addition & 1 deletion ls-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static int list(char **path)
return err;
}

static const char *ls_tree_usage =
static const char ls_tree_usage[] =
"git-ls-tree [-d] [-r] [-z] <tree-ish> [path...]";

int main(int argc, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion read-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ static int read_cache_unmerged(void)
return deleted;
}

static char *read_tree_usage = "git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])";
static const char read_tree_usage[] = "git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])";

static struct cache_file cache_file;

Expand Down
2 changes: 1 addition & 1 deletion ssh-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static void service(int fd_in, int fd_out) {
} while (1);
}

static const char *ssh_push_usage =
static const char ssh_push_usage[] =
"git-ssh-push [-c] [-t] [-a] [-w ref] commit-id url";

int main(int argc, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion tar-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define EXT_HEADER_PATH 1
#define EXT_HEADER_LINKPATH 2

static const char *tar_tree_usage = "git-tar-tree <key> [basedir]";
static const char tar_tree_usage[] = "git-tar-tree <key> [basedir]";

static char block[BLOCKSIZE];
static unsigned long offset;
Expand Down
2 changes: 1 addition & 1 deletion test-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <sys/mman.h>
#include "delta.h"

static const char *usage =
static const char usage[] =
"test-delta (-d|-p) <from_file> <data_file> <out_file>";

int main(int argc, char *argv[])
Expand Down
2 changes: 1 addition & 1 deletion var.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <errno.h>
#include <string.h>

static char *var_usage = "git-var [-l | <variable>]";
static const char var_usage[] = "git-var [-l | <variable>]";

struct git_var {
const char *name;
Expand Down
2 changes: 1 addition & 1 deletion verify-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static int verify_one_pack(char *arg, int verbose)
return verify_pack(g, verbose);
}

static const char *verify_pack_usage = "git-verify-pack [-v] <pack>...";
static const char verify_pack_usage[] = "git-verify-pack [-v] <pack>...";

int main(int ac, char **av)
{
Expand Down

0 comments on commit 4d1f119

Please sign in to comment.