summaryrefslogtreecommitdiff
path: root/trace2/tr2_cfg.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2021-12-02 00:37:53 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-12-01 23:10:50 -0800
commitbe738607934ceb0c99fbcc81bb1949413acd3459 (patch)
treeccd970ad0b212a1923270baf408887a74498c9c7 /trace2/tr2_cfg.c
parentlog: handle --decorate-refs with userformat "%d" (diff)
downloadtgif-be738607934ceb0c99fbcc81bb1949413acd3459.tar.xz
log: load decorations with --simplify-by-decoration
It's possible to specify --simplify-by-decoration but not --decorate. In this case we do respect the simplification, but we don't actually show any decorations. However, it works by lazy-loading the decorations when needed; this is discussed in more detail in 0cc7380d88 (log-tree: call load_ref_decorations() in get_name_decoration(), 2019-09-08). This works for basic cases, but will fail to respect any --decorate-refs option (or its variants). Those are handled only when cmd_log_init() loads the ref decorations up front, which is only when --decorate is specified explicitly (or as of the previous commit, when the userformat asks for %d or similar). We can solve this by making sure to load the decorations if we're going to simplify using them but they're not otherwise going to be displayed. The new test shows a simple case that fails without this patch. Note that we expect two commits in the output: the one we asked for by --decorate-refs, and the initial commit. The latter is just a quirk of how --simplify-by-decoration works. Arguably it may be a bug, but it's unrelated to this patch (which is just about the loading of the decorations; you get the same behavior before this patch with an explicit --decorate). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2/tr2_cfg.c')
0 files changed, 0 insertions, 0 deletions