Re: [PATCH next] test-lib: set $DIFF to diff if it is unset
- From
- Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
- Date
- Jun 10, 2010, 17:23 UTC
- Message-ID
- <I5rdmhJblm27JnzIPi7xP5KmntXzA3-wGL-IGXejOPAurGsMke2J3g@cipher.nrlssc.navy.mil>
- In-Reply-To
- <06ffbe0ca6aac061336f6f595e89f75c09ab88ac.1276162629.git.trast@student.ethz.ch>
On 06/10/2010 04:39 AM, Thomas Rast wrote:
Show 29 quoted lines
> Since 7b3bdbb (fixup: do not unconditionally disable "diff -u",
> 2010-05-31), test-lib.sh depends on having $DIFF set in the
> environment for the construction of $GIT_TEST_CMP. While this works
> when called from the main Makefile, it fails if the tests are called
> on their own and the user does not have $DIFF set.
>
> Set it to 'diff' if it is unset, like the Makefile does.
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> ---
>
> I have an uneasy feeling that I must be missing something, seeing as
> this went unnoticed for 10 days...
>
> t/test-lib.sh | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index b23a61d..4d89049 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -78,6 +78,7 @@ export EDITOR
>
> if test -z "$GIT_TEST_CMP"
> then
> + DIFF=${DIFF:-diff}
> if test -n "$GIT_TEST_CMP_USE_COPIED_CONTEXT"
> then
> GIT_TEST_CMP="$DIFF -c"I think what should be done instead, is to move this section down below the line where GIT-BUILD-OPTIONS is sourced. That way, the value of $DIFF can be gotten from that file.
I guess GIT_TEST_CMP and GIT_TEST_CMP_USE_COPIED_CONTEXT should be written into GIT-BUILD-OPTIONS too.
-brandon