Skip to content

Commit a5a323f

Browse files
ydirsongitster
authored andcommitted
Add reference for status letters in documentation.
Also fix error in diff_filepair::status documentation, and point to the in-code reference as well as the doc. Signed-off-by: Yann Dirson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7756ba7 commit a5a323f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Documentation/diff-format.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ That is, from the left to the right:
4646
. path for "dst"; only exists for C or R.
4747
. an LF or a NUL when '-z' option is used, to terminate the record.
4848

49+
Possible status letters are:
50+
51+
- A: addition of a file
52+
- C: copy of a file into a new one
53+
- D: deletion of a file
54+
- M: modification of the contents or mode of a file
55+
- R: renaming of a file
56+
- T: change in the type of the file
57+
- U: file is unmerged (you must complete the merge before it can
58+
be committed)
59+
- X: "unknown" change type (most probably a bug, please report it)
60+
61+
Status letters C and M are always followed by a score (denoting the
62+
percentage of similarity between the source and target of the move or
63+
copy), and are the only ones to be so.
64+
4965
<sha1> is shown as all 0's if a file is new on the filesystem
5066
and it is out of sync with the index.
5167

diffcore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct diff_filepair {
5858
struct diff_filespec *one;
5959
struct diff_filespec *two;
6060
unsigned short int score;
61-
char status; /* M C R N D U (see Documentation/diff-format.txt) */
61+
char status; /* M C R A D U etc. (see Documentation/diff-format.txt or DIFF_STATUS_* in diff.h) */
6262
unsigned broken_pair : 1;
6363
unsigned renamed_pair : 1;
6464
unsigned is_unmerged : 1;

0 commit comments

Comments
 (0)