{"thread":{"id":"8269","subject":"[PATCH] rename dirlink to gitlink.","startedAt":"2007-05-21T20:08:28Z","lastAt":"2007-05-22T11:53:53Z","messageCount":7,"participants":["Martin Waitz","Torgil Svensson","Junio C Hamano","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"42923","messageId":"20070521200828.GC5412@admingilde.org","threadId":"8269","inReplyTo":null,"subject":"[PATCH] rename dirlink to gitlink.","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-05-21T20:08:28Z","receivedAt":"2007-05-21T20:08:28Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"Unify naming of plumbing dirlink/gitlink concept:\n\nperl -pi -e 's/dirlink/gitlink/g' -e 's/DIRLNK/GITLINK/g'\n---\n archive-tar.c          |    4 ++--\n archive-zip.c          |    2 +-\n builtin-fsck.c         |    4 ++--\n builtin-ls-tree.c      |    2 +-\n builtin-update-index.c |    4 ++--\n cache-tree.c           |    2 +-\n cache.h                |   10 +++++-----\n diff.c                 |    2 +-\n dir.c                  |    6 +++---\n dir.h                  |    2 +-\n entry.c                |    4 ++--\n list-objects.c         |    2 +-\n read-cache.c           |    6 +++---\n tree.c                 |    4 ++--\n 14 files changed, 27 insertions(+), 27 deletions(-)\n\ndiff --git a/archive-tar.c b/archive-tar.c\nindex 33e7657..66fe3e3 100644\n--- a/archive-tar.c\n+++ b/archive-tar.c\n@@ -167,7 +167,7 @@ static void write_entry(const unsigned char *sha1, struct strbuf *path,\n \t} else {\n \t\tif (verbose)\n \t\t\tfprintf(stderr, \"%.*s\\n\", path->len, path->buf);\n-\t\tif (S_ISDIR(mode) || S_ISDIRLNK(mode)) {\n+\t\tif (S_ISDIR(mode) || S_ISGITLINK(mode)) {\n \t\t\t*header.typeflag = TYPEFLAG_DIR;\n \t\t\tmode = (mode | 0777) & ~tar_umask;\n \t\t} else if (S_ISLNK(mode)) {\n@@ -280,7 +280,7 @@ static int write_tar_entry(const unsigned char *sha1,\n \tmemcpy(path.buf + baselen, filename, filenamelen);\n \tpath.len = baselen + filenamelen;\n \tpath.buf[path.len] = '\\0';\n-\tif (S_ISDIR(mode) || S_ISDIRLNK(mode)) {\n+\tif (S_ISDIR(mode) || S_ISGITLINK(mode)) {\n \t\tstrbuf_append_string(&path, \"/\");\n \t\tbuffer = NULL;\n \t\tsize = 0;\ndiff --git a/archive-zip.c b/archive-zip.c\nindex 3cbf6bb..444e162 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -182,7 +182,7 @@ static int write_zip_entry(const unsigned char *sha1,\n \t\tgoto out;\n \t}\n \n-\tif (S_ISDIR(mode) || S_ISDIRLNK(mode)) {\n+\tif (S_ISDIR(mode) || S_ISGITLINK(mode)) {\n \t\tmethod = 0;\n \t\tattr2 = 16;\n \t\tresult = (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);\ndiff --git a/builtin-fsck.c b/builtin-fsck.c\nindex 44ce629..cbbcaf0 100644\n--- a/builtin-fsck.c\n+++ b/builtin-fsck.c\n@@ -256,7 +256,7 @@ static int fsck_tree(struct tree *item)\n \t\tcase S_IFREG | 0644:\n \t\tcase S_IFLNK:\n \t\tcase S_IFDIR:\n-\t\tcase S_IFDIRLNK:\n+\t\tcase S_IFGITLINK:\n \t\t\tbreak;\n \t\t/*\n \t\t * This is nonstandard, but we had a few of these\n@@ -715,7 +715,7 @@ int cmd_fsck(int argc, char **argv, const char *prefix)\n \t\t\tstruct object *obj;\n \n \t\t\tmode = ntohl(active_cache[i]->ce_mode);\n-\t\t\tif (S_ISDIRLNK(mode))\n+\t\t\tif (S_ISGITLINK(mode))\n \t\t\t\tcontinue;\n \t\t\tblob = lookup_blob(active_cache[i]->sha1);\n \t\t\tif (!blob)\ndiff --git a/builtin-ls-tree.c b/builtin-ls-tree.c\nindex 1cb4dca..9a5977f 100644\n--- a/builtin-ls-tree.c\n+++ b/builtin-ls-tree.c\n@@ -60,7 +60,7 @@ static int show_tree(const unsigned char *sha1, const char *base, int baselen,\n \tint retval = 0;\n \tconst char *type = blob_type;\n \n-\tif (S_ISDIRLNK(mode)) {\n+\tif (S_ISGITLINK(mode)) {\n \t\t/*\n \t\t * Maybe we want to have some recursive version here?\n \t\t *\ndiff --git a/builtin-update-index.c b/builtin-update-index.c\nindex 8f98991..509369e 100644\n--- a/builtin-update-index.c\n+++ b/builtin-update-index.c\n@@ -134,7 +134,7 @@ static int process_directory(const char *path, int len, struct stat *st)\n \t/* Exact match: file or existing gitlink */\n \tif (pos >= 0) {\n \t\tstruct cache_entry *ce = active_cache[pos];\n-\t\tif (S_ISDIRLNK(ntohl(ce->ce_mode))) {\n+\t\tif (S_ISGITLINK(ntohl(ce->ce_mode))) {\n \n \t\t\t/* Do nothing to the index if there is no HEAD! */\n \t\t\tif (resolve_gitlink_ref(path, \"HEAD\", sha1) < 0)\n@@ -178,7 +178,7 @@ static int process_file(const char *path, int len, struct stat *st)\n \tint pos = cache_name_pos(path, len);\n \tstruct cache_entry *ce = pos < 0 ? NULL : active_cache[pos];\n \n-\tif (ce && S_ISDIRLNK(ntohl(ce->ce_mode)))\n+\tif (ce && S_ISGITLINK(ntohl(ce->ce_mode)))\n \t\treturn error(\"%s is already a gitlink, not replacing\", path);\n \n \treturn add_one_path(ce, path, len, st);\ndiff --git a/cache-tree.c b/cache-tree.c\nindex 6369cc7..350a79b 100644\n--- a/cache-tree.c\n+++ b/cache-tree.c\n@@ -326,7 +326,7 @@ static int update_one(struct cache_tree *it,\n \t\t\tmode = ntohl(ce->ce_mode);\n \t\t\tentlen = pathlen - baselen;\n \t\t}\n-\t\tif (mode != S_IFDIRLNK && !missing_ok && !has_sha1_file(sha1))\n+\t\tif (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1))\n \t\t\treturn error(\"invalid object %s\", sha1_to_hex(sha1));\n \n \t\tif (!ce->ce_mode)\ndiff --git a/cache.h b/cache.h\nindex 4204bc1..2497c21 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -40,8 +40,8 @@\n  * happens that everybody shares the same bit representation\n  * in the UNIX world (and apparently wider too..)\n  */\n-#define S_IFDIRLNK\t0160000\n-#define S_ISDIRLNK(m)\t(((m) & S_IFMT) == S_IFDIRLNK)\n+#define S_IFGITLINK\t0160000\n+#define S_ISGITLINK(m)\t(((m) & S_IFMT) == S_IFGITLINK)\n \n /*\n  * Intensive research over the course of many years has shown that\n@@ -123,8 +123,8 @@ static inline unsigned int create_ce_mode(unsigned int mode)\n {\n \tif (S_ISLNK(mode))\n \t\treturn htonl(S_IFLNK);\n-\tif (S_ISDIR(mode) || S_ISDIRLNK(mode))\n-\t\treturn htonl(S_IFDIRLNK);\n+\tif (S_ISDIR(mode) || S_ISGITLINK(mode))\n+\t\treturn htonl(S_IFGITLINK);\n \treturn htonl(S_IFREG | ce_permissions(mode));\n }\n static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned int mode)\n@@ -142,7 +142,7 @@ static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned in\n }\n #define canon_mode(mode) \\\n \t(S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \\\n-\tS_ISLNK(mode) ? S_IFLNK : S_ISDIR(mode) ? S_IFDIR : S_IFDIRLNK)\n+\tS_ISLNK(mode) ? S_IFLNK : S_ISDIR(mode) ? S_IFDIR : S_IFGITLINK)\n \n #define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)\n \ndiff --git a/diff.c b/diff.c\nindex 33297aa..9a5e980 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1467,7 +1467,7 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)\n \tif (size_only && 0 < s->size)\n \t\treturn 0;\n \n-\tif (S_ISDIRLNK(s->mode))\n+\tif (S_ISGITLINK(s->mode))\n \t\treturn diff_populate_gitlink(s, size_only);\n \n \tif (!s->sha1_valid ||\ndiff --git a/dir.c b/dir.c\nindex 11fab7f..f543f50 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -321,7 +321,7 @@ static enum exist_status directory_exists_in_index(const char *dirname, int len)\n \t\t\tbreak;\n \t\tif (endchar == '/')\n \t\t\treturn index_directory;\n-\t\tif (!endchar && S_ISDIRLNK(ntohl(ce->ce_mode)))\n+\t\tif (!endchar && S_ISGITLINK(ntohl(ce->ce_mode)))\n \t\t\treturn index_gitdir;\n \t}\n \treturn index_nonexistent;\n@@ -356,7 +356,7 @@ static enum exist_status directory_exists_in_index(const char *dirname, int len)\n  *      also true and the directory is empty, in which case\n  *      we just ignore it entirely.\n  *  (b) if it looks like a git directory, and we don't have\n- *      'no_dirlinks' set we treat it as a gitlink, and show it\n+ *      'no_gitlinks' set we treat it as a gitlink, and show it\n  *      as a directory.\n  *  (c) otherwise, we recurse into it.\n  */\n@@ -383,7 +383,7 @@ static enum directory_treatment treat_directory(struct dir_struct *dir,\n \tcase index_nonexistent:\n \t\tif (dir->show_other_directories)\n \t\t\tbreak;\n-\t\tif (!dir->no_dirlinks) {\n+\t\tif (!dir->no_gitlinks) {\n \t\t\tunsigned char sha1[20];\n \t\t\tif (resolve_gitlink_ref(dirname, \"HEAD\", sha1) == 0)\n \t\t\t\treturn show_directory;\ndiff --git a/dir.h b/dir.h\nindex 817c674..172147f 100644\n--- a/dir.h\n+++ b/dir.h\n@@ -34,7 +34,7 @@ struct dir_struct {\n \tunsigned int show_ignored:1,\n \t\t     show_other_directories:1,\n \t\t     hide_empty_directories:1,\n-\t\t     no_dirlinks:1;\n+\t\t     no_gitlinks:1;\n \tstruct dir_entry **entries;\n \n \t/* Exclude info */\ndiff --git a/entry.c b/entry.c\nindex 82bf725..ae64764 100644\n--- a/entry.c\n+++ b/entry.c\n@@ -145,7 +145,7 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout\n \t\t\t\t\t\t \"symlink %s (%s)\", path, strerror(errno));\n \t\t}\n \t\tbreak;\n-\tcase S_IFDIRLNK:\n+\tcase S_IFGITLINK:\n \t\tif (to_tempfile)\n \t\t\treturn error(\"git-checkout-index: cannot create temporary subproject %s\", path);\n \t\tif (mkdir(path, 0777) < 0)\n@@ -194,7 +194,7 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *t\n \t\tunlink(path);\n \t\tif (S_ISDIR(st.st_mode)) {\n \t\t\t/* If it is a gitlink, leave it alone! */\n-\t\t\tif (S_ISDIRLNK(ntohl(ce->ce_mode)))\n+\t\t\tif (S_ISGITLINK(ntohl(ce->ce_mode)))\n \t\t\t\treturn 0;\n \t\t\tif (!state->force)\n \t\t\t\treturn error(\"%s is a directory\", path);\ndiff --git a/list-objects.c b/list-objects.c\nindex 310f8d3..e5c88c2 100644\n--- a/list-objects.c\n+++ b/list-objects.c\n@@ -87,7 +87,7 @@ static void process_tree(struct rev_info *revs,\n \t\t\tprocess_tree(revs,\n \t\t\t\t     lookup_tree(entry.sha1),\n \t\t\t\t     p, &me, entry.path);\n-\t\telse if (S_ISDIRLNK(entry.mode))\n+\t\telse if (S_ISGITLINK(entry.mode))\n \t\t\tprocess_gitlink(revs, entry.sha1,\n \t\t\t\t\tp, &me, entry.path);\n \t\telse\ndiff --git a/read-cache.c b/read-cache.c\nindex d9f46da..ad4e187 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -92,7 +92,7 @@ static int ce_compare_gitlink(struct cache_entry *ce)\n \n \t/*\n \t * We don't actually require that the .git directory\n-\t * under DIRLNK directory be a valid git directory. It\n+\t * under GITLINK directory be a valid git directory. It\n \t * might even be missing (in case nobody populated that\n \t * sub-project).\n \t *\n@@ -115,7 +115,7 @@ static int ce_modified_check_fs(struct cache_entry *ce, struct stat *st)\n \t\t\treturn DATA_CHANGED;\n \t\tbreak;\n \tcase S_IFDIR:\n-\t\tif (S_ISDIRLNK(ntohl(ce->ce_mode)))\n+\t\tif (S_ISGITLINK(ntohl(ce->ce_mode)))\n \t\t\treturn 0;\n \tdefault:\n \t\treturn TYPE_CHANGED;\n@@ -142,7 +142,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)\n \t\t    (has_symlinks || !S_ISREG(st->st_mode)))\n \t\t\tchanged |= TYPE_CHANGED;\n \t\tbreak;\n-\tcase S_IFDIRLNK:\n+\tcase S_IFGITLINK:\n \t\tif (!S_ISDIR(st->st_mode))\n \t\t\tchanged |= TYPE_CHANGED;\n \t\telse if (ce_compare_gitlink(ce))\ndiff --git a/tree.c b/tree.c\nindex e4a39aa..a372827 100644\n--- a/tree.c\n+++ b/tree.c\n@@ -157,7 +157,7 @@ static void track_tree_refs(struct tree *item)\n \t/* Count how many entries there are.. */\n \tinit_tree_desc(&desc, item->buffer, item->size);\n \twhile (tree_entry(&desc, &entry)) {\n-\t\tif (S_ISDIRLNK(entry.mode))\n+\t\tif (S_ISGITLINK(entry.mode))\n \t\t\tcontinue;\n \t\tn_refs++;\n \t}\n@@ -169,7 +169,7 @@ static void track_tree_refs(struct tree *item)\n \twhile (tree_entry(&desc, &entry)) {\n \t\tstruct object *obj;\n \n-\t\tif (S_ISDIRLNK(entry.mode))\n+\t\tif (S_ISGITLINK(entry.mode))\n \t\t\tcontinue;\n \t\tif (S_ISDIR(entry.mode))\n \t\t\tobj = &lookup_tree(entry.sha1)->object;\n-- \n1.5.2.2.g081e\n\n-- \nMartin Waitz\n"},{"id":"42936","messageId":"e7bda7770705211612w3ce1b7dew8d48f1ddeb7d100e@mail.gmail.com","threadId":"8269","inReplyTo":"20070521200828.GC5412@admingilde.org","subject":"Re: [PATCH] rename dirlink to gitlink.","fromName":"Torgil Svensson","fromEmail":"torgil.svensson@gmail.com","sentAt":"2007-05-21T23:12:02Z","receivedAt":"2007-05-21T23:12:02Z","isPatch":true,"sender":{"key":"torgil.svensson@gmail.com","avatar":null},"body":"On 5/21/07, Martin Waitz <tali@admingilde.org> wrote:\n> Unify naming of plumbing dirlink/gitlink concept:\n>\n> perl -pi -e 's/dirlink/gitlink/g' -e 's/DIRLNK/GITLINK/g'\n> ---\n\n\nDoes this mean that the link doesn't necessarily has to be represented\nas a directory (even though current code does it) ?\n\n//Torgil\n"},{"id":"42938","messageId":"7vodkdbvmk.fsf@assigned-by-dhcp.cox.net","threadId":"8269","inReplyTo":"e7bda7770705211612w3ce1b7dew8d48f1ddeb7d100e@mail.gmail.com","subject":"Re: [PATCH] rename dirlink to gitlink.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-21T23:32:51Z","receivedAt":"2007-05-21T23:32:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Torgil Svensson\" <torgil.svensson@gmail.com> writes:\n\n> On 5/21/07, Martin Waitz <tali@admingilde.org> wrote:\n>> Unify naming of plumbing dirlink/gitlink concept:\n>>\n>> perl -pi -e 's/dirlink/gitlink/g' -e 's/DIRLNK/GITLINK/g'\n>> ---\n>\n> Does this mean that the link doesn't necessarily has to be represented\n> as a directory (even though current code does it) ?\n\nI do not think the patch has that much deep meaning.\n\nPersonally I think the patch is similar to renaming \"cache\" used\nin the code to \"index\" --- needless code shuffling that does not\nbuy you anything.\n\nAs an internal symbol, S_IFDIRLNK makes _much_ more sense than\nS_IFGITLINK, exactly because it is a mixture of S_IFDIR and\nS_IFLNK.\n\nThe only excuse that we _might_ want to consider the patch is\nthat S_IFDIRLNK has not lived that long, compared to the use of\nword \"cache\" in our codebase.  It's only two weeks old -- so if\nwe were to apply this patch, we would need to do that right\naway, or it will be never.\n\nBut I am not _so_ enthused about the renaming in the code.\n"},{"id":"42945","messageId":"20070522055939.GG5412@admingilde.org","threadId":"8269","inReplyTo":"7vodkdbvmk.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] rename dirlink to gitlink.","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-05-22T05:59:39Z","receivedAt":"2007-05-22T05:59:39Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Mon, May 21, 2007 at 04:32:51PM -0700, Junio C Hamano wrote:\n> As an internal symbol, S_IFDIRLNK makes _much_ more sense than\n> S_IFGITLINK, exactly because it is a mixture of S_IFDIR and\n> S_IFLNK.\n\nBut then we also should be consequent and rename the entire\nlow-level plumbing to dirlink.  I don't see a reason to keep\nboth.\n\nFor me the S_ macro names are about the file type which is represented\nby them.  The fact that dirlinks/gitlinks are represented as\nDIR + LNK is nice but not so important that we have to name the\nmacro that way.\n\n-- \nMartin Waitz\n"},{"id":"42950","messageId":"7vd50t9y92.fsf@assigned-by-dhcp.cox.net","threadId":"8269","inReplyTo":"20070522055939.GG5412@admingilde.org","subject":"Re: [PATCH] rename dirlink to gitlink.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-22T06:19:05Z","receivedAt":"2007-05-22T06:19:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Waitz <tali@admingilde.org> writes:\n\n> hoi :)\n>\n> On Mon, May 21, 2007 at 04:32:51PM -0700, Junio C Hamano wrote:\n>> As an internal symbol, S_IFDIRLNK makes _much_ more sense than\n>> S_IFGITLINK, exactly because it is a mixture of S_IFDIR and\n>> S_IFLNK.\n>\n> But then we also should be consequent and rename the entire\n> low-level plumbing to dirlink.  I don't see a reason to keep\n> both.\n\nOk.  Let's do that then before it is too late.\n"},{"id":"42969","messageId":"20070522113920.GI5412@admingilde.org","threadId":"8269","inReplyTo":"7vd50t9y92.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] rename gitlink to dirlink.","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-05-22T11:39:20Z","receivedAt":"2007-05-22T11:39:20Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"Unify naming of plumbing dirlink/gitlink concept:\n\nperl -pi -e 's/gitlink/dirlink/g'\n\nSigned-off-by: Martin Waitz <tali@admingilde.org>\n---\n\nOn Mon, May 21, 2007 at 11:19:05PM -0700, Junio C Hamano wrote:\n> > But then we also should be consequent and rename the entire\n> > low-level plumbing to dirlink.  I don't see a reason to keep\n> > both.\n> \n> Ok.  Let's do that then before it is too late.\n\nnow you can choose which one you want to apply...\n\n builtin-ls-files.c     |    2 +-\n builtin-update-index.c |   14 +++++++-------\n diff.c                 |    4 ++--\n dir.c                  |   10 +++++-----\n entry.c                |    2 +-\n list-objects.c         |   10 +++++-----\n read-cache.c           |    6 +++---\n refs.c                 |   12 ++++++------\n refs.h                 |    4 ++--\n sha1_file.c            |    2 +-\n tree.c                 |    2 +-\n 11 files changed, 34 insertions(+), 34 deletions(-)\n\ndiff --git a/builtin-ls-files.c b/builtin-ls-files.c\nindex f7c066b..ad0267b 100644\n--- a/builtin-ls-files.c\n+++ b/builtin-ls-files.c\n@@ -97,7 +97,7 @@ static void show_other_files(struct dir_struct *dir)\n \t *\n \t * (Matching entries are normally pruned during\n \t * the directory tree walk, but will show up for\n-\t * gitlinks because we don't necessarily have\n+\t * dirlinks because we don't necessarily have\n \t * dir->show_other_directories set to suppress\n \t * them).\n \t */\ndiff --git a/builtin-update-index.c b/builtin-update-index.c\nindex 8f98991..7fe2466 100644\n--- a/builtin-update-index.c\n+++ b/builtin-update-index.c\n@@ -106,7 +106,7 @@ static int add_one_path(struct cache_entry *old, const char *path, int len, stru\n /*\n  * Handle a path that was a directory. Four cases:\n  *\n- *  - it's already a gitlink in the index, and we keep it that\n+ *  - it's already a dirlink in the index, and we keep it that\n  *    way, and update it if we can (if we cannot find the HEAD,\n  *    we're going to keep it unchanged in the index!)\n  *\n@@ -124,20 +124,20 @@ static int add_one_path(struct cache_entry *old, const char *path, int len, stru\n  *    to try to update it as a directory.\n  *\n  *  - it doesn't exist at all in the index, but it is a valid\n- *    git directory, and it should be *added* as a gitlink.\n+ *    git directory, and it should be *added* as a dirlink.\n  */\n static int process_directory(const char *path, int len, struct stat *st)\n {\n \tunsigned char sha1[20];\n \tint pos = cache_name_pos(path, len);\n \n-\t/* Exact match: file or existing gitlink */\n+\t/* Exact match: file or existing dirlink */\n \tif (pos >= 0) {\n \t\tstruct cache_entry *ce = active_cache[pos];\n \t\tif (S_ISDIRLNK(ntohl(ce->ce_mode))) {\n \n \t\t\t/* Do nothing to the index if there is no HEAD! */\n-\t\t\tif (resolve_gitlink_ref(path, \"HEAD\", sha1) < 0)\n+\t\t\tif (resolve_dirlink_ref(path, \"HEAD\", sha1) < 0)\n \t\t\t\treturn 0;\n \n \t\t\treturn add_one_path(ce, path, len, st);\n@@ -162,8 +162,8 @@ static int process_directory(const char *path, int len, struct stat *st)\n \t\treturn error(\"%s: is a directory - add individual files instead\", path);\n \t}\n \n-\t/* No match - should we add it as a gitlink? */\n-\tif (!resolve_gitlink_ref(path, \"HEAD\", sha1))\n+\t/* No match - should we add it as a dirlink? */\n+\tif (!resolve_dirlink_ref(path, \"HEAD\", sha1))\n \t\treturn add_one_path(NULL, path, len, st);\n \n \t/* Error out. */\n@@ -179,7 +179,7 @@ static int process_file(const char *path, int len, struct stat *st)\n \tstruct cache_entry *ce = pos < 0 ? NULL : active_cache[pos];\n \n \tif (ce && S_ISDIRLNK(ntohl(ce->ce_mode)))\n-\t\treturn error(\"%s is already a gitlink, not replacing\", path);\n+\t\treturn error(\"%s is already a dirlink, not replacing\", path);\n \n \treturn add_one_path(ce, path, len, st);\n }\ndiff --git a/diff.c b/diff.c\nindex 33297aa..434947e 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1432,7 +1432,7 @@ static int populate_from_stdin(struct diff_filespec *s)\n \treturn 0;\n }\n \n-static int diff_populate_gitlink(struct diff_filespec *s, int size_only)\n+static int diff_populate_dirlink(struct diff_filespec *s, int size_only)\n {\n \tint len;\n \tchar *data = xmalloc(100);\n@@ -1468,7 +1468,7 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)\n \t\treturn 0;\n \n \tif (S_ISDIRLNK(s->mode))\n-\t\treturn diff_populate_gitlink(s, size_only);\n+\t\treturn diff_populate_dirlink(s, size_only);\n \n \tif (!s->sha1_valid ||\n \t    reuse_worktree_file(s->path, s->sha1, 0)) {\ndiff --git a/dir.c b/dir.c\nindex 11fab7f..1f17fc7 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -300,7 +300,7 @@ enum exist_status {\n \n /*\n  * The index sorts alphabetically by entry name, which\n- * means that a gitlink sorts as '\\0' at the end, while\n+ * means that a dirlink sorts as '\\0' at the end, while\n  * a directory (which is defined not as an entry, but as\n  * the files it contains) will sort with the '/' at the\n  * end.\n@@ -343,8 +343,8 @@ static enum exist_status directory_exists_in_index(const char *dirname, int len)\n  * directory name, we always recurse into the directory to see\n  * all the files.\n  *\n- * Case 2: If we *already* have that directory name as a gitlink,\n- * we always continue to see it as a gitlink, regardless of whether\n+ * Case 2: If we *already* have that directory name as a dirlink,\n+ * we always continue to see it as a dirlink, regardless of whether\n  * there is an actual git directory there or not (it might not\n  * be checked out as a subproject!)\n  *\n@@ -356,7 +356,7 @@ static enum exist_status directory_exists_in_index(const char *dirname, int len)\n  *      also true and the directory is empty, in which case\n  *      we just ignore it entirely.\n  *  (b) if it looks like a git directory, and we don't have\n- *      'no_dirlinks' set we treat it as a gitlink, and show it\n+ *      'no_dirlinks' set we treat it as a dirlink, and show it\n  *      as a directory.\n  *  (c) otherwise, we recurse into it.\n  */\n@@ -385,7 +385,7 @@ static enum directory_treatment treat_directory(struct dir_struct *dir,\n \t\t\tbreak;\n \t\tif (!dir->no_dirlinks) {\n \t\t\tunsigned char sha1[20];\n-\t\t\tif (resolve_gitlink_ref(dirname, \"HEAD\", sha1) == 0)\n+\t\t\tif (resolve_dirlink_ref(dirname, \"HEAD\", sha1) == 0)\n \t\t\t\treturn show_directory;\n \t\t}\n \t\treturn recurse_into_directory;\ndiff --git a/entry.c b/entry.c\nindex 82bf725..db66663 100644\n--- a/entry.c\n+++ b/entry.c\n@@ -193,7 +193,7 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *t\n \t\t */\n \t\tunlink(path);\n \t\tif (S_ISDIR(st.st_mode)) {\n-\t\t\t/* If it is a gitlink, leave it alone! */\n+\t\t\t/* If it is a dirlink, leave it alone! */\n \t\t\tif (S_ISDIRLNK(ntohl(ce->ce_mode)))\n \t\t\t\treturn 0;\n \t\t\tif (!state->force)\ndiff --git a/list-objects.c b/list-objects.c\nindex 310f8d3..8027e02 100644\n--- a/list-objects.c\n+++ b/list-objects.c\n@@ -26,7 +26,7 @@ static void process_blob(struct rev_info *revs,\n }\n \n /*\n- * Processing a gitlink entry currently does nothing, since\n+ * Processing a dirlink entry currently does nothing, since\n  * we do not recurse into the subproject.\n  *\n  * We *could* eventually add a flag that actually does that,\n@@ -34,20 +34,20 @@ static void process_blob(struct rev_info *revs,\n  *  - is the subproject actually checked out?\n  *  - if so, see if the subproject has already been added\n  *    to the alternates list, and add it if not.\n- *  - process the commit (or tag) the gitlink points to\n+ *  - process the commit (or tag) the dirlink points to\n  *    recursively.\n  *\n  * However, it's unclear whether there is really ever any\n  * reason to see superprojects and subprojects as such a\n  * \"unified\" object pool (potentially resulting in a totally\n  * humongous pack - avoiding which was the whole point of\n- * having gitlinks in the first place!).\n+ * having dirlinks in the first place!).\n  *\n  * So for now, there is just a note that we *could* follow\n  * the link, and how to do it. Whether it necessarily makes\n  * any sense what-so-ever to ever do that is another issue.\n  */\n-static void process_gitlink(struct rev_info *revs,\n+static void process_dirlink(struct rev_info *revs,\n \t\t\t    const unsigned char *sha1,\n \t\t\t    struct object_array *p,\n \t\t\t    struct name_path *path,\n@@ -88,7 +88,7 @@ static void process_tree(struct rev_info *revs,\n \t\t\t\t     lookup_tree(entry.sha1),\n \t\t\t\t     p, &me, entry.path);\n \t\telse if (S_ISDIRLNK(entry.mode))\n-\t\t\tprocess_gitlink(revs, entry.sha1,\n+\t\t\tprocess_dirlink(revs, entry.sha1,\n \t\t\t\t\tp, &me, entry.path);\n \t\telse\n \t\t\tprocess_blob(revs,\ndiff --git a/read-cache.c b/read-cache.c\nindex d9f46da..3aa92a4 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -86,7 +86,7 @@ static int ce_compare_link(struct cache_entry *ce, size_t expected_size)\n \treturn match;\n }\n \n-static int ce_compare_gitlink(struct cache_entry *ce)\n+static int ce_compare_dirlink(struct cache_entry *ce)\n {\n \tunsigned char sha1[20];\n \n@@ -98,7 +98,7 @@ static int ce_compare_gitlink(struct cache_entry *ce)\n \t *\n \t * If so, we consider it always to match.\n \t */\n-\tif (resolve_gitlink_ref(ce->name, \"HEAD\", sha1) < 0)\n+\tif (resolve_dirlink_ref(ce->name, \"HEAD\", sha1) < 0)\n \t\treturn 0;\n \treturn hashcmp(sha1, ce->sha1);\n }\n@@ -145,7 +145,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)\n \tcase S_IFDIRLNK:\n \t\tif (!S_ISDIR(st->st_mode))\n \t\t\tchanged |= TYPE_CHANGED;\n-\t\telse if (ce_compare_gitlink(ce))\n+\t\telse if (ce_compare_dirlink(ce))\n \t\t\tchanged |= DATA_CHANGED;\n \t\treturn changed;\n \tdefault:\ndiff --git a/refs.c b/refs.c\nindex 89876bf..ee79329 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -285,7 +285,7 @@ static struct ref_list *get_loose_refs(void)\n #define MAXDEPTH 5\n #define MAXREFLEN (1024)\n \n-static int resolve_gitlink_packed_ref(char *name, int pathlen, const char *refname, unsigned char *result)\n+static int resolve_dirlink_packed_ref(char *name, int pathlen, const char *refname, unsigned char *result)\n {\n \tFILE *f;\n \tstruct cached_refs refs;\n@@ -312,7 +312,7 @@ static int resolve_gitlink_packed_ref(char *name, int pathlen, const char *refna\n \treturn retval;\n }\n \n-static int resolve_gitlink_ref_recursive(char *name, int pathlen, const char *refname, unsigned char *result, int recursion)\n+static int resolve_dirlink_ref_recursive(char *name, int pathlen, const char *refname, unsigned char *result, int recursion)\n {\n \tint fd, len = strlen(refname);\n \tchar buffer[128], *p;\n@@ -322,7 +322,7 @@ static int resolve_gitlink_ref_recursive(char *name, int pathlen, const char *re\n \tmemcpy(name + pathlen, refname, len+1);\n \tfd = open(name, O_RDONLY);\n \tif (fd < 0)\n-\t\treturn resolve_gitlink_packed_ref(name, pathlen, refname, result);\n+\t\treturn resolve_dirlink_packed_ref(name, pathlen, refname, result);\n \n \tlen = read(fd, buffer, sizeof(buffer)-1);\n \tclose(fd);\n@@ -343,10 +343,10 @@ static int resolve_gitlink_ref_recursive(char *name, int pathlen, const char *re\n \twhile (isspace(*p))\n \t\tp++;\n \n-\treturn resolve_gitlink_ref_recursive(name, pathlen, p, result, recursion+1);\n+\treturn resolve_dirlink_ref_recursive(name, pathlen, p, result, recursion+1);\n }\n \n-int resolve_gitlink_ref(const char *path, const char *refname, unsigned char *result)\n+int resolve_dirlink_ref(const char *path, const char *refname, unsigned char *result)\n {\n \tint len = strlen(path), retval;\n \tchar *gitdir;\n@@ -359,7 +359,7 @@ int resolve_gitlink_ref(const char *path, const char *refname, unsigned char *re\n \tmemcpy(gitdir, path, len);\n \tmemcpy(gitdir + len, \"/.git/\", 7);\n \n-\tretval = resolve_gitlink_ref_recursive(gitdir, len+6, refname, result, 0);\n+\tretval = resolve_dirlink_ref_recursive(gitdir, len+6, refname, result, 0);\n \tfree(gitdir);\n \treturn retval;\n }\ndiff --git a/refs.h b/refs.h\nindex f61f6d9..5cbb711 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -60,7 +60,7 @@ extern int check_ref_format(const char *target);\n /** rename ref, return 0 on success **/\n extern int rename_ref(const char *oldref, const char *newref, const char *logmsg);\n \n-/** resolve ref in nested \"gitlink\" repository */\n-extern int resolve_gitlink_ref(const char *name, const char *refname, unsigned char *result);\n+/** resolve ref in nested \"dirlink\" repository */\n+extern int resolve_dirlink_ref(const char *name, const char *refname, unsigned char *result);\n \n #endif /* REFS_H */\ndiff --git a/sha1_file.c b/sha1_file.c\nindex be991ed..c37fbed 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -2393,7 +2393,7 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, int write\n \t\tfree(target);\n \t\tbreak;\n \tcase S_IFDIR:\n-\t\treturn resolve_gitlink_ref(path, \"HEAD\", sha1);\n+\t\treturn resolve_dirlink_ref(path, \"HEAD\", sha1);\n \tdefault:\n \t\treturn error(\"%s: unsupported file type\", path);\n \t}\ndiff --git a/tree.c b/tree.c\nindex e4a39aa..d8014eb 100644\n--- a/tree.c\n+++ b/tree.c\n@@ -141,7 +141,7 @@ struct tree *lookup_tree(const unsigned char *sha1)\n \n /*\n  * NOTE! Tree refs to external git repositories\n- * (ie gitlinks) do not count as real references.\n+ * (ie dirlinks) do not count as real references.\n  *\n  * You don't have to have those repositories\n  * available at all, much less have the objects\n-- \n1.5.0.3\n\n\n-- \nMartin Waitz\n"},{"id":"42970","messageId":"20070522115353.GI4489@pasky.or.cz","threadId":"8269","inReplyTo":"7vodkdbvmk.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] rename dirlink to gitlink.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2007-05-22T11:53:53Z","receivedAt":"2007-05-22T11:53:53Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Tue, May 22, 2007 at 01:32:51AM CEST, Junio C Hamano wrote:\n> \"Torgil Svensson\" <torgil.svensson@gmail.com> writes:\n> \n> > On 5/21/07, Martin Waitz <tali@admingilde.org> wrote:\n> >> Unify naming of plumbing dirlink/gitlink concept:\n> >>\n> >> perl -pi -e 's/dirlink/gitlink/g' -e 's/DIRLNK/GITLINK/g'\n> >> ---\n> >\n> > Does this mean that the link doesn't necessarily has to be represented\n> > as a directory (even though current code does it) ?\n> \n> I do not think the patch has that much deep meaning.\n> \n> Personally I think the patch is similar to renaming \"cache\" used\n> in the code to \"index\" --- needless code shuffling that does not\n> buy you anything.\n\nFWIW, I seriously considered making a patch for that several times - but\nalways found something better to do; that is, it is not so big an itch\nfor me to scratch unless I'd be really bored and miss some goot git@\nflamewar badly ;-). However, I still think that using \"cache\" in the\ncode is a mistake - it's confusing and inconsistent.\n\n(BTW, the other thing I hate about the codebase are the filenames. When\nI want to look at the source of some command, I have to try THREE names:\ngit-something.<tab> (sh, perl, ...), builtin-something.c and\nsomething.c. I wish I could just write git-something.<tab>. :-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nEver try. Ever fail. No matter. // Try again. Fail again. Fail better.\n\t\t-- Samuel Beckett\n"}]}