{"thread":{"id":"15076","subject":"[FYI] How I compile on IRIX 6.5 with the MIPSpro compiler and ksh","startedAt":"2008-08-18T22:55:10Z","lastAt":"2008-08-22T21:11:48Z","messageCount":28,"participants":["Brandon Casey","Junio C Hamano","Boyd Lynn Gerber","Mike Ralphson","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"87580","messageId":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":null,"subject":"[FYI] How I compile on IRIX 6.5 with the MIPSpro compiler and ksh","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T22:55:10Z","receivedAt":"2008-08-18T22:55:10Z","isPatch":false,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"\nThis email describes how I have successfully compiled git on IRIX6.5 with the\nnative MIPSpro compiler version 7.4.4m and successfully run nearly all of the\ntests using the Korn shell.\n\nA series of 7 patches will follow this email. The patches work around a couple\nof flaws in the IRIX c99 compiler, and the not-quite-recent build environment.\n\nA build script is provided at the end of this email.\n\nThe GIT_SKIP_TESTS environment variable was used to skip tests which still fail.\nThe tests which still fail do so because of an ancient iconv, with one exception:\nthe t5000 tests which fail are due to the installed gnu tar being too old.\n\nTwo lingering concerns:\n  1) Building with -Ofast produced an executable which segfaulted and could not\n     pass the tests.\n  2) Building without THREADED_DELTA_SEARCH=1 produced an executable which\n     segfaulted and could not pass the tests.\n\nI have no debugger.\n\nOtherwise, I've been using this executable somewhat and have not experienced any\nproblems. Maybe it will be useful to others.\n\n Makefile                      |   12 ++++++++++++\n git-compat-util.h             |   12 +++++++++++-\n t/lib-git-svn.sh              |    3 +++\n t/t1002-read-tree-m-u-2way.sh |   10 ++++++----\n t/t9301-fast-export.sh        |    1 -\n t/test-lib.sh                 |    2 +-\n templates/Makefile            |    2 +-\n unpack-trees.c                |    3 ++-\n 8 files changed, 36 insertions(+), 9 deletions(-)\n\n-brandon\n\n\n#!/bin/sh\n\nGIT_SKIP_TESTS='\n   t3900.1[0-289] t3900.2[023]\n   t3901.*\n   t5000.1[0-24-689] t5000.2[01]\n   t5100.[56] t5100.1[02]\n   t9301.4\n'\n\nexport GIT_SKIP_TESTS\n\n# NO_C99_FORMAT is required since this c99 compiler does not understand %td,\n# and probably not %zu.\n\nexec gmake \\\n    CC=c99 \\\n    CFLAGS='-n32 -O2' \\\n    SHELL_PATH='/bin/ksh' \\\n    TAR=gtar \\\n    NO_C99_FORMAT=1 \\\n    NO_CURL=1 \\\n    NO_OPENSSL=1 \\\n    NO_TCLTK=1 \\\n    NO_PERL_MAKEMAKER=1 \\\n    THREADED_DELTA_SEARCH=1\n"},{"id":"87581","messageId":"g4oal8s8kBLktHCvtMjDXsBf7EJ0qrlynAps5eiTDAl3a6vy6guKmg@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","subject":"[PATCH] Makefile: add section for SGI IRIX","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T23:02:39Z","receivedAt":"2008-08-18T23:02:39Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"---\n Makefile |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 52c67c1..890694c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -705,6 +705,18 @@ ifeq ($(uname_S),GNU)\n \t# GNU/Hurd\n \tNO_STRLCPY=YesPlease\n endif\n+ifeq ($(uname_S),IRIX)\n+\tNO_SETENV = YesPlease\n+\tNO_UNSETENV = YesPlease\n+\tNO_STRCASESTR = YesPlease\n+\tNO_MEMMEM = YesPlease\n+\tNO_MKDTEMP = YesPlease\n+\tNO_EXTERNAL_GREP = UnfortunatelyYes\n+\tSHELL_PATH = /usr/gnu/bin/bash\n+\tifdef NO_C99_FORMAT\n+\t\tBASIC_CFLAGS += -Dinline=__inline\n+\tendif\n+endif\n ifeq ($(uname_S),IRIX64)\n \tNO_IPV6=YesPlease\n \tNO_SETENV=YesPlease\n-- \n1.6.0.13.ge1c8\n"},{"id":"87582","messageId":"pJRtiHdsP9HbnKMePwHZJe4brRLzVt3u6tqH8mkWqf8@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","subject":"[PATCH] git-compat-util.h: adjust for SGI IRIX 6.5","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T23:05:21Z","receivedAt":"2008-08-18T23:05:21Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Don't define _XOPEN_SOURCE\nDo    define _SGI_SOURCE\nDeclare the _xpg5 versions of *snprintf() along with wrapper macros\n\nDefining _XOPEN_SOURCE prevents many of the common functions and macros\nfrom being defined. _Not_ setting _XOPEN_SOURCE, and instead setting\n_SGI_SOURCE, provides all of the XPG4, XPG5, BSD, POSIX functions and\ndeclarations, _BUT_ provides a horribly broken snprintf(). The provided\nsnprintf() can not be worked around using git's compat workaround, since\nSGI's vsnprintf() always returns the number of characters written into\nthe string, instead of -1 which is what git's compat version expects.\nSGI does have a working snprintf(), but it is only provided when\n_NO_XOPEN5 evaluates to zero, and this only happens if _XOPEN_SOURCE is\ndefined which, as mentioned above, prevents many other common functions\nand defines. The working *snprintf() functions are named _xpg5_vsnprintf()\nand _xpg5_snprintf(), so declarations for these two functions were added\nto git-compat-util.h and macros were added for vsnprintf and snprintf to\ncall these versions.\n---\n git-compat-util.h |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex cf89cdf..f22707c 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -39,13 +39,14 @@\n /* Approximation of the length of the decimal representation of this type. */\n #define decimal_length(x)\t((int)(sizeof(x) * 2.56 + 0.5) + 1)\n \n-#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)\n+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)\n #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n #endif\n #define _ALL_SOURCE 1\n #define _GNU_SOURCE 1\n #define _BSD_SOURCE 1\n+#define _SGI_SOURCE 1\n \n #include <unistd.h>\n #include <stdio.h>\n@@ -262,6 +263,15 @@ extern int git_snprintf(char *str, size_t maxsize,\n #define vsnprintf git_vsnprintf\n extern int git_vsnprintf(char *str, size_t maxsize,\n \t\t\t const char *format, va_list ap);\n+#elif defined(sgi)\n+extern int      _xpg5_vsnprintf(char * __restrict,\n+                        __SGI_LIBC_NAMESPACE_QUALIFIER size_t,\n+                        const char * __restrict, /* va_list */ char *);\n+#define vsnprintf _xpg5_vsnprintf\n+extern int      _xpg5_snprintf(char * __restrict,\n+                        __SGI_LIBC_NAMESPACE_QUALIFIER size_t,\n+                        const char * __restrict, ...);\n+#define snprintf _xpg5_snprintf\n #endif\n \n #ifdef __GLIBC_PREREQ\n-- \n1.6.0.13.ge1c8\n"},{"id":"87584","messageId":"7e_S4wgjMk99ug7uOEQgrscrYYSl9z1jT8V-nSfW25bykfWmGi-mEA@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","subject":"[PATCH] unpack-trees.c: work around run-time array initialization flaw on IRIX 6.5","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T23:09:52Z","receivedAt":"2008-08-18T23:09:52Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"The c99 MIPSpro Compiler version 7.4.4m on IRIX 6.5 does not properly\ninitialize run-time initialized arrays. An array which is initialized with\nfewer elements than the length of the array should have the unitialized\nelements initialized to zero. This compiler does perform proper\ninitialization when static initialization parameters are used. So, work\naround this by initializing with static elements, followed by a simple\nassignment.\n---\n unpack-trees.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex cba0aca..de7cb0b 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -143,7 +143,8 @@ static inline int call_unpack_fn(struct cache_entry **src, struct unpack_trees_o\n \n static int unpack_index_entry(struct cache_entry *ce, struct unpack_trees_options *o)\n {\n-\tstruct cache_entry *src[5] = { ce, };\n+\tstruct cache_entry *src[5] = { NULL, };\n+\tsrc[0] = ce;\n \n \to->pos++;\n \tif (ce_stage(ce)) {\n-- \n1.6.0.13.ge1c8\n"},{"id":"87586","messageId":"XAO6w2f4AxtqGEL6HNTkRYjhSFFUavQK8LYfdASEGw3-LRoH4_7Cdg@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","subject":"[PATCH] templates/Makefile: work around SGI install which assumes / if ROOT not defined","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T23:14:23Z","receivedAt":"2008-08-18T23:14:23Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"---\n\nHmm, I'm thinking that this is probably only an issue when path is\nnot absolute, since I didn't have any problems installing the\nexecutables. Possibly, a more general fix is to provide the\nabsolute path here.\n\n-brandon\n\n templates/Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/templates/Makefile b/templates/Makefile\nindex 9f3f1fc..3ea63e1 100644\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -29,7 +29,7 @@ boilerplates.made : $(bpsrc)\n \t\tcase \"$$boilerplate\" in *~) continue ;; esac && \\\n \t\tdst=`echo \"$$boilerplate\" | sed -e 's|^this|.|;s|--|/|g'` && \\\n \t\tdir=`expr \"$$dst\" : '\\(.*\\)/'` && \\\n-\t\t$(INSTALL) -d -m 755 blt/$$dir && \\\n+\t\tROOT=./ $(INSTALL) -d -m 755 blt/$$dir && \\\n \t\tcase \"$$boilerplate\" in \\\n \t\t*--) ;; \\\n \t\t*) cp -p $$boilerplate blt/$$dst ;; \\\n-- \n1.6.0.13.ge1c8\n"},{"id":"87587","messageId":"gPlIc7E6mNDrXE6mwaHXFoin7rDpLmjvuzlhJfCp-YmuyVK3pEzqNA@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","subject":"[PATCH] test-lib.sh: work around ksh's trap shortcomings","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T23:16:11Z","receivedAt":"2008-08-18T23:16:11Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"In ksh, if trap is called within a function with 0 or EXIT as its signal,\nthen the trap will be executed at the time the function returns. This\ncauses a problem in the test functions since 'trap - exit' is called\nwithin the test_done function in order to remove the trap which calls\ndie() on exit. This means trap has to be called from the scripts top-level.\nDo so using an alias.\n\nAdditionally, there is some strangeness with respect to aliases and\nsourced script files; the alias hack doesn't work. So call 'trap - 0'\ndirectly in lib-git-svn.sh before calling the test_done function.\n---\n t/lib-git-svn.sh |    3 +++\n t/test-lib.sh    |    2 +-\n 2 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex a841df2..e2e8cf3 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -3,6 +3,7 @@\n if test -n \"$NO_SVN_TESTS\"\n then\n \ttest_expect_success 'skipping git-svn tests, NO_SVN_TESTS defined' :\n+\ttrap - exit\n \ttest_done\n \texit\n fi\n@@ -15,6 +16,7 @@ svn >/dev/null 2>&1\n if test $? -ne 1\n then\n     test_expect_success 'skipping git-svn tests, svn not found' :\n+    trap - exit\n     test_done\n     exit\n fi\n@@ -39,6 +41,7 @@ then\n \t\terr='Perl SVN libraries not found or unusable, skipping test'\n \tfi\n \ttest_expect_success \"$err\" :\n+\ttrap - exit\n \ttest_done\n \texit\n fi\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 11c0275..6a3fc93 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -415,7 +415,6 @@ test_create_repo () {\n }\n \n test_done () {\n-\ttrap - exit\n \ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n \tmkdir -p \"$test_results_dir\"\n \ttest_results_path=\"$test_results_dir/${0%-*}-$$\"\n@@ -457,6 +456,7 @@ test_done () {\n \n \tesac\n }\n+alias test_done='trap - exit && test_done'\n \n # Test the binaries we have just built.  The tests are kept in\n # t/ subdirectory and are run in 'trash directory' subdirectory.\n-- \n1.6.0.13.ge1c8\n"},{"id":"87588","messageId":"jD7q5MKwWCg8rtaY_HWMMwcScqY6a1Yqn2KlDBchicoLNYubT7tjHg@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","subject":"[PATCH] t1002-read-tree-m-u-2way.sh: use 'git diff -U0' rather than 'diff -U0'","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T23:17:53Z","receivedAt":"2008-08-18T23:17:53Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Some old platforms have an old diff which doesn't have the -U option.\n'git diff' can be used in its place. Adjust the comparison function to\nstrip git's additional header lines to make this possible.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n t/t1002-read-tree-m-u-2way.sh |   10 ++++++----\n 1 files changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh\nindex aa9dd58..5e40cec 100755\n--- a/t/t1002-read-tree-m-u-2way.sh\n+++ b/t/t1002-read-tree-m-u-2way.sh\n@@ -14,6 +14,8 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'\n _x40=\"$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40\"\n compare_change () {\n \tsed >current \\\n+\t    -e '1{/^diff --git /d;}' \\\n+\t    -e '2{/^index /d;}' \\\n \t    -e '/^--- /d; /^+++ /d; /^@@ /d;' \\\n \t    -e 's/^\\(.[0-7][0-7][0-7][0-7][0-7][0-7]\\) '\"$_x40\"' /\\1 X /' \"$1\"\n \ttest_cmp expected current\n@@ -75,7 +77,7 @@ test_expect_success \\\n      git update-index --add yomin &&\n      git read-tree -m -u $treeH $treeM &&\n      git ls-files --stage >4.out || return 1\n-     diff -U0 M.out 4.out >4diff.out\n+     git diff -U0 --no-index M.out 4.out >4diff.out\n      compare_change 4diff.out expected &&\n      check_cache_at yomin clean &&\n      sum bozbar frotz nitfol >actual4.sum &&\n@@ -94,7 +96,7 @@ test_expect_success \\\n      echo yomin yomin >yomin &&\n      git read-tree -m -u $treeH $treeM &&\n      git ls-files --stage >5.out || return 1\n-     diff -U0 M.out 5.out >5diff.out\n+     git diff -U0 --no-index M.out 5.out >5diff.out\n      compare_change 5diff.out expected &&\n      check_cache_at yomin dirty &&\n      sum bozbar frotz nitfol >actual5.sum &&\n@@ -206,7 +208,7 @@ test_expect_success \\\n      git update-index --add nitfol &&\n      git read-tree -m -u $treeH $treeM &&\n      git ls-files --stage >14.out || return 1\n-     diff -U0 M.out 14.out >14diff.out\n+     git diff -U0 --no-index M.out 14.out >14diff.out\n      compare_change 14diff.out expected &&\n      sum bozbar frotz >actual14.sum &&\n      grep -v nitfol M.sum > expected14.sum &&\n@@ -227,7 +229,7 @@ test_expect_success \\\n      echo nitfol nitfol nitfol >nitfol &&\n      git read-tree -m -u $treeH $treeM &&\n      git ls-files --stage >15.out || return 1\n-     diff -U0 M.out 15.out >15diff.out\n+     git diff -U0 --no-index M.out 15.out >15diff.out\n      compare_change 15diff.out expected &&\n      check_cache_at nitfol dirty &&\n      sum bozbar frotz >actual15.sum &&\n-- \n1.6.0.13.ge1c8\n"},{"id":"87590","messageId":"kbCw6MBjduXNz0eWrsdfGIVr60qjr7cf1eJqhd4l-UzDfHEk1LrlkA@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","subject":"[PATCH] t9301-fast-export.sh: don't unset config variable while we're skipping test 4","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T23:20:12Z","receivedAt":"2008-08-18T23:20:12Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"---\n\n\nThis is necessary if t9301.4 is included in the GIT_SKIP_TESTS\nenvironment variable.\n\n-brandon\n\n\n t/t9301-fast-export.sh |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex c19b4a2..475aadd 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -190,7 +190,6 @@ export GIT_COMMITTER_NAME='C O Mitter'\n \n test_expect_success 'setup copies' '\n \n-\tgit config --unset i18n.commitencoding &&\n \tgit checkout -b copy rein &&\n \tgit mv file file3 &&\n \tgit commit -m move1 &&\n-- \n1.6.0.13.ge1c8\n"},{"id":"87594","messageId":"7vhc9hlwt3.fsf@gitster.siamese.dyndns.org","threadId":"15076","inReplyTo":"XAO6w2f4AxtqGEL6HNTkRYjhSFFUavQK8LYfdASEGw3-LRoH4_7Cdg@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] templates/Makefile: work around SGI install which assumes / if ROOT not defined","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-18T23:37:12Z","receivedAt":"2008-08-18T23:37:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> diff --git a/templates/Makefile b/templates/Makefile\n> index 9f3f1fc..3ea63e1 100644\n> --- a/templates/Makefile\n> +++ b/templates/Makefile\n> @@ -29,7 +29,7 @@ boilerplates.made : $(bpsrc)\n>  \t\tcase \"$$boilerplate\" in *~) continue ;; esac && \\\n>  \t\tdst=`echo \"$$boilerplate\" | sed -e 's|^this|.|;s|--|/|g'` && \\\n>  \t\tdir=`expr \"$$dst\" : '\\(.*\\)/'` && \\\n> -\t\t$(INSTALL) -d -m 755 blt/$$dir && \\\n> +\t\tROOT=./ $(INSTALL) -d -m 755 blt/$$dir && \\\n\nI do not see absolutely any reason to use install there.\n\nI have to wonder why 9907721 (templates/Makefile: don't depend on local\numask setting, 2008-02-28) did not do this instead:\n\n\t$(QUIET)umask 022 && ls *--* 2>/dev/null | \\\n\twhile read boilerplate; \\\n\tdo \\\n\t\tcase \"$$boilerplate\" in *~) continue ;; esac && \\\n\t\tdst=`echo \"$$boilerplate\" | sed -e 's|^this|.|;s|--|/|g'` && \\\n\t\tdir=`expr \"$$dst\" : '\\(.*\\)/'` && \\\n\t\tmkdir -p blt/$$dir && \\\n\t\tcase \"$$boilerplate\" in \\\n\t\t*--) ;; \\\n\t\t*) cp $$boilerplate blt/$$dst ;; \\\n\t\tesac || exit; \\\n\tdone && \\\n\tdate >$@\n"},{"id":"87596","messageId":"7vbpzplw9o.fsf@gitster.siamese.dyndns.org","threadId":"15076","inReplyTo":"gPlIc7E6mNDrXE6mwaHXFoin7rDpLmjvuzlhJfCp-YmuyVK3pEzqNA@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] test-lib.sh: work around ksh's trap shortcomings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-18T23:48:51Z","receivedAt":"2008-08-18T23:48:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> In ksh, if trap is called within a function with 0 or EXIT as its signal,\n> then the trap will be executed at the time the function returns. This\n> causes a problem in the test functions since 'trap - exit' is called\n> within the test_done function\n\nYour alias test_done that calls function test_done look ugly and confusing\nbeyond words.  Perhaps test_done() can instead set a global variable and\ndie() can notice it instead, like this?  I haven't bothered to change the\nother \"trap - exit\" but I think you got the idea...\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 11c0275..010bfda 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -156,10 +156,16 @@ test_count=0\n test_fixed=0\n test_broken=0\n test_success=0\n+test_exit_ok=0\n \n die () {\n-\techo >&5 \"FATAL: Unexpected exit with code $?\"\n-\texit 1\n+\tstatus=$?\n+\tif test 1 != $test_exit_ok\n+\tthen\n+\t\techo >&5 \"FATAL: Unexpected exit with code $status\"\n+\t\texit 1\n+\tfi\n+\texit $status\n }\n \n trap 'die' exit\n@@ -415,6 +421,7 @@ test_create_repo () {\n }\n \n test_done () {\n+\ttest_exit_ok=1\n \ttrap - exit\n \ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n \tmkdir -p \"$test_results_dir\"\n"},{"id":"87597","messageId":"qw8I-hj2DPdupx-n9x_lbhU3ZInSuv-YQPkZBgfC9axOHo5NEzzrEQ@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil","subject":"Re: [FYI] How I compile on IRIX 6.5 with the MIPSpro compiler and ksh","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-18T23:51:54Z","receivedAt":"2008-08-18T23:51:54Z","isPatch":false,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"\nI hope these messages threaded correctly for everyone.\n\nThey show up correctly on gmane, but not for me in Thunderbird.\n\nFor me, the Message-Id of the first message is:\n  giNXZFTxzY3B65dQob7CwvwwfSKlZpw_60oz81RxU5UN3PsTT_3dMQ@cipher.nrlssc.navy.mil\nand this is what I provide to git-send-email.\n\nBut when I receive a message sent in such a way back from vger (i.e. using\ngit-send-email to set In-Reply-To), the In-Reply-To field looks like:\n\n  48A9FDCE.3070906@nrlssc.navy.mil\n\nso thunderbird does not nest the replies beneath the original message.\n\n-brandon\n"},{"id":"87615","messageId":"ZqhiQsjr6llIQS0q8PP8utINgu-mnafhFeUc119IDyjsaBEePvtv9g@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"7vbpzplw9o.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] test-lib.sh: work around ksh's trap shortcomings","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-19T00:06:38Z","receivedAt":"2008-08-19T00:06:38Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"\nI will try your suggestions.\n\nI also hope you noticed that these patches followed an FYI message\nand were not meant for direct inclusion. I hope you noticed that\nsince I don't want you to waste your time. Maybe I should have\nput FYI in the [PATCH] string.\n\nThat being said, I (as always) appreciate the comments.\n\n-brandon\n\n\nJunio C Hamano wrote:\n> Brandon Casey <casey@nrlssc.navy.mil> writes:\n> \n>> In ksh, if trap is called within a function with 0 or EXIT as its signal,\n>> then the trap will be executed at the time the function returns. This\n>> causes a problem in the test functions since 'trap - exit' is called\n>> within the test_done function\n> \n> Your alias test_done that calls function test_done look ugly and confusing\n> beyond words.  Perhaps test_done() can instead set a global variable and\n> die() can notice it instead, like this?  I haven't bothered to change the\n> other \"trap - exit\" but I think you got the idea...\n> \n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 11c0275..010bfda 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -156,10 +156,16 @@ test_count=0\n>  test_fixed=0\n>  test_broken=0\n>  test_success=0\n> +test_exit_ok=0\n>  \n>  die () {\n> -\techo >&5 \"FATAL: Unexpected exit with code $?\"\n> -\texit 1\n> +\tstatus=$?\n> +\tif test 1 != $test_exit_ok\n> +\tthen\n> +\t\techo >&5 \"FATAL: Unexpected exit with code $status\"\n> +\t\texit 1\n> +\tfi\n> +\texit $status\n>  }\n>  \n>  trap 'die' exit\n> @@ -415,6 +421,7 @@ test_create_repo () {\n>  }\n>  \n>  test_done () {\n> +\ttest_exit_ok=1\n>  \ttrap - exit\n>  \ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n>  \tmkdir -p \"$test_results_dir\"\n"},{"id":"87627","messageId":"7vtzdhkfo2.fsf@gitster.siamese.dyndns.org","threadId":"15076","inReplyTo":"kbCw6MBjduXNz0eWrsdfGIVr60qjr7cf1eJqhd4l-UzDfHEk1LrlkA@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] t9301-fast-export.sh: don't unset config variable while we're skipping test 4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-19T00:32:45Z","receivedAt":"2008-08-19T00:32:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> ---\n>\n>\n> This is necessary if t9301.4 is included in the GIT_SKIP_TESTS\n> environment variable.\n\nIf it is not skipped what happens?  Does your change break this test?\n\nHow about attempting to unset always (because the test does not want to\nhave the configuration) but ignore the result from the command (because\nthe config may not have had anything to unset to begin with depending on\nwhat happened in the previous tests)?\n\n>  t/t9301-fast-export.sh |    1 -\n>  1 files changed, 0 insertions(+), 1 deletions(-)\n>\n> diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\n> index c19b4a2..475aadd 100755\n> --- a/t/t9301-fast-export.sh\n> +++ b/t/t9301-fast-export.sh\n> @@ -190,7 +190,6 @@ export GIT_COMMITTER_NAME='C O Mitter'\n>  \n>  test_expect_success 'setup copies' '\n>  \n> -\tgit config --unset i18n.commitencoding &&\n>  \tgit checkout -b copy rein &&\n>  \tgit mv file file3 &&\n>  \tgit commit -m move1 &&\n> -- \n> 1.6.0.13.ge1c8\n"},{"id":"87628","messageId":"XjMPN99F86xBqhO6FWdPpHD5Gr3r-dH2xHwjFFmE3P4jw1t54M8gRA@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"7vtzdhkfo2.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] t9301-fast-export.sh: don't unset config variable while we're skipping test 4","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-19T00:39:16Z","receivedAt":"2008-08-19T00:39:16Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Brandon Casey <casey@nrlssc.navy.mil> writes:\n> \n>> ---\n>>\n>>\n>> This is necessary if t9301.4 is included in the GIT_SKIP_TESTS\n>> environment variable.\n> \n> If it is not skipped what happens?  Does your change break this test?\n\nYes, it was only meant as an example to be used along with the build\nscript I supplied.\n\n> How about attempting to unset always (because the test does not want to\n> have the configuration) but ignore the result from the command (because\n> the config may not have had anything to unset to begin with depending on\n> what happened in the previous tests)?\n\nYes, unsetting always and ignoring the result would allow this test to\npass. It could also be moved into its own test so that it could be skipped\nusing GIT_SKIP_TESTS, but still signal failure when it is not skipped.\n\n-brandon\n"},{"id":"87631","messageId":"FnxO7Orp3rSZw-HOO0O0Mr3CM46BkVX3CwFWT098m6GBmWq0jNk82A@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"7vhc9hlwt3.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] templates/Makefile: work around SGI install which assumes / if ROOT not defined","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-19T00:52:50Z","receivedAt":"2008-08-19T00:52:50Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> I do not see absolutely any reason to use install there.\n> \n> I have to wonder why 9907721 (templates/Makefile: don't depend on local\n> umask setting, 2008-02-28) did not do this instead:\n> \n> \t$(QUIET)umask 022 && ls *--* 2>/dev/null | \\\n> \twhile read boilerplate; \\\n> \tdo \\\n> \t\tcase \"$$boilerplate\" in *~) continue ;; esac && \\\n> \t\tdst=`echo \"$$boilerplate\" | sed -e 's|^this|.|;s|--|/|g'` && \\\n> \t\tdir=`expr \"$$dst\" : '\\(.*\\)/'` && \\\n> \t\tmkdir -p blt/$$dir && \\\n> \t\tcase \"$$boilerplate\" in \\\n> \t\t*--) ;; \\\n> \t\t*) cp $$boilerplate blt/$$dst ;; \\\n> \t\tesac || exit; \\\n> \tdone && \\\n> \tdate >$@\n> \n\nThat works just fine for me.\n\n-brandon\n"},{"id":"87633","messageId":"alpine.LNX.1.10.0808181915080.27911@xenau.zenez.com","threadId":"15076","inReplyTo":"qw8I-hj2DPdupx-n9x_lbhU3ZInSuv-YQPkZBgfC9axOHo5NEzzrEQ@cipher.nrlssc.navy.mil","subject":"Re: [FYI] How I compile on IRIX 6.5 with the MIPSpro compiler and ksh","fromName":"Boyd Lynn Gerber","fromEmail":"gerberb@zenez.com","sentAt":"2008-08-19T01:18:22Z","receivedAt":"2008-08-19T01:18:22Z","isPatch":false,"sender":{"key":"gerberb@zenez.com","avatar":null},"body":"I would have liked to see \n\nSubject : patch [0/7] How to compile IRIX 6.5 w/ MIPSpro compiler/ksh\n...\nSubject : patch [7/7] How to compile IRIX 6.5 w/ MIPSpro compiler/ksh\n\nIt would be easier to follow all your patches with all the other email on \nthe lists.\n\nThanks,\n\n--\nBoyd Gerber <gerberb@zenez.com>\nZENEZ\t1042 East Fort Union #135, Midvale Utah  84047\n"},{"id":"87634","messageId":"VwGqSQqTmS_71c2tEIK0D2cjMpjvYOmdxqdCmj-vQqTdUYLOigUCNQ@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"alpine.LNX.1.10.0808181915080.27911@xenau.zenez.com","subject":"Re: [FYI] How I compile on IRIX 6.5 with the MIPSpro compiler and ksh","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-19T01:25:36Z","receivedAt":"2008-08-19T01:25:36Z","isPatch":false,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Boyd Lynn Gerber wrote:\n> I would have liked to see \n> \n> Subject : patch [0/7] How to compile IRIX 6.5 w/ MIPSpro compiler/ksh\n> ...\n> Subject : patch [7/7] How to compile IRIX 6.5 w/ MIPSpro compiler/ksh\n> \n> It would be easier to follow all your patches with all the other email on \n> the lists.\n\nwhoops, yeah, I should have done that. Sorry.\n\n-brandon\n"},{"id":"87636","messageId":"cqiOMMbzSSjqZoLDEa5uscl2d0D71PrGu2TpSOULLuV5nTVnEEWCzQ@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"7vbpzplw9o.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] test-lib.sh: work around ksh's trap shortcomings","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-19T01:27:14Z","receivedAt":"2008-08-19T01:27:14Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Your alias test_done that calls function test_done look ugly and confusing\n> beyond words.  Perhaps test_done() can instead set a global variable and\n> die() can notice it instead, like this?  I haven't bothered to change the\n> other \"trap - exit\" but I think you got the idea...\n\nYes that works and is much clearer. Tested on solaris and irix.\n\n-brandon\n"},{"id":"87655","messageId":"7v3al1h2rk.fsf@gitster.siamese.dyndns.org","threadId":"15076","inReplyTo":"ZqhiQsjr6llIQS0q8PP8utINgu-mnafhFeUc119IDyjsaBEePvtv9g@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] test-lib.sh: work around ksh's trap shortcomings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-19T07:39:43Z","receivedAt":"2008-08-19T07:39:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> Junio C Hamano wrote:\n>> Brandon Casey <casey@nrlssc.navy.mil> writes:\n>> \n>>> In ksh, if trap is called within a function with 0 or EXIT as its signal,\n>>> then the trap will be executed at the time the function returns. This\n>>> causes a problem in the test functions since 'trap - exit' is called\n>>> within the test_done function\n>> \n>> Your alias test_done that calls function test_done look ugly and confusing\n>> beyond words.\n> ...\n> I will try your suggestions.\n>\n> I also hope you noticed that these patches followed an FYI message\n> and were not meant for direct inclusion. I hope you noticed that\n> since I don't want you to waste your time. Maybe I should have\n> put FYI in the [PATCH] string.\n\nYeah, I think I got the subtle distinction between [PATCH FYI], [PATCH]\nand ones with and without sign-offs.\n\nI've read \"trap\" section of 1003.1 2004 three times but I do not see the\nexact definition of \"EXIT\" condition mentioned.  Is the behaviour to\nconsider \"function return\" the EXIT condition considered a \"shortcoming\"\n(aka bug)?\n"},{"id":"87705","messageId":"nRhBKqCwHxZZH8zh17SOnUKHFp0V5HZj8_Lcmybj49DM7L4TYYoZbQ@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"7v3al1h2rk.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] test-lib.sh: work around ksh's trap shortcomings","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-19T14:59:52Z","receivedAt":"2008-08-19T14:59:52Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n\n> Yeah, I think I got the subtle distinction between [PATCH FYI], [PATCH]\n> and ones with and without sign-offs.\n\nHeh, so subtle as to be unintentional. I think I mucked up that posting.\nI should have labeled them all FYI and numbered them. I did hope there\nwould be some discussion that would result in a followup patch for\nsubmission.\n\n> I've read \"trap\" section of 1003.1 2004 three times but I do not see the\n> exact definition of \"EXIT\" condition mentioned.  Is the behaviour to\n> consider \"function return\" the EXIT condition considered a \"shortcoming\"\n> (aka bug)?\n\nNo, I think it is the defined behavior for the Korn shell.\n\nThe SunOS 5.7 man page states:\n\n     If sig  is  0 or EXIT and the trap  statement is exe-\n     cuted inside the body of a function, then the com-\n     mand arg is executed after the function completes.\n     If sig is 0 or EXIT for a trap   set  outside  any\n     function, the command arg is executed on exit from\n     the shell.\n\nThe IRIX 6.5 man page has the exact same wording.\n\nOn linux, the man page for the public domain Korn shell states\n\n    Functions  defined with the function reserved word are treated differ-\n    ently in the following ways from functions defined with the  ()  nota-\n    tion:\n\n        ...\n\n      - The EXIT trap, if set in a function, will be executed after the\n        function returns.\n\nBut then later in the trap section:\n\n    The original Korn shell’s DEBUG trap and the  handling  of  ERR\n    and EXIT traps in functions are not yet implemented.\n\n\nIf Korn shell is to be supported, it seems that trap on EXIT must be\navoided within functions. I think the only one is in git-bisect.\n\n-brandon\n"},{"id":"87776","messageId":"nEEUmh6BVMDYtwf1vENCYuaLiFUWKW_dbgPP__ECl3s@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"cqiOMMbzSSjqZoLDEa5uscl2d0D71PrGu2TpSOULLuV5nTVnEEWCzQ@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] test-lib.sh: work around ksh's trap shortcomings","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-20T00:19:13Z","receivedAt":"2008-08-20T00:19:13Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Brandon Casey wrote:\n> Junio C Hamano wrote:\n>> Your alias test_done that calls function test_done look ugly and confusing\n>> beyond words.  Perhaps test_done() can instead set a global variable and\n>> die() can notice it instead, like this?  I haven't bothered to change the\n>> other \"trap - exit\" but I think you got the idea...\n> \n> Yes that works and is much clearer. Tested on solaris and irix.\n\nI spoke too soon. Failing tests do not terminate the testing.\n\nksh does not place the exit status of the shell in $? or provide it as an argument\nto the trap function. Possibly the status of the 'exit' command is provided instead?\n\n$ cat test.sh\n#!/bin/sh\n\ndie () {\n    status=$?\n    echo >&2 \"die status: $status\"\n    exit $status\n}\n\ntrap 'die' 0\n\necho \"I am dying\"\nexit 1\n\n###### END TEST SCRIPT ######\n\nlinux $ /bin/sh test.sh\nI am dying\ndie status: 1\nlinux $ echo $?\n1\n\nlinux $ /usr/bin/ksh test.sh\nI am dying\ndie status: 1\nlinux $ echo $?\n1\n\nIRIX $ /bin/ksh test.sh\nI am dying\ndie status: 0\nIRIX $ echo $?\n0\n\nSunOS $ /usr/xpg4/bin/sh test.sh\nI am dying\ndie status: 0\nSunOS $ echo $?\n0\n\nAh, no, it looks like the status of the command executed immediately before\nexit is what the trap has access to in $?. Adding a call to false before exit\nin the above script causes the korn scripts to exit with status 1 on IRIX and\nSunOS.\n\n#!/bin/sh\n\ndie () {\n    status=$?\n    echo >&2 \"die status: $status\"\n    exit $status\n}\n\ntrap 'die' 0\n\necho \"I am dying\"\nfalse\nexit 1\n\n-brandon\n"},{"id":"87813","messageId":"e2b179460808200436p1c35da29h5e895f44346df80d@mail.gmail.com","threadId":"15076","inReplyTo":"nEEUmh6BVMDYtwf1vENCYuaLiFUWKW_dbgPP__ECl3s@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] test-lib.sh: work around ksh's trap shortcomings","fromName":"Mike Ralphson","fromEmail":"mike.ralphson@gmail.com","sentAt":"2008-08-20T11:36:06Z","receivedAt":"2008-08-20T11:36:06Z","isPatch":true,"sender":{"key":"mike.ralphson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/21603?v=4"},"body":"2008/8/20 Brandon Casey <casey@nrlssc.navy.mil>\n>\n> Brandon Casey wrote:\n> > Junio C Hamano wrote:\n> >> Your alias test_done that calls function test_done look ugly and confusing\n> >> beyond words.  Perhaps test_done() can instead set a global variable and\n> >> die() can notice it instead, like this?  I haven't bothered to change the\n> >> other \"trap - exit\" but I think you got the idea...\n> >\n> > Yes that works and is much clearer. Tested on solaris and irix.\n>\n> I spoke too soon. Failing tests do not terminate the testing.\n>\n> ksh does not place the exit status of the shell in $? or provide it as an argument\n> to the trap function. ...  it looks like the status of the command executed immediately before\n> exit is what the trap has access to in $?. Adding a call to false before exit\n> in the above script causes the korn scripts to exit with status 1 on IRIX and\n> SunOS.\n\nJust to report the same findings with AIX 5.3's /bin/sh (which is\n/bin/ksh), /bin/ksh93 and even /bin/bsh\n\nMike\n"},{"id":"88068","messageId":"y-OStBu9jZ4ghBeO7Duf6UrkhSEZFsB9o5V_P-EgCcq3k1diXe1EAA@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"7vhc9hlwt3.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] templates/Makefile: install is unnecessary, just use mkdir -p","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-22T00:31:50Z","receivedAt":"2008-08-22T00:31:50Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nThe native install on some platforms (namely IRIX 6.5) treats non-absolute\npaths as being relative to the root directory rather than relative to\nthe current directory. Work around this by avoiding install in this case\nsince it is unnecessary, and instead depend on the local umask setting\nand use mkdir.\n\nTested-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nJunio C Hamano wrote:\n\n> I do not see absolutely any reason to use install there.\n> \n> I have to wonder why 9907721 (templates/Makefile: don't depend on local\n> umask setting, 2008-02-28) did not do this instead:\n\nworks for me.\n\n-brandon\n\n\n templates/Makefile |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/templates/Makefile b/templates/Makefile\nindex cc3fc30..0722a92 100644\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -23,13 +23,13 @@ all: boilerplates.made custom\n \n bpsrc = $(filter-out %~,$(wildcard *--*))\n boilerplates.made : $(bpsrc)\n-\t$(QUIET)ls *--* 2>/dev/null | \\\n+\t$(QUIET)umask 022 && ls *--* 2>/dev/null | \\\n \twhile read boilerplate; \\\n \tdo \\\n \t\tcase \"$$boilerplate\" in *~) continue ;; esac && \\\n \t\tdst=`echo \"$$boilerplate\" | sed -e 's|^this|.|;s|--|/|g'` && \\\n \t\tdir=`expr \"$$dst\" : '\\(.*\\)/'` && \\\n-\t\t$(INSTALL) -d -m 755 blt/$$dir && \\\n+\t\tmkdir -p blt/$$dir && \\\n \t\tcase \"$$boilerplate\" in \\\n \t\t*--) ;; \\\n \t\t*) cp -p $$boilerplate blt/$$dst ;; \\\n-- \n1.6.0.21.g35a2e\n"},{"id":"88071","messageId":"ZdQ6b4vecqtrZ-7Mze6M9UBwrI9qQRUu-BoApXUv0v2zM76stzXd3w@cipher.nrlssc.navy.mil","threadId":"15076","inReplyTo":"7vtzdhkfo2.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] t9301-fast-export: move unset of config variable into its own test function","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-22T00:48:49Z","receivedAt":"2008-08-22T00:48:49Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"On platforms with a broken iconv it may be necessary to skip the fourth\ntest in this script. Test four sets the i18n.commitencoding config variable.\nIf test four is skipped, then a later unset of the i18n.commitencoding\nconfig variable will return a non-zero exit status and cause a test to fail.\nSo move the 'config --unset' into its own test function which allows it to\nbe skipped independently.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n t/t9301-fast-export.sh |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex 3cb9f80..41d444d 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -185,12 +185,17 @@ test_expect_success 'submodule fast-export | fast-import' '\n \n '\n \n+test_expect_success 'unset i18n.commitencoding' '\n+\n+\tgit config --unset i18n.commitencoding\n+\n+'\n+\n export GIT_AUTHOR_NAME='A U Thor'\n export GIT_COMMITTER_NAME='C O Mitter'\n \n test_expect_success 'setup copies' '\n \n-\tgit config --unset i18n.commitencoding &&\n \tgit checkout -b copy rein &&\n \tgit mv file file3 &&\n \tgit commit -m move1 &&\n-- \n1.6.0.21.g35a2e\n"},{"id":"88104","messageId":"7vbpzlbgyl.fsf@gitster.siamese.dyndns.org","threadId":"15076","inReplyTo":"ZdQ6b4vecqtrZ-7Mze6M9UBwrI9qQRUu-BoApXUv0v2zM76stzXd3w@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] t9301-fast-export: move unset of config variable into its own test function","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-22T08:18:42Z","receivedAt":"2008-08-22T08:18:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> On platforms with a broken iconv it may be necessary to skip the fourth\n> test in this script. Test four sets the i18n.commitencoding config variable.\n> If test four is skipped, then a later unset of the i18n.commitencoding\n> config variable will return a non-zero exit status and cause a test to fail.\n> So move the 'config --unset' into its own test function which allows it to\n> be skipped independently.\n\nI do not know if this is worth it, and I am reasonably sure this is not an\noptimal solution for this particular case.\n\nMany existing pieces in the test scripts, I even suspect majority of them,\ndo depend on earlier piece in the sequence to succeed and try to build on\ntop of the state they have left.  In the ideal world, especially when the\nsoftware is young and flaky, perhaps that should not be the case and\nhaving test pieces that are as independent as each other would be easier\nto fix many tests that do not pass, but these days we expect all tests to\npass, so running tests has become like reading the error output from\ncompilers --- very often, the first error is the only one that counts.\n\nEven though test-lib.sh does support skipping individual test pieces by\nadding t9301.12 to GIT_TEST_SKIP, it is not very useful in practice with\nthe current set of tests, it would involve huge effort to make it reliably\nusable, and individual test pieces in the end result from such an effort\nwill have to perform their own set-up from scratch, which would mean the\ntest will take even longer to run, to catch occasional breakages.\n\nFor this particular case, what we are interested in testing is not that\n\"config --unset\" exits with 0 status.  We are however interested in making\nsure that i18n.commitencoding is not set when the body of #12 runs.\n\nSo I think a more appropriate change would be something like this for this\nparticular case.\n\n t/t9301-fast-export.sh |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git c/t/t9301-fast-export.sh i/t/t9301-fast-export.sh\nindex 3cb9f80..2ce2aff 100755\n--- c/t/t9301-fast-export.sh\n+++ i/t/t9301-fast-export.sh\n@@ -190,7 +190,9 @@ export GIT_COMMITTER_NAME='C O Mitter'\n \n test_expect_success 'setup copies' '\n \n-\tgit config --unset i18n.commitencoding &&\n+\tgit config --unset i18n.commitencoding\n+\n+\ttest -z $(git config i18n.commitencoding) &&\n \tgit checkout -b copy rein &&\n \tgit mv file file3 &&\n \tgit commit -m move1 &&\n"},{"id":"88105","messageId":"7v7ia9bgqc.fsf@gitster.siamese.dyndns.org","threadId":"15076","inReplyTo":"7vbpzlbgyl.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] t9301-fast-export: move unset of config variable into its own test function","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-22T08:23:39Z","receivedAt":"2008-08-22T08:23:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> For this particular case, what we are interested in testing is not that\n> \"config --unset\" exits with 0 status.  We are however interested in making\n> sure that i18n.commitencoding is not set when the body of #12 runs.\n>\n> So I think a more appropriate change would be something like this for this\n> particular case.\n\nHaving said that, we may want to have an easier way to exclude certain\nclasses of pieces, and also encourage test writers to group pieces that\nare related to these classes together.\n\nFor example, this introduces a new environment you can set,\nGIT_SKIP_TEST_CLASS, which is a space separated list of classes of\nfeatures that you would want to exclude from the test.\ntest_expect_success/failure can now take an optional \"class token\" as the\nfirst parameter (they traditionally took only two parameters, but with\nclass token, they take three).\n\nThis example defines I18N class, and lets you exclude the one you were\nmanually excluding with \"GIT_SKIP_TESTS=t9301.4\"\n\n\n t/t9301-fast-export.sh |    2 +-\n t/test-lib.sh          |   50 ++++++++++++++++++++++++++++++++++++++++++-----\n 2 files changed, 45 insertions(+), 7 deletions(-)\n\ndiff --git i/t/t9301-fast-export.sh w/t/t9301-fast-export.sh\nindex 2ce2aff..361e8dc 100755\n--- i/t/t9301-fast-export.sh\n+++ w/t/t9301-fast-export.sh\n@@ -63,7 +63,7 @@ test_expect_success 'fast-export master~2..master' '\n \n '\n \n-test_expect_success 'iso-8859-1' '\n+test_expect_success I18N 'iso-8859-1' '\n \n \tgit config i18n.commitencoding ISO-8859-1 &&\n \t# use author and committer name in ISO-8859-1 to match it.\ndiff --git i/t/test-lib.sh w/t/test-lib.sh\nindex e2b106c..88d6d50 100644\n--- i/t/test-lib.sh\n+++ w/t/test-lib.sh\n@@ -232,22 +232,44 @@ test_run_ () {\n \treturn 0\n }\n \n+# space sparated list of skippable test classes\n+GIT_SKIPPABLE_TEST_CLASSES='I18N'\n+\n test_skip () {\n \tthis_test=$(expr \"./$0\" : '.*/\\(t[0-9]*\\)-[^/]*$')\n \tthis_test=\"$this_test.$(expr \"$test_count\" + 1)\"\n+\n \tto_skip=\n-\tfor skp in $GIT_SKIP_TESTS\n-\tdo\n-\t\tcase \"$this_test\" in\n-\t\t$skp)\n+\tif test -n \"$test_class\"\n+\tthen\n+\t\tcase \" $GIT_SKIPPABLE_TEST_CLASSES \" in\n+\t\t*\" $test_class \"*) ;; # ok\n+\t\t*)\n+\t\t\tsay_color error \"'$test_class' is not a skippable test class\"\n+\t\t\terror \"Skippable are $GIT_SKIPPABLE_TEST_CLASSES\"\n+\t\tesac\n+\t\tcase \" $GIT_SKIP_TEST_CLASS \" in\n+\t\t*\" $test_class \"*)\n \t\t\tto_skip=t\n+\t\t\ttest_class=\"($test_class) \"\n \t\tesac\n-\tdone\n+\tfi\n+\tif test -z \"$to_skip\"\n+\tthen\n+\t\tfor skp in $GIT_SKIP_TESTS\n+\t\tdo\n+\t\t\tcase \"$this_test\" in\n+\t\t\t$skp)\n+\t\t\t\tto_skip=t\n+\t\t\t\tbreak\n+\t\t\tesac\n+\t\tdone\n+\tfi\n \tcase \"$to_skip\" in\n \tt)\n \t\tsay_color skip >&3 \"skipping test: $@\"\n \t\ttest_count=$(expr \"$test_count\" + 1)\n-\t\tsay_color skip \"skip $test_count: $1\"\n+\t\tsay_color skip \"skip $test_count: $test_class$1\"\n \t\t: true\n \t\t;;\n \t*)\n@@ -257,6 +279,10 @@ test_skip () {\n }\n \n test_expect_failure () {\n+\tcase $# in\n+\t2)\ttest_class= ;;\n+\t3)\ttest_class=$1; shift ;;\n+\tesac\n \ttest \"$#\" = 2 ||\n \terror \"bug in the test script: not 2 parameters to test-expect-failure\"\n \tif ! test_skip \"$@\"\n@@ -274,6 +300,10 @@ test_expect_failure () {\n }\n \n test_expect_success () {\n+\tcase $# in\n+\t2)\ttest_class= ;;\n+\t3)\ttest_class=$1; shift ;;\n+\tesac\n \ttest \"$#\" = 2 ||\n \terror \"bug in the test script: not 2 parameters to test-expect-success\"\n \tif ! test_skip \"$@\"\n@@ -291,6 +321,10 @@ test_expect_success () {\n }\n \n test_expect_code () {\n+\tcase $# in\n+\t3)\ttest_class= ;;\n+\t4)\ttest_class=$1; shift ;;\n+\tesac\n \ttest \"$#\" = 3 ||\n \terror \"bug in the test script: not 3 parameters to test-expect-code\"\n \tif ! test_skip \"$@\"\n@@ -316,6 +350,10 @@ test_expect_code () {\n # Usage: test_external description command arguments...\n # Example: test_external 'Perl API' perl ../path/to/test.pl\n test_external () {\n+\tcase $# in\n+\t3)\ttest_class= ;;\n+\t4)\ttest_class=$1; shift ;;\n+\tesac\n \ttest \"$#\" -eq 3 ||\n \terror >&5 \"bug in the test script: not 3 parameters to test_external\"\n \tdescr=\"$1\"\n"},{"id":"88109","messageId":"48AE8093.4070609@viscovery.net","threadId":"15076","inReplyTo":"7v7ia9bgqc.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] t9301-fast-export: move unset of config variable into its own test function","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-08-22T09:02:11Z","receivedAt":"2008-08-22T09:02:11Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano schrieb:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> For this particular case, what we are interested in testing is not that\n>> \"config --unset\" exits with 0 status.  We are however interested in making\n>> sure that i18n.commitencoding is not set when the body of #12 runs.\n>>\n>> So I think a more appropriate change would be something like this for this\n>> particular case.\n> \n> Having said that, we may want to have an easier way to exclude certain\n> classes of pieces, and also encourage test writers to group pieces that\n> are related to these classes together.\n> \n> For example, this introduces a new environment you can set,\n> GIT_SKIP_TEST_CLASS, which is a space separated list of classes of\n> features that you would want to exclude from the test.\n> test_expect_success/failure can now take an optional \"class token\" as the\n> first parameter (they traditionally took only two parameters, but with\n> class token, they take three).\n\nNice idea. Another class would be the tests that depend on that the\nfilesystem supports symbolic links.\n\n> -test_expect_success 'iso-8859-1' '\n> +test_expect_success I18N 'iso-8859-1' '\n\nHow do the tests look like if this token is the *last* argument?\n\nTo continue the idea, please look into t5302-pack-index.sh: We skip some\ntests if we don't have support for 64bit file offsets. Making these tests\na \"static\" class would not be appropriate because the condition whether\n64bit support is present is derived dynamically by the testsuite. What if\nwe could write tests like this:\n\ntest_expect_success \\\n    'index v2: verify a pack with some 64-bit offsets' \\\n    'git verify-pack -v \"test-3-${pack3}.pack\"' \\\n    'test \"$have_64bits\"'\n\ni.e. the 3rd argument is a condition that tells whether the test should be\nrun. And in other cases the 3rd argument is the token that you propose:\n\ntest_expect_success 'iso-8859-1' '\n\n     ...test goes here...\n\n' I18N\n\nHm?\n\n-- Hannes\n"},{"id":"88199","messageId":"7vljyo92ln.fsf@gitster.siamese.dyndns.org","threadId":"15076","inReplyTo":"48AE8093.4070609@viscovery.net","subject":"Re: [PATCH] t9301-fast-export: move unset of config variable into its own test function","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-22T21:11:48Z","receivedAt":"2008-08-22T21:11:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Nice idea. Another class would be the tests that depend on that the\n> filesystem supports symbolic links.\n>\n>> -test_expect_success 'iso-8859-1' '\n>> +test_expect_success I18N 'iso-8859-1' '\n>\n> How do the tests look like if this token is the *last* argument?\n\nI thought about it but rejected it because it is much easier to spot class\ntokens if it comes immediately after test_expect_xyzzy.\n\nI suspect that certain classes of tests that need to be skipped can be\nautodetected inside test-lib.sh; it would be an independent topic to build\non top of this.  Your example of 64-bit may be one of them.\n"}]}