Skip to content

Support added for ignore outliers#1

Open
rahulthakur319 wants to merge 1 commit intoTrelisResearch:mainfrom
rahulthakur319:ignore_fixes
Open

Support added for ignore outliers#1
rahulthakur319 wants to merge 1 commit intoTrelisResearch:mainfrom
rahulthakur319:ignore_fixes

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

@RonanKMcGovern
Copy link
Contributor

thanks for this. I just merged a pr that uses default git: #2

lmk if you want to add on top of that

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