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

[PATCH] git-clean: remove fifo, devices, socket files

From
AVAndrey Vagin <avagin@openvz.org>
Date
Jul 15, 2016, 02:42 UTC
Message-ID
<1468550579-9298-1-git-send-email-avagin@openvz.org>

Currently git-clean removes only links and files, but there can be special files like fifo, sockets, devices.

I think git-clean has to remove them too.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 cache.h | 8 ++++++++
 dir.c   | 4 ++++
 2 files changed, 12 insertions(+)
diff --git a/cache.h b/cache.h
index f1dc289..a2f1258 100644
--- a/cache.h
+++ b/cache.h
@@ -77,10 +77,18 @@ struct object_id {
 #undef DT_DIR
 #undef DT_REG
 #undef DT_LNK
+#undef DT_FIFO
+#undef DT_BLK
+#undef DT_CHR
+#undef DT_SOCK
 #define DT_UNKNOWN	0
 #define DT_DIR		1
 #define DT_REG		2
 #define DT_LNK		3
+#define DT_FIFO		4
+#define DT_BLK		5
+#define DT_CHR		6
+#define DT_SOCK		7
 #define DTYPE(de)	DT_UNKNOWN
 #endif
 
diff --git a/dir.c b/dir.c
index 6172b34..930dd99 100644
--- a/dir.c
+++ b/dir.c
@@ -1470,8 +1470,12 @@ static enum path_treatment treat_one_path(struct dir_struct *dir,
 		strbuf_addch(path, '/');
 		return treat_directory(dir, untracked, path->buf, path->len,
 				       baselen, exclude, simplify);
+	case DT_BLK:
+	case DT_CHR:
+	case DT_FIFO:
 	case DT_REG:
 	case DT_LNK:
+	case DT_SOCK:
 		return exclude ? path_excluded : path_untracked;
 	}
 }
-- 
2.5.5
Next: Johannes Sixt
Message 1 of 6 in “git-clean: remove fifo, devices, socket files”
  1. git-clean: remove fifo, devices, socket filesAndrey Vagin, Jul 15, 2016
  2. Johannes SixtJul 15, 2016
  3. Andrey VaginJul 15, 2016
  4. Johannes SchindelinJul 15, 2016
  5. Johannes SixtJul 15, 2016
  6. Andrew VaginJul 15, 2016

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.