-
Notifications
You must be signed in to change notification settings - Fork 90
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 .quiltignore on S3 #4326
Comments
Suggested improvement
|
🎯 Supported and Unsupported Patterns in
|
Pattern Type | Works on Local Files? | Works on S3 Paths? | Notes |
---|---|---|---|
Basic Filename Matching | ✅ Yes | ✅ Yes | Matches specific filenames. |
Wildcards (* ) |
✅ Yes | ✅ Yes | Matches any number of characters except / . |
Recursive (** ) |
✅ Yes | ✅ Yes | Matches everything inside a folder or nested folders. |
Negation (! ) |
✅ Yes | Works for local, needs extra logic for S3. | |
Directory Matching (/ ) |
✅ Yes | ✅ Yes | S3 treats directories as prefixes. |
Prefix Matching (temp/ ) |
✅ Yes | ✅ Yes | Matches all files under a directory. |
❌ Unsupported Patterns
Pattern Type | Works on Local Files? | Works on S3 Paths? | Notes |
---|---|---|---|
Single Character Matching (? ) |
❌ No | ❌ No | AWS S3 does not support ? , and fnmatch has limitations. |
Character Ranges ([a-z] ) |
❌ No | ❌ No | fnmatch does not handle [a-z] correctly with / . |
Escaping (\ ) |
❌ No | ❌ No | Needs manual handling for special characters like # . |
📌 Key Takeaways
- S3 treats "directories" as prefixes, so directory filtering works well.
- Negation (
!
) is tricky for S3, requiring additional filtering. - Wildcard (
*
) and recursive (**
) patterns work perfectly. - No support for
?
,[a-z]
, or escaped characters.
Sample .quiltignore file for testing # Ignore all `.log` files except `important.log`
*.log
!important.log
# Ignore the `logs/` directory and everything inside it
logs/**
# Ignore `backups/` directory but allow `.zip` files inside it
backups/*
!backups/*.zip
# Ignore all files inside `folder1/subfolder` except `keep-me.txt`
folder1/subfolder/*
!folder1/subfolder/keep-me.txt |
Script to create test folder #!/bin/bash
# Define base directory
BASE_DIR="."
# Create main directories
mkdir -p $BASE_DIR/{logs,backups,folder1/subfolder}
# Create files in the root directory
touch $BASE_DIR/file1.txt
touch $BASE_DIR/file2.log
touch $BASE_DIR/important.log
# Create files inside logs/
touch $BASE_DIR/logs/error.log
touch $BASE_DIR/logs/access.log
# Create files inside backups/
touch $BASE_DIR/backups/backup1.zip
touch $BASE_DIR/backups/backup2.tar.gz
# Create files inside folder1/
touch $BASE_DIR/folder1/keep.txt
touch $BASE_DIR/folder1/temp.log
# Create files inside folder1/subfolder/
touch $BASE_DIR/folder1/subfolder/ignore-me.txt
touch $BASE_DIR/folder1/subfolder/keep-me.txt
# Create the .gitignore file
cat <<EOL > $BASE_DIR/.gitignore
# Ignore all `.log` files except `important.log`
*.log
!important.log
# Ignore the `logs/` directory and everything inside it
logs/**
# Ignore `backups/` directory but allow `.zip` files inside it
backups/*
!backups/*.zip
# Ignore all files inside `folder1/subfolder` except `keep-me.txt`
folder1/subfolder/*
!folder1/subfolder/keep-me.txt
EOL
echo "✅ Test directory structure created successfully inside '$BASE_DIR'." |
Sample folder: s3://udp-spec/example/quiltignore |
Raw output
|
After the ignore filter:
|
We should very that this produces the expected result from both local and S3 folders! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now, quiltignore_filter only support 'file' for the url_scheme
The text was updated successfully, but these errors were encountered: