Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support added for ignore outliers #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rahulthakur319
Copy link

No description provided.

@rahulthakur319
Copy link
Author

Changes to fr.sh

Improved ignore pattern matching:

Now handles both absolute and relative paths correctly. Supports nested directory ignores

New matches_ignore_pattern function:

matches_ignore_pattern() {
    local pattern=$1
    local path=$2
    
    if [[ $pattern == /* ]]; then
        pattern=${pattern#/}
        [[ $path == $pattern || $path == $pattern/* ]] && return 0
    else
        [[ $path == */$pattern || $path == $pattern || $path == $pattern/* ]] && return 0
    fi
    
    return 1
}

Examples of newly supported patterns:

venv/ in .gitignore now correctly ignores:

/venv/
/backend/venv/
Any venv/ directory at any level

Why it wasn't supported earlier:

Previous version used simple string matching:
[[ $path == $pattern || $path == $pattern/* ]]

This didn't account for nested directories or relative paths

Result:
More intuitive and powerful ignore mechanism, aligning with standard .gitignore behavior

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.

1 participant