Skip to content

Commit 9633eb6

Browse files
committed
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>
1 parent 9f223ef commit 9633eb6

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

revision.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3112,6 +3112,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
31123112
object_context_release(&oc);
31133113
}
31143114

3115+
if (revs->line_level_traverse) {
3116+
if (want_ancestry(revs))
3117+
revs->limited = 1;
3118+
revs->topo_order = 1;
3119+
if (!revs->diffopt.output_format)
3120+
revs->diffopt.output_format = DIFF_FORMAT_PATCH;
3121+
}
3122+
31153123
/* Did the user ask for any diff output? Run the diff! */
31163124
if (revs->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT)
31173125
revs->diff = 1;
@@ -3125,14 +3133,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
31253133
if (revs->diffopt.objfind)
31263134
revs->simplify_history = 0;
31273135

3128-
if (revs->line_level_traverse) {
3129-
if (want_ancestry(revs))
3130-
revs->limited = 1;
3131-
revs->topo_order = 1;
3132-
if (!revs->diffopt.output_format)
3133-
revs->diffopt.output_format = DIFF_FORMAT_PATCH;
3134-
}
3135-
31363136
if (revs->topo_order && !generation_numbers_enabled(the_repository))
31373137
revs->limited = 1;
31383138

0 commit comments

Comments
 (0)