[PATCH] cleanup of in-code names

Fixes all in-code names that leaved during "big name change".

Signed-off-by: Alexey Nezhdanov <snake@penza-gsm.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
maint
Alexey Nezhdanov 2005-05-19 15:17:16 +04:00 committed by Linus Torvalds
parent 9669e17a2f
commit 667bb59b2d
19 changed files with 50 additions and 50 deletions

View File

@ -5,22 +5,22 @@
* *
* Careful: order of argument flags does matter. For example, * Careful: order of argument flags does matter. For example,
* *
* checkout-cache -a -f file.c * git-checkout-cache -a -f file.c
* *
* Will first check out all files listed in the cache (but not * Will first check out all files listed in the cache (but not
* overwrite any old ones), and then force-checkout "file.c" a * overwrite any old ones), and then force-checkout "file.c" a
* second time (ie that one _will_ overwrite any old contents * second time (ie that one _will_ overwrite any old contents
* with the same filename). * with the same filename).
* *
* Also, just doing "checkout-cache" does nothing. You probably * Also, just doing "git-checkout-cache" does nothing. You probably
* meant "checkout-cache -a". And if you want to force it, you * meant "git-checkout-cache -a". And if you want to force it, you
* want "checkout-cache -f -a". * want "git-checkout-cache -f -a".
* *
* Intuitiveness is not the goal here. Repeatability is. The * Intuitiveness is not the goal here. Repeatability is. The
* reason for the "no arguments means no work" thing is that * reason for the "no arguments means no work" thing is that
* from scripts you are supposed to be able to do things like * from scripts you are supposed to be able to do things like
* *
* find . -name '*.h' -print0 | xargs -0 checkout-cache -f -- * find . -name '*.h' -print0 | xargs -0 git-checkout-cache -f --
* *
* which will force all existing *.h files to be replaced with * which will force all existing *.h files to be replaced with
* their cached copies. If an empty command line implied "all", * their cached copies. If an empty command line implied "all",
@ -122,7 +122,7 @@ static int write_entry(struct cache_entry *ce, const char *path)
if (!new || strcmp(type, "blob")) { if (!new || strcmp(type, "blob")) {
if (new) if (new)
free(new); free(new);
return error("checkout-cache: unable to read sha1 file of %s (%s)", return error("git-checkout-cache: unable to read sha1 file of %s (%s)",
path, sha1_to_hex(ce->sha1)); path, sha1_to_hex(ce->sha1));
} }
switch (ntohl(ce->ce_mode) & S_IFMT) { switch (ntohl(ce->ce_mode) & S_IFMT) {
@ -130,14 +130,14 @@ static int write_entry(struct cache_entry *ce, const char *path)
fd = create_file(path, ntohl(ce->ce_mode)); fd = create_file(path, ntohl(ce->ce_mode));
if (fd < 0) { if (fd < 0) {
free(new); free(new);
return error("checkout-cache: unable to create file %s (%s)", return error("git-checkout-cache: unable to create file %s (%s)",
path, strerror(errno)); path, strerror(errno));
} }
wrote = write(fd, new, size); wrote = write(fd, new, size);
close(fd); close(fd);
free(new); free(new);
if (wrote != size) if (wrote != size)
return error("checkout-cache: unable to write file %s", path); return error("git-checkout-cache: unable to write file %s", path);
break; break;
case S_IFLNK: case S_IFLNK:
memcpy(target, new, size); memcpy(target, new, size);
@ -145,14 +145,14 @@ static int write_entry(struct cache_entry *ce, const char *path)
create_directories(path); create_directories(path);
if (symlink(target, path)) { if (symlink(target, path)) {
free(new); free(new);
return error("checkout-cache: unable to create symlink %s (%s)", return error("git-checkout-cache: unable to create symlink %s (%s)",
path, strerror(errno)); path, strerror(errno));
} }
free(new); free(new);
break; break;
default: default:
free(new); free(new);
return error("checkout-cache: unknown file mode for %s", path); return error("git-checkout-cache: unknown file mode for %s", path);
} }


if (refresh_cache) { if (refresh_cache) {
@ -178,7 +178,7 @@ static int checkout_entry(struct cache_entry *ce, const char *base_dir)
return 0; return 0;
if (!force) { if (!force) {
if (!quiet) if (!quiet)
fprintf(stderr, "checkout-cache: %s already exists\n", path); fprintf(stderr, "git-checkout-cache: %s already exists\n", path);
return 0; return 0;
} }


@ -201,7 +201,7 @@ static int checkout_file(const char *name, const char *base_dir)
if (!quiet) { if (!quiet) {
pos = -pos - 1; pos = -pos - 1;
fprintf(stderr, fprintf(stderr,
"checkout-cache: %s is %s.\n", "git-checkout-cache: %s is %s.\n",
name, name,
(pos < active_nr && (pos < active_nr &&
!strcmp(active_cache[pos]->name, name)) ? !strcmp(active_cache[pos]->name, name)) ?

View File

@ -98,7 +98,7 @@ static void check_valid(unsigned char *sha1, const char *expect)
*/ */
#define MAXPARENT (16) #define MAXPARENT (16)


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


int main(int argc, char **argv) int main(int argc, char **argv)
{ {

View File

@ -304,7 +304,7 @@ int main(int argc, char **argv)
struct entry *entry; struct entry *entry;


if (argc != 2 || get_sha1(argv[1], sha1)) if (argc != 2 || get_sha1(argv[1], sha1))
usage("convert-cache <sha1>"); usage("git-convert-cache <sha1>");


entry = convert_entry(sha1); entry = convert_entry(sha1);
printf("new sha1: %s\n", sha1_to_hex(entry->new_sha1)); printf("new sha1: %s\n", sha1_to_hex(entry->new_sha1));

View File

@ -181,7 +181,7 @@ int main(int argc, char **argv)
argv++; argv++;
argc--; argc--;
if (!strcmp(arg, "-r")) { if (!strcmp(arg, "-r")) {
/* We accept the -r flag just to look like diff-tree */ /* We accept the -r flag just to look like git-diff-tree */
continue; continue;
} }
if (!strcmp(arg, "-p")) { if (!strcmp(arg, "-p")) {

View File

@ -7,7 +7,7 @@
#include "diff.h" #include "diff.h"


static const char *diff_files_usage = static const char *diff_files_usage =
"diff-files [-p] [-q] [-r] [-z] [-M] [paths...]"; "git-diff-files [-p] [-q] [-r] [-z] [-M] [paths...]";


static int generate_patch = 0; static int generate_patch = 0;
static int line_termination = '\n'; static int line_termination = '\n';

View File

@ -259,7 +259,7 @@ static int diff_tree(void *tree1, unsigned long size1, void *tree2, unsigned lon
update_tree_entry(&tree2, &size2); update_tree_entry(&tree2, &size2);
continue; continue;
} }
die("diff-tree: internal error"); die("git-diff-tree: internal error");
} }
return 0; return 0;
} }
@ -421,7 +421,7 @@ static int diff_tree_stdin(char *line)
} }


static char *diff_tree_usage = static char *diff_tree_usage =
"diff-tree [-p] [-r] [-z] [--stdin] [-M] [-m] [-s] [-v] <tree-ish> <tree-ish>"; "git-diff-tree [-p] [-r] [-z] [--stdin] [-M] [-m] [-s] [-v] <tree-ish> <tree-ish>";


int main(int argc, char **argv) int main(int argc, char **argv)
{ {

View File

@ -152,7 +152,7 @@ static int fsck_tree(struct tree *item)
} }


if (has_full_path) { if (has_full_path) {
fprintf(stderr, "warning: fsck-cache: tree %s " fprintf(stderr, "warning: git-fsck-cache: tree %s "
"has full pathnames in it\n", "has full pathnames in it\n",
sha1_to_hex(item->object.sha1)); sha1_to_hex(item->object.sha1));
} }
@ -385,7 +385,7 @@ int main(int argc, char **argv)
continue; continue;
} }
if (*arg == '-') if (*arg == '-')
usage("fsck-cache [--tags] [[--unreachable] [--cache] <head-sha1>*]"); usage("git-fsck-cache [--tags] [[--unreachable] [--cache] <head-sha1>*]");
} }


sha1_dir = get_object_directory(); sha1_dir = get_object_directory();

View File

@ -283,7 +283,7 @@ static void show_files(void)
} }


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


int main(int argc, char **argv) int main(int argc, char **argv)

View File

@ -81,7 +81,7 @@ static int list(unsigned char *sha1)
return 0; return 0;
} }


static const char *ls_tree_usage = "ls-tree [-r] [-z] <key>"; static const char *ls_tree_usage = "git-ls-tree [-r] [-z] <key>";


int main(int argc, char **argv) int main(int argc, char **argv)
{ {

View File

@ -60,7 +60,7 @@ int main(int argc, char **argv)
if (argc != 3 || if (argc != 3 ||
get_sha1(argv[1], rev1key) || get_sha1(argv[1], rev1key) ||
get_sha1(argv[2], rev2key)) { get_sha1(argv[2], rev2key)) {
usage("merge-base <commit-id> <commit-id>"); usage("git-merge-base <commit-id> <commit-id>");
} }
rev1 = lookup_commit_reference(rev1key); rev1 = lookup_commit_reference(rev1key);
rev2 = lookup_commit_reference(rev2key); rev2 = lookup_commit_reference(rev2key);

View File

@ -39,7 +39,7 @@ static int merge_entry(int pos, const char *path)
int found; int found;
if (pos >= active_nr) if (pos >= active_nr)
die("merge-cache: %s not in the cache", path); die("git-merge-cache: %s not in the cache", path);
arguments[0] = pgm; arguments[0] = pgm;
arguments[1] = ""; arguments[1] = "";
arguments[2] = ""; arguments[2] = "";
@ -64,7 +64,7 @@ static int merge_entry(int pos, const char *path)
arguments[stage + 4] = ownbuf[stage]; arguments[stage + 4] = ownbuf[stage];
} while (++pos < active_nr); } while (++pos < active_nr);
if (!found) if (!found)
die("merge-cache: %s not in the cache", path); die("git-merge-cache: %s not in the cache", path);
run_program(); run_program();
return found; return found;
} }
@ -97,7 +97,7 @@ int main(int argc, char **argv)
int i, force_file = 0; int i, force_file = 0;


if (argc < 3) if (argc < 3)
usage("merge-cache [-o] <merge-program> (-a | <filename>*)"); usage("git-merge-cache [-o] <merge-program> (-a | <filename>*)");


read_cache(); read_cache();


@ -118,7 +118,7 @@ int main(int argc, char **argv)
merge_all(); merge_all();
continue; continue;
} }
die("merge-cache: unknown option %s", arg); die("git-merge-cache: unknown option %s", arg);
} }
merge_file(arg); merge_file(arg);
} }

View File

@ -159,7 +159,7 @@ static void merge_stat_info(struct cache_entry **src, int nr)
} }
} }


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


int main(int argc, char **argv) int main(int argc, char **argv)
{ {

View File

@ -27,7 +27,7 @@ int main(int argc, char **argv)
} }


if (!commit_arg || get_sha1(commit_arg, sha1)) if (!commit_arg || get_sha1(commit_arg, sha1))
usage("usage: rev-list [OPTION] commit-id\n" usage("usage: git-rev-list [OPTION] commit-id\n"
" --max-count=nr\n" " --max-count=nr\n"
" --max-age=epoch\n" " --max-age=epoch\n"
" --min-age=epoch\n"); " --min-age=epoch\n");

View File

@ -64,7 +64,7 @@ void process_commit(unsigned char *sha1)
} }


/* /*
* Usage: rev-tree [--edges] [--cache <cache-file>] <commit-id> [<commit-id2>] * Usage: git-rev-tree [--edges] [--cache <cache-file>] <commit-id> [<commit-id2>]
* *
* The cache-file can be quite important for big trees. This is an * The cache-file can be quite important for big trees. This is an
* expensive operation if you have to walk the whole chain of * expensive operation if you have to walk the whole chain of
@ -98,7 +98,7 @@ int main(int argc, char **argv)
basemask |= 1<<nr; basemask |= 1<<nr;
} }
if (nr >= MAX_COMMITS || get_sha1(arg, sha1[nr])) if (nr >= MAX_COMMITS || get_sha1(arg, sha1[nr]))
usage("rev-tree [--edges] [--cache <cache-file>] <commit-id> [<commit-id>]"); usage("git-rev-tree [--edges] [--cache <cache-file>] <commit-id> [<commit-id>]");
process_commit(sha1[nr]); process_commit(sha1[nr]);
nr++; nr++;
} }

10
rpush.c
View File

@ -14,7 +14,7 @@ void service(int fd_in, int fd_out) {
do { do {
size = read(fd_in, sha1 + posn, 20 - posn); size = read(fd_in, sha1 + posn, 20 - posn);
if (size < 0) { if (size < 0) {
perror("rpush: read "); perror("git-rpush: read ");
return; return;
} }
if (!size) if (!size)
@ -26,7 +26,7 @@ void service(int fd_in, int fd_out) {


buf = map_sha1_file(sha1, &objsize); buf = map_sha1_file(sha1, &objsize);
if (!buf) { if (!buf) {
fprintf(stderr, "rpush: could not find %s\n", fprintf(stderr, "git-rpush: could not find %s\n",
sha1_to_hex(sha1)); sha1_to_hex(sha1));
return; return;
} }
@ -35,9 +35,9 @@ void service(int fd_in, int fd_out) {
size = write(fd_out, buf + posn, objsize - posn); size = write(fd_out, buf + posn, objsize - posn);
if (size <= 0) { if (size <= 0) {
if (!size) { if (!size) {
fprintf(stderr, "rpush: write closed"); fprintf(stderr, "git-rpush: write closed");
} else { } else {
perror("rpush: write "); perror("git-rpush: write ");
} }
return; return;
} }
@ -56,7 +56,7 @@ int main(int argc, char **argv)
arg++; arg++;
} }
if (argc < arg + 2) { if (argc < arg + 2) {
usage("rpush [-c] [-t] [-a] commit-id url"); usage("git-rpush [-c] [-t] [-a] commit-id url");
return 1; return 1;
} }
commit_id = argv[arg]; commit_id = argv[arg];

View File

@ -17,7 +17,7 @@
#define EXT_HEADER_PATH 1 #define EXT_HEADER_PATH 1
#define EXT_HEADER_LINKPATH 2 #define EXT_HEADER_LINKPATH 2


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


static char block[BLOCKSIZE]; static char block[BLOCKSIZE];
static unsigned long offset; static unsigned long offset;
@ -40,9 +40,9 @@ static void reliable_write(void *buf, unsigned long size)
continue; continue;
if (errno == EPIPE) if (errno == EPIPE)
exit(0); exit(0);
die("tar-tree: %s", strerror(errno)); die("git-tar-tree: %s", strerror(errno));
} else if (!ret) { } else if (!ret) {
die("tar-tree: disk full?"); die("git-tar-tree: disk full?");
} }
size -= ret; size -= ret;
buf += ret; buf += ret;

View File

@ -27,7 +27,7 @@ int main(int argc, char **argv)
unsigned char sha1[20]; unsigned char sha1[20];


if (argc != 2 || get_sha1(argv[1], sha1)) if (argc != 2 || get_sha1(argv[1], sha1))
usage("unpack-file.c <sha1>"); usage("git-unpack-file <sha1>");


puts(create_temp_file(sha1)); puts(create_temp_file(sha1));
return 0; return 0;

View File

@ -9,7 +9,7 @@
* Default to not allowing changes to the list of files. The * Default to not allowing changes to the list of files. The
* tool doesn't actually care, but this makes it harder to add * tool doesn't actually care, but this makes it harder to add
* files to the revision control by mistake by doing something * files to the revision control by mistake by doing something
* like "update-cache *" and suddenly having all the object * like "git-update-cache *" and suddenly having all the object
* files be revision controlled. * files be revision controlled.
*/ */
static int allow_add = 0, allow_remove = 0, allow_replace = 0, not_new = 0; static int allow_add = 0, allow_remove = 0, allow_replace = 0, not_new = 0;
@ -158,7 +158,7 @@ static int compare_link(struct cache_entry *ce, unsigned long expected_size)
* file that hasn't been changed but where the stat entry is * file that hasn't been changed but where the stat entry is
* out of date. * out of date.
* *
* For example, you'd want to do this after doing a "read-tree", * For example, you'd want to do this after doing a "git-read-tree",
* to link up the stat cache details with the proper files. * to link up the stat cache details with the proper files.
*/ */
static struct cache_entry *refresh_entry(struct cache_entry *ce) static struct cache_entry *refresh_entry(struct cache_entry *ce)
@ -333,17 +333,17 @@ int main(int argc, char **argv)
} }
if (!strcmp(path, "--cacheinfo")) { if (!strcmp(path, "--cacheinfo")) {
if (i+3 >= argc) if (i+3 >= argc)
die("update-cache: --cacheinfo <mode> <sha1> <path>"); die("git-update-cache: --cacheinfo <mode> <sha1> <path>");
if (add_cacheinfo(argv[i+1], argv[i+2], argv[i+3])) if (add_cacheinfo(argv[i+1], argv[i+2], argv[i+3]))
die("update-cache: --cacheinfo cannot add %s", argv[i+3]); die("git-update-cache: --cacheinfo cannot add %s", argv[i+3]);
i += 3; i += 3;
continue; continue;
} }
if (!strcmp(path, "--force-remove")) { if (!strcmp(path, "--force-remove")) {
if (argc <= i + 1) if (argc <= i + 1)
die("update-cache: --force-remove <path>"); die("git-update-cache: --force-remove <path>");
if (remove_file_from_cache(argv[i+1])) if (remove_file_from_cache(argv[i+1]))
die("update-cache: --force-remove cannot remove %s", argv[i+1]); die("git-update-cache: --force-remove cannot remove %s", argv[i+1]);
i++; i++;
continue; continue;
} }

View File

@ -89,7 +89,7 @@ int main(int argc, char **argv)
unsigned char sha1[20]; unsigned char sha1[20];


if (entries < 0) if (entries < 0)
die("write-tree: error reading cache"); die("git-write-tree: error reading cache");


/* Verify that the tree is merged */ /* Verify that the tree is merged */
funny = 0; funny = 0;
@ -104,7 +104,7 @@ int main(int argc, char **argv)
} }
} }
if (funny) if (funny)
die("write-tree: not able to write tree"); die("git-write-tree: not able to write tree");


/* Also verify that the cache does not have path and path/file /* Also verify that the cache does not have path and path/file
* at the same time. At this point we know the cache has only * at the same time. At this point we know the cache has only
@ -131,11 +131,11 @@ int main(int argc, char **argv)
} }
} }
if (funny) if (funny)
die("write-tree: not able to write tree"); die("git-write-tree: not able to write tree");


/* Ok, write it out */ /* Ok, write it out */
if (write_tree(active_cache, entries, "", 0, sha1) != entries) if (write_tree(active_cache, entries, "", 0, sha1) != entries)
die("write-tree: internal error"); die("git-write-tree: internal error");
printf("%s\n", sha1_to_hex(sha1)); printf("%s\n", sha1_to_hex(sha1));
return 0; return 0;
} }