From 4bb04f2190d526f8917663f0be62d8026e1ed100 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 11 Apr 2005 15:47:57 -0700 Subject: [PATCH] Rename ".dircache" directory to ".git" I started out calling the tool "dircache". That's clearly moronic. --- README | 2 +- cache.h | 2 +- init-db.c | 4 ++-- read-cache.c | 2 +- read-tree.c | 6 +++--- update-cache.c | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README b/README index 27577f768..cf550e258 100644 --- a/README +++ b/README @@ -122,7 +122,7 @@ it's not something "git" does for you. Another way of saying the same thing: "git" itself only handles content integrity, the trust has to come from outside. - Current Directory Cache (".dircache/index") + Current Directory Cache (".git/index") The "current directory cache" is a simple binary file, which contains an efficient representation of a virtual directory content at some random diff --git a/cache.h b/cache.h index 4b101188d..07598d469 100644 --- a/cache.h +++ b/cache.h @@ -64,7 +64,7 @@ struct cache_entry **active_cache; unsigned int active_nr, active_alloc; #define DB_ENVIRONMENT "SHA1_FILE_DIRECTORY" -#define DEFAULT_DB_ENVIRONMENT ".dircache/objects" +#define DEFAULT_DB_ENVIRONMENT ".git/objects" #define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7) #define ce_size(ce) cache_entry_size((ce)->namelen) diff --git a/init-db.c b/init-db.c index bbb3ad98e..503e7193f 100644 --- a/init-db.c +++ b/init-db.c @@ -10,8 +10,8 @@ int main(int argc, char **argv) char *sha1_dir = getenv(DB_ENVIRONMENT), *path; int len, i; - if (mkdir(".dircache", 0755) < 0) { - perror("unable to create .dircache"); + if (mkdir(".git", 0755) < 0) { + perror("unable to create .git directory"); exit(1); } diff --git a/read-cache.c b/read-cache.c index 3c575f7d1..545369446 100644 --- a/read-cache.c +++ b/read-cache.c @@ -364,7 +364,7 @@ int read_cache(void) sha1_file_directory = DEFAULT_DB_ENVIRONMENT; if (access(sha1_file_directory, X_OK) < 0) return error("no access to SHA1 file directory"); - fd = open(".dircache/index", O_RDONLY); + fd = open(".git/index", O_RDONLY); if (fd < 0) return (errno == ENOENT) ? 0 : error("open failed"); diff --git a/read-tree.c b/read-tree.c index 5c9d38ba5..dc24e91b0 100644 --- a/read-tree.c +++ b/read-tree.c @@ -68,7 +68,7 @@ static int remove_lock = 0; static void remove_lock_file(void) { if (remove_lock) - unlink(".dircache/index.lock"); + unlink(".git/index.lock"); } int main(int argc, char **argv) @@ -76,7 +76,7 @@ int main(int argc, char **argv) int i, newfd; unsigned char sha1[20]; - newfd = open(".dircache/index.lock", O_RDWR | O_CREAT | O_EXCL, 0600); + newfd = open(".git/index.lock", O_RDWR | O_CREAT | O_EXCL, 0600); if (newfd < 0) usage("unable to create new cachefile"); atexit(remove_lock_file); @@ -99,7 +99,7 @@ int main(int argc, char **argv) usage("failed to unpack tree object %s", arg); } if (write_cache(newfd, active_cache, active_nr) || - rename(".dircache/index.lock", ".dircache/index")) + rename(".git/index.lock", ".git/index")) usage("unable to write new index file"); remove_lock = 0; return 0; diff --git a/update-cache.c b/update-cache.c index ea956e47b..25db78908 100644 --- a/update-cache.c +++ b/update-cache.c @@ -205,7 +205,7 @@ static void refresh_cache(void) /* * We fundamentally don't like some paths: we don't want * dot or dot-dot anywhere, and in fact, we don't even want - * any other dot-files (.dircache or anything else). They + * any other dot-files (.git or anything else). They * are hidden, for chist sake. * * Also, we don't want double slashes or slashes at the @@ -235,7 +235,7 @@ static int remove_lock = 0; static void remove_lock_file(void) { if (remove_lock) - unlink(".dircache/index.lock"); + unlink(".git/index.lock"); } int main(int argc, char **argv) @@ -243,7 +243,7 @@ int main(int argc, char **argv) int i, newfd, entries; int allow_options = 1; - newfd = open(".dircache/index.lock", O_RDWR | O_CREAT | O_EXCL, 0600); + newfd = open(".git/index.lock", O_RDWR | O_CREAT | O_EXCL, 0600); if (newfd < 0) usage("unable to create new cachefile"); @@ -284,7 +284,7 @@ int main(int argc, char **argv) usage("Unable to add %s to database", path); } if (write_cache(newfd, active_cache, active_nr) || - rename(".dircache/index.lock", ".dircache/index")) + rename(".git/index.lock", ".git/index")) usage("Unable to write new cachefile"); remove_lock = 0; -- 2.26.2