From 3efa5912dd2a81a4ce999950a6a0a0b3a5f7ceb4 Mon Sep 17 00:00:00 2001 From: toastal Date: Tue, 16 Jul 2024 01:29:54 +0700 Subject: [PATCH 1/3] Basic Darcs support (ignoring VCS dir) Darcs is a decentralized version control system. Advanced support would be adding .boring file support like .gitignore. --- src/tup/pel_group.c | 4 +++- src/tup/server/fuse_fs.c | 2 ++ tup.1 | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tup/pel_group.c b/src/tup/pel_group.c index 6cddba1bf..e8a97250a 100644 --- a/src/tup/pel_group.c +++ b/src/tup/pel_group.c @@ -47,6 +47,8 @@ int pel_ignored(const char *path, int len) return 1; if(len == 4 && strncmp(path, ".svn", 4) == 0) return 1; + if(len == 6 && strncmp(path, "_darcs", 6) == 0) + return 1; if(len == 7 && strncmp(path, ".ccache", 7) == 0) return 1; /* See also fuse_fs.c:is_hidden() */ @@ -169,7 +171,7 @@ int get_path_elements(const char *path, struct pel_group *pg) } TAILQ_FOREACH(pel, &pg->path_list, list) { - if(pel->path[0] == '.') { + if(pel->path[0] == '.' || pel->path[0] == '_') { if(pel->len == 2 && strncmp(pel->path, "..", 2) == 0) { /* .. paths are ignored */ } else if(pel_ignored(pel->path, pel->len)) { diff --git a/src/tup/server/fuse_fs.c b/src/tup/server/fuse_fs.c index cd1216304..e5a7a1756 100644 --- a/src/tup/server/fuse_fs.c +++ b/src/tup/server/fuse_fs.c @@ -101,6 +101,8 @@ static int is_hidden(const char *path) return 1; if(strstr(path, "/.bzr") != NULL) return 1; + if(strstr(path, "/_darcs") != NULL) + return 1; if(is_ccache_path(path)) return 1; return 0; diff --git a/tup.1 b/tup.1 index eaed9b9d8..f928a412d 100644 --- a/tup.1 +++ b/tup.1 @@ -320,7 +320,7 @@ Set to '1' to keep building as much as possible even if errors are encountered. Set to '1' to track dependencies on files outside of the tup hierarchy. The default is '0', which only tracks dependencies within the tup hierarchy. For example, if you want all C files to be re-compiled when gcc is updated on your system, you should set this to '1'. In Linux and OSX, using full dependencies requires that the tup binary is suid as root so that it can run sub-processes in a chroot environment. Alternatively on Linux, if your kernel supports user namespaces, then you don't need to make the binary suid. Note that if this value is set to '1' from '0', tup will rebuild the entire project. Disabling this option when it was previously enabled does not require a full rebuild, but does take some time since the nodes representing external files are cleared out. NOTE: This does not currently work with ccache or other programs that may write to external files due to issues with locking. This may be fixed in the future. .TP .B updater.warnings (defaults to '1') -Set to '0' to disable warnings about writing to hidden files. Tup doesn't track files that are hidden. If a sub-process writes to a hidden file, then by default tup will display a warning that this file was created. By disabling this option, those warnings are not displayed. Hidden filenames (or directories) include: ., .., .tup, .git, .hg, .bzr, .svn. +Set to '0' to disable warnings about writing to hidden files. Tup doesn't track files that are hidden. If a sub-process writes to a hidden file, then by default tup will display a warning that this file was created. By disabling this option, those warnings are not displayed. Hidden filenames (or directories) include: ., .., .tup, .git, .hg, .bzr, .svn, _darcs. .TP .B display.color (default 'auto') Set to 'never' to disable ANSI escape codes for colored output, or 'always' to always use ANSI escape codes for colored output. The default is 'auto', which displays uses colored output if stdout is connected to a tty, and uses no colors otherwise (ie: if stdout is redirected to a file). From ca3e97764b83537d192833ca78ce9dcae5d8d15a Mon Sep 17 00:00:00 2001 From: toastal Date: Thu, 18 Jul 2024 21:55:27 +0700 Subject: [PATCH 2/3] Basic Pijul support (ignoring VCS dir) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pijul is a decentralized version control system. Ignorefile use .ignore which use the same as the Git-branded, .gitignore file… so more advanced support could be added. --- src/tup/pel_group.c | 2 ++ src/tup/server/fuse_fs.c | 2 ++ tup.1 | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tup/pel_group.c b/src/tup/pel_group.c index e8a97250a..73eb7b059 100644 --- a/src/tup/pel_group.c +++ b/src/tup/pel_group.c @@ -47,6 +47,8 @@ int pel_ignored(const char *path, int len) return 1; if(len == 4 && strncmp(path, ".svn", 4) == 0) return 1; + if(len == 6 && strncmp(path, ".pijul", 6) == 0) + return 1; if(len == 6 && strncmp(path, "_darcs", 6) == 0) return 1; if(len == 7 && strncmp(path, ".ccache", 7) == 0) diff --git a/src/tup/server/fuse_fs.c b/src/tup/server/fuse_fs.c index e5a7a1756..642075290 100644 --- a/src/tup/server/fuse_fs.c +++ b/src/tup/server/fuse_fs.c @@ -101,6 +101,8 @@ static int is_hidden(const char *path) return 1; if(strstr(path, "/.bzr") != NULL) return 1; + if(strstr(path, "/.pijul") != NULL) + return 1; if(strstr(path, "/_darcs") != NULL) return 1; if(is_ccache_path(path)) diff --git a/tup.1 b/tup.1 index f928a412d..663c73110 100644 --- a/tup.1 +++ b/tup.1 @@ -320,7 +320,7 @@ Set to '1' to keep building as much as possible even if errors are encountered. Set to '1' to track dependencies on files outside of the tup hierarchy. The default is '0', which only tracks dependencies within the tup hierarchy. For example, if you want all C files to be re-compiled when gcc is updated on your system, you should set this to '1'. In Linux and OSX, using full dependencies requires that the tup binary is suid as root so that it can run sub-processes in a chroot environment. Alternatively on Linux, if your kernel supports user namespaces, then you don't need to make the binary suid. Note that if this value is set to '1' from '0', tup will rebuild the entire project. Disabling this option when it was previously enabled does not require a full rebuild, but does take some time since the nodes representing external files are cleared out. NOTE: This does not currently work with ccache or other programs that may write to external files due to issues with locking. This may be fixed in the future. .TP .B updater.warnings (defaults to '1') -Set to '0' to disable warnings about writing to hidden files. Tup doesn't track files that are hidden. If a sub-process writes to a hidden file, then by default tup will display a warning that this file was created. By disabling this option, those warnings are not displayed. Hidden filenames (or directories) include: ., .., .tup, .git, .hg, .bzr, .svn, _darcs. +Set to '0' to disable warnings about writing to hidden files. Tup doesn't track files that are hidden. If a sub-process writes to a hidden file, then by default tup will display a warning that this file was created. By disabling this option, those warnings are not displayed. Hidden filenames (or directories) include: ., .., .tup, .git, .hg, .bzr, .svn, .pijul, _darcs. .TP .B display.color (default 'auto') Set to 'never' to disable ANSI escape codes for colored output, or 'always' to always use ANSI escape codes for colored output. The default is 'auto', which displays uses colored output if stdout is connected to a tty, and uses no colors otherwise (ie: if stdout is redirected to a file). From 08b1b67b849b74ba3a242c3ca15595c78fd0a919 Mon Sep 17 00:00:00 2001 From: toastal Date: Mon, 29 Jul 2024 00:17:27 +0700 Subject: [PATCH 3/3] Direnv support Direnv is a tool for tracking your local developer environment. With the rise of Nix popularity & its hooks for local Nix development, this tool has become quite popular, but it caches changes in a local directory that makes Tup noisy. This commit is a duplicate of another proposed patch, however, unlike that patchset, this is standalone. --- src/tup/pel_group.c | 2 ++ src/tup/server/fuse_fs.c | 2 ++ tup.1 | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tup/pel_group.c b/src/tup/pel_group.c index 73eb7b059..f5a16c431 100644 --- a/src/tup/pel_group.c +++ b/src/tup/pel_group.c @@ -53,6 +53,8 @@ int pel_ignored(const char *path, int len) return 1; if(len == 7 && strncmp(path, ".ccache", 7) == 0) return 1; + if(len == 7 && strncmp(path, ".direnv", 7) == 0) + return 1; /* See also fuse_fs.c:is_hidden() */ return 0; } diff --git a/src/tup/server/fuse_fs.c b/src/tup/server/fuse_fs.c index 642075290..9ea20bd8d 100644 --- a/src/tup/server/fuse_fs.c +++ b/src/tup/server/fuse_fs.c @@ -105,6 +105,8 @@ static int is_hidden(const char *path) return 1; if(strstr(path, "/_darcs") != NULL) return 1; + if(strstr(path, "/.direnv") != NULL) + return 1; if(is_ccache_path(path)) return 1; return 0; diff --git a/tup.1 b/tup.1 index 663c73110..05feb2be4 100644 --- a/tup.1 +++ b/tup.1 @@ -320,7 +320,7 @@ Set to '1' to keep building as much as possible even if errors are encountered. Set to '1' to track dependencies on files outside of the tup hierarchy. The default is '0', which only tracks dependencies within the tup hierarchy. For example, if you want all C files to be re-compiled when gcc is updated on your system, you should set this to '1'. In Linux and OSX, using full dependencies requires that the tup binary is suid as root so that it can run sub-processes in a chroot environment. Alternatively on Linux, if your kernel supports user namespaces, then you don't need to make the binary suid. Note that if this value is set to '1' from '0', tup will rebuild the entire project. Disabling this option when it was previously enabled does not require a full rebuild, but does take some time since the nodes representing external files are cleared out. NOTE: This does not currently work with ccache or other programs that may write to external files due to issues with locking. This may be fixed in the future. .TP .B updater.warnings (defaults to '1') -Set to '0' to disable warnings about writing to hidden files. Tup doesn't track files that are hidden. If a sub-process writes to a hidden file, then by default tup will display a warning that this file was created. By disabling this option, those warnings are not displayed. Hidden filenames (or directories) include: ., .., .tup, .git, .hg, .bzr, .svn, .pijul, _darcs. +Set to '0' to disable warnings about writing to hidden files. Tup doesn't track files that are hidden. If a sub-process writes to a hidden file, then by default tup will display a warning that this file was created. By disabling this option, those warnings are not displayed. Hidden filenames (or directories) include: ., .., .tup, .git, .hg, .bzr, .svn, .pijul, .direnv, _darcs. .TP .B display.color (default 'auto') Set to 'never' to disable ANSI escape codes for colored output, or 'always' to always use ANSI escape codes for colored output. The default is 'auto', which displays uses colored output if stdout is connected to a tty, and uses no colors otherwise (ie: if stdout is redirected to a file).