From 7b88176e9bce658fd44c2192c1b7aa6e612ee0c2 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 14 Jun 2010 18:12:29 +0200 Subject: pretty: Introduce ' ' modifier to add space if non-empty We have the '+' modifiier which helps combine format specifiers which may possibly be empty, e.g. '%s%+b%n'. Introduce an analogous ' ' (space) modifier which adds a space before non-empty items. This helps assemble "one line type" format specifiers. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- t/t6006-rev-list-format.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 't') diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 9b77073df8..cccacd4add 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -200,6 +200,16 @@ test_expect_success 'add LF before non-empty (2)' ' grep "^$" actual ' +test_expect_success 'add SP before non-empty (1)' ' + git show -s --pretty=format:"%s% bThanks" HEAD^^ >actual && + test $(wc -w actual && + test $(wc -w expect2 && echo LONG LONG LONG >expect3 && -- cgit v1.2.3