git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Allow dot files in ls-files as well.

From
Junio C Hamano <junkio@cox.net>
Date
May 25, 2005, 00:44 UTC
Message-ID
<7v1x7wt9qm.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7v8y24taai.fsf@assigned-by-dhcp.cox.net>
>>>>> "JCH" == Junio C Hamano <junkio@cox.net> writes:
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> I considered it, but it's so much easier to allow things LT> later than deny them, that I preferred being anal about it.

JCH> That is not the point. GIT_DIR set to "GIT" would happily suck JCH> index file in. You are not being anal enough.

... which makes me feel that, since you cannot be anal enough anyway, it would be more consistent not to be more restrictive than necessary (the user has every right to screw himself anyway).

No matter what you end up doing, you would need something like this as well (I am not screening .git here but that should be easy for you to add).

------------ Allow dot files in ls-files as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
cd /opt/packrat/playpen/public/in-place/git/git.junio/
PATH=.:$PATH jit-diff 1: ls-files.c
# - linus: git-update-cache: allow dot-files
# + (working tree)
diff --git a/ls-files.c b/ls-files.c
--- a/ls-files.c
+++ b/ls-files.c
@@ -136,7 +136,9 @@ static void read_directory(const char *p
 		while ((de = readdir(dir)) != NULL) {
 			int len;
 
-			if (de->d_name[0] == '.')
+			if (de->d_name[0] == '.' &&
+			    (de->d_name[1] == 0 ||
+			     (de->d_name[1] == '.' && de->d_name[2] == 0)))
 				continue;
 			if (excluded(de->d_name) != show_ignored)
 				continue;
Previous: Junio C HamanoNext: Linus Torvalds
Message 4 of 11 in “Re: git-update-cache: allow dot-files”
  1. Junio C HamanoMay 25, 2005
  2. Linus TorvaldsMay 25, 2005
  3. Junio C HamanoMay 25, 2005
  4. Allow dot files in ls-files as well.Junio C Hamano, May 25, 2005
  5. Linus TorvaldsMay 25, 2005
  6. Junio C HamanoMay 25, 2005
  7. Allow dot files in ls-files as well (take #2).Junio C Hamano, May 25, 2005
  8. Linus TorvaldsMay 25, 2005
  9. Junio C HamanoMay 25, 2005
  10. Petr BaudisMay 26, 2005
  11. Junio C HamanoMay 26, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.