From 73c727d69f47572bf7f21fa31831f9a3fdad944c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Thu, 19 Jan 2017 18:41:23 +0700 Subject: log --graph: customize the graph lines with config log.graphColors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- t/t4202-log.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 't/t4202-log.sh') diff --git a/t/t4202-log.sh b/t/t4202-log.sh index e2db47c36e..0aeabed96d 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -313,6 +313,28 @@ test_expect_success 'log --graph with merge' ' test_cmp expect actual ' +cat > expect.colors <<\EOF +* Merge branch 'side' +|\ +| * side-2 +| * side-1 +* | Second +* | sixth +* | fifth +* | fourth +|/ +* third +* second +* initial +EOF + +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 -- cgit v1.2.3