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

[PATCH 0/3] line-log: integrate -L with the standard log output pipeline

From
Michael Montalbo via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 28, 2026, 04:05 UTC
Message-ID
<pull.2094.git.1777349126.gitgitgadget@gmail.com>

Since its introduction, git log -L has short-circuited from log_tree_commit() into its own output function, bypassing log_tree_diff() and log_tree_diff_flush(). This skips no_free save/restore, always_show_header, diff_free() cleanup, and means that pickaxe (-S, -G, --find-object) and --diff-filter cannot suppress commits whose pairs are all filtered out, because show_log() runs before diffcore_std().

This series restructures the flow so that -L goes through the same log_tree_diff() -> log_tree_diff_flush() path as normal single-parent and merge diffs, then uses that to enable several non-patch diff formats.

Patch 1: revision: move -L setup before output_format-to-diff derivation

Preparatory reorder in setup_revisions(). The -L block sets a default DIFF_FORMAT_PATCH when no format is requested; move it before the derivation of revs->diff from output_format so the default is visible to that check. No behavior change on its own.

Patch 2: line-log: integrate -L output with the standard log-tree pipeline

Rename line_log_print() to line_log_queue_pairs(), stripping it down to only queue pre-computed filepairs. log_tree_diff_flush() handles show_log(), diffcore_std(), and diff_flush(). This fixes pickaxe and --diff-filter suppression, and aligns the commit/diff separator with the rest of log output. Also rejects --full-diff, which is meaningless when filepairs are pre-computed.

Patch 3: line-log: allow non-patch diff formats with -L

Expand the allowlist to accept --raw, --name-only, --name-status, and --summary. These only read filepair metadata already set by the line-log machinery. Diff stat formats (--stat, --numstat, --shortstat, --dirstat) remain blocked because they call compute_diffstat() on full blob content and would show whole-file statistics rather than range-scoped ones.

Michael Montalbo (3):
  revision: move -L setup before output_format-to-diff derivation
  line-log: integrate -L output with the standard log-tree pipeline
  line-log: allow non-patch diff formats with -L
 Documentation/line-range-options.adoc         | 10 +-
 line-log.c                                    | 30 ++----
 line-log.h                                    |  2 +-
 log-tree.c                                    |  9 +-
 revision.c                                    | 25 +++--
 t/t4211-line-log.sh                           | 99 ++++++++++++++++---
 t/t4211/sha1/expect.parallel-change-f-to-main |  1 -
 .../sha256/expect.parallel-change-f-to-main   |  1 -
 8 files changed, 120 insertions(+), 57 deletions(-)
base-commit: 9f223ef1c026d91c7ac68cc0211bde255dda6199
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2094%2Fmmontalbo%2Fmm%2Fline-log-use-log-tree-diff-flush-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2094/mmontalbo/mm/line-log-use-log-tree-diff-flush-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2094
-- 
gitgitgadget
Next: Michael Montalbo via GitGitGadget
Message 1 of 20 in “line-log: integrate -L with the standard log output pipeline”
  1. 0/3 line-log: integrate -L with the standard log output pipelineMichael Montalbo via GitGitGadget, Apr 28, 2026
  2. 1/3 revision: move -L setup before output_format-to-diff derivationMichael Montalbo via GitGitGadget, Apr 28, 2026
  3. 2/3 line-log: integrate -L output with the standard log-tree pipelineMichael Montalbo via GitGitGadget, Apr 28, 2026
  4. 3/3 line-log: allow non-patch diff formats with -LMichael Montalbo via GitGitGadget, Apr 28, 2026
  5. Junio C HamanoMay 12, 2026
  6. D. Ben KnobleMay 22, 2026
  7. 0/3 line-log: integrate -L with the standard log output pipelineMichael Montalbo via GitGitGadget, May 25, 2026
  8. 1/3 revision: move -L setup before output_format-to-diff derivationMichael Montalbo via GitGitGadget, May 25, 2026
  9. 2/3 line-log: integrate -L output with the standard log-tree pipelineMichael Montalbo via GitGitGadget, May 25, 2026
  10. 3/3 line-log: allow non-patch diff formats with -LMichael Montalbo via GitGitGadget, May 25, 2026
  11. D. Ben KnobleMay 27, 2026
  12. Junio C HamanoMay 28, 2026
  13. Michael MontalboMay 28, 2026
  14. 0/3 line-log: integrate -L with the standard log output pipelineMichael Montalbo via GitGitGadget, May 28, 2026
  15. 1/3 revision: move -L setup before output_format-to-diff derivationMichael Montalbo via GitGitGadget, May 28, 2026
  16. 2/3 line-log: integrate -L output with the standard log-tree pipelineMichael Montalbo via GitGitGadget, May 28, 2026
  17. 3/3 line-log: allow non-patch diff formats with -LMichael Montalbo via GitGitGadget, May 28, 2026
  18. Ben KnobleMay 29, 2026
  19. Junio C HamanoJun 1, 2026
  20. Michael MontalboMay 24, 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.