SHA question

Andy Wardley abw at
Fri Jan 15 20:16:09 GMT 2010

On 14/01/2010 17:41, Philip Newton wrote:
> Yes - you're missing the fact that in order to compute the differences
> (which it has to if it doesn't want to transfer the whole file), it
> has to read the entire file over the slow NFS link into your
> computer's memory in order to compare it with the "local" file in
> order to tell which pieces have changed.

No, I don't think it does.

My understanding[*] is that it computes a checksum for each block of a file
and only transmits blocks that have different checksums.  That's how it
handles incremental changes on large files (e.g. an extra few lines at
the end of a log file doesn't require the whole file to be transmitted).

Some relevant options are:

    --checksum     always checksum
    --block-size   checksum block size
    --whole-file   transmit the whole file
    --size-only    compare file size instead of checksum


[*] which could be flawed

More information about the mailing list