Skip to content

Commit ed68228

Browse files
committed
Merge branch 'rs/simplify-by-deco-with-deco-refs-exclude'
"git log --decorate-refs-exclude=<pattern>" was incorrectly overruled when the "--simplify-by-decoration" option is used, which has been corrected. * rs/simplify-by-deco-with-deco-refs-exclude: log-tree: call load_ref_decorations() in get_name_decoration() log: test --decorate-refs-exclude with --simplify-by-decoration
2 parents ad8f036 + 0cc7380 commit ed68228

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

log-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ void add_name_decoration(enum decoration_type type, const char *name, struct obj
7777

7878
const struct name_decoration *get_name_decoration(const struct object *obj)
7979
{
80+
load_ref_decorations(NULL, DECORATE_SHORT_REFS);
8081
return lookup_decoration(&name_decoration, obj);
8182
}
8283

pretty.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,11 +1239,9 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
12391239
strbuf_addstr(sb, get_revision_mark(NULL, commit));
12401240
return 1;
12411241
case 'd':
1242-
load_ref_decorations(NULL, DECORATE_SHORT_REFS);
12431242
format_decorations(sb, commit, c->auto_color);
12441243
return 1;
12451244
case 'D':
1246-
load_ref_decorations(NULL, DECORATE_SHORT_REFS);
12471245
format_decorations_extended(sb, commit, c->auto_color, "", ", ", "");
12481246
return 1;
12491247
case 'S': /* tag/branch like --source */

revision.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
20612061
revs->simplify_by_decoration = 1;
20622062
revs->limited = 1;
20632063
revs->prune = 1;
2064-
load_ref_decorations(NULL, DECORATE_SHORT_REFS);
20652064
} else if (!strcmp(arg, "--date-order")) {
20662065
revs->sort_order = REV_SORT_BY_COMMIT_DATE;
20672066
revs->topo_order = 1;

t/t4202-log.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,21 @@ test_expect_success 'decorate-refs and decorate-refs-exclude' '
837837
test_cmp expect.decorate actual
838838
'
839839

840+
test_expect_success 'decorate-refs-exclude and simplify-by-decoration' '
841+
cat >expect.decorate <<-\EOF &&
842+
Merge-tag-reach (HEAD -> master)
843+
reach (tag: reach, reach)
844+
seventh (tag: seventh)
845+
Merge-branch-tangle
846+
Merge-branch-side-early-part-into-tangle (tangle)
847+
tangle-a (tag: tangle-a)
848+
EOF
849+
git log -n6 --decorate=short --pretty="tformat:%f%d" \
850+
--decorate-refs-exclude="*octopus*" \
851+
--simplify-by-decoration >actual &&
852+
test_cmp expect.decorate actual
853+
'
854+
840855
test_expect_success 'log.decorate config parsing' '
841856
git log --oneline --decorate=full >expect.full &&
842857
git log --oneline --decorate=short >expect.short &&

0 commit comments

Comments
 (0)