From b4ecbcf6a256e533a3e0231095758527999e7fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 8 Sep 2019 19:58:41 +0200 Subject: log: test --decorate-refs-exclude with --simplify-by-decoration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Demonstrate that a decoration filter given with --decorate-refs-exclude is inadvertently overruled by --simplify-by-decoration. Reported-by: Étienne SERVAIS Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- t/t4202-log.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't/t4202-log.sh') diff --git a/t/t4202-log.sh b/t/t4202-log.sh index c20209324c..01c95d1375 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -837,6 +837,21 @@ test_expect_success 'decorate-refs and decorate-refs-exclude' ' test_cmp expect.decorate actual ' +test_expect_failure 'decorate-refs-exclude and simplify-by-decoration' ' + cat >expect.decorate <<-\EOF && + Merge-tag-reach (HEAD -> master) + reach (tag: reach, reach) + seventh (tag: seventh) + Merge-branch-tangle + Merge-branch-side-early-part-into-tangle (tangle) + tangle-a (tag: tangle-a) + EOF + git log -n6 --decorate=short --pretty="tformat:%f%d" \ + --decorate-refs-exclude="*octopus*" \ + --simplify-by-decoration >actual && + test_cmp expect.decorate actual +' + test_expect_success 'log.decorate config parsing' ' git log --oneline --decorate=full >expect.full && git log --oneline --decorate=short >expect.short && -- cgit v1.2.3 From 0cc7380d8846c30ce0d5d6310b2cb5994f269133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 8 Sep 2019 19:58:51 +0200 Subject: log-tree: call load_ref_decorations() in get_name_decoration() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Load a default set of ref name decorations at the first lookup. This frees direct and indirect callers from doing so. They can still do it if they want to use a filter or are interested in full decorations instead of the default short ones -- the first load_ref_decorations() call wins. This means that the load in builtin/log.c::cmd_log_init_finish() is respected even if --simplify-by-decoration is given, as the previously dominating earlier load in handle_revision_opt() is gone. So a filter given with --decorate-refs-exclude is used for simplification in that case, as expected. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- t/t4202-log.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t4202-log.sh') diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 01c95d1375..bb66d1d93c 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -837,7 +837,7 @@ test_expect_success 'decorate-refs and decorate-refs-exclude' ' test_cmp expect.decorate actual ' -test_expect_failure 'decorate-refs-exclude and simplify-by-decoration' ' +test_expect_success 'decorate-refs-exclude and simplify-by-decoration' ' cat >expect.decorate <<-\EOF && Merge-tag-reach (HEAD -> master) reach (tag: reach, reach) -- cgit v1.2.3