Skip to content

Conversation

@Wastus
Copy link

@Wastus Wastus commented Aug 31, 2025

Description

I brought in the suggestion for an ignore pattern in #70 and made a proof of concept which was integrated by @tehniemer.

As seen in #144 the pattern is hard to get right and does not follow the typical file globbing pattern rules.

I suggest a switch to bash file globbing patterns which are what linux users are probably used to. This does not need any new dependencies, but breaks the regex patterns in use (only released under beta so far). I also added a note for the documentation, that this feature should not be used to exclude often changing files (which will break parity calculations).

Fixes #144

I've tested the functionality in a separate script with some old log files from earlier runs and with a few runs on my own instance.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code (only required for new or big features)
  • My changes generate no new warnings

Copilot AI review requested due to automatic review settings August 31, 2025 18:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR switches from regex-based pattern matching to bash glob patterns for the ignore functionality, making it more user-friendly and familiar to Linux users. The change addresses usability issues with the current regex implementation that was difficult to configure correctly.

Key changes:

  • Replace complex regex patterns with standard bash glob matching
  • Refactor counting logic to use a new helper function instead of grep with regex
  • Update configuration documentation with clear examples and warnings

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
snapraid-aio-script.sh Implements new glob-based pattern matching logic and refactors counting functions
script-config.conf Updates configuration documentation and changes IGNORE_PATTERN to use array syntax

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

… default value is an empty array now so that the old counting is used
@auanasgheps
Copy link
Owner

Hey, thanks for the massive contribution! It's very appreciated!

I will soon review and approve it. But since I don't use the feature there won't be much to test personally.

@auanasgheps
Copy link
Owner

I think I add a warning/disclaimer. This feature is for advanced users, since most of the use cases should be covered by properly excluding those files in SnapRAID itself

Better warn the user that this is an advanced feature.
@auanasgheps
Copy link
Owner

Hi there, sorry if I haven't merged your PR. It will happen soon.
I was busy working on other little bugs I left behind. I wanted to make sure I had those cleared before adding new features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants