The Samba-Bugzilla – Bug 10448
Finish implementing the --ignore-case feature
Last modified: 2015-07-16 13:45:42 UTC
I'm not sure why --ignore-case isn't provided as a standard flag for current versions of rsync, but I think it should be included as it's incredibly useful, especially since Windows and OS X systems both default to case insensitive while Linux tends to have case-insensitive file systems a lot more often, plus it's possible for all free to to have any combination of sensitivity and insensitivity which can be a nightmare to manage properly.
Anyway, I'd like to recommend that --ignore-case be provided by default in a future release. I'd even go a step further and recommend providing a soft-error if rsync detects that it is syncing from a case sensitive system to a case-insensitive one or vice-versa so that users are warned of any potential issues with files or even directories that may end being overwritten, or copied again and again.
The current patch is only a partial implementation of the feature, so it is not yet ready for merging into the main code.
tested with 3.07 and 3.1 with --ignore-case patch applied
mkdir -p a/b/c/d/e/f
mkdir -p A/b/C/D/e/F
add some files to a/b/c/d/e/f/
rsync -r --ignore-case a/ A/
>> creates b/c/d/e/f/<files>
Why is it not ignoring case? I expect it to add all files in 'f' to 'F'
Because you're not running it on a case-ignoring filesystem. That patch is (sadly) only a partially effective set of changes that helps rsync to deal with a filesystem that doesn't differentiate upper-/lower-case when naming files. Rsync's main algorithm of probing for files by name (via stat) didn't change, and thus it doesn't try to find an alternate name for the same file if the filesystem isn't conglomerating them together (and indeed, it totally fails to notice if the case on a filename has changed on the server compared to the file's name on the receiver).
For a means of fixing this, I'm imaging having the code that is used for --delete-during getting modified to notice changes in case and trying to fix them (even if rsync isn't doing a delete-during run). If that were done, the patch would probably then be in good enough shape to finally be included in the main code.