Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In git log's --name-status listing, what are the numbers suffixed to the status tag?

Tags:

git

I feel like the answer to this should be simple, but the path I'm taking to search for it doesn't turn it up. Here's a sample output from a git log command (with some options) (names of files have been changed to protect the innocent):

$ git log --pretty=%H --follow --name-status -- plans/some_file
997efbccfb0c54f95dd3c22498e47d2971caff0d

C070    plans/some_files_previous_name     plans/some_file
9a265ea5f5b232ec778fb0193ff2f48b3ea25cdf

A       plans/some_files_previous_name
eadecec4b743cc33e16a4eabf68e35cac62c0fa0

D       plans/some_files_previous_name
dc408368cf6f80c841f94f58e4c5dc3283929483

M       plans/some_files_previous_name
8feb7d99b92a993cd8c95506c8d419e4f59d513e

What does the 070 after the C mean in the status part of the first entry?

like image 270
A. Wilson Avatar asked Feb 01 '16 22:02

A. Wilson


1 Answers

man git-log

and searching for --name-status gets us

   --name-status
       Show only names and status of changed files. See the description of the
       --diff-filter option on what the status letters mean.

and searching for --diff-filter gives us

   --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]
       Select only files that are Added (A), Copied (C), Deleted (D), Modified (M),
       Renamed (R), have their type (i.e. regular file, symlink, submodule, ...)
       changed (T), are Unmerged (U), are Unknown (X), or have had their pairing
       Broken (B). Any combination of the filter characters (including none) can be
       used. When * (All-or-none) is added to the combination, all paths are selected
       if there is any file that matches other criteria in the comparison; if there is
       no file that matches other criteria, nothing is selected.

and from http://git-scm.com/docs/git-diff:

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). Status letter M may be followed by a score (denoting the percentage of dissimilarity) for file rewrites.

like image 84
kevchoi Avatar answered Nov 14 '22 21:11

kevchoi