[PR #475] [MERGED] fix: Support absolute path with -X option #502

Closed
opened 2026-06-08 11:28:53 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bootandy/dust/pull/475
Author: @frendsick
Created: 3/7/2025
Status: Merged
Merged: 3/11/2025
Merged by: @bootandy

Base: masterHead: feat/ignore-absolute-directory


📝 Commits (5)

  • 9b985d5 fix: Ignoring absolute path with -X option
  • a163868 perf: Do not canonicalize non-absolute ignored path
  • c5fcb96 refactor: Extract is_ignored_path function
  • 4913639 perf: Canonicalize ignored absolute path only once
  • 47f3b13 rewrite: Reduce indentation with guard clause

📊 Changes

3 files changed (+39 additions, -2 deletions)

View changed files

📝 src/dir_walker.rs (+26 -2)
📝 src/main.rs (+2 -0)
📝 src/utils.rs (+11 -0)

📄 Description

Allow excluding any directory or file by absolute path using the -X option.

The proposed change for the ignore_file function checks whether the file's absolute path representation starts with any of the absolute path representations of ignored directories. Any file inside an ignored folder should have a common path with the ignored directory.

Fixes: #471


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bootandy/dust/pull/475 **Author:** [@frendsick](https://github.com/frendsick) **Created:** 3/7/2025 **Status:** ✅ Merged **Merged:** 3/11/2025 **Merged by:** [@bootandy](https://github.com/bootandy) **Base:** `master` ← **Head:** `feat/ignore-absolute-directory` --- ### 📝 Commits (5) - [`9b985d5`](https://github.com/bootandy/dust/commit/9b985d55ea700c1e9fd6b8065d2b2ade7482a239) fix: Ignoring absolute path with `-X` option - [`a163868`](https://github.com/bootandy/dust/commit/a1638684b26b1be8f145be832b51b42a5aedb304) perf: Do not canonicalize non-absolute ignored path - [`c5fcb96`](https://github.com/bootandy/dust/commit/c5fcb96b27bbacab17629b604383fa9f47f8005d) refactor: Extract is_ignored_path function - [`4913639`](https://github.com/bootandy/dust/commit/49136399bd1a0989e620d59bc8a31b12ce3a51a8) perf: Canonicalize ignored absolute path only once - [`47f3b13`](https://github.com/bootandy/dust/commit/47f3b132d4d19b161e50e7bc501ae7d450c0b10a) rewrite: Reduce indentation with guard clause ### 📊 Changes **3 files changed** (+39 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/dir_walker.rs` (+26 -2) 📝 `src/main.rs` (+2 -0) 📝 `src/utils.rs` (+11 -0) </details> ### 📄 Description Allow excluding any directory or file by absolute path using the `-X` option. The proposed change for the `ignore_file` function checks whether the file's absolute path representation starts with any of the absolute path representations of ignored directories. Any file inside an ignored folder should have a common path with the ignored directory. Fixes: #471 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-06-08 11:28:53 +03:00
zhus closed this issue 2026-06-08 11:28:54 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#502