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

[PATCH 12/12] doc: rev-list: complete diff-tree by mentioning --always

From
Kkristofferhaugsbakk@fastmail.com <kristofferhaugsbakk@fastmail.com>
Date
Dec 2, 2026, 22:14 UTC
Message-ID
<diff-tree_ex._--always.dfb@m5gid.xyz>
In-Reply-To
<CV_diff-tree_NUL_termination.def@m5gid.xyz>
From: Kristoffer Haugsbakk <code@khaugsbakk.name>

This example implies that it acts a lot like some git-log(1) invocation. The immediate thought is 'git log --patch', but that would be wrong; the git-diff-tree(1) command does not output commits which do not have a diff, like a merge commit. The example doesn’t say that, but it is useful for the reader to know that they need to make this adjustment if they want git-log(1) output. So let’s mention it after the code example.

Of course, this is not complete; you would need to pass '--notes' or '--show-notes-by-default' to git-diff-tree(1) in order to mimic the git-log(1) notes behavior. And maybe other things. But those are small details compared to not getting a commit at all.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---
 Documentation/git-rev-list.adoc | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/Documentation/git-rev-list.adoc b/Documentation/git-rev-list.adoc
index f582491dd43..0dd6269d662 100644
--- a/Documentation/git-rev-list.adoc
+++ b/Documentation/git-rev-list.adoc
@@ -61,6 +61,9 @@ git rev-list --format=medium HEAD
 git rev-list HEAD |
 git diff-tree --stdin --format=medium -p
 ----------
++
+This will not print commits without diffs, like merge commits. Use
+`--always` to also print those commits.
 
 * Print the list of commits on the current branch that touched any
   file in the `Documentation` directory.
-- 
2.56.1.5.g155936fbb2a
Previous: kristofferhaugsbakk@fastmail.com
Message 13 of 13 in “revision: learn -Z for NUL termination”
  1. 00/12 revision: learn -Z for NUL terminationkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  2. 01/12 t4205: use correct 'setup' keywordkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  3. 02/12 t4205: add test coverage for NUL separator and --patchkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  4. 03/12 t4205: test blank line between commit and diff explicitlykristofferhaugsbakk@fastmail.com, Dec 2, 2026
  5. 04/12 t4013-diff-various.sh: test --stdin -z --patchkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  6. 05/12 log-tree: terminate cmt+diff when -z --patchkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  7. 06/12 t4205: test --diff-mergeskristofferhaugsbakk@fastmail.com, Dec 2, 2026
  8. 07/12 revision: learn -Z for NUL terminationkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  9. 08/12 revision: split out termination characterkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  10. 09/12 diff-tree: flush each diff when --stdinkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  11. 10/12 doc: diff-tree: tell about --no-commit-id in Descriptionkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  12. 11/12 doc: diff-tree: add Examples section and mention --stdinkristofferhaugsbakk@fastmail.com, Dec 2, 2026
  13. 12/12 doc: rev-list: complete diff-tree by mentioning --alwayskristofferhaugsbakk@fastmail.com, Dec 2, 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.