]> git.ipfire.org Git - thirdparty/git.git/commitdiff
log: decorate HEAD -> branch with the same color for arrow and HEAD
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 9 Jul 2016 12:49:49 +0000 (14:49 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Jul 2016 22:08:26 +0000 (15:08 -0700)
Commit 76c61fb (log: decorate HEAD with branch name under
--decorate=full, too - 2015-05-13) adds "HEAD -> branch" decoration to
show current branch vs detached HEAD. The sign of whether HEAD is
detached or not is "->" (vs ",") because the branch is always colored
by type. Color the arrow the same as HEAD to visually emphasize that
the following branch is HEAD, without paying too much attention to the
actual separators "->" or ","

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
log-tree.c
t/t4207-log-decoration-colors.sh

index 01beb11f65b518e382fa01f18f03c5a9f2ddf529..c70f992a963945610051bcbe20463da2e21d0dbf 100644 (file)
@@ -263,8 +263,6 @@ void format_decorations_extended(struct strbuf *sb,
 
                        if (current_and_HEAD &&
                            decoration->type == DECORATION_REF_HEAD) {
-                               strbuf_addstr(sb, color_reset);
-                               strbuf_addstr(sb, color_commit);
                                strbuf_addstr(sb, " -> ");
                                strbuf_addstr(sb, color_reset);
                                strbuf_addstr(sb, decorate_get_color(use_color, current_and_HEAD->type));
index f8008b6a3d2a5fc200665998288d121d1c35dd25..b972296f0634144defe5a7a083c5607893a7ca10 100755 (executable)
@@ -44,7 +44,7 @@ test_expect_success setup '
 '
 
 cat >expected <<EOF
-${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD${c_reset}${c_commit} ->\
+${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD ->\
  ${c_reset}${c_branch}master${c_reset}${c_commit},\
  ${c_reset}${c_tag}tag: v1.0${c_reset}${c_commit},\
  ${c_reset}${c_tag}tag: B${c_reset}${c_commit})${c_reset} B