]> git.ipfire.org Git - thirdparty/git.git/commit
revision: move -L setup before output_format-to-diff derivation
authorMichael Montalbo <mmontalbo@gmail.com>
Mon, 25 May 2026 19:40:56 +0000 (19:40 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 May 2026 22:57:49 +0000 (07:57 +0900)
commita6969f90a502a83d53af5a293e203ac5b41996d2
tree137ac4d0b7ab96eed7cd4510edf9099fda6c6bf7
parent94f057755b7941b321fd11fec1b2e3ca5313a4e0
revision: move -L setup before output_format-to-diff derivation

The line_level_traverse block sets a default DIFF_FORMAT_PATCH when
no output format has been explicitly requested.  This default must
be visible to the "Did the user ask for any diff output?" check
that derives revs->diff from revs->diffopt.output_format.

Currently the -L block runs after that derivation, so revs->diff
stays 0 when no explicit format is given.  This does not matter yet
because log_tree_commit() short-circuits into line_log_print()
before consulting revs->diff, but the next commit will route -L
through the normal log_tree_diff() path, which checks revs->diff.

Move the block above the derivation so the default DIFF_FORMAT_PATCH
is in place when revs->diff is computed.  No behavior change on its
own.

Signed-off-by: Michael Montalbo <mmontalbo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c