]> Kevux Git Server - rit/commit
revision: move -L setup before output_format-to-diff derivation
authorMichael Montalbo <mmontalbo@gmail.com>
Thu, 28 May 2026 20:47:44 +0000 (20:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 May 2026 05:06:21 +0000 (14:06 +0900)
commit558057cf4f43ea3b28c5e0b1b2250cab362f1a6a
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