git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] diff-format.adoc: 'git diff-files' prints two lines for unmerged files

From
Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>
Date
May 15, 2026, 15:48 UTC
Message-ID
<6c7d5c5853d5e36a0fddcc403c5be66f51517c00.1778860091.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.2304.git.git.1778860091.gitgitgadget@gmail.com>
From: Philippe Blain <levraiphilippeblain@gmail.com>

Since 10637b84d9 (diff-files: -1/-2/-3 to diff against unmerged stage., 2005-11-29), for unmerged entries 'git diff-files' print both an "unmerged" line ('U'), as well as an "in-place edit" line ('M') comparing stage 2 (by default) with the working tree. The "Raw output format" documentation however mentions that all commands print a single line per changed file. Adjust diff-format.adoc to also mention this special case, for completeness.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/diff-format.adoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/diff-format.adoc b/Documentation/diff-format.adoc
index 7f18c64f1e..43d91ef868 100644
--- a/Documentation/diff-format.adoc
+++ b/Documentation/diff-format.adoc
@@ -19,7 +19,9 @@ compared differs:
 `git-diff-files [<pattern>...]`::
         compares the index and the files on the filesystem.
 
-All the commands print one output line per changed file.
+All the commands print one output line per changed file,
+except `git diff-files` in the case of an unmerged file, which prints
+both an "unmerged" and an "in-place edit" line.
 
 An output line is formatted this way:
 
-- 
gitgitgadget
Previous: Philippe Blain via GitGitGadgetNext: Philippe Blain via GitGitGadget
Message 3 of 4 in “Some more "Raw output format" doc improvements”
  1. 0/3 Some more "Raw output format" doc improvementsPhilippe Blain via GitGitGadget, May 15, 2026
  2. 1/3 diff-format.adoc: remove mention of diff-tree specific outputPhilippe Blain via GitGitGadget, May 15, 2026
  3. 2/3 diff-format.adoc: 'git diff-files' prints two lines for unmerged filesPhilippe Blain via GitGitGadget, May 15, 2026
  4. 3/3 diff-format.adoc: mode and hash are 0* for unmerged paths from index onlyPhilippe Blain via GitGitGadget, May 15, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.