Bug 7951 - Option for case insensitivity in filter rules
Option for case insensitivity in filter rules
Status: NEW
Product: rsync
Classification: Unclassified
Component: core
All All
: P3 enhancement
: ---
Assigned To: Wayne Davison
Rsync QA Contact
Depends on:
  Show dependency treegraph
Reported: 2011-02-09 18:18 UTC by Stefan Nowak
Modified: 2014-05-10 14:19 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Nowak 2011-02-09 18:18:35 UTC

- Filter Rule: **.gif
- Plus an argument switch like: --filter-rules-case-insensitive
Result: matches all possible case permutations of .gif


- Filter Rule: **.[gG][iI][fF]
Remark: Not very user friendly, especially if you have a lot of filters.


No related bug in the tracker, I searched for all relevant keywords/permutations.
But the mailinglist mentions request + a patch:

When will this feature be implemented into the main product line?
Comment 1 Matt McCutchen 2011-02-09 19:02:24 UTC
The --ignore-case option of the "ignore-case.diff" maintained patch applies to filters.  Is that what you want, or do you want case-insensitive filters on a case-sensitive run?  If you tried the option and it did not work correctly, please provide steps to reproduce.
Comment 2 Chris Dunlop 2011-02-11 00:23:06 UTC
Rather than a command line switch which turns all filename comparisons case-insensitive (per --ignore-case from ignore-case.diff), or makes filter rules case-insensitive (per requested --filter-rules-case-insensitive), I'd prefer filter rules themselves come in case-sensitive and case-insensitive versions, e.g.:

# Exclude .gif files, but not .GIF
exclude, *.gif
- *.gif

# Exclude .gif and .GIF (and .GiF etc) files
excludei, *.gif
-i *.gif

A use-case for this is on a case-sensitive filesystem where you do care about case sensitivity in file names (i.e. --ignore-case
isn't appropriate), but you want to filter all case permutations in some cases but not others (i.e. --filter-rules-case-insensitive would be inappropriate).
Comment 3 Stefan Nowak 2011-07-01 22:49:25 UTC
It would be fine if case-sensitivity could be both set by a switch in a filter file line (for fine granularity control as suggested by Chris Dunlop) and as a command line switch, which applies to all filter rules (catch all as mentioned by Matt McCutchen).
Comment 4 Haravikk 2014-05-10 14:19:28 UTC
I'd just like to say that I'd also prefer the implementation proposed by Chris Dunlop; an i flag on filter rules would be a lot more flexible.

I recently encountered the problem with this when trying to add a rule for deleting temporary folders (*/tmp/, */temp/ etc.) and using classes is a really horrible workaround.