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

Re: [GSoC Patch 4/5] t4214: use lib-log-graph functions

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 19, 2020, 17:29 UTC
Message-ID
<xmqqpneafptt.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20200216134750.18947-4-abhishekkumar8222@gmail.com>
Abhishek Kumar <abhishekkumar8222@gmail.com> writes:
Show 34 quoted lines
> @@ -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
>  '
> ...

Unlike the previous two steps, this does seem to make the script cleaner and slightly more readable (it is still unreadable but that is mostly due to the contents of the here-doc text and cannot be helped ;-).

Previous: Abhishek KumarNext: Junio C Hamano
Message 9 of 18 in “lib-log-graph.sh: consolidate test_cmp_graph logic”
  1. 1/5 lib-log-graph.sh: consolidate test_cmp_graph logicAbhishek Kumar, Feb 16, 2020
  2. 2/5 t3430: use lib-log-graph functionsAbhishek Kumar, Feb 16, 2020
  3. Junio C HamanoFeb 19, 2020
  4. 3/5 t4215: use lib-log-graph functionsAbhishek Kumar, Feb 16, 2020
  5. Junio C HamanoFeb 19, 2020
  6. 5/5 t4202: use lib-log-graph functionsAbhishek Kumar, Feb 16, 2020
  7. Junio C HamanoFeb 19, 2020
  8. 4/5 t4214: use lib-log-graph functionsAbhishek Kumar, Feb 16, 2020
  9. Junio C HamanoFeb 19, 2020
  10. Junio C HamanoFeb 17, 2020
  11. Junio C HamanoFeb 19, 2020
  12. 0/2 Consolidate test_cmp_graph logicAbhishek Kumar, Feb 20, 2020
  13. 2/2 lib-log-graph: consolidate colored graph cmp logicAbhishek Kumar, Feb 20, 2020
  14. 1/2 lib-log-graph: consolidate test_cmp_graph logicAbhishek Kumar, Feb 20, 2020
  15. Junio C HamanoFeb 20, 2020
  16. 1/2 lib-log-graph: consolidate test_cmp_graph logicAbhishek Kumar, Feb 24, 2020
  17. 2/2 lib-log-graph: consolidate colored graph cmp logicAbhishek Kumar, Feb 24, 2020
  18. Junio C HamanoFeb 24, 2020

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.