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

[PATCH] Add tests for "Pass graph width to pretty formatting, so '%>|' can work properly"

From
Josef Kufner <josef@kufner.cz>
Date
Sep 11, 2015, 20:22 UTC
Message-ID
<1442002952-8834-1-git-send-email-josef@kufner.cz>
In-Reply-To
<CAPig+cRkSRSC0eaBencw8cFrd64sUBQE44aSJ0T2WyPg2JTFCw@mail.gmail.com>
Signed-off-by: Josef Kufner <josef@kufner.cz>
---
 t/t4205-log-pretty-formats.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index 7398605..3358837 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -319,6 +319,18 @@ EOF
 	test_cmp expected actual
 '
 
+# Note: Space between 'message' and 'two' should be in the same column as in previous test.
+test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '
+	git -c i18n.logOutputEncoding=$test_encoding log --graph --pretty="tformat:%h %>|(40)%s" >actual &&
+	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
+* $head1                    message two
+* $head2                    message one
+* $head3                        add bar
+* $head4            $(commit_msg)
+EOF
+	test_cmp expected actual
+'
+
 test_expect_success 'right alignment formatting with no padding' '
 	git log --pretty="tformat:%>(1)%s" >actual &&
 	cat <<EOF >expected &&
@@ -330,6 +342,17 @@ EOF
 	test_cmp expected actual
 '
 
+test_expect_success 'right alignment formatting with no padding and with --graph' '
+	git log --graph --pretty="tformat:%>(1)%s" >actual &&
+	cat <<EOF >expected &&
+* message two
+* message one
+* add bar
+* $(commit_msg)
+EOF
+	test_cmp expected actual
+'
+
 test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' '
 	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual &&
 	cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
-- 
2.5.1
Previous: Junio C HamanoNext: Josef Kufner
Message 6 of 8 in “Pass graph width to pretty formatting, so '%>|' can work properly”
  1. Pass graph width to pretty formatting, so '%>|' can work properlyJosef Kufner, Sep 11, 2015
  2. Junio C HamanoSep 11, 2015
  3. Add tests for "Pass graph width to pretty formatting, so '%>|' can work properly"Josef Kufner, Sep 11, 2015
  4. Eric SunshineSep 11, 2015
  5. Junio C HamanoSep 11, 2015
  6. Add tests for "Pass graph width to pretty formatting, so '%>|' can work properly"Josef Kufner, Sep 11, 2015
  7. Josef KufnerSep 11, 2015
  8. Josef KufnerSep 11, 2015

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.