git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] log: decorate HEAD -> branch with the same color for branch and HEAD

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jun 30, 2016, 16:39 UTC
Message-ID
<20160630163942.8353-1-pclouds@gmail.com>

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 ", "). It's too subtle for my poor eyes. If color is used, we can make the branch name's color the same as HEAD to visually emphasize that it's the current branch.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 For the original discussion of 76c61fb see
 http://thread.gmane.org/gmane.comp.version-control.git/263922
 log-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log-tree.c b/log-tree.c
index 78a5381..440e7cc 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -267,7 +267,7 @@ void format_decorations_extended(struct strbuf *sb,
 				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));
+				strbuf_addstr(sb, decorate_get_color(use_color, DECORATION_REF_HEAD));
 				show_name(sb, current_and_HEAD);
 			}
 			strbuf_addstr(sb, color_reset);
-- 
2.8.2.531.gd073806
Next: Duy Nguyen
Message 1 of 6 in “log: decorate HEAD -> branch with the same color for branch and HEAD”
  1. log: decorate HEAD -> branch with the same color for branch and HEADNguyễn Thái Ngọc Duy, Jun 30, 2016
  2. Duy NguyenJun 30, 2016
  3. Jeff KingJul 1, 2016
  4. Michael J GruberJul 1, 2016
  5. Duy NguyenJul 1, 2016
  6. log: decorate HEAD -> branch with the same color for arrow and HEADNguyễn Thái Ngọc Duy, Jul 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.