diff-format.adoc: mode and hash are 0* for unmerged paths from index only

In the "Raw output format" section, we mention that the 'mode' and 'sha1' for "src" and "dst" are 0* if "(creation|deletion) or unmerged". For unmerged entries, 'mode' and 'sha1' are in fact 0* only when we are looking at the index, i.e. on the left side for 'git diff-files' and on the right side for 'git diff-index --cached'. Be more precise by mentioning this, and while at it uniformize the wording of the "work tree out of sync with the index" case. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Philippe Blain committed May 15, 2026 at 15:48 UTC 6d09e798bcfba92ef071abb27ad807985681122c
1 file changed +4 -4
Documentation/diff-format.adoc
+4 -4
@@ -37,13 +37,13 @@ unmerged :000000 000000 0000000 0000000 U file6
37 That is, from the left to the right:
38
39 . a colon.
40 -. mode for "src"; 000000 if creation or unmerged.
40 +. mode for "src"; 000000 if creation, or if "src" is from the index and is unmerged.
41 . a space.
42 -. mode for "dst"; 000000 if deletion or unmerged.
42 +. mode for "dst"; 000000 if deletion, or if "dst" is from the index and is unmerged.
43 . a space.
44 -. sha1 for "src"; 0\{40\} if creation or unmerged.
44 +. sha1 for "src"; 0\{40\} if creation, or if "src" is from the index and is unmerged.
45 . a space.
46 -. sha1 for "dst"; 0\{40\} if deletion, unmerged or "work tree out of sync with the index".
46 +. sha1 for "dst"; 0\{40\} if deletion, if "dst" is from the index and is unmerged, or if "dst" is from the work tree and is out of sync with the index.
47 . a space.
48 . status, followed by optional "score" number.
49 . a tab or a NUL when `-z` option is used.