{"thread":{"id":"2248","subject":"[PATCH 4/8] Implement an interoperability test for fetch-pack/upload-pack","startedAt":"2005-10-28T02:48:03Z","lastAt":"2005-10-28T03:59:29Z","messageCount":2,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"10735","messageId":"Pine.LNX.4.63.0510280447440.20516@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2248","inReplyTo":null,"subject":"[PATCH 4/8] Implement an interoperability test for fetch-pack/upload-pack","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-10-28T02:48:03Z","receivedAt":"2005-10-28T02:48:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe next patches will extend the pack protocol. This test assures that this\nextension is compatible to earlier versions of git-fetch-pack/git-upload-pack.\n\nAll you need to do to take advantage of this test, is to install older\nknown-to-be-working binaries in the path as \"old-git-fetch-pack\" and\n\"old-git-upload-pack\".\n\nNote that the warning when testing with old-git-fetch-pack is to be\nexpected (it just says that the old version was not taking advantage\nof all the information which the server sent).\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n t/t5501-old-fetch-and-upload.sh |   43 +++++++++++++++++++++++++++++++++++++++\n 1 files changed, 43 insertions(+), 0 deletions(-)\n create mode 100755 t/t5501-old-fetch-and-upload.sh\n\napplies-to: 4286a14deeaa64cf1d00fc5f7cb197e91f230ab9\n0bae675fd1eb4ec33834a6c8d0b6bbc88adc30da\ndiff --git a/t/t5501-old-fetch-and-upload.sh b/t/t5501-old-fetch-and-upload.sh\nnew file mode 100755\nindex 0000000..86df785\n--- /dev/null\n+++ b/t/t5501-old-fetch-and-upload.sh\n@@ -0,0 +1,43 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2005 Johannes Schindelin\n+#\n+\n+# Test that the current fetch-pack/upload-pack plays nicely with\n+# an old counterpart\n+\n+cd $(dirname $0) || exit 1\n+\n+tmp=$(mktemp tmp-XXXX)\n+\n+retval=0\n+\n+if [ -z \"$1\" ]; then\n+\tlist=\"fetch upload\"\n+else\n+\tlist=\"$@\"\n+fi\n+\n+for i in $list; do\n+\tcase \"$i\" in\n+\tfetch) pgm=\"old-git-fetch-pack\"; replace=\"$pgm\";;\n+\tupload) pgm=\"old-git-upload-pack\"; replace=\"git-fetch-pack --exec=$pgm\";;\n+\tboth) pgm=\"old-git-upload-pack\"; replace=\"old-git-fetch-pack --exec=$pgm\";;\n+\tesac\n+\n+\tif which $pgm; then\n+\t\techo \"Testing with $pgm\"\n+\t\tsed -e \"s/git-fetch-pack/$replace/g\" \\\n+\t\t\t-e \"s/# old fails/warn/\" < t5500-fetch-pack.sh > $tmp\n+\n+\t\tsh $tmp || retval=$?\n+\t\trm $tmp\n+\n+\t\ttest $retval != 0 && exit $retval\n+\telse\n+\t\techo \"Skipping test for $i, since I cannot find $pgm\"\n+\tfi\n+done\n+\n+exit 0\n+\n---\n0.99.8.GIT\n"},{"id":"10747","messageId":"Pine.LNX.4.63.0510280557071.5054@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2248","inReplyTo":"Pine.LNX.4.63.0510280447440.20516@wbgn013.biozentrum.uni-wuerzburg.de","subject":"[PATCH] make t5501 less annoying, was Re: [PATCH 4/8] Implement an interoperability test for fetch-pack/upload-pack","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-10-28T03:59:29Z","receivedAt":"2005-10-28T03:59:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nOn Linux, \"mktemp tmp-XXXX\" will not work. Also, redirect stderr on which,\nso it does not complain too loudly. After all, this test should only be\nexecuted when old binaries are available.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n\n t/t5501-old-fetch-and-upload.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\napplies-to: f961b5204f8ead99f2beb0b2dc9f1e662c47fd74\n4462bf60f4fca1d7774f441b374943109083efd9\ndiff --git a/t/t5501-old-fetch-and-upload.sh b/t/t5501-old-fetch-and-upload.sh\nindex 86df785..ada5130 100755\n--- a/t/t5501-old-fetch-and-upload.sh\n+++ b/t/t5501-old-fetch-and-upload.sh\n@@ -8,7 +8,7 @@\n \n cd $(dirname $0) || exit 1\n \n-tmp=$(mktemp tmp-XXXX)\n+tmp=$(mktemp /tmp/tmp-XXXXXXXX)\n \n retval=0\n \n@@ -25,7 +25,7 @@ for i in $list; do\n \tboth) pgm=\"old-git-upload-pack\"; replace=\"old-git-fetch-pack --exec=$pgm\";;\n \tesac\n \n-\tif which $pgm; then\n+\tif which $pgm 2>/dev/null; then\n \t\techo \"Testing with $pgm\"\n \t\tsed -e \"s/git-fetch-pack/$replace/g\" \\\n \t\t\t-e \"s/# old fails/warn/\" < t5500-fetch-pack.sh > $tmp\n---\n0.99.8.GIT\n"}]}