{"thread":{"id":"12875","subject":"[PATCH] t9600-cvsimport.sh: set HOME before checking for cvsps availability","startedAt":"2008-03-26T17:34:20Z","lastAt":"2008-03-27T11:07:59Z","messageCount":4,"participants":["Gerrit Pape","Junio C Hamano","Jeff King","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"73145","messageId":"20080326173420.16383.qmail@4b0e1e5c705f62.315fe32.mid.smarden.org","threadId":"12875","inReplyTo":null,"subject":"[PATCH] t9600-cvsimport.sh: set HOME before checking for cvsps availability","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2008-03-26T17:34:20Z","receivedAt":"2008-03-26T17:34:20Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"From: Frank Lichtenheld <djpig@debian.org>\n\nThis actually sounds like a bug in cvsps, which requires an existing\nhome directory when asked for the usage through -h\n\n $ HOME=/nonexistent cvsps -h\n Cannot create the cvsps directory '.cvsps': No such file or directory\n\nThis made t9600 think that cvsps is not available if HOME did not exist,\ncausing the tests to be skipped\n\n $ HOME=/nonexistent sh t9600-cvsimport.sh\n * skipping cvsimport tests, cvsps not found\n * passed all 0 test(s)\n\nNow t9600 sets HOME to the current working directory before checking for\nthe availability of the cvsps program.\n\nThis issue has been discovered by Marco Rodrigues, and fixed by Frank\nLichtenheld through\n http://bugs.debian.org/471969\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n t/t9600-cvsimport.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 7706430..00a74ee 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -3,6 +3,12 @@\n test_description='git-cvsimport basic tests'\n . ./test-lib.sh\n \n+CVSROOT=$(pwd)/cvsroot\n+export CVSROOT\n+# for clean cvsps cache\n+HOME=$(pwd)\n+export HOME\n+\n if ! type cvs >/dev/null 2>&1\n then\n \tsay 'skipping cvsimport tests, cvs not found'\n@@ -26,12 +32,6 @@ case \"$cvsps_version\" in\n \t;;\n esac\n \n-CVSROOT=$(pwd)/cvsroot\n-export CVSROOT\n-# for clean cvsps cache\n-HOME=$(pwd)\n-export HOME\n-\n test_expect_success 'setup cvsroot' 'cvs init'\n \n test_expect_success 'setup a cvs module' '\n-- \n1.5.4.4\n"},{"id":"73146","messageId":"7v8x05e5fa.fsf@gitster.siamese.dyndns.org","threadId":"12875","inReplyTo":"20080326173420.16383.qmail@4b0e1e5c705f62.315fe32.mid.smarden.org","subject":"Re: [PATCH] t9600-cvsimport.sh: set HOME before checking for cvsps availability","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-26T17:55:21Z","receivedAt":"2008-03-26T17:55:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Gerrit Pape <pape@smarden.org> writes:\n\n> From: Frank Lichtenheld <djpig@debian.org>\n>\n> This actually sounds like a bug in cvsps, which requires an existing\n> home directory when asked for the usage through -h\n>\n>  $ HOME=/nonexistent cvsps -h\n>  Cannot create the cvsps directory '.cvsps': No such file or directory\n\nThanks.\n\nIn the longer run, we probably would want to do something similar for all\ntests to ensure a stable testing environment, don't we?  $HOME/.gitconfig\nmay affect the way tested programs behave otherwise.\n"},{"id":"73179","messageId":"20080327032834.GA5417@coredump.intra.peff.net","threadId":"12875","inReplyTo":"7v8x05e5fa.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] t9600-cvsimport.sh: set HOME before checking for cvsps availability","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-03-27T03:28:34Z","receivedAt":"2008-03-27T03:28:34Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Mar 26, 2008 at 10:55:21AM -0700, Junio C Hamano wrote:\n\n> In the longer run, we probably would want to do something similar for all\n> tests to ensure a stable testing environment, don't we?  $HOME/.gitconfig\n> may affect the way tested programs behave otherwise.\n\nWe used to, as per a patch from Gerrit long ago:\n\n  2eb10ac... Set $HOME for selftests\n\nbut it was removed during Dscho's config fix:\n\n  8565d2d... Make tests independent of global config files\n\nwhich used GIT_CONFIG instead. But that had some problems, which I fixed\nin:\n\n  8bfa6bd... fix config reading in tests\n\nand that patch explicitly suppresses lookup in the ~/.gitconfig and\n/etc/gitconfig files (implemented by ab88c363).\n\nSo I think all is correct with .gitconfig files. However, I still think\nsetting HOME is a good idea, because it eliminates one more variable in\ntest runs. In particular, I know I have gotten cvsps into a funny state\nthat was resolved by removing the ~/.cvsps cache. So it's probably worth\ndoing as a preventative measure, even if it doesn't fix a specific bug.\n\n-Peff\n"},{"id":"73196","messageId":"alpine.LSU.1.00.0803271207190.3802@racer.site","threadId":"12875","inReplyTo":"20080327032834.GA5417@coredump.intra.peff.net","subject":"Re: [PATCH] t9600-cvsimport.sh: set HOME before checking for cvsps availability","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-27T11:07:59Z","receivedAt":"2008-03-27T11:07:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Mar 2008, Jeff King wrote:\n\n> However, I still think setting HOME is a good idea, because it \n> eliminates one more variable in test runs. In particular, I know I have \n> gotten cvsps into a funny state that was resolved by removing the \n> ~/.cvsps cache. So it's probably worth doing as a preventative measure, \n> even if it doesn't fix a specific bug.\n\nYes, I did not think about 3rd party configurations when I removed that \nHOME setting.  Bad me.\n\nCiao,\nDscho\n"}]}