What does the message “rewrite ... (90%)” mean after a Git commit?

When git performs the commit, it overwrites the binaries with something similar to rewrite foobar.bin (76%) . What is it %? Percentage changed or percentage saved from old file. I know that git uses the binary delta for files, but I just don't know how many %% is overwriting, and it doesn't seem to be on the help page for git help commit .

Thank!

+82
git
Jun 25 '09 at 21:07
source share
3 answers

Its a measure of the likeness index. The similarity index is the percentage of unchanged rows. git considers your file to be text.

+53
Jun 25 '09 at 22:18
source share

I believe that Martin is right, this number is an index of similarity. From git-diff man pages:

The similarity indicator is the percentage of unchanged lines, and the Difference indicator is the percentage of changed lines. This is a rounded integer followed by a percent sign. The similarity index value of 100% is thus reserved for two equal files, while 100% dissimilarity means that there is no line from the old file turned into a new one.

The first time I saw a number that I thought my binaries were changing a lot!

+20
Oct 18 '09 at 14:42
source share

He is trying to rewrite CR and LF in a consistent format. That is, it does not see your binary as binary. To make git do it right, put the following line in . Gitattributes :

 *.bin -crlf -diff -merge 

From this page , which means:

all files with the extension [.bin] will have no carriage return / line transfers will not differ and merges will lead to conflicts leaving the original file untouched.

-four
Jun 25 '09 at 21:35
source share



All Articles