{"thread":{"id":"24064","subject":"[PATCH next] test-lib: set $DIFF to diff if it is unset","startedAt":"2010-06-10T09:39:49Z","lastAt":"2010-06-15T15:19:02Z","messageCount":7,"participants":["Thomas Rast","Ævar Arnfjörð Bjarmason","Brandon Casey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"143410","messageId":"06ffbe0ca6aac061336f6f595e89f75c09ab88ac.1276162629.git.trast@student.ethz.ch","threadId":"24064","inReplyTo":null,"subject":"[PATCH next] test-lib: set $DIFF to diff if it is unset","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-06-10T09:39:49Z","receivedAt":"2010-06-10T09:39:49Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Since 7b3bdbb (fixup: do not unconditionally disable \"diff -u\",\n2010-05-31), test-lib.sh depends on having $DIFF set in the\nenvironment for the construction of $GIT_TEST_CMP.  While this works\nwhen called from the main Makefile, it fails if the tests are called\non their own and the user does not have $DIFF set.\n\nSet it to 'diff' if it is unset, like the Makefile does.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nI have an uneasy feeling that I must be missing something, seeing as\nthis went unnoticed for 10 days...\n\n t/test-lib.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b23a61d..4d89049 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -78,6 +78,7 @@ export EDITOR\n \n if test -z \"$GIT_TEST_CMP\"\n then\n+\tDIFF=${DIFF:-diff}\n \tif test -n \"$GIT_TEST_CMP_USE_COPIED_CONTEXT\"\n \tthen\n \t\tGIT_TEST_CMP=\"$DIFF -c\"\n-- \n1.7.1.550.g553ab5\n"},{"id":"143411","messageId":"AANLkTikCQ_up4UY445RE-wU_jeP9g63sPlix0wm6KJNo@mail.gmail.com","threadId":"24064","inReplyTo":"06ffbe0ca6aac061336f6f595e89f75c09ab88ac.1276162629.git.trast@student.ethz.ch","subject":"Re: [PATCH next] test-lib: set $DIFF to diff if it is unset","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-06-10T09:46:06Z","receivedAt":"2010-06-10T09:46:06Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Jun 10, 2010 at 09:39, Thomas Rast <trast@student.ethz.ch> wrote:\n> Since 7b3bdbb (fixup: do not unconditionally disable \"diff -u\",\n> 2010-05-31), test-lib.sh depends on having $DIFF set in the\n> environment for the construction of $GIT_TEST_CMP.  While this works\n> when called from the main Makefile, it fails if the tests are called\n> on their own and the user does not have $DIFF set.\n>\n> Set it to 'diff' if it is unset, like the Makefile does.\n>\n> Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n> ---\n>\n> I have an uneasy feeling that I must be missing something, seeing as\n> this went unnoticed for 10 days...\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\nI spotted it too when preparing the TAP series, I just didn't submit a\nfix for it.\n"},{"id":"143458","messageId":"I5rdmhJblm27JnzIPi7xP5KmntXzA3-wGL-IGXejOPAurGsMke2J3g@cipher.nrlssc.navy.mil","threadId":"24064","inReplyTo":"06ffbe0ca6aac061336f6f595e89f75c09ab88ac.1276162629.git.trast@student.ethz.ch","subject":"Re: [PATCH next] test-lib: set $DIFF to diff if it is unset","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-06-10T17:23:36Z","receivedAt":"2010-06-10T17:23:36Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"On 06/10/2010 04:39 AM, Thomas Rast wrote:\n> Since 7b3bdbb (fixup: do not unconditionally disable \"diff -u\",\n> 2010-05-31), test-lib.sh depends on having $DIFF set in the\n> environment for the construction of $GIT_TEST_CMP.  While this works\n> when called from the main Makefile, it fails if the tests are called\n> on their own and the user does not have $DIFF set.\n> \n> Set it to 'diff' if it is unset, like the Makefile does.\n> \n> Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n> ---\n> \n> I have an uneasy feeling that I must be missing something, seeing as\n> this went unnoticed for 10 days...\n> \n>  t/test-lib.sh |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> \n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index b23a61d..4d89049 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -78,6 +78,7 @@ export EDITOR\n>  \n>  if test -z \"$GIT_TEST_CMP\"\n>  then\n> +\tDIFF=${DIFF:-diff}\n>  \tif test -n \"$GIT_TEST_CMP_USE_COPIED_CONTEXT\"\n>  \tthen\n>  \t\tGIT_TEST_CMP=\"$DIFF -c\"\n\nI think what should be done instead, is to move this section\ndown below the line where GIT-BUILD-OPTIONS is sourced.  That\nway, the value of $DIFF can be gotten from that file.\n\nI guess GIT_TEST_CMP and GIT_TEST_CMP_USE_COPIED_CONTEXT\nshould be written into GIT-BUILD-OPTIONS too.\n\n-brandon\n"},{"id":"143519","messageId":"7vhbl9k0jv.fsf@alter.siamese.dyndns.org","threadId":"24064","inReplyTo":"I5rdmhJblm27JnzIPi7xP5KmntXzA3-wGL-IGXejOPAurGsMke2J3g@cipher.nrlssc.navy.mil","subject":"Re: [PATCH next] test-lib: set $DIFF to diff if it is unset","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-06-11T16:15:48Z","receivedAt":"2010-06-11T16:15:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:\n\n> I think what should be done instead, is to move this section\n> down below the line where GIT-BUILD-OPTIONS is sourced.  That\n> way, the value of $DIFF can be gotten from that file.\n>\n> I guess GIT_TEST_CMP and GIT_TEST_CMP_USE_COPIED_CONTEXT\n> should be written into GIT-BUILD-OPTIONS too.\n\nI like that.  Something like this?\n\n Makefile      |    6 ++++++\n t/test-lib.sh |   20 ++++++++++----------\n 2 files changed, 16 insertions(+), 10 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 0367e8a..6b3b59b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1944,6 +1944,12 @@ GIT-BUILD-OPTIONS: FORCE\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\n \t@echo NO_PYTHON=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PYTHON)))'\\' >>$@\n+ifdef GIT_TEST_CMP\n+\t@echo GIT_TEST_CMP=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_TEST_CMP)))'\\' >>$@\n+endif\n+ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT\n+\t@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@\n+endif\n \n ### Detect Tck/Tk interpreter path changes\n ifndef NO_TCLTK\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex a290011..eafe146 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -64,16 +64,6 @@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n export EDITOR\n \n-if test -z \"$GIT_TEST_CMP\"\n-then\n-\tif test -n \"$GIT_TEST_CMP_USE_COPIED_CONTEXT\"\n-\tthen\n-\t\tGIT_TEST_CMP=\"$DIFF -c\"\n-\telse\n-\t\tGIT_TEST_CMP=\"$DIFF -u\"\n-\tfi\n-fi\n-\n # Protect ourselves from common misconfiguration to export\n # CDPATH into the environment\n unset CDPATH\n@@ -691,6 +681,16 @@ export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOB\n \n . ../GIT-BUILD-OPTIONS\n \n+if test -z \"$GIT_TEST_CMP\"\n+then\n+\tif test -n \"$GIT_TEST_CMP_USE_COPIED_CONTEXT\"\n+\tthen\n+\t\tGIT_TEST_CMP=\"$DIFF -c\"\n+\telse\n+\t\tGIT_TEST_CMP=\"$DIFF -u\"\n+\tfi\n+fi\n+\n GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git\n export GITPERLLIB\n test -d ../templates/blt || {\n"},{"id":"143521","messageId":"iUCxSq8AkQcB-kKuhJbfBTktKHW01RLx8KAu4BZwAUKZkkBhiPlxTg@cipher.nrlssc.navy.mil","threadId":"24064","inReplyTo":"7vhbl9k0jv.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH next] test-lib: set $DIFF to diff if it is unset","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-06-11T16:26:16Z","receivedAt":"2010-06-11T16:26:16Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"On 06/11/2010 11:15 AM, Junio C Hamano wrote:\n> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:\n> \n>> I think what should be done instead, is to move this section\n>> down below the line where GIT-BUILD-OPTIONS is sourced.  That\n>> way, the value of $DIFF can be gotten from that file.\n>>\n>> I guess GIT_TEST_CMP and GIT_TEST_CMP_USE_COPIED_CONTEXT\n>> should be written into GIT-BUILD-OPTIONS too.\n> \n> I like that.  Something like this?\n\nLooks good, will test.\n\n-brandon\n"},{"id":"143522","messageId":"201006111834.36226.trast@student.ethz.ch","threadId":"24064","inReplyTo":"7vhbl9k0jv.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH next] test-lib: set $DIFF to diff if it is unset","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-06-11T16:34:35Z","receivedAt":"2010-06-11T16:34:35Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Junio C Hamano wrote:\n> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:\n> \n> > I think what should be done instead, is to move this section\n> > down below the line where GIT-BUILD-OPTIONS is sourced.  That\n> > way, the value of $DIFF can be gotten from that file.\n> >\n> > I guess GIT_TEST_CMP and GIT_TEST_CMP_USE_COPIED_CONTEXT\n> > should be written into GIT-BUILD-OPTIONS too.\n> \n> I like that.  Something like this?\n\nFine by me, and tested.\n\nAcked-by: Thomas Rast <trast@student.ethz.ch>\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"143751","messageId":"MTKWrx_yfsJOdxAp5oH0FEOHFEBrkTzK1kWr_OkbndT_557CMkCAHA@cipher.nrlssc.navy.mil","threadId":"24064","inReplyTo":"iUCxSq8AkQcB-kKuhJbfBTktKHW01RLx8KAu4BZwAUKZkkBhiPlxTg@cipher.nrlssc.navy.mil","subject":"Re: [PATCH next] test-lib: set $DIFF to diff if it is unset","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-06-15T15:19:02Z","receivedAt":"2010-06-15T15:19:02Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"On 06/11/2010 11:26 AM, Brandon Casey wrote:\n> On 06/11/2010 11:15 AM, Junio C Hamano wrote:\n>> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:\n>>\n>>> I think what should be done instead, is to move this section\n>>> down below the line where GIT-BUILD-OPTIONS is sourced.  That\n>>> way, the value of $DIFF can be gotten from that file.\n>>>\n>>> I guess GIT_TEST_CMP and GIT_TEST_CMP_USE_COPIED_CONTEXT\n>>> should be written into GIT-BUILD-OPTIONS too.\n>> I like that.  Something like this?\n> \n> Looks good, will test.\n\nWorks for me.  It's kind of belated, I know.\n"}]}