{"thread":{"id":"24730","subject":"[PATCH v5.1 16/17] Add tests for line history browser","startedAt":"2010-08-13T15:07:33Z","lastAt":"2010-08-13T15:07:33Z","messageCount":1,"participants":["Bo Yang"],"isPatch":true,"patchVersion":5,"patchTotal":17},"messages":[{"id":"148001","messageId":"1281712053-24243-1-git-send-email-struggleyb.nku@gmail.com","threadId":"24730","inReplyTo":null,"subject":"[PATCH v5.1 16/17] Add tests for line history browser","fromName":"Bo Yang","fromEmail":"struggleyb.nku@gmail.com","sentAt":"2010-08-13T15:07:33Z","receivedAt":"2010-08-13T15:07:33Z","isPatch":true,"sender":{"key":"struggleyb.nku@gmail.com","avatar":"https://avatars.githubusercontent.com/u/233030?v=4"},"body":"t/t4301-log-line-single-history.sh:\n  test the linear line of history.\n\nt/t4302-log-line-merge-history.sh:\n  test the case that there are merges in the history.\n\nSigned-off-by: Bo Yang <struggleyb.nku@gmail.com>\n---\n t/t4301-log-line-single-history.sh |  685 ++++++++++++++++++++++++++++++++++++\n t/t4302-log-line-merge-history.sh  |  174 +++++++++\n 2 files changed, 859 insertions(+), 0 deletions(-)\n create mode 100755 t/t4301-log-line-single-history.sh\n create mode 100755 t/t4302-log-line-merge-history.sh\n\ndiff --git a/t/t4301-log-line-single-history.sh b/t/t4301-log-line-single-history.sh\nnew file mode 100755\nindex 0000000..3197ea8\n--- /dev/null\n+++ b/t/t4301-log-line-single-history.sh\n@@ -0,0 +1,685 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Bo Yang\n+#\n+\n+test_description='Test git log -L with single line of history'\n+\n+. ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/diff-lib.sh\n+\n+cat >path0 <<\\EOF\n+void func()\n+{\n+\tint a = 0;\n+\tint b = 1;\n+\tint c;\n+\tc = a + b;\n+}\n+EOF\n+\n+cat >path1 <<\\EOF\n+void output()\n+{\n+\tprintf(\"hello world\");\n+}\n+EOF\n+\n+test_expect_success 'add path0/path1 and commit.' '\n+\tgit add path0 path1 &&\n+\tgit commit -m \"Base commit\"\n+'\n+\n+cat >path0 <<\\EOF\n+void func()\n+{\n+\tint a = 10;\n+\tint b = 11;\n+\tint c;\n+\tc = a + b;\n+}\n+EOF\n+\n+cat >path1 <<\\EOF\n+void output()\n+{\n+\tconst char *str = \"hello world!\";\n+\tprintf(\"%s\", str);\n+}\n+EOF\n+\n+test_expect_success 'Change the 2,3 lines of path0 and path1.' '\n+\tgit add path0 path1 &&\n+\tgit commit -m \"Change 2,3 lines of path0 and path1\"\n+'\n+\n+cat >path0 <<\\EOF\n+void func()\n+{\n+\tint a = 10;\n+\tint b = 11;\n+\tint c;\n+\tc = 10 * (a + b);\n+}\n+EOF\n+\n+test_expect_success 'Change the 5th line of path0.' '\n+\tgit add path0 &&\n+\tgit commit -m \"Change the 5th line of path0\"\n+'\n+\n+cat >path0 <<\\EOF\n+void func()\n+{\n+\tint a = 10;\n+\tint b = 11;\n+\tprintf(\"%d\", a - b);\n+}\n+EOF\n+\n+test_expect_success 'Final change of path0.' '\n+\tgit add path0 &&\n+\tgit commit -m \"Final change of path0\"\n+'\n+\n+cat >expected-path0 <<\\EOF\n+Final change of path0\n+\n+diff --git a/path0 b/path0\n+index ccdf243..ccf8bcf 100644\n+--- a/path0\n++++ b/path0\n+@@ -1,7 +1,6 @@\n+ void func()\n+ {\n+ \tint a = 10;\n+ \tint b = 11;\n+-\tint c;\n+-\tc = 10 * (a + b);\n++\tprintf(\"%d\", a - b);\n+ }\n+\n+Change the 5th line of path0\n+\n+diff --git a/path0 b/path0\n+index b0eb888..ccdf243 100644\n+--- a/path0\n++++ b/path0\n+@@ -1,7 +1,7 @@\n+ void func()\n+ {\n+ \tint a = 10;\n+ \tint b = 11;\n+ \tint c;\n+-\tc = a + b;\n++\tc = 10 * (a + b);\n+ }\n+\n+Change 2,3 lines of path0 and path1\n+\n+diff --git a/path0 b/path0\n+index fb33939..b0eb888 100644\n+--- a/path0\n++++ b/path0\n+@@ -1,7 +1,7 @@\n+ void func()\n+ {\n+-\tint a = 0;\n+-\tint b = 1;\n++\tint a = 10;\n++\tint b = 11;\n+ \tint c;\n+ \tc = a + b;\n+ }\n+\n+Base commit\n+\n+diff --git a/path0 b/path0\n+new file mode 100644\n+index 0000000..fb33939\n+--- /dev/null\n++++ b/path0\n+@@ -0,0 +1,7 @@\n++void func()\n++{\n++\tint a = 0;\n++\tint b = 1;\n++\tint c;\n++\tc = a + b;\n++}\n+EOF\n+\n+cat >expected-path1 <<\\EOF\n+Change 2,3 lines of path0 and path1\n+\n+diff --git a/path1 b/path1\n+index 52be2a5..cc54b12 100644\n+--- a/path1\n++++ b/path1\n+@@ -1,4 +1,5 @@\n+ void output()\n+ {\n+-\tprintf(\"hello world\");\n++\tconst char *str = \"hello world!\";\n++\tprintf(\"%s\", str);\n+ }\n+\n+Base commit\n+\n+diff --git a/path1 b/path1\n+new file mode 100644\n+index 0000000..52be2a5\n+--- /dev/null\n++++ b/path1\n+@@ -0,0 +1,4 @@\n++void output()\n++{\n++\tprintf(\"hello world\");\n++}\n+EOF\n+\n+cat >expected-pathall <<\\EOF\n+Final change of path0\n+\n+diff --git a/path0 b/path0\n+index ccdf243..ccf8bcf 100644\n+--- a/path0\n++++ b/path0\n+@@ -1,7 +1,6 @@\n+ void func()\n+ {\n+ \tint a = 10;\n+ \tint b = 11;\n+-\tint c;\n+-\tc = 10 * (a + b);\n++\tprintf(\"%d\", a - b);\n+ }\n+\n+Change the 5th line of path0\n+\n+diff --git a/path0 b/path0\n+index b0eb888..ccdf243 100644\n+--- a/path0\n++++ b/path0\n+@@ -1,7 +1,7 @@\n+ void func()\n+ {\n+ \tint a = 10;\n+ \tint b = 11;\n+ \tint c;\n+-\tc = a + b;\n++\tc = 10 * (a + b);\n+ }\n+\n+Change 2,3 lines of path0 and path1\n+\n+diff --git a/path0 b/path0\n+index fb33939..b0eb888 100644\n+--- a/path0\n++++ b/path0\n+@@ -1,7 +1,7 @@\n+ void func()\n+ {\n+-\tint a = 0;\n+-\tint b = 1;\n++\tint a = 10;\n++\tint b = 11;\n+ \tint c;\n+ \tc = a + b;\n+ }\n+diff --git a/path1 b/path1\n+index 52be2a5..cc54b12 100644\n+--- a/path1\n++++ b/path1\n+@@ -1,4 +1,5 @@\n+ void output()\n+ {\n+-\tprintf(\"hello world\");\n++\tconst char *str = \"hello world!\";\n++\tprintf(\"%s\", str);\n+ }\n+\n+Base commit\n+\n+diff --git a/path0 b/path0\n+new file mode 100644\n+index 0000000..fb33939\n+--- /dev/null\n++++ b/path0\n+@@ -0,0 +1,7 @@\n++void func()\n++{\n++\tint a = 0;\n++\tint b = 1;\n++\tint c;\n++\tc = a + b;\n++}\n+diff --git a/path1 b/path1\n+new file mode 100644\n+index 0000000..52be2a5\n+--- /dev/null\n++++ b/path1\n+@@ -0,0 +1,4 @@\n++void output()\n++{\n++\tprintf(\"hello world\");\n++}\n+EOF\n+\n+cat >expected-linenum <<\\EOF\n+Change 2,3 lines of path0 and path1\n+\n+diff --git a/path0 b/path0\n+index fb33939..b0eb888 100644\n+--- a/path0\n++++ b/path0\n+@@ -2,3 +2,3 @@\n+ {\n+-\tint a = 0;\n+-\tint b = 1;\n++\tint a = 10;\n++\tint b = 11;\n+\n+Base commit\n+\n+diff --git a/path0 b/path0\n+new file mode 100644\n+index 0000000..fb33939\n+--- /dev/null\n++++ b/path0\n+@@ -0,0 +2,3 @@\n++{\n++\tint a = 0;\n++\tint b = 1;\n+EOF\n+\n+cat >expected-always <<\\EOF\n+Final change of path0\n+\n+diff --git a/path0 b/path0\n+index ccdf243..ccf8bcf 100644\n+--- a/path0\n++++ b/path0\n+@@ -2,3 +2,3 @@\n+ {\n+ \tint a = 10;\n+ \tint b = 11;\n+\n+Change the 5th line of path0\n+\n+diff --git a/path0 b/path0\n+index b0eb888..ccdf243 100644\n+--- a/path0\n++++ b/path0\n+@@ -2,3 +2,3 @@\n+ {\n+ \tint a = 10;\n+ \tint b = 11;\n+\n+Change 2,3 lines of path0 and path1\n+\n+diff --git a/path0 b/path0\n+index fb33939..b0eb888 100644\n+--- a/path0\n++++ b/path0\n+@@ -2,3 +2,3 @@\n+ {\n+-\tint a = 0;\n+-\tint b = 1;\n++\tint a = 10;\n++\tint b = 11;\n+\n+Base commit\n+\n+diff --git a/path0 b/path0\n+new file mode 100644\n+index 0000000..fb33939\n+--- /dev/null\n++++ b/path0\n+@@ -0,0 +2,3 @@\n++{\n++\tint a = 0;\n++\tint b = 1;\n+EOF\n+\n+test_expect_success 'Show the line level log of path0' '\n+\tgit log --pretty=format:%s%n%b -L /func/,/^}/ path0 > current-path0\n+'\n+\n+test_expect_success 'validate the path0 output.' '\n+\ttest_cmp current-path0 expected-path0\n+'\n+\n+test_expect_success 'Show the line level log of path1' '\n+\tgit log --pretty=format:%s%n%b -L /output/,/^}/ path1 > current-path1\n+'\n+\n+test_expect_success 'validate the path1 output.' '\n+\ttest_cmp current-path1 expected-path1\n+'\n+\n+test_expect_success 'Show the line level log of two files' '\n+\tgit log --pretty=format:%s%n%b -L /func/,/^}/ path0 -L /output/,/^}/ path1 > current-pathall\n+'\n+\n+test_expect_success 'validate the all path output.' '\n+\ttest_cmp current-pathall expected-pathall\n+'\n+\n+test_expect_success 'Test the line number argument' '\n+\tgit log --pretty=format:%s%n%b -L 2,4 path0 > current-linenum\n+'\n+\n+test_expect_success 'validate the line number output.' '\n+\ttest_cmp current-linenum expected-linenum\n+'\n+test_expect_success 'Test the --full-line-diff option' '\n+\tgit log --pretty=format:%s%n%b --full-line-diff -L 2,4 path0 > current-always\n+'\n+\n+test_expect_success 'validate the --full-line-diff output.' '\n+    test_cmp current-always expected-always\n+'\n+\n+# Rerun all log with graph\n+test_expect_success 'Show the line level log of path0 with --graph' '\n+\tgit log --pretty=format:%s%n%b --graph -L /func/,/^}/ path0 > current-path0-graph\n+'\n+\n+test_expect_success 'Show the line level log of path1 with --graph' '\n+\tgit log --pretty=format:%s%n%b --graph -L /output/,/^}/ path1 > current-path1-graph\n+'\n+\n+test_expect_success 'Show the line level log of two files with --graph' '\n+\tgit log --pretty=format:%s%n%b --graph -L /func/,/^}/ path0 --graph -L /output/,/^}/ path1 > current-pathall-graph\n+'\n+\n+test_expect_success 'Test the line number argument with --graph' '\n+\tgit log --pretty=format:%s%n%b --graph -L 2,4 path0 > current-linenum-graph\n+'\n+\n+test_expect_success 'Test the --full-line-diff option with --graph option' '\n+\tgit log --pretty=format:%s%n%b --full-line-diff --graph -L 2,4 path0 > current-always-graph\n+'\n+\n+cat > expected-path0-graph <<\\EOF\n+* Final change of path0\n+| \n+| diff --git a/path0 b/path0\n+| index ccdf243..ccf8bcf 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -1,7 +1,6 @@\n+|  void func()\n+|  {\n+|  \tint a = 10;\n+|  \tint b = 11;\n+| -\tint c;\n+| -\tc = 10 * (a + b);\n+| +\tprintf(\"%d\", a - b);\n+|  }\n+|  \n+* Change the 5th line of path0\n+| \n+| diff --git a/path0 b/path0\n+| index b0eb888..ccdf243 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -1,7 +1,7 @@\n+|  void func()\n+|  {\n+|  \tint a = 10;\n+|  \tint b = 11;\n+|  \tint c;\n+| -\tc = a + b;\n+| +\tc = 10 * (a + b);\n+|  }\n+|  \n+* Change 2,3 lines of path0 and path1\n+| \n+| diff --git a/path0 b/path0\n+| index fb33939..b0eb888 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -1,7 +1,7 @@\n+|  void func()\n+|  {\n+| -\tint a = 0;\n+| -\tint b = 1;\n+| +\tint a = 10;\n+| +\tint b = 11;\n+|  \tint c;\n+|  \tc = a + b;\n+|  }\n+|  \n+* Base commit\n+  \n+  diff --git a/path0 b/path0\n+  new file mode 100644\n+  index 0000000..fb33939\n+  --- /dev/null\n+  +++ b/path0\n+  @@ -0,0 +1,7 @@\n+  +void func()\n+  +{\n+  +\tint a = 0;\n+  +\tint b = 1;\n+  +\tint c;\n+  +\tc = a + b;\n+  +}\n+EOF\n+\n+cat > expected-path1-graph <<\\EOF\n+* Change 2,3 lines of path0 and path1\n+| \n+| diff --git a/path1 b/path1\n+| index 52be2a5..cc54b12 100644\n+| --- a/path1\n+| +++ b/path1\n+| @@ -1,4 +1,5 @@\n+|  void output()\n+|  {\n+| -\tprintf(\"hello world\");\n+| +\tconst char *str = \"hello world!\";\n+| +\tprintf(\"%s\", str);\n+|  }\n+|  \n+* Base commit\n+  \n+  diff --git a/path1 b/path1\n+  new file mode 100644\n+  index 0000000..52be2a5\n+  --- /dev/null\n+  +++ b/path1\n+  @@ -0,0 +1,4 @@\n+  +void output()\n+  +{\n+  +\tprintf(\"hello world\");\n+  +}\n+EOF\n+\n+cat > expected-pathall-graph <<\\EOF\n+* Final change of path0\n+| \n+| diff --git a/path0 b/path0\n+| index ccdf243..ccf8bcf 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -1,7 +1,6 @@\n+|  void func()\n+|  {\n+|  \tint a = 10;\n+|  \tint b = 11;\n+| -\tint c;\n+| -\tc = 10 * (a + b);\n+| +\tprintf(\"%d\", a - b);\n+|  }\n+|  \n+* Change the 5th line of path0\n+| \n+| diff --git a/path0 b/path0\n+| index b0eb888..ccdf243 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -1,7 +1,7 @@\n+|  void func()\n+|  {\n+|  \tint a = 10;\n+|  \tint b = 11;\n+|  \tint c;\n+| -\tc = a + b;\n+| +\tc = 10 * (a + b);\n+|  }\n+|  \n+* Change 2,3 lines of path0 and path1\n+| \n+| diff --git a/path0 b/path0\n+| index fb33939..b0eb888 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -1,7 +1,7 @@\n+|  void func()\n+|  {\n+| -\tint a = 0;\n+| -\tint b = 1;\n+| +\tint a = 10;\n+| +\tint b = 11;\n+|  \tint c;\n+|  \tc = a + b;\n+|  }\n+| diff --git a/path1 b/path1\n+| index 52be2a5..cc54b12 100644\n+| --- a/path1\n+| +++ b/path1\n+| @@ -1,4 +1,5 @@\n+|  void output()\n+|  {\n+| -\tprintf(\"hello world\");\n+| +\tconst char *str = \"hello world!\";\n+| +\tprintf(\"%s\", str);\n+|  }\n+|  \n+* Base commit\n+  \n+  diff --git a/path0 b/path0\n+  new file mode 100644\n+  index 0000000..fb33939\n+  --- /dev/null\n+  +++ b/path0\n+  @@ -0,0 +1,7 @@\n+  +void func()\n+  +{\n+  +\tint a = 0;\n+  +\tint b = 1;\n+  +\tint c;\n+  +\tc = a + b;\n+  +}\n+  diff --git a/path1 b/path1\n+  new file mode 100644\n+  index 0000000..52be2a5\n+  --- /dev/null\n+  +++ b/path1\n+  @@ -0,0 +1,4 @@\n+  +void output()\n+  +{\n+  +\tprintf(\"hello world\");\n+  +}\n+EOF\n+\n+cat > expected-linenum-graph <<\\EOF\n+* Change 2,3 lines of path0 and path1\n+| \n+| diff --git a/path0 b/path0\n+| index fb33939..b0eb888 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -2,3 +2,3 @@\n+|  {\n+| -\tint a = 0;\n+| -\tint b = 1;\n+| +\tint a = 10;\n+| +\tint b = 11;\n+|  \n+* Base commit\n+  \n+  diff --git a/path0 b/path0\n+  new file mode 100644\n+  index 0000000..fb33939\n+  --- /dev/null\n+  +++ b/path0\n+  @@ -0,0 +2,3 @@\n+  +{\n+  +\tint a = 0;\n+  +\tint b = 1;\n+EOF\n+\n+cat > expected-always-graph <<\\EOF\n+* Final change of path0\n+| \n+| diff --git a/path0 b/path0\n+| index ccdf243..ccf8bcf 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -2,3 +2,3 @@\n+|  {\n+|  \tint a = 10;\n+|  \tint b = 11;\n+|  \n+* Change the 5th line of path0\n+| \n+| diff --git a/path0 b/path0\n+| index b0eb888..ccdf243 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -2,3 +2,3 @@\n+|  {\n+|  \tint a = 10;\n+|  \tint b = 11;\n+|  \n+* Change 2,3 lines of path0 and path1\n+| \n+| diff --git a/path0 b/path0\n+| index fb33939..b0eb888 100644\n+| --- a/path0\n+| +++ b/path0\n+| @@ -2,3 +2,3 @@\n+|  {\n+| -\tint a = 0;\n+| -\tint b = 1;\n+| +\tint a = 10;\n+| +\tint b = 11;\n+|  \n+* Base commit\n+  \n+  diff --git a/path0 b/path0\n+  new file mode 100644\n+  index 0000000..fb33939\n+  --- /dev/null\n+  +++ b/path0\n+  @@ -0,0 +2,3 @@\n+  +{\n+  +\tint a = 0;\n+  +\tint b = 1;\n+EOF\n+\n+test_expect_success 'validate the path0 output.' '\n+\ttest_cmp current-path0-graph expected-path0-graph\n+'\n+\n+test_expect_success 'validate the path1 output.' '\n+\ttest_cmp current-path1-graph expected-path1-graph\n+'\n+\n+test_expect_success 'validate the all path output.' '\n+\ttest_cmp current-pathall-graph expected-pathall-graph\n+'\n+\n+test_expect_success 'validate graph output' '\n+\ttest_cmp current-linenum-graph expected-linenum-graph\n+'\n+\n+test_expect_success 'validate --full-line-diff output' '\n+\ttest_cmp current-always-graph expected-always-graph\n+'\n+\n+test_done\ndiff --git a/t/t4302-log-line-merge-history.sh b/t/t4302-log-line-merge-history.sh\nnew file mode 100755\nindex 0000000..8634116\n--- /dev/null\n+++ b/t/t4302-log-line-merge-history.sh\n@@ -0,0 +1,174 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Bo Yang\n+#\n+\n+test_description='Test git log -L with merge commit'\n+\n+. ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/diff-lib.sh\n+\n+cat >path0 <<\\EOF\n+void func()\n+{\n+\tprintf(\"hello\");\n+}\n+EOF\n+\n+test_expect_success 'Add path0 and commit.' '\n+\tgit add path0 &&\n+\tgit commit -m \"Base commit\"\n+'\n+\n+cat >path0 <<\\EOF\n+void func()\n+{\n+\tprintf(\"hello earth\");\n+}\n+EOF\n+\n+test_expect_success 'Change path0 in master.' '\n+\tgit add path0 &&\n+\tgit commit -m \"Change path0 in master\"\n+'\n+\n+test_expect_success 'Make a new branch from the base commit' '\n+\tgit checkout -b feature master^\n+'\n+\n+cat >path0 <<\\EOF\n+void func()\n+{\n+\tprint(\"hello moon\");\n+}\n+EOF\n+\n+test_expect_success 'Change path0 in feature.' '\n+\tgit add path0 &&\n+\tgit commit -m \"Change path0 in feature\"\n+'\n+\n+test_expect_success 'Merge the master to feature' '\n+\t! git merge master\n+'\n+\n+cat >path0 <<\\EOF\n+void func()\n+{\n+\tprintf(\"hello earth and moon\");\n+}\n+EOF\n+\n+test_expect_success 'Resolve the conflict' '\n+\tgit add path0 &&\n+\tgit commit -m \"Merge two branches\"\n+'\n+\n+test_expect_success 'Show the line level log of path0' '\n+\tgit log --pretty=format:%s%n%b -L /func/,/^}/ path0 > current\n+'\n+\n+cat >expected <<\\EOF\n+Merge two branches\n+\n+nontrivial merge found\n+path0\n+@@ 3,1 @@\n+ \tprintf(\"hello earth and moon\");\n+\n+\n+Change path0 in master\n+\n+diff --git a/path0 b/path0\n+index 56aeee5..11e66c5 100644\n+--- a/path0\n++++ b/path0\n+@@ -1,4 +1,4 @@\n+ void func()\n+ {\n+-\tprintf(\"hello\");\n++\tprintf(\"hello earth\");\n+ }\n+\n+Change path0 in feature\n+\n+diff --git a/path0 b/path0\n+index 56aeee5..258fced 100644\n+--- a/path0\n++++ b/path0\n+@@ -1,4 +1,4 @@\n+ void func()\n+ {\n+-\tprintf(\"hello\");\n++\tprint(\"hello moon\");\n+ }\n+\n+Base commit\n+\n+diff --git a/path0 b/path0\n+new file mode 100644\n+index 0000000..56aeee5\n+--- /dev/null\n++++ b/path0\n+@@ -0,0 +1,4 @@\n++void func()\n++{\n++\tprintf(\"hello\");\n++}\n+EOF\n+\n+cat > expected-graph <<\\EOF\n+*   Merge two branches\n+|\\  \n+| | \n+| | nontrivial merge found\n+| | path0\n+| | @@ 3,1 @@\n+| |  \tprintf(\"hello earth and moon\");\n+| | \n+| |   \n+| * Change path0 in master\n+| | \n+| | diff --git a/path0 b/path0\n+| | index 56aeee5..11e66c5 100644\n+| | --- a/path0\n+| | +++ b/path0\n+| | @@ -3,1 +3,1 @@\n+| | -\tprintf(\"hello\");\n+| | +\tprintf(\"hello earth\");\n+| |   \n+* | Change path0 in feature\n+|/  \n+|   \n+|   diff --git a/path0 b/path0\n+|   index 56aeee5..258fced 100644\n+|   --- a/path0\n+|   +++ b/path0\n+|   @@ -3,1 +3,1 @@\n+|   -\tprintf(\"hello\");\n+|   +\tprint(\"hello moon\");\n+|  \n+* Base commit\n+  \n+  diff --git a/path0 b/path0\n+  new file mode 100644\n+  index 0000000..56aeee5\n+  --- /dev/null\n+  +++ b/path0\n+  @@ -0,0 +3,1 @@\n+  +\tprintf(\"hello\");\n+EOF\n+\n+test_expect_success 'Show the line log of the 2 line of path0 with graph' '\n+\tgit log --pretty=format:%s%n%b --graph -L 3,+1 path0 > current-graph\n+'\n+\n+test_expect_success 'validate the output.' '\n+\ttest_cmp current expected\n+'\n+\n+test_expect_success 'validate the graph output.' '\n+\ttest_cmp current-graph expected-graph\n+'\n+\n+test_done\n-- \n1.7.2.1.113.gbd542\n"}]}