{"thread":{"id":"30273","subject":"[PATCH v4 1/4] t4052: test --stat output with --graph","startedAt":"2012-04-18T02:29:47Z","lastAt":"2012-04-29T21:28:34Z","messageCount":17,"participants":["Lucian Poston","Zbigniew Jędrzejewski-Szmek","Junio C Hamano","Kacper Kornet","Stefano Lattarini"],"isPatch":true,"patchVersion":4,"patchTotal":4},"messages":[{"id":"189595","messageId":"1334716196-9870-1-git-send-email-lucian.poston@gmail.com","threadId":"30273","inReplyTo":null,"subject":"[PATCH v4 1/4] t4052: test --stat output with --graph","fromName":"Lucian Poston","fromEmail":"lucian.poston@gmail.com","sentAt":"2012-04-18T02:29:47Z","receivedAt":"2012-04-18T02:29:47Z","isPatch":true,"sender":{"key":"lucian.poston@gmail.com","avatar":"https://avatars.githubusercontent.com/u/646121?v=4"},"body":"From: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\n\nAdd tests which show that the width of the --prefix added by --graph\nis not taken into consideration when the diff stat output width is\ncalculated.\n\nSigned-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\nSigned-off-by: Lucian Poston <lucian.poston@gmail.com>\n---\n t/t4052-stat-output.sh |   78 +++++++++++++++++++++++++++++++++++++++++++++--\n 1 files changed, 74 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh\nindex 328aa8f..da14984 100755\n--- a/t/t4052-stat-output.sh\n+++ b/t/t4052-stat-output.sh\n@@ -82,11 +82,15 @@ test_expect_success 'preparation for big change tests' '\n cat >expect80 <<'EOF'\n  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n-\n+cat >expect80-graph <<'EOF'\n+|  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+EOF\n cat >expect200 <<'EOF'\n  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n-\n+cat >expect200-graph <<'EOF'\n+|  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+EOF\n while read verb expect cmd args\n do\n \ttest_expect_success \"$cmd $verb COLUMNS (big change)\" '\n@@ -94,6 +98,14 @@ do\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect\" actual\n \t'\n+\n+\ttest \"$cmd\" != diff || continue\n+\n+\ttest_expect_success \"$cmd --graph $verb COLUMNS (big change)\" '\n+\t\tCOLUMNS=200 git $cmd $args --graph >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect-graph\" actual\n+\t'\n done <<\\EOF\n ignores expect80 format-patch -1 --stdout\n respects expect200 diff HEAD^ HEAD --stat\n@@ -104,7 +116,9 @@ EOF\n cat >expect40 <<'EOF'\n  abcd | 1000 ++++++++++++++++++++++++++\n EOF\n-\n+cat >expect40-graph <<'EOF'\n+|  abcd | 1000 ++++++++++++++++++++++++++\n+EOF\n while read verb expect cmd args\n do\n \ttest_expect_success \"$cmd $verb not enough COLUMNS (big change)\" '\n@@ -118,6 +132,20 @@ do\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect\" actual\n \t'\n+\n+\ttest \"$cmd\" != diff || continue\n+\n+\ttest_expect_success \"$cmd --graph $verb not enough COLUMNS (big change)\" '\n+\t\tCOLUMNS=40 git $cmd $args --graph >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect-graph\" actual\n+\t'\n+\n+\ttest_expect_success \"$cmd --graph $verb statGraphWidth config\" '\n+\t\tgit -c diff.statGraphWidth=26 $cmd $args --graph >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect-graph\" actual\n+\t'\n done <<\\EOF\n ignores expect80 format-patch -1 --stdout\n respects expect40 diff HEAD^ HEAD --stat\n@@ -129,6 +157,9 @@ EOF\n cat >expect <<'EOF'\n  abcd | 1000 ++++++++++++++++++++++++++\n EOF\n+cat >expect-graph <<'EOF'\n+|  abcd | 1000 ++++++++++++++++++++++++++\n+EOF\n while read cmd args\n do\n \ttest_expect_success \"$cmd --stat=width with big change\" '\n@@ -143,11 +174,25 @@ do\n \t\ttest_cmp expect actual\n \t'\n \n-\ttest_expect_success \"$cmd --stat-graph--width with big change\" '\n+\ttest_expect_success \"$cmd --stat-graph-width with big change\" '\n \t\tgit $cmd $args --stat-graph-width=26 >output\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp expect actual\n \t'\n+\n+\ttest \"$cmd\" != diff || continue\n+\n+\ttest_expect_success \"$cmd --stat-width=width --graph with big change\" '\n+\t\tgit $cmd $args --stat-width=40 --graph >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp expect-graph actual\n+\t'\n+\n+\ttest_expect_success \"$cmd --stat-graph-width --graph with big change\" '\n+\t\tgit $cmd $args --stat-graph-width=26 --graph >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp expect-graph actual\n+\t'\n done <<\\EOF\n format-patch -1 --stdout\n diff HEAD^ HEAD --stat\n@@ -164,6 +209,9 @@ test_expect_success 'preparation for long filename tests' '\n cat >expect <<'EOF'\n  ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++\n EOF\n+cat >expect-graph <<'EOF'\n+|  ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++\n+EOF\n while read cmd args\n do\n \ttest_expect_success \"$cmd --stat=width with big change is more balanced\" '\n@@ -171,6 +219,14 @@ do\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp expect actual\n \t'\n+\n+\ttest \"$cmd\" != diff || continue\n+\n+\ttest_expect_success \"$cmd --stat=width --graph with big change is balanced\" '\n+\t\tgit $cmd $args --stat-width=60 --graph >output &&\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp expect-graph actual\n+\t'\n done <<\\EOF\n format-patch -1 --stdout\n diff HEAD^ HEAD --stat\n@@ -181,9 +237,15 @@ EOF\n cat >expect80 <<'EOF'\n  ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++\n EOF\n+cat >expect80-graph <<'EOF'\n+|  ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++\n+EOF\n cat >expect200 <<'EOF'\n  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n+cat >expect200-graph <<'EOF'\n+|  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+EOF\n while read verb expect cmd args\n do\n \ttest_expect_success \"$cmd $verb COLUMNS (long filename)\" '\n@@ -191,6 +253,14 @@ do\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect\" actual\n \t'\n+\n+\ttest \"$cmd\" != diff || continue\n+\n+\ttest_expect_success \"$cmd --graph $verb COLUMNS (long filename)\" '\n+\t\tCOLUMNS=200 git $cmd $args --graph >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect-graph\" actual\n+\t'\n done <<\\EOF\n ignores expect80 format-patch -1 --stdout\n respects expect200 diff HEAD^ HEAD --stat\n-- \n1.7.3.4\n"},{"id":"189596","messageId":"1334716196-9870-2-git-send-email-lucian.poston@gmail.com","threadId":"30273","inReplyTo":"1334716196-9870-1-git-send-email-lucian.poston@gmail.com","subject":"[PATCH v4 2/4] Adjust stat width calculations to take --graph output into account","fromName":"Lucian Poston","fromEmail":"lucian.poston@gmail.com","sentAt":"2012-04-18T02:29:48Z","receivedAt":"2012-04-18T02:29:48Z","isPatch":true,"sender":{"key":"lucian.poston@gmail.com","avatar":"https://avatars.githubusercontent.com/u/646121?v=4"},"body":"The recent change to compute the width of diff --stat did not take into\nconsideration the output from --graph. The consequence is that when both\noptions are used, e.g. in 'log --stat --graph', the lines are too long.\n\nAdd output_prefix_length to diff_options. Initialize the value to 0 and only\nset it when graph.c:diff_output_prefix_callback() is called.\n\nUsing output_prefix_length, adjust stat width calculations to take --graph\noutput into account.\n\nt4052: Modify tests to verify that diff stat output is adjusted to compenstate\nfor the history graph tree.\n\nSigned-off-by: Lucian Poston <lucian.poston@gmail.com>\n---\n diff.c                 |    2 +-\n diff.h                 |    1 +\n graph.c                |    3 +++\n t/t4052-stat-output.sh |   34 +++++++++++++++++++++++++---------\n 4 files changed, 30 insertions(+), 10 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 377ec1e..0b61cf7 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1445,7 +1445,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)\n \t */\n \n \tif (options->stat_width == -1)\n-\t\twidth = term_columns();\n+\t\twidth = term_columns() - options->output_prefix_length;\n \telse\n \t\twidth = options->stat_width ? options->stat_width : 80;\n \ndiff --git a/diff.h b/diff.h\nindex cb68743..19d762f 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -150,6 +150,7 @@ struct diff_options {\n \tdiff_format_fn_t format_callback;\n \tvoid *format_callback_data;\n \tdiff_prefix_fn_t output_prefix;\n+\tint output_prefix_length;\n \tvoid *output_prefix_data;\n };\n \ndiff --git a/graph.c b/graph.c\nindex 7358416..7e0a099 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -194,8 +194,10 @@ static struct strbuf *diff_output_prefix_callback(struct diff_options *opt, void\n \tstruct git_graph *graph = data;\n \tstatic struct strbuf msgbuf = STRBUF_INIT;\n \n+\tassert(opt);\n \tassert(graph);\n \n+\topt->output_prefix_length = graph->width;\n \tstrbuf_reset(&msgbuf);\n \tgraph_padding_line(graph, &msgbuf);\n \treturn &msgbuf;\n@@ -245,6 +247,7 @@ struct git_graph *graph_init(struct rev_info *opt)\n \t */\n \topt->diffopt.output_prefix = diff_output_prefix_callback;\n \topt->diffopt.output_prefix_data = graph;\n+\topt->diffopt.output_prefix_length = 0;\n \n \treturn graph;\n }\ndiff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh\nindex da14984..d748e5e 100755\n--- a/t/t4052-stat-output.sh\n+++ b/t/t4052-stat-output.sh\n@@ -89,7 +89,7 @@ cat >expect200 <<'EOF'\n  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n cat >expect200-graph <<'EOF'\n-|  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+|  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n while read verb expect cmd args\n do\n@@ -117,7 +117,7 @@ cat >expect40 <<'EOF'\n  abcd | 1000 ++++++++++++++++++++++++++\n EOF\n cat >expect40-graph <<'EOF'\n-|  abcd | 1000 ++++++++++++++++++++++++++\n+|  abcd | 1000 ++++++++++++++++++++++++\n EOF\n while read verb expect cmd args\n do\n@@ -127,12 +127,6 @@ do\n \t\ttest_cmp \"$expect\" actual\n \t'\n \n-\ttest_expect_success \"$cmd $verb statGraphWidth config\" '\n-\t\tgit -c diff.statGraphWidth=26 $cmd $args >output\n-\t\tgrep \" | \" output >actual &&\n-\t\ttest_cmp \"$expect\" actual\n-\t'\n-\n \ttest \"$cmd\" != diff || continue\n \n \ttest_expect_success \"$cmd --graph $verb not enough COLUMNS (big change)\" '\n@@ -140,6 +134,28 @@ do\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect-graph\" actual\n \t'\n+done <<\\EOF\n+ignores expect80 format-patch -1 --stdout\n+respects expect40 diff HEAD^ HEAD --stat\n+respects expect40 show --stat\n+respects expect40 log -1 --stat\n+EOF\n+\n+cat >expect40 <<'EOF'\n+ abcd | 1000 ++++++++++++++++++++++++++\n+EOF\n+cat >expect40-graph <<'EOF'\n+|  abcd | 1000 ++++++++++++++++++++++++++\n+EOF\n+while read verb expect cmd args\n+do\n+\ttest_expect_success \"$cmd $verb statGraphWidth config\" '\n+\t\tgit -c diff.statGraphWidth=26 $cmd $args >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect\" actual\n+\t'\n+\n+\ttest \"$cmd\" != diff || continue\n \n \ttest_expect_success \"$cmd --graph $verb statGraphWidth config\" '\n \t\tgit -c diff.statGraphWidth=26 $cmd $args --graph >output\n@@ -244,7 +260,7 @@ cat >expect200 <<'EOF'\n  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n cat >expect200-graph <<'EOF'\n-|  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+|  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n while read verb expect cmd args\n do\n-- \n1.7.3.4\n"},{"id":"189597","messageId":"1334716196-9870-3-git-send-email-lucian.poston@gmail.com","threadId":"30273","inReplyTo":"1334716196-9870-1-git-send-email-lucian.poston@gmail.com","subject":"[PATCH v4 3/4] t4052: Test diff-stat output with minimum columns","fromName":"Lucian Poston","fromEmail":"lucian.poston@gmail.com","sentAt":"2012-04-18T02:29:49Z","receivedAt":"2012-04-18T02:29:49Z","isPatch":true,"sender":{"key":"lucian.poston@gmail.com","avatar":"https://avatars.githubusercontent.com/u/646121?v=4"},"body":"When COLUMNS or --stat-width restricts the diff-stat width to near the\nminimum, 26 columns, the graph_width value becomes negative. Consequently, the\ngraph part of diff-stat is not resized properly.\n\nSigned-off-by: Lucian Poston <lucian.poston@gmail.com>\n---\n t/t4052-stat-output.sh |   28 ++++++++++++++++++++++++++++\n 1 files changed, 28 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh\nindex d748e5e..6305c99 100755\n--- a/t/t4052-stat-output.sh\n+++ b/t/t4052-stat-output.sh\n@@ -284,6 +284,34 @@ respects expect200 show --stat\n respects expect200 log -1 --stat\n EOF\n \n+cat >expect1 <<'EOF'\n+ ...aaaaaaa | 1000 ++++++\n+EOF\n+cat >expect1-graph <<'EOF'\n+|  ...aaaaaaa | 1000 ++++++\n+EOF\n+while read verb expect cmd args\n+do\n+\ttest_expect_failure \"$cmd $verb prefix greater than COLUMNS (big change)\" '\n+\t\tCOLUMNS=1 git $cmd $args >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect\" actual\n+\t'\n+\n+\ttest \"$cmd\" != diff || continue\n+\n+\ttest_expect_failure \"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n+\t\tCOLUMNS=1 git $cmd $args --graph >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect-graph\" actual\n+\t'\n+done <<\\EOF\n+ignores expect80 format-patch -1 --stdout\n+respects expect1 diff HEAD^ HEAD --stat\n+respects expect1 show --stat\n+respects expect1 log -1 --stat\n+EOF\n+\n cat >expect <<'EOF'\n  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n-- \n1.7.3.4\n"},{"id":"189598","messageId":"1334716196-9870-4-git-send-email-lucian.poston@gmail.com","threadId":"30273","inReplyTo":"1334716196-9870-1-git-send-email-lucian.poston@gmail.com","subject":"[PATCH v4 4/4] Prevent graph_width of stat width from falling below min","fromName":"Lucian Poston","fromEmail":"lucian.poston@gmail.com","sentAt":"2012-04-18T02:29:50Z","receivedAt":"2012-04-18T02:29:50Z","isPatch":true,"sender":{"key":"lucian.poston@gmail.com","avatar":"https://avatars.githubusercontent.com/u/646121?v=4"},"body":"Update tests in t4052 fixed by this change.\n\nSigned-off-by: Lucian Poston <lucian.poston@gmail.com>\n---\n diff.c                 |    6 +++++-\n t/t4052-stat-output.sh |    4 ++--\n 2 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 0b61cf7..f08b41a 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1473,8 +1473,12 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)\n \t * Adjust adjustable widths not to exceed maximum width\n \t */\n \tif (name_width + number_width + 6 + graph_width > width) {\n-\t\tif (graph_width > width * 3/8 - number_width - 6)\n+\t\tif (graph_width > width * 3/8 - number_width - 6) {\n \t\t\tgraph_width = width * 3/8 - number_width - 6;\n+\t\t\tif (graph_width < 6)\n+\t\t\t\tgraph_width = 6;\n+\t\t}\n+\n \t\tif (options->stat_graph_width &&\n \t\t    graph_width > options->stat_graph_width)\n \t\t\tgraph_width = options->stat_graph_width;\ndiff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh\nindex 6305c99..ced32db 100755\n--- a/t/t4052-stat-output.sh\n+++ b/t/t4052-stat-output.sh\n@@ -292,7 +292,7 @@ cat >expect1-graph <<'EOF'\n EOF\n while read verb expect cmd args\n do\n-\ttest_expect_failure \"$cmd $verb prefix greater than COLUMNS (big change)\" '\n+\ttest_expect_success \"$cmd $verb prefix greater than COLUMNS (big change)\" '\n \t\tCOLUMNS=1 git $cmd $args >output\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect\" actual\n@@ -300,7 +300,7 @@ do\n \n \ttest \"$cmd\" != diff || continue\n \n-\ttest_expect_failure \"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n+\ttest_expect_success \"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n \t\tCOLUMNS=1 git $cmd $args --graph >output\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect-graph\" actual\n-- \n1.7.3.4\n"},{"id":"189610","messageId":"4F8E7F9D.8080207@in.waw.pl","threadId":"30273","inReplyTo":"1334716196-9870-1-git-send-email-lucian.poston@gmail.com","subject":"Re: [PATCH v4 1/4] t4052: test --stat output with --graph","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2012-04-18T08:47:25Z","receivedAt":"2012-04-18T08:47:25Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"On 04/18/2012 04:29 AM, Lucian Poston wrote:\n> 1/4 Prevent graph_width of stat width from falling below min\n> 2/4 t4052: Test diff-stat output with minimum columns\n> 3/4 Adjust stat width calculations to take --graph output into account\n> 4/4 t4052: test --stat output with --graph\n\nLooks nice.\n\nZbyszek\n"},{"id":"189656","messageId":"7v4nsglru2.fsf@alter.siamese.dyndns.org","threadId":"30273","inReplyTo":"1334716196-9870-3-git-send-email-lucian.poston@gmail.com","subject":"Re: [PATCH v4 3/4] t4052: Test diff-stat output with minimum columns","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-04-18T20:15:17Z","receivedAt":"2012-04-18T20:15:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lucian Poston <lucian.poston@gmail.com> writes:\n\n> When COLUMNS or --stat-width restricts the diff-stat width to near the\n> minimum, 26 columns, the graph_width value becomes negative. Consequently, the\n> graph part of diff-stat is not resized properly.\n>\n> Signed-off-by: Lucian Poston <lucian.poston@gmail.com>\n> ---\n>  t/t4052-stat-output.sh |   28 ++++++++++++++++++++++++++++\n>  1 files changed, 28 insertions(+), 0 deletions(-)\n\nRunning t4052 with this patch applied reports\n\n# fixed 2 known breakage(s)\n# still have 5 known breakage(s)\n# passed all remaining 81 test(s)\n\nPlease mark the ones that already pass as \"test_expect_success\", leaving\nthe only broken ones as \"test_expect_failure\".  Otherwise the patch to the\ntest that contains the fix would not illustrate what it fixed.\n\nThanks.\n"},{"id":"189667","messageId":"1334783377-31229-1-git-send-email-lucian.poston@gmail.com","threadId":"30273","inReplyTo":"1334716196-9870-3-git-send-email-lucian.poston@gmail.com","subject":"Re: [PATCH v4 3/4] t4052: Test diff-stat output with minimum columns","fromName":"Lucian Poston","fromEmail":"lucian.poston@gmail.com","sentAt":"2012-04-18T21:09:33Z","receivedAt":"2012-04-18T21:09:33Z","isPatch":true,"sender":{"key":"lucian.poston@gmail.com","avatar":"https://avatars.githubusercontent.com/u/646121?v=4"},"body":"When COLUMNS or --stat-width restricts the diff-stat width to near the\nminimum, 26 columns, the graph_width value becomes negative. Consequently, the\ngraph part of diff-stat is not resized properly.\n\nSigned-off-by: Lucian Poston <lucian.poston@gmail.com>\n---\n t/t4052-stat-output.sh |   28 ++++++++++++++++++++++++++++\n 1 files changed, 28 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh\nindex d748e5e..b8eec8f 100755\n--- a/t/t4052-stat-output.sh\n+++ b/t/t4052-stat-output.sh\n@@ -284,6 +284,34 @@ respects expect200 show --stat\n respects expect200 log -1 --stat\n EOF\n \n+cat >expect1 <<'EOF'\n+ ...aaaaaaa | 1000 ++++++\n+EOF\n+cat >expect1-graph <<'EOF'\n+|  ...aaaaaaa | 1000 ++++++\n+EOF\n+while read teststate verb expect cmd args\n+do\n+\ttest_expect_$teststate \"$cmd $verb prefix greater than COLUMNS (big change)\" '\n+\t\tCOLUMNS=1 git $cmd $args >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect\" actual\n+\t'\n+\n+\ttest \"$cmd\" != diff || continue\n+\n+\ttest_expect_$teststate \"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n+\t\tCOLUMNS=1 git $cmd $args --graph >output\n+\t\tgrep \" | \" output >actual &&\n+\t\ttest_cmp \"$expect-graph\" actual\n+\t'\n+done <<\\EOF\n+success ignores expect80 format-patch -1 --stdout\n+failure respects expect1 diff HEAD^ HEAD --stat\n+failure respects expect1 show --stat\n+failure respects expect1 log -1 --stat\n+EOF\n+\n cat >expect <<'EOF'\n  abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n EOF\n-- \n1.7.3.4\n"},{"id":"189668","messageId":"1334783544-31311-1-git-send-email-lucian.poston@gmail.com","threadId":"30273","inReplyTo":"1334716196-9870-4-git-send-email-lucian.poston@gmail.com","subject":"Re: [PATCH v4 4/4] Prevent graph_width of stat width from falling below min","fromName":"Lucian Poston","fromEmail":"lucian.poston@gmail.com","sentAt":"2012-04-18T21:12:18Z","receivedAt":"2012-04-18T21:12:18Z","isPatch":true,"sender":{"key":"lucian.poston@gmail.com","avatar":"https://avatars.githubusercontent.com/u/646121?v=4"},"body":"Update tests in t4052 fixed by this change.\n\nSigned-off-by: Lucian Poston <lucian.poston@gmail.com>\n---\n diff.c                 |    6 +++++-\n t/t4052-stat-output.sh |   14 +++++++-------\n 2 files changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 0b61cf7..f08b41a 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1473,8 +1473,12 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)\n \t * Adjust adjustable widths not to exceed maximum width\n \t */\n \tif (name_width + number_width + 6 + graph_width > width) {\n-\t\tif (graph_width > width * 3/8 - number_width - 6)\n+\t\tif (graph_width > width * 3/8 - number_width - 6) {\n \t\t\tgraph_width = width * 3/8 - number_width - 6;\n+\t\t\tif (graph_width < 6)\n+\t\t\t\tgraph_width = 6;\n+\t\t}\n+\n \t\tif (options->stat_graph_width &&\n \t\t    graph_width > options->stat_graph_width)\n \t\t\tgraph_width = options->stat_graph_width;\ndiff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh\nindex b8eec8f..ced32db 100755\n--- a/t/t4052-stat-output.sh\n+++ b/t/t4052-stat-output.sh\n@@ -290,9 +290,9 @@ EOF\n cat >expect1-graph <<'EOF'\n |  ...aaaaaaa | 1000 ++++++\n EOF\n-while read teststate verb expect cmd args\n+while read verb expect cmd args\n do\n-\ttest_expect_$teststate \"$cmd $verb prefix greater than COLUMNS (big change)\" '\n+\ttest_expect_success \"$cmd $verb prefix greater than COLUMNS (big change)\" '\n \t\tCOLUMNS=1 git $cmd $args >output\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect\" actual\n@@ -300,16 +300,16 @@ do\n \n \ttest \"$cmd\" != diff || continue\n \n-\ttest_expect_$teststate \"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n+\ttest_expect_success \"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n \t\tCOLUMNS=1 git $cmd $args --graph >output\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect-graph\" actual\n \t'\n done <<\\EOF\n-success ignores expect80 format-patch -1 --stdout\n-failure respects expect1 diff HEAD^ HEAD --stat\n-failure respects expect1 show --stat\n-failure respects expect1 log -1 --stat\n+ignores expect80 format-patch -1 --stdout\n+respects expect1 diff HEAD^ HEAD --stat\n+respects expect1 show --stat\n+respects expect1 log -1 --stat\n EOF\n \n cat >expect <<'EOF'\n-- \n1.7.3.4\n"},{"id":"189670","messageId":"CACz_eydRKq6d5LU3OpYhZ84_TXOXoxYS=_PzkEJOfDinB1D2Kg@mail.gmail.com","threadId":"30273","inReplyTo":"7v4nsglru2.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 3/4] t4052: Test diff-stat output with minimum columns","fromName":"Lucian Poston","fromEmail":"lucian.poston@gmail.com","sentAt":"2012-04-18T21:19:09Z","receivedAt":"2012-04-18T21:19:09Z","isPatch":true,"sender":{"key":"lucian.poston@gmail.com","avatar":"https://avatars.githubusercontent.com/u/646121?v=4"},"body":"On Wed, Apr 18, 2012 at 13:15, Junio C Hamano <gitster@pobox.com> wrote:\n> Lucian Poston <lucian.poston@gmail.com> writes:\n>\n>> When COLUMNS or --stat-width restricts the diff-stat width to near the\n>> minimum, 26 columns, the graph_width value becomes negative. Consequently, the\n>> graph part of diff-stat is not resized properly.\n>>\n>> Signed-off-by: Lucian Poston <lucian.poston@gmail.com>\n>> ---\n>>  t/t4052-stat-output.sh |   28 ++++++++++++++++++++++++++++\n>>  1 files changed, 28 insertions(+), 0 deletions(-)\n>\n> Running t4052 with this patch applied reports\n>\n> # fixed 2 known breakage(s)\n> # still have 5 known breakage(s)\n> # passed all remaining 81 test(s)\n>\n> Please mark the ones that already pass as \"test_expect_success\", leaving\n> the only broken ones as \"test_expect_failure\".  Otherwise the patch to the\n> test that contains the fix would not illustrate what it fixed.\n\nSorry about that. Fixed in the recently emailed diffs.\n\nThanks!\n"},{"id":"190184","messageId":"20120426223422.GC22261@camk.edu.pl","threadId":"30273","inReplyTo":"1334783377-31229-1-git-send-email-lucian.poston@gmail.com","subject":"Re: [PATCH v4 3/4] t4052: Test diff-stat output with minimum columns","fromName":"Kacper Kornet","fromEmail":"draenog@pld-linux.org","sentAt":"2012-04-26T22:34:22Z","receivedAt":"2012-04-26T22:34:22Z","isPatch":true,"sender":{"key":"draenog@pld-linux.org","avatar":"https://avatars.githubusercontent.com/u/608762?v=4"},"body":"On Wed, Apr 18, 2012 at 02:09:33PM -0700, Lucian Poston wrote:\n> When COLUMNS or --stat-width restricts the diff-stat width to near the\n> minimum, 26 columns, the graph_width value becomes negative. Consequently, the\n> graph part of diff-stat is not resized properly.\n\n> Signed-off-by: Lucian Poston <lucian.poston@gmail.com>\n> ---\n>  t/t4052-stat-output.sh |   28 ++++++++++++++++++++++++++++\n>  1 files changed, 28 insertions(+), 0 deletions(-)\n\n> diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh\n> index d748e5e..b8eec8f 100755\n> --- a/t/t4052-stat-output.sh\n> +++ b/t/t4052-stat-output.sh\n> @@ -284,6 +284,34 @@ respects expect200 show --stat\n>  respects expect200 log -1 --stat\n>  EOF\n\n> +cat >expect1 <<'EOF'\n> + ...aaaaaaa | 1000 ++++++\n> +EOF\n> +cat >expect1-graph <<'EOF'\n> +|  ...aaaaaaa | 1000 ++++++\n> +EOF\n> +while read teststate verb expect cmd args\n> +do\n> +\ttest_expect_$teststate \"$cmd $verb prefix greater than COLUMNS (big change)\" '\n> +\t\tCOLUMNS=1 git $cmd $args >output\n> +\t\tgrep \" | \" output >actual &&\n> +\t\ttest_cmp \"$expect\" actual\n> +\t'\n> +\n> +\ttest \"$cmd\" != diff || continue\n> +\n> +\ttest_expect_$teststate \"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n> +\t\tCOLUMNS=1 git $cmd $args --graph >output\n> +\t\tgrep \" | \" output >actual &&\n> +\t\ttest_cmp \"$expect-graph\" actual\n> +\t'\n> +done <<\\EOF\n> +success ignores expect80 format-patch -1 --stdout\n> +failure respects expect1 diff HEAD^ HEAD --stat\n> +failure respects expect1 show --stat\n> +failure respects expect1 log -1 --stat\n> +EOF\n> +\n>  cat >expect <<'EOF'\n>   abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  EOF\n\nThese tests fail when /bin/sh is mksh. The problem is, mksh set COLUMNS\nto be at least 12.\n\n-- \n  Kacper Kornet\n"},{"id":"190201","messageId":"1335518725-19728-1-git-send-email-zbyszek@in.waw.pl","threadId":"30273","inReplyTo":"20120426223422.GC22261@camk.edu.pl","subject":"[PATCH] test: skip test with COLUMNS=1 under mksh","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2012-04-27T09:25:25Z","receivedAt":"2012-04-27T09:25:25Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)\n$COLUMNS is \"always set, defaults to 80, unless the value as reported\nby stty(1) is non-zero and sane enough\". This applies also to setting\nit directly for one command:\n\n$ COLUMNS=30 python -c 'import os; print os.environ[\"COLUMNS\"]'\n30\n$ COLUMNS=20 python -c 'import os; print os.environ[\"COLUMNS\"]'\n20\n$ COLUMNS=10 python -c 'import os; print os.environ[\"COLUMNS\"]'\n98\n\nLet's test if we can set COLUMNS=1, and if not, skip the tests that\nwant to use that. A prereq is added, which is set if $COLUMNS can be\nset.\n\nIn t9002-column.sh, file with expected output was shared between two\ntest cases, but set in the first one. Since the first test case can\nnow be skipped, setting up the expected output is moved outside of the\ntest case.\n\nSigned-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\n---\n\nThis fixes problems under /bin/sh=mksh in two newly added test files:\nt4052 and t9002. I think that doing it with a prereq is fairly\nminimalistic, and the output looks nice.\n\n t/t4052-stat-output.sh |    6 ++++--\n t/t9002-column.sh      |    5 +++--\n t/test-lib.sh          |    1 +\n 3 files changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh\nindex ced32db..ddd9497 100755\n--- a/t/t4052-stat-output.sh\n+++ b/t/t4052-stat-output.sh\n@@ -292,7 +292,8 @@ cat >expect1-graph <<'EOF'\n EOF\n while read verb expect cmd args\n do\n-\ttest_expect_success \"$cmd $verb prefix greater than COLUMNS (big change)\" '\n+\ttest_expect_success COLUMNS_CAN_BE_1 \\\n+\t\t\"$cmd $verb prefix greater than COLUMNS (big change)\" '\n \t\tCOLUMNS=1 git $cmd $args >output\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect\" actual\n@@ -300,7 +301,8 @@ do\n \n \ttest \"$cmd\" != diff || continue\n \n-\ttest_expect_success \"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n+\ttest_expect_success COLUMNS_CAN_BE_1 \\\n+\t\t\"$cmd --graph $verb prefix greater than COLUMNS (big change)\" '\n \t\tCOLUMNS=1 git $cmd $args --graph >output\n \t\tgrep \" | \" output >actual &&\n \t\ttest_cmp \"$expect-graph\" actual\ndiff --git a/t/t9002-column.sh b/t/t9002-column.sh\nindex c7d7a65..8998352 100755\n--- a/t/t9002-column.sh\n+++ b/t/t9002-column.sh\n@@ -50,8 +50,7 @@ EOF\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'COLUMNS = 1' '\n-\tcat >expected <<\\EOF &&\n+cat >expected <<\\EOF\n one\n two\n three\n@@ -64,6 +63,8 @@ nine\n ten\n eleven\n EOF\n+\n+test_expect_success COLUMNS_CAN_BE_1 'COLUMNS = 1' '\n \tCOLUMNS=1 git column --mode=column <lista >actual &&\n \ttest_cmp expected actual\n '\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b7d7100..9e2b711 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -615,6 +615,7 @@ case $(uname -s) in\n \t;;\n esac\n \n+( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n test -n \"$USE_LIBPCRE\" && test_set_prereq LIBPCRE\n-- \n1.7.10.433.g48a19\n"},{"id":"190220","messageId":"xmqqehr99mz3.fsf@junio.mtv.corp.google.com","threadId":"30273","inReplyTo":"1335518725-19728-1-git-send-email-zbyszek@in.waw.pl","subject":"Re: [PATCH] test: skip test with COLUMNS=1 under mksh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-04-27T16:08:16Z","receivedAt":"2012-04-27T16:08:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n\n> mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)\n> $COLUMNS is \"always set, defaults to 80, unless the value as reported\n> by stty(1) is non-zero and sane enough\". This applies also to setting\n> it directly for one command:\n>\n> $ COLUMNS=30 python -c 'import os; print os.environ[\"COLUMNS\"]'\n> 30\n> $ COLUMNS=20 python -c 'import os; print os.environ[\"COLUMNS\"]'\n> 20\n> $ COLUMNS=10 python -c 'import os; print os.environ[\"COLUMNS\"]'\n> 98\n\nI'd hate to say this, but that shell is broken.\n\n> Let's test if we can set COLUMNS=1, and if not, skip the tests that\n> want to use that. A prereq is added, which is set if $COLUMNS can be\n> set.\n\nAnd I think that is a sensible workaround, even though COLUMNS_CAN_BE_1\nmight not be the best name for it.\n\n> +( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n\nThis is different from what you wrote in your log message, but I trust\nthat it will fail under the problematic shell?\n\nWill queue; thanks.\n"},{"id":"190221","messageId":"xmqqaa1x9mdi.fsf@junio.mtv.corp.google.com","threadId":"30273","inReplyTo":"1335518725-19728-1-git-send-email-zbyszek@in.waw.pl","subject":"Re: [PATCH] test: skip test with COLUMNS=1 under mksh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-04-27T16:21:13Z","receivedAt":"2012-04-27T16:21:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n\n> mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)\n> $COLUMNS is \"always set, defaults to 80, unless the value as reported\n> by stty(1) is non-zero and sane enough\". This applies also to setting\n> it directly for one command:\n>\n> $ COLUMNS=30 python -c 'import os; print os.environ[\"COLUMNS\"]'\n> 30\n> $ COLUMNS=20 python -c 'import os; print os.environ[\"COLUMNS\"]'\n> 20\n> $ COLUMNS=10 python -c 'import os; print os.environ[\"COLUMNS\"]'\n> 98\n\nI wonder if this is an easier workaround, though.\n\n\tenv COLUMNS=10 $cmd\n\nIn any case, I'd split this patch to three, as these tests belong to two\nindependent topics.\n"},{"id":"190226","messageId":"4F9B1F38.8040406@gmail.com","threadId":"30273","inReplyTo":"xmqqaa1x9mdi.fsf@junio.mtv.corp.google.com","subject":"Re: [PATCH] test: skip test with COLUMNS=1 under mksh","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-04-27T22:35:36Z","receivedAt":"2012-04-27T22:35:36Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"Hi Junio, Zbigniew.\n\nOn 04/27/2012 06:21 PM, Junio C Hamano wrote:\n> Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n> \n>> mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)\n>> $COLUMNS is \"always set, defaults to 80, unless the value as reported\n>> by stty(1) is non-zero and sane enough\". This applies also to setting\n>> it directly for one command:\n>>\n>> $ COLUMNS=30 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>> 30\n>> $ COLUMNS=20 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>> 20\n>> $ COLUMNS=10 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>> 98\n> \n> I wonder if this is an easier workaround, though.\n> \n> \tenv COLUMNS=10 $cmd\n> \nIt works for me:\n\n  $ mksh -c 'COLUMNS=10 env | grep COLUMNS'\n  COLUMNS=113\n\n  $ mksh -c 'env COLUMNS=10 env | grep COLUMNS'\n  COLUMNS=10\n\n  $ dpkg -l mksh\n  ...\n  ii  mksh  40.2-2  MirBSD Korn Shell\n\nHTH,\n  Stefano\n"},{"id":"190250","messageId":"4F9BCFD9.8020005@in.waw.pl","threadId":"30273","inReplyTo":"4F9B1F38.8040406@gmail.com","subject":"Re: [PATCH] test: skip test with COLUMNS=1 under mksh","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2012-04-28T11:09:13Z","receivedAt":"2012-04-28T11:09:13Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"On 04/28/2012 12:35 AM, Stefano Lattarini wrote:\n> Hi Junio, Zbigniew.\n> \n> On 04/27/2012 06:21 PM, Junio C Hamano wrote:\n>> Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n>>\n>>> mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)\n>>> $COLUMNS is \"always set, defaults to 80, unless the value as reported\n>>> by stty(1) is non-zero and sane enough\". This applies also to setting\n>>> it directly for one command:\n>>>\n>>> $ COLUMNS=30 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>>> 30\n>>> $ COLUMNS=20 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>>> 20\n>>> $ COLUMNS=10 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>>> 98\n>>\n>> I wonder if this is an easier workaround, though.\n>>\n>> \tenv COLUMNS=10 $cmd\n>>\n> It works for me:\n> \n>   $ mksh -c 'COLUMNS=10 env | grep COLUMNS'\n>   COLUMNS=113\n> \n>   $ mksh -c 'env COLUMNS=10 env | grep COLUMNS'\n>   COLUMNS=10\n> \n>   $ dpkg -l mksh\n>   ...\n>   ii  mksh  40.2-2  MirBSD Korn Shell\n> \n> HTH,\n>   Stefano\n> \nThis approach with 'env COLUMNS=1 git ...' looks nicer, and works when\ninvoked directly, but doesn't work when run under the test harness,\nbecause bin-wrappers/git uses !/bin/sh, which resets COLUMNS. So this\nsimpler approach doesn't look feasible.\n\nZbyszek\n"},{"id":"190251","messageId":"4F9BCFDE.1090103@in.waw.pl","threadId":"30273","inReplyTo":"xmqqehr99mz3.fsf@junio.mtv.corp.google.com","subject":"Re: [PATCH] test: skip test with COLUMNS=1 under mksh","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2012-04-28T11:09:18Z","receivedAt":"2012-04-28T11:09:18Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"On 04/27/2012 06:08 PM, Junio C Hamano wrote:\n> Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n> \n>> mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)\n>> $COLUMNS is \"always set, defaults to 80, unless the value as reported\n>> by stty(1) is non-zero and sane enough\". This applies also to setting\n>> it directly for one command:\n>>\n>> $ COLUMNS=30 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>> 30\n>> $ COLUMNS=20 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>> 20\n>> $ COLUMNS=10 python -c 'import os; print os.environ[\"COLUMNS\"]'\n>> 98\n> \n> I'd hate to say this, but that shell is broken.\nYes.\n\n>> Let's test if we can set COLUMNS=1, and if not, skip the tests that\n>> want to use that. A prereq is added, which is set if $COLUMNS can be\n>> set.\n> \n> And I think that is a sensible workaround, even though COLUMNS_CAN_BE_1\n> might not be the best name for it.\n> \n>> +( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n> \n> This is different from what you wrote in your log message, but I trust\n> that it will fail under the problematic shell?\nYes.\n\n> Will queue; thanks.\nCool.\n\nZbyszek\n"},{"id":"190253","messageId":"7vsjfmxm65.fsf@alter.siamese.dyndns.org","threadId":"30273","inReplyTo":"4F9BCFD9.8020005@in.waw.pl","subject":"Re: [PATCH] test: skip test with COLUMNS=1 under mksh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-04-29T21:28:34Z","receivedAt":"2012-04-29T21:28:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:\n\n> This approach with 'env COLUMNS=1 git ...' looks nicer, and works when\n> invoked directly, but doesn't work when run under the test harness,\n> because bin-wrappers/git uses !/bin/sh, which resets COLUMNS. So this\n> simpler approach doesn't look feasible.\n\nSigh... That shell seem to be infinitely broken X-<.\n"}]}