From: Junio C Hamano <gitster@pobox.com>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 1/1] tests: Allow customization of how say_color() prints
Date: Sat, 15 Dec 2012 22:34:23 -0800 [thread overview]
Message-ID: <7vobhuqzdc.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <50CCCB86.5080701@ramsay1.demon.co.uk> (Ramsay Jones's message of "Sat, 15 Dec 2012 19:12:06 +0000")
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index f50f834..9dcf3c1 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -202,6 +202,15 @@ do
> esac
> done
>
> +if test -z "$GIT_TEST_PRINT"
> +then
> + GIT_TEST_PRINT="printf %s"
> +fi
> +if test -z "$GIT_TEST_PRINT_LN"
> +then
> + GIT_TEST_PRINT_LN="printf %s\n"
> +fi
> +
> if test -n "$color"
> then
> say_color () {
> @@ -221,7 +230,7 @@ then
> test -n "$quiet" && return;;
> esac
> shift
> - printf "%s" "$*"
> + $GIT_TEST_PRINT "$*"
> tput sgr0
> echo
> )
> @@ -230,7 +239,7 @@ else
> say_color() {
> test -z "$1" && test -n "$quiet" && return
> shift
> - printf "%s\n" "$*"
> + $GIT_TEST_PRINT_LN "$*"
> }
> fi
As you said, this is ugly and also unwieldy in that I do not see an
easy way for a platform/builder to define something that needs to
pass a parameter with $IFS in it in these two variables.
Why does your printf die in the first place???
next prev parent reply other threads:[~2012-12-16 6:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-15 19:12 [PATCH 1/1] tests: Allow customization of how say_color() prints Ramsay Jones
2012-12-16 6:34 ` Junio C Hamano [this message]
2012-12-17 22:31 ` Ramsay Jones
2012-12-18 1:42 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vobhuqzdc.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).