The question:
Git uses content based file addressing system (that is it uses blobs and trees hashes as a "file names"). I was wondering what are the benefits of such addressing system?
I can clearly see some of the benefits, but those are minor:
- If someone changes some file in the git repo, it will break all the commits which point to it. Thus you will for sure know that something bad has happend. But is it really that useful?
- Using hash for a file decouples real file name from its content and thus you can "cheaply" rename a file...
I feel that the true reason for using sha for file addressing is quite different. Can anyone explain?
P.S. The clarification. The question is about WHY Git uses hashes for addressing files and not HOW does it do so. I know somewhat of a HOW, I need to know WHY.
P.P.S. There is an article about Git principals and why Git looks so strange (because it should be used on a machine where no other software except for core OS and a text editor present), but still this article mentions only this WHY:
if you calculate sha of a file and this sha is already in the objects folder, then you know that you need not store it again, since sha depends on contents.
All right, this WHY I get. Any other WHY use content addressable file system?