binaryfiles - Why is the git index file binary? -


most of files in git directory plain text files (except compressed loose objects , packfiles). can cat , edit files .git/head or .git/refs/heads/master , inspect repository if gets corrupted.

but .git/index binary file. wouldn't plain text file more useful because can modified hand?

scott chacon shows in presentation following image (slide 278): index scott chacon

in opinion, can put plain text file.

so why binary file rather plain text file?

the index, presented in "what git index contain exactly?" contains metadata and, noted below jazimov, references:

  • index entries: references entries, metadata (time, mode, size, sha1, ...)
  • cached trees, references trees ("pre-computed hashes trees can derived index"), helps speed tree object generation index new commit.

the concatenation of data makes binary file, although actual reason pure speculation. not being able modify hand one.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -