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

Feature discussion: Programatically defined file-filtering. #1317

Open
Ben-PH opened this issue Oct 10, 2024 · 0 comments
Open

Feature discussion: Programatically defined file-filtering. #1317

Ben-PH opened this issue Oct 10, 2024 · 0 comments
Labels
A-config Area: Related to the config file functionality and format C-enhancement Category: New feature or request

Comments

@Ben-PH
Copy link

Ben-PH commented Oct 10, 2024

@simonsan and I started this discussion in discord. It's fitting to summarize and continue in here.

My use case: ignore the build output of a cargo project (i.e. ignore target directory when it shares a directory with Cargo.toml, edge-cases aside)

Current approach

Currently, one can ignore/include files based on approaches such as globs, respecting .gitignore files, etc. An initial suggestion was to respect .gitignore files. This works when file-management of a git project happens to mirror what you want to backup. It does not work when the things you want to backup don't align with what you want in your git repo, as it's not the job of .gitignore to filter what you want backed up. Personal configurations, such as IDE settings, comes to mind.

Some other scenarios, though arbitrary and contrived, illustrate the potential value of allowing some sort of programatic definition, or scriptability, to be added to the backup process:

  • Add inclusion/exclusion parameters based on some sort of script. E.g. "find all the files that differ from the most up to date remote branch, and include them. if this is above $FILE_SIZE, backup just the diff. if the diff is bigger that $FILE_SIZE, log an error"
  • Add inclusion/exclusion paramaters based on file content. I don't know why, but someone out there might want to exclude files that contain the string "foobar" within the first 0x42KiB of a file.
  • Add the ability to add include/exclude paramaters that apply to parts of files (e.g. "in path/to/dir/** and git status shows that there is a merge conflict, snip-out the code that is the down-stream source of the conflict" is one contrived example)
  • Only apply certain shell hooks according under defined include/exclude parameters.

I am curious to see where this discussion will take us.

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Oct 10, 2024
@simonsan simonsan added this to the Rework includes/excludes milestone Oct 10, 2024
@simonsan simonsan added C-enhancement Category: New feature or request A-config Area: Related to the config file functionality and format and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: Related to the config file functionality and format C-enhancement Category: New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants