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

[PATCH] Do not ignore hidden refs

From
Petr Baudis <pasky@suse.cz>
Date
Nov 18, 2006, 04:11 UTC
Message-ID
<20061118041137.6064.75827.stgit@machine.or.cz>

Some of the ref manipulation tools (git-for-each-ref and git-show-ref in particular) would not handle hidden (~ /^\./) refs. This may be an acceptable or possibly even desirable behaviour for the ref walkers and repackers, but git-show-ref hiddenrefname must work.

This makes Git not ignore hidden refs at all. I'm not opposed to making some particular parts of the ref interface to continue to ignore hidden refs, but the restriction cannot be so deep.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 refs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/refs.c b/refs.c
index f003a0b..06fa5c2 100644
--- a/refs.c
+++ b/refs.c
@@ -141,7 +141,8 @@ static struct ref_list *get_ref_dir(cons
 			int flag;
 			int namelen;
 
-			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;
 			namelen = strlen(de->d_name);
Next: Junio C Hamano
Message 1 of 14 in “Do not ignore hidden refs”
  1. Do not ignore hidden refsPetr Baudis, Nov 18, 2006
  2. Junio C HamanoNov 18, 2006
  3. Petr BaudisNov 18, 2006
  4. Junio C HamanoNov 18, 2006
  5. Shawn PearceNov 18, 2006
  6. Petr BaudisNov 18, 2006
  7. Junio C HamanoNov 18, 2006
  8. Petr BaudisNov 18, 2006
  9. Junio C HamanoNov 18, 2006
  10. Petr BaudisNov 18, 2006
  11. Junio C HamanoNov 19, 2006
  12. Petr BaudisNov 19, 2006
  13. Linus TorvaldsNov 18, 2006
  14. Junio C HamanoNov 18, 2006

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.