path: root/t/
diff options
authorNguyễn Thái Ngọc Duy <>2017-01-19 11:41:23 (GMT)
committerJunio C Hamano <>2017-01-24 02:32:11 (GMT)
commit73c727d69f47572bf7f21fa31831f9a3fdad944c (patch)
tree21e0d482c895a0aa7ea14ffb05630eb0f7c378a0 /t/
parentbc4075653e3f704f0440ec54e16f88fbc39a682d (diff)
log --graph: customize the graph lines with config log.graphColors
If you have a 256 colors terminal (or one with true color support), then the predefined 12 colors seem limited. On the other hand, you don't want to draw graph lines with every single color in this mode because the two colors could look extremely similar. This option allows you to hand pick the colors you want. Even with standard terminal, if your background color is neither black or white, then the graph line may match your background and become hidden. You can exclude your background color (or simply the colors you hate) with this. Signed-off-by: Nguyễn Thái Ngọc Duy <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 22 insertions, 0 deletions
diff --git a/t/ b/t/
index e2db47c..0aeabed 100755
--- a/t/
+++ b/t/
@@ -313,6 +313,28 @@ test_expect_success 'log --graph with merge' '
test_cmp expect actual
+cat > expect.colors <<\EOF
+* Merge branch 'side'
+<BLUE>|<RESET> * side-2
+<BLUE>|<RESET> * side-1
+* <CYAN>|<RESET> Second
+* <CYAN>|<RESET> sixth
+* <CYAN>|<RESET> fifth
+* <CYAN>|<RESET> fourth
+* third
+* second
+* initial
+test_expect_success 'log --graph with merge with log.graphColors' '
+ test_config log.graphColors ",, blue,invalid-color, cyan, red , " &&
+ git log --color=always --graph --date-order --pretty=tformat:%s |
+ test_decode_color | sed "s/ *\$//" >actual &&
+ test_cmp expect.colors actual
test_expect_success 'log --raw --graph -m with merge' '
git log --raw --graph --oneline -m master | head -n 500 >actual &&
grep "initial" actual