Subject: Re: What does the 100 in R100 mean?

From: Thomas Rast <[email-masked]>
Date: Fri, 14 May 2010 14:20:52 +0200

Todd A. Jacobs wrote:
> When I'm looking at the output for renamed files in git-log or
> git-whatchanged, renamed files always seem to say "R100." So, I looked
> in the man page, followed the internal references to --diff-filter, and
> remain stumped as to what the digits stand for. I couldn't even find an
> explanatory comment in the git source code.
> 
> Obviously, R is for "(R)enamed." What is the "100" for? If it's being
> returned as a flag to --name-status and friends, it should probably be
> documented somewhere.

It is, but in the "wrong" section:

RAW OUTPUT FORMAT
[...]
       Possible status letters are:
       ·   A: addition of a file
       ·   C: copy of a file into a new one
       ·   D: deletion of a file
       ·   M: modification of the contents or mode of a file
       ·   R: renaming of a file
[...]
       Status letters C and R are always followed by a score (denoting
       the percentage of similarity between the source and target of
       the move or copy), and are the only ones to be so.

The patch below might rectify that, but it's not that reader-friendly
because it has to point at the git-diff manpage where diff-format.txt
is not included.  The ifdef is also an incomplete test because
diff-{files,index,tree} include diff-format.txt but don't set
git-diff.

diff --git i/Documentation/diff-options.txt w/Documentation/diff-options.txt
index 98cc779..424971c 100644
--- i/Documentation/diff-options.txt
+++ w/Documentation/diff-options.txt
@@ -107,8 +107,12 @@ any of those replacements occurred.
 	Show only names of changed files.
 
 --name-status::
-	Show only names and status of changed files. See the description
-	of the `--diff-filter` option on what the status letters mean.
+	Show only names and status of changed files. See the "RAW
+	OUTPUT FORMAT" section
+ifndef::git-diff[]
+	in linkgit:git-diff[1]
+endif::git-diff[]
+	for what the status codes mean.
 
 --submodule[=<format>]::
 	Chose the output format for submodule differences. <format> can be one of

-- 
Thomas Rast
trast@{inf,student}.ethz.ch