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

Re: [GSoC Patch 1/5] lib-log-graph.sh: consolidate test_cmp_graph logic

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 19, 2020, 17:32 UTC
Message-ID
<xmqqh7zmfpod.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<xmqqk14mm61r.fsf@gitster-ct.c.googlers.com>

Here is what I said in the message I am responding to in the patch form.

 t/lib-log-graph.sh | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/t/lib-log-graph.sh b/t/lib-log-graph.sh
index 999f2600de..bc70f01e84 100644
--- a/t/lib-log-graph.sh
+++ b/t/lib-log-graph.sh
@@ -1,6 +1,12 @@
 # Helpers shared by the test scripts for comparing log graphs.
 
-sanitize_output() {
+sanitize_output () {
+	# Versions of Git that predate 7f814632 ("Use correct grammar
+	# in diffstat summary line", 2012-02-01) did not correctly use
+	# singular when one path was involved, and a handful of rules
+	# were added to work with both older and newer versions of Git
+	# back then.  These are probably not relevant anymore, and
+	# we'd want to lose them someday...
 	sed -e 's/ *$//' \
 	    -e 's/commit [0-9a-f]*$/commit COMMIT_OBJECT_NAME/' \
 	    -e 's/Merge: [ 0-9a-f]*$/Merge: MERGE_PARENTS/' \
@@ -15,25 +21,25 @@ sanitize_output() {
 }
 
 # Assume expected graph is in file `expect`
-test_cmp_graph_file() {
+test_cmp_graph_file () {
 	git log --graph "$@" >output &&
-	sanitize_output >output.trimmed <output &&
-	test_i18ncmp expect output.trimmed
+	sanitize_output >output.sanitized <output &&
+	test_i18ncmp expect output.sanitized
 }
 
-test_cmp_graph() {
+test_cmp_graph () {
 	cat >expect &&
 	test_cmp_graph_file "$@"
 }
 
 # Assume expected graph is in file `expect.colors`
-test_cmp_colored_graph_file() {
+test_cmp_colored_graph_file () {
 	git log --graph --color=always "$@" >output.colors.raw &&
 	test_decode_color <output.colors.raw | sed "s/ *\$//" >output.colors &&
 	test_cmp expect.colors output.colors
 }
 
-test_cmp_colored_graph() {
+test_cmp_colored_graph () {
 	cat >expect.colors &&
 	test_cmp_colored_graph_file "$@"
 }
-- 
2.25.1-440-g39558b81cc
Previous: Junio C HamanoNext: Abhishek Kumar
Message 11 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.