Odd behavior with --detect-renamed

Erik Pettersson rsync-list at ejp.se
Fri Dec 28 16:31:21 GMT 2007


Hello,

I'm totally new to this list, so I hope I don't break all the rules. :)
I've looked through the archives (and google), and I really can't find the
answer to my question.

I'm trying out the 'detect-renamed'-patch, and I've encountered some odd
behavior. I've applied the patch to both rsync-2.6.9 and rsync-3.0.0pre7,
and it's the same behavior.

Basicly, what I've noticed is that if I move a file into a newly created
directory (which is what happens if I rename a directory, for example), the
file isn't detected as renamed. However, if I manually create the new
directory on the target-side, the file is correctly detected as a rename,
and isn't transfered over the network.

Here I've moved 'file' into a newly created directory 'dir2', which isn't
available on the target-side.

> $ find src
> src
> src/dir1
> src/dir1/dir2
> src/dir1/dir2/file
>
> $ find dst
> dst
> dst/dir1
> dst/dir1/file
>
> $ rsync -avv --detect-renamed -e ssh src/dir1 localhost:dst
> [...]
> total: matches=0  hash_hits=0  false_alarms=0 data=4544512

The file isn't detected as a rename.

If I create 'dir2' manually on the target-side, it is detected correctly:

> $ find src
> src
> src/dir1
> src/dir1/dir2
> src/dir1/dir2/file
>
> $ find dst
> dst
> dst/dir1
> dst/dir1/file
> dst/dir1/dir2
>
> $ rsync -avv --detect-renamed -e ssh src/dir1 localhost:dst
> [...]
> found renamed: dir1/file => dir1/dir2/file
> [...]
> total: matches=2136  hash_hits=2136  false_alarms=0 data=0

Is this a bug (I think so), or should it be like this?
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list