{"thread":{"id":"65641","subject":"[PATCH 0/3] Some more \"Raw output format\" doc improvements","startedAt":"2026-05-15T15:48:14Z","lastAt":"2026-05-15T15:48:18Z","messageCount":4,"participants":["Philippe Blain via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"543405","messageId":"pull.2304.git.git.1778860091.gitgitgadget@gmail.com","threadId":"65641","inReplyTo":null,"subject":"[PATCH 0/3] Some more \"Raw output format\" doc improvements","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-15T15:48:08Z","receivedAt":"2026-05-15T15:48:14Z","isPatch":true,"body":"Here are some small improvements to the \"Raw output format\" documentation\nthat I noticed while working on another topic.\n\nPhilippe Blain (3):\n  diff-format.adoc: remove mention of diff-tree specific output\n  diff-format.adoc: 'git diff-files' prints two lines for unmerged files\n  diff-format.adoc: mode and hash are 0* for unmerged paths from index\n    only\n\n Documentation/diff-format.adoc | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\n\nbase-commit: 59ff4886a579f4bc91e976fe18590b9ae02c7a08\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2304%2Fphil-blain%2Fdiff-raw-format-doc-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2304/phil-blain/diff-raw-format-doc-v1\nPull-Request: https://github.com/git/git/pull/2304\n-- \ngitgitgadget\n"},{"id":"543406","messageId":"7e48be4024b3a2a75b8c549653d13585c9e88fb7.1778860091.git.gitgitgadget@gmail.com","threadId":"65641","inReplyTo":"pull.2304.git.git.1778860091.gitgitgadget@gmail.com","subject":"[PATCH 1/3] diff-format.adoc: remove mention of diff-tree specific output","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-15T15:48:09Z","receivedAt":"2026-05-15T15:48:15Z","isPatch":true,"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nIn the \"Raw output format\" section, we start by mentioning that 'git\ndiff-tree' prints the hashes of what is being compared. This is only\ntrue in --stdin mode, and is already mentioned in the description of\n'--stdin' in git-diff-tree.adoc. Remove this sentence such that we only\nfocus on the common output between diff-tree, diff-index, diff-files and\ndiff --raw.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/diff-format.adoc | 4 +---\n 1 file changed, 1 insertion(+), 3 deletions(-)\n\ndiff --git a/Documentation/diff-format.adoc b/Documentation/diff-format.adoc\nindex 9f7e988241..7f18c64f1e 100644\n--- a/Documentation/diff-format.adoc\n+++ b/Documentation/diff-format.adoc\n@@ -19,9 +19,7 @@ compared differs:\n `git-diff-files [<pattern>...]`::\n         compares the index and the files on the filesystem.\n \n-The `git-diff-tree` command begins its output by printing the hash of\n-what is being compared. After that, all the commands print one output\n-line per changed file.\n+All the commands print one output line per changed file.\n \n An output line is formatted this way:\n \n-- \ngitgitgadget\n\n"},{"id":"543407","messageId":"6c7d5c5853d5e36a0fddcc403c5be66f51517c00.1778860091.git.gitgitgadget@gmail.com","threadId":"65641","inReplyTo":"pull.2304.git.git.1778860091.gitgitgadget@gmail.com","subject":"[PATCH 2/3] diff-format.adoc: 'git diff-files' prints two lines for unmerged files","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-15T15:48:10Z","receivedAt":"2026-05-15T15:48:17Z","isPatch":true,"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nSince 10637b84d9 (diff-files: -1/-2/-3 to diff against unmerged stage.,\n2005-11-29), for unmerged entries 'git diff-files' print both an\n\"unmerged\" line ('U'), as well as an \"in-place edit\" line ('M')\ncomparing stage 2 (by default) with the working tree. The \"Raw output\nformat\" documentation however mentions that all commands print a single\nline per changed file. Adjust diff-format.adoc to also mention this\nspecial case, for completeness.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/diff-format.adoc | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/diff-format.adoc b/Documentation/diff-format.adoc\nindex 7f18c64f1e..43d91ef868 100644\n--- a/Documentation/diff-format.adoc\n+++ b/Documentation/diff-format.adoc\n@@ -19,7 +19,9 @@ compared differs:\n `git-diff-files [<pattern>...]`::\n         compares the index and the files on the filesystem.\n \n-All the commands print one output line per changed file.\n+All the commands print one output line per changed file,\n+except `git diff-files` in the case of an unmerged file, which prints\n+both an \"unmerged\" and an \"in-place edit\" line.\n \n An output line is formatted this way:\n \n-- \ngitgitgadget\n\n"},{"id":"543408","messageId":"bf103e169b7c7c8a68ae4191514cfe517c577f6d.1778860091.git.gitgitgadget@gmail.com","threadId":"65641","inReplyTo":"pull.2304.git.git.1778860091.gitgitgadget@gmail.com","subject":"[PATCH 3/3] diff-format.adoc: mode and hash are 0* for unmerged paths from index only","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-15T15:48:11Z","receivedAt":"2026-05-15T15:48:18Z","isPatch":true,"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nIn the \"Raw output format\" section, we mention that the 'mode' and\n'sha1' for \"src\" and \"dst\" are 0* if \"(creation|deletion) or unmerged\".\nFor unmerged entries, 'mode' and 'sha1' are in fact 0* only when we are\nlooking at the index, i.e. on the left side for 'git diff-files' and on\nthe right side for 'git diff-index --cached'. Be more precise by\nmentioning this, and while at it uniformize the wording of the \"work\ntree out of sync with the index\" case.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/diff-format.adoc | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/diff-format.adoc b/Documentation/diff-format.adoc\nindex 43d91ef868..ef5df140fe 100644\n--- a/Documentation/diff-format.adoc\n+++ b/Documentation/diff-format.adoc\n@@ -37,13 +37,13 @@ unmerged       :000000 000000 0000000 0000000 U file6\n That is, from the left to the right:\n \n . a colon.\n-. mode for \"src\"; 000000 if creation or unmerged.\n+. mode for \"src\"; 000000 if creation, or if \"src\" is from the index and is unmerged.\n . a space.\n-. mode for \"dst\"; 000000 if deletion or unmerged.\n+. mode for \"dst\"; 000000 if deletion, or if \"dst\" is from the index and is unmerged.\n . a space.\n-. sha1 for \"src\"; 0\\{40\\} if creation or unmerged.\n+. sha1 for \"src\"; 0\\{40\\} if creation, or if \"src\" is from the index and is unmerged.\n . a space.\n-. sha1 for \"dst\"; 0\\{40\\} if deletion, unmerged or \"work tree out of sync with the index\".\n+. 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.\n . a space.\n . status, followed by optional \"score\" number.\n . a tab or a NUL when `-z` option is used.\n-- \ngitgitgadget\n"}]}