From: Abhishek Kumar <abhishekkumar8222@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [GSoC Patch 4/5] t4214: use lib-log-graph functions
Date: Sun, 16 Feb 2020 19:17:49 +0530 [thread overview]
Message-ID: <20200216134750.18947-4-abhishekkumar8222@gmail.com> (raw)
In-Reply-To: <20200216134750.18947-1-abhishekkumar8222@gmail.com>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Abhishek Kumar <abhishekkumar8222@gmail.com>
---
t/t4214-log-graph-octopus.sh | 86 ++++++++----------------------------
1 file changed, 19 insertions(+), 67 deletions(-)
diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh
index 40d27db674..e85cf07d2c 100755
--- a/t/t4214-log-graph-octopus.sh
+++ b/t/t4214-log-graph-octopus.sh
@@ -3,6 +3,7 @@
test_description='git log --graph of skewed left octopus merge.'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-log-graph.sh
test_expect_success 'set up merge history' '
test_commit initial &&
@@ -24,7 +25,7 @@ test_expect_success 'set up merge history' '
'
test_expect_success 'log --graph with tricky octopus merge, no color' '
- cat >expect.uncolored <<-\EOF &&
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order left octopus-merge <<-\EOF
* left
| *-. octopus-merge
|/|\ \
@@ -37,14 +38,11 @@ test_expect_success 'log --graph with tricky octopus merge, no color' '
|/
* initial
EOF
- git log --color=never --graph --date-order --pretty=tformat:%s left octopus-merge >actual.raw &&
- sed "s/ *\$//" actual.raw >actual &&
- test_cmp expect.uncolored actual
'
test_expect_success 'log --graph with tricky octopus merge with colors' '
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
- cat >expect.colors <<-\EOF &&
+ test_cmp_colored_graph --pretty=tformat:%s --date-order left octopus-merge <<-\EOF
* left
<RED>|<RESET> *<MAGENTA>-<RESET><MAGENTA>.<RESET> octopus-merge
<RED>|<RESET><RED>/<RESET><YELLOW>|<RESET><BLUE>\<RESET> <MAGENTA>\<RESET>
@@ -57,16 +55,13 @@ test_expect_success 'log --graph with tricky octopus merge with colors' '
<MAGENTA>|<RESET><MAGENTA>/<RESET>
* initial
EOF
- git log --color=always --graph --date-order --pretty=tformat:%s left octopus-merge >actual.colors.raw &&
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
- test_cmp expect.colors actual.colors
'
# Repeat the previous two tests with "normal" octopus merge (i.e.,
# without the first parent skewing to the "left" branch column).
test_expect_success 'log --graph with normal octopus merge, no color' '
- cat >expect.uncolored <<-\EOF &&
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order octopus-merge <<-\EOF
*---. octopus-merge
|\ \ \
| | | * 4
@@ -78,13 +73,11 @@ test_expect_success 'log --graph with normal octopus merge, no color' '
|/
* initial
EOF
- git log --color=never --graph --date-order --pretty=tformat:%s octopus-merge >actual.raw &&
- sed "s/ *\$//" actual.raw >actual &&
- test_cmp expect.uncolored actual
'
test_expect_success 'log --graph with normal octopus merge with colors' '
- cat >expect.colors <<-\EOF &&
+ test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
+ test_cmp_colored_graph --pretty=tformat:%s --date-order octopus-merge <<-\EOF
*<YELLOW>-<RESET><YELLOW>-<RESET><BLUE>-<RESET><BLUE>.<RESET> octopus-merge
<RED>|<RESET><GREEN>\<RESET> <YELLOW>\<RESET> <BLUE>\<RESET>
<RED>|<RESET> <GREEN>|<RESET> <YELLOW>|<RESET> * 4
@@ -96,14 +89,10 @@ test_expect_success 'log --graph with normal octopus merge with colors' '
<BLUE>|<RESET><BLUE>/<RESET>
* initial
EOF
- test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
- git log --color=always --graph --date-order --pretty=tformat:%s octopus-merge >actual.colors.raw &&
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
- test_cmp expect.colors actual.colors
'
test_expect_success 'log --graph with normal octopus merge and child, no color' '
- cat >expect.uncolored <<-\EOF &&
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order after-merge <<-\EOF
* after-merge
*---. octopus-merge
|\ \ \
@@ -116,13 +105,11 @@ test_expect_success 'log --graph with normal octopus merge and child, no color'
|/
* initial
EOF
- git log --color=never --graph --date-order --pretty=tformat:%s after-merge >actual.raw &&
- sed "s/ *\$//" actual.raw >actual &&
- test_cmp expect.uncolored actual
'
test_expect_success 'log --graph with normal octopus and child merge with colors' '
- cat >expect.colors <<-\EOF &&
+ test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-merge <<-\EOF
* after-merge
*<BLUE>-<RESET><BLUE>-<RESET><MAGENTA>-<RESET><MAGENTA>.<RESET> octopus-merge
<GREEN>|<RESET><YELLOW>\<RESET> <BLUE>\<RESET> <MAGENTA>\<RESET>
@@ -135,14 +122,10 @@ test_expect_success 'log --graph with normal octopus and child merge with colors
<MAGENTA>|<RESET><MAGENTA>/<RESET>
* initial
EOF
- test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
- git log --color=always --graph --date-order --pretty=tformat:%s after-merge >actual.colors.raw &&
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
- test_cmp expect.colors actual.colors
'
test_expect_success 'log --graph with tricky octopus merge and its child, no color' '
- cat >expect.uncolored <<-\EOF &&
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order left after-merge <<-\EOF
* left
| * after-merge
| *-. octopus-merge
@@ -156,14 +139,10 @@ test_expect_success 'log --graph with tricky octopus merge and its child, no col
|/
* initial
EOF
- git log --color=never --graph --date-order --pretty=tformat:%s left after-merge >actual.raw &&
- sed "s/ *\$//" actual.raw >actual &&
- test_cmp expect.uncolored actual
'
test_expect_success 'log --graph with tricky octopus merge and its child with colors' '
- test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
- cat >expect.colors <<-\EOF &&
+ test_cmp_colored_graph --pretty=tformat:%s --date-order left after-merge <<-\EOF
* left
<RED>|<RESET> * after-merge
<RED>|<RESET> *<CYAN>-<RESET><CYAN>.<RESET> octopus-merge
@@ -177,13 +156,10 @@ test_expect_success 'log --graph with tricky octopus merge and its child with co
<CYAN>|<RESET><CYAN>/<RESET>
* initial
EOF
- git log --color=always --graph --date-order --pretty=tformat:%s left after-merge >actual.colors.raw &&
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
- test_cmp expect.colors actual.colors
'
test_expect_success 'log --graph with crossover in octopus merge, no color' '
- cat >expect.uncolored <<-\EOF &&
+ test_cmp_graph --pretty=tformat:%s --date-order after-4 octopus-merge <<-\EOF
* after-4
| *---. octopus-merge
| |\ \ \
@@ -200,14 +176,11 @@ test_expect_success 'log --graph with crossover in octopus merge, no color' '
|/
* initial
EOF
- git log --color=never --graph --date-order --pretty=tformat:%s after-4 octopus-merge >actual.raw &&
- sed "s/ *\$//" actual.raw >actual &&
- test_cmp expect.uncolored actual
'
test_expect_success 'log --graph with crossover in octopus merge with colors' '
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
- cat >expect.colors <<-\EOF &&
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-4 octopus-merge <<-\EOF
* after-4
<RED>|<RESET> *<BLUE>-<RESET><BLUE>-<RESET><RED>-<RESET><RED>.<RESET> octopus-merge
<RED>|<RESET> <GREEN>|<RESET><YELLOW>\<RESET> <BLUE>\<RESET> <RED>\<RESET>
@@ -224,13 +197,10 @@ test_expect_success 'log --graph with crossover in octopus merge with colors' '
<MAGENTA>|<RESET><MAGENTA>/<RESET>
* initial
EOF
- git log --color=always --graph --date-order --pretty=tformat:%s after-4 octopus-merge >actual.colors.raw &&
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
- test_cmp expect.colors actual.colors
'
test_expect_success 'log --graph with crossover in octopus merge and its child, no color' '
- cat >expect.uncolored <<-\EOF &&
+ test_cmp_graph --pretty=tformat:%s --date-order after-4 after-merge <<-\EOF
* after-4
| * after-merge
| *---. octopus-merge
@@ -248,14 +218,11 @@ test_expect_success 'log --graph with crossover in octopus merge and its child,
|/
* initial
EOF
- git log --color=never --graph --date-order --pretty=tformat:%s after-4 after-merge >actual.raw &&
- sed "s/ *\$//" actual.raw >actual &&
- test_cmp expect.uncolored actual
'
test_expect_success 'log --graph with crossover in octopus merge and its child with colors' '
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
- cat >expect.colors <<-\EOF &&
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-4 after-merge <<-\EOF
* after-4
<RED>|<RESET> * after-merge
<RED>|<RESET> *<MAGENTA>-<RESET><MAGENTA>-<RESET><RED>-<RESET><RED>.<RESET> octopus-merge
@@ -273,13 +240,10 @@ test_expect_success 'log --graph with crossover in octopus merge and its child w
<CYAN>|<RESET><CYAN>/<RESET>
* initial
EOF
- git log --color=always --graph --date-order --pretty=tformat:%s after-4 after-merge >actual.colors.raw &&
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
- test_cmp expect.colors actual.colors
'
test_expect_success 'log --graph with unrelated commit and octopus tip, no color' '
- cat >expect.uncolored <<-\EOF &&
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order --pretty=tformat:%s after-initial octopus-merge <<-\EOF
* after-initial
| *---. octopus-merge
| |\ \ \
@@ -296,14 +260,11 @@ test_expect_success 'log --graph with unrelated commit and octopus tip, no color
|/
* initial
EOF
- git log --color=never --graph --date-order --pretty=tformat:%s after-initial octopus-merge >actual.raw &&
- sed "s/ *\$//" actual.raw >actual &&
- test_cmp expect.uncolored actual
'
test_expect_success 'log --graph with unrelated commit and octopus tip with colors' '
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
- cat >expect.colors <<-\EOF &&
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-initial octopus-merge <<-\EOF
* after-initial
<RED>|<RESET> *<BLUE>-<RESET><BLUE>-<RESET><MAGENTA>-<RESET><MAGENTA>.<RESET> octopus-merge
<RED>|<RESET> <GREEN>|<RESET><YELLOW>\<RESET> <BLUE>\<RESET> <MAGENTA>\<RESET>
@@ -320,13 +281,10 @@ test_expect_success 'log --graph with unrelated commit and octopus tip with colo
<RED>|<RESET><RED>/<RESET>
* initial
EOF
- git log --color=always --graph --date-order --pretty=tformat:%s after-initial octopus-merge >actual.colors.raw &&
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
- test_cmp expect.colors actual.colors
'
test_expect_success 'log --graph with unrelated commit and octopus child, no color' '
- cat >expect.uncolored <<-\EOF &&
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order after-initial after-merge <<-\EOF
* after-initial
| * after-merge
| *---. octopus-merge
@@ -344,14 +302,11 @@ test_expect_success 'log --graph with unrelated commit and octopus child, no col
|/
* initial
EOF
- git log --color=never --graph --date-order --pretty=tformat:%s after-initial after-merge >actual.raw &&
- sed "s/ *\$//" actual.raw >actual &&
- test_cmp expect.uncolored actual
'
test_expect_success 'log --graph with unrelated commit and octopus child with colors' '
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
- cat >expect.colors <<-\EOF &&
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-initial after-merge <<-\EOF
* after-initial
<RED>|<RESET> * after-merge
<RED>|<RESET> *<MAGENTA>-<RESET><MAGENTA>-<RESET><CYAN>-<RESET><CYAN>.<RESET> octopus-merge
@@ -369,9 +324,6 @@ test_expect_success 'log --graph with unrelated commit and octopus child with co
<RED>|<RESET><RED>/<RESET>
* initial
EOF
- git log --color=always --graph --date-order --pretty=tformat:%s after-initial after-merge >actual.colors.raw &&
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
- test_cmp expect.colors actual.colors
'
test_done
--
2.25.0
next prev parent reply other threads:[~2020-02-16 13:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-16 13:47 [GSoC Patch 1/5] lib-log-graph.sh: consolidate test_cmp_graph logic Abhishek Kumar
2020-02-16 13:47 ` [GSoC Patch 2/5] t3430: use lib-log-graph functions Abhishek Kumar
2020-02-19 17:23 ` Junio C Hamano
2020-02-16 13:47 ` [GSoC Patch 3/5] t4215: " Abhishek Kumar
2020-02-19 17:26 ` Junio C Hamano
2020-02-16 13:47 ` Abhishek Kumar [this message]
2020-02-19 17:29 ` [GSoC Patch 4/5] t4214: " Junio C Hamano
2020-02-16 13:47 ` [GSoC Patch 5/5] t4202: " Abhishek Kumar
2020-02-19 17:31 ` Junio C Hamano
2020-02-17 0:05 ` [GSoC Patch 1/5] lib-log-graph.sh: consolidate test_cmp_graph logic Junio C Hamano
2020-02-19 17:32 ` Junio C Hamano
2020-02-20 9:15 ` [GSoC PATCH v2 0/2] Consolidate " Abhishek Kumar
2020-02-20 9:15 ` [GSoC PATCH v2 1/2] lib-log-graph: consolidate " Abhishek Kumar
2020-02-20 17:49 ` Junio C Hamano
2020-02-20 9:15 ` [PATCH v2 2/2] lib-log-graph: consolidate colored graph cmp logic Abhishek Kumar
2020-02-24 13:38 ` [GSoC Patch v3 1/2] lib-log-graph: consolidate test_cmp_graph logic Abhishek Kumar
2020-02-24 13:38 ` [GSoC Patch v3 2/2] lib-log-graph: consolidate colored graph cmp logic Abhishek Kumar
2020-02-24 21:17 ` [GSoC Patch v3 1/2] lib-log-graph: consolidate test_cmp_graph logic Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200216134750.18947-4-abhishekkumar8222@gmail.com \
--to=abhishekkumar8222@gmail.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).