Skip to contentSkip to conversation

What does the 100 in R100 mean?

DISCUSSION Todd A. Jacobs 2 participants 2 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

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.

Signature · 2 lines
"Oh, look: rocks!"
	-- Doctor Who, "Destiny of the Daleks"
#1 lore raw
Quoted 9 lines · Todd A. Jacobs

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.

Documentation/diff-options.txt +6 -2
index 98cc779..424971c 100644
@@ -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
Signature · 2 lines
Thomas Rast
trast@{inf,student}.ethz.ch