Skip to content

Commit 69247e2

Browse files
committed
Merge branch 'sg/column-nl' into maint
The parser for the "--nl" option of "git column" has been corrected. * sg/column-nl: column: fix parsing of the '--nl' option
2 parents 689cfaf + c93ca46 commit 69247e2

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

Documentation/git-column.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ OPTIONS
3939
--indent=<string>::
4040
String to be printed at the beginning of each line.
4141

42-
--nl=<N>::
42+
--nl=<string>::
4343
String to be printed at the end of each line,
4444
including newline character.
4545

builtin/column.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int cmd_column(int argc, const char **argv, const char *prefix)
2929
OPT_INTEGER(0, "raw-mode", &colopts, N_("layout to use")),
3030
OPT_INTEGER(0, "width", &copts.width, N_("maximum width")),
3131
OPT_STRING(0, "indent", &copts.indent, N_("string"), N_("padding space on left border")),
32-
OPT_INTEGER(0, "nl", &copts.nl, N_("padding space on right border")),
32+
OPT_STRING(0, "nl", &copts.nl, N_("string"), N_("padding space on right border")),
3333
OPT_INTEGER(0, "padding", &copts.padding, N_("padding space between columns")),
3434
OPT_END()
3535
};

t/t9002-column.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@ EOF
4242
test_cmp expected actual
4343
'
4444

45+
test_expect_success '--nl' '
46+
cat >expected <<\EOF &&
47+
oneZ
48+
twoZ
49+
threeZ
50+
fourZ
51+
fiveZ
52+
sixZ
53+
sevenZ
54+
eightZ
55+
nineZ
56+
tenZ
57+
elevenZ
58+
EOF
59+
git column --nl="Z$LF" --mode=plain <lista >actual &&
60+
test_cmp expected actual
61+
'
62+
4563
test_expect_success '80 columns' '
4664
cat >expected <<\EOF &&
4765
one two three four five six seven eight nine ten eleven

0 commit comments

Comments
 (0)