Skip to content

Commit a3178b8

Browse files
committed
Merge branch 'pb/diff-doc-raw-format' into maint
Update "git diff/log --raw" format documentation. source: <[email protected]> * pb/diff-doc-raw-format: diff-index.txt: update raw output format in examples diff-format.txt: correct misleading wording diff-format.txt: dst can be 0* SHA-1 when path is deleted, too
2 parents 84c3dfd + 1971510 commit a3178b8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Documentation/diff-format.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ That is, from the left to the right:
4343
. a space.
4444
. sha1 for "src"; 0\{40\} if creation or unmerged.
4545
. a space.
46-
. sha1 for "dst"; 0\{40\} if creation, unmerged or "look at work tree".
46+
. sha1 for "dst"; 0\{40\} if deletion, unmerged or "work tree out of sync with the index".
4747
. a space.
4848
. status, followed by optional "score" number.
4949
. a tab or a NUL when `-z` option is used.
@@ -69,8 +69,8 @@ percentage of similarity between the source and target of the move or
6969
copy). Status letter M may be followed by a score (denoting the
7070
percentage of dissimilarity) for file rewrites.
7171

72-
<sha1> is shown as all 0's if a file is new on the filesystem
73-
and it is out of sync with the index.
72+
The sha1 for "dst" is shown as all 0's if a file on the filesystem
73+
is out of sync with the index.
7474

7575
Example:
7676

Documentation/git-diff-index.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ done an `update-index` to make that effective in the index file.
6969
matches my working directory. But doing a 'git diff-index' does:
7070

7171
torvalds@ppc970:~/git> git diff-index --cached HEAD
72-
-100644 blob 4161aecc6700a2eb579e842af0b7f22b98443f74 commit.c
73-
+100644 blob 4161aecc6700a2eb579e842af0b7f22b98443f74 git-commit.c
72+
:100644 000000 4161aecc6700a2eb579e842af0b7f22b98443f74 0000000000000000000000000000000000000000 D commit.c
73+
:000000 100644 0000000000000000000000000000000000000000 4161aecc6700a2eb579e842af0b7f22b98443f74 A git-commit.c
7474

7575
You can see easily that the above is a rename.
7676

@@ -103,7 +103,7 @@ have not actually done a 'git update-index' on it yet - there is no
103103
"object" associated with the new state, and you get:
104104

105105
torvalds@ppc970:~/v2.6/linux> git diff-index --abbrev HEAD
106-
:100644 100664 7476bb... 000000... kernel/sched.c
106+
:100644 100644 7476bb5ba 000000000 M kernel/sched.c
107107

108108
i.e., it shows that the tree has changed, and that `kernel/sched.c` is
109109
not up to date and may contain new stuff. The all-zero sha1 means that to

0 commit comments

Comments
 (0)