rustic-rs / rustic

rustic - fast, encrypted, and deduplicated backups powered by Rust
https://rustic.cli.rs
Apache License 2.0
1.83k stars 70 forks source link

Feature: Configurable exceptions for gitignore #1168

Open intgr opened 3 months ago

intgr commented 3 months ago

I have tons of git repositories under my home directory, which I want to keep backed up.

I want to keep git-ignore = true in my settings to ignore build artifacts and most unnecessary junk in repositories.

But there are certain paths, which are gitignored (I don't want to share with other developers), but still want backed up:


I might put in the effort to submit a PR for this, but first I want to ensure the feature makes sense to others.

I guess this would be an additional setting. Naming is a bit complicated, since it's a double negative, "git-ignore-ignores" probably wouldn't fly. 😄

I think this should only apply if a path would be matched by glob = [...], but is excluded by .gitignore. So glob exclude rule can still exclude _local from a backup.

Maybe git-ignore-exceptions = ["_local", ".idea", "maybe*glob*syntax*too"]

git-ignore-override?

aawsome commented 3 months ago

Thanks @intgr for opening this issue and sorry for the late reply!

I think this is somewhat related to a general overworking of how to include/exclude. I created a milestone for that: https://github.com/rustic-rs/rustic/issues?q=is%3Aopen+is%3Aissue+milestone%3A%22Overwork+includes%2Fexcludes%22

The current state is:

I think we should have

If you want to work on this, you are very welcome! I'll try to support as much as I can but must say that I am unfortunately a bit short on time, currently...

intgr commented 3 months ago

abilities to priorize includes/excludes

Do you have any concrete thoughts on what the configuration schema for that might look like? If we want full flexibility with arbitrary cascades of includes/excludes, seems like it could get pretty complicated. But I haven't thought much about this.

Something like git-ignore-exceptions that I proposed above would be a step in the opposite direction?