{"thread":{"id":"23037","subject":"[patch 01/15] user-cppflags.patch","startedAt":"2010-03-16T05:42:20Z","lastAt":"2010-04-25T08:39:55Z","messageCount":37,"participants":["Gary V. Vaughan","Sverre Rabbelier","Junio C Hamano","Johannes Sixt","Brandon Casey","Avery Pennarun"],"isPatch":true,"patchVersion":1,"patchTotal":15},"messages":[{"id":"136930","messageId":"20100316054220.075676000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":null,"subject":"[patch 00/15] Portability Patches v3","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:20Z","receivedAt":"2010-03-16T05:42:20Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Here are the portability patches we needed at TWW to enable\ngit-1.7.0.2 to compile and run on all of the wide range of Unix\nmachines we support.  These patches apply to the git-1.7.0.2 release,\nand address all of the feedback from the previous two times I posted\nthem to this list, most particularly splitting everything into many\nsmall self-contained chunks.\n\nNote that I have not invested the time to figure out why the testsuite\nis mostly useless on everything but Linux and Solaris 8+, because I'm\nreasonably satisfied that the build itself is working properly.  Most\nlikely, it is merely GNUisms in the way the test cases call external\ntools.  But maybe I'm missing something, but even the 3 new patches to\naddress test errors when diff does not support the -u option don't\nimprove the testsuite situation on HPUX, AIX, OSF1 and Solaris 7 and\nolder.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136924","messageId":"20100316054300.978104000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 01/15] user-cppflags.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:21Z","receivedAt":"2010-03-16T05:42:21Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Without this patch there is no straight forward way to pass additional\nCPPFLAGS at configure-time.  At TWW, everything non-vendor package is\ninstalled to its own subdirectory, so we need the following to show\nthe preprocessor where the headers for the libraries we will link\nlater can be found:\n\n\t$SHELL ./configure \\\n\tCPPFLAGS=\"-I${SB_VAR_CURL_INC}\\\n\t -I${SB_VAR_LIBEXPAT_INC}\\\n\t -I${SB_VAR_LIBZ_INC}\\\n\t${CPPFLAGS+ $CPPFLAGS}\" <<...>>\n---\n Makefile      |    6 ++++--\n config.mak.in |    1 +\n configure.ac  |    1 +\n 3 files changed, 6 insertions(+), 2 deletions(-)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -236,7 +236,7 @@ endif\n \n CFLAGS = -g -O2 -Wall\n LDFLAGS =\n-ALL_CFLAGS = $(CFLAGS)\n+ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n STRIP ?= strip\n \nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -3,6 +3,7 @@\n \n CC = @CC@\n CFLAGS = @CFLAGS@\n+CPPFLAGS = @CPPFLAGS@\n LDFLAGS = @LDFLAGS@\n CC_LD_DYNPATH = @CC_LD_DYNPATH@\n AR = @AR@\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136936","messageId":"20100316054306.167331000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 02/15] const-expr.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:22Z","receivedAt":"2010-03-16T05:42:22Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Unfortunately, there are still plenty of production systems with\nvendor compilers that choke unless all compound declarations can be\ndetermined statically at compile time, for example hpux10.20 (I can\nprovide a comprehensive list of our supported platforms that exhibit\nthis problem if necessary).\n\nThis patch simply breaks apart any compound declarations with dynamic\ninitialisation expressions, and moves the initialisation until after\nthe last declaration in the same block, in all the places necessary to\nhave the offending compilers accept the code.\n---\n builtin-add.c      |    4 +++-\n builtin-blame.c    |   10 ++++++----\n builtin-cat-file.c |    4 +++-\n builtin-checkout.c |    3 ++-\n builtin-commit.c   |    3 ++-\n builtin-fetch.c    |    6 ++++--\n builtin-remote.c   |    9 ++++++---\n convert.c          |    4 +++-\n daemon.c           |   19 ++++++++++---------\n ll-merge.c         |   14 +++++++-------\n refs.c             |    6 +++++-\n remote.c           |    3 +--\n unpack-trees.c     |    4 +++-\n wt-status.c        |   23 ++++++++++++-----------\n 14 files changed, 67 insertions(+), 45 deletions(-)\n\nIndex: b/convert.c\n===================================================================\n--- a/convert.c\n+++ b/convert.c\n@@ -249,7 +249,9 @@ static int filter_buffer(int in, int out\n \tstruct child_process child_process;\n \tstruct filter_params *params = (struct filter_params *)data;\n \tint write_err, status;\n-\tconst char *argv[] = { params->cmd, NULL };\n+\tconst char *argv[] = { NULL, NULL };\n+\n+\targv[0] = params->cmd;\n \n \tmemset(&child_process, 0, sizeof(child_process));\n \tchild_process.argv = argv;\nIndex: b/remote.c\n===================================================================\n--- a/remote.c\n+++ b/remote.c\n@@ -657,10 +657,9 @@ static struct refspec *parse_refspec_int\n \n int valid_fetch_refspec(const char *fetch_refspec_str)\n {\n-\tconst char *fetch_refspec[] = { fetch_refspec_str };\n \tstruct refspec *refspec;\n \n-\trefspec = parse_refspec_internal(1, fetch_refspec, 1, 1);\n+\trefspec = parse_refspec_internal(1, &fetch_refspec_str, 1, 1);\n \tfree_refspecs(refspec, 1);\n \treturn !!refspec;\n }\nIndex: b/unpack-trees.c\n===================================================================\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -287,9 +287,11 @@ static void add_same_unmerged(struct cac\n static int unpack_index_entry(struct cache_entry *ce,\n \t\t\t      struct unpack_trees_options *o)\n {\n-\tstruct cache_entry *src[5] = { ce, NULL, };\n+\tstruct cache_entry *src[5] = { NULL, NULL };\n \tint ret;\n \n+\tsrc[0] = ce;\n+\n \tmark_ce_used(ce, o);\n \tif (ce_stage(ce)) {\n \t\tif (o->skip_unmerged) {\nIndex: b/daemon.c\n===================================================================\n--- a/daemon.c\n+++ b/daemon.c\n@@ -141,15 +141,14 @@ static char *path_ok(char *directory)\n \t}\n \telse if (interpolated_path && saw_extended_args) {\n \t\tstruct strbuf expanded_path = STRBUF_INIT;\n-\t\tstruct strbuf_expand_dict_entry dict[] = {\n-\t\t\t{ \"H\", hostname },\n-\t\t\t{ \"CH\", canon_hostname },\n-\t\t\t{ \"IP\", ip_address },\n-\t\t\t{ \"P\", tcp_port },\n-\t\t\t{ \"D\", directory },\n-\t\t\t{ NULL }\n-\t\t};\n+\t\tstruct strbuf_expand_dict_entry dict[6];\n \n+\t\tdict[0].placeholder = \"H\"; dict[0].value = hostname;\n+\t\tdict[1].placeholder = \"CH\"; dict[1].value = canon_hostname;\n+\t\tdict[2].placeholder = \"IP\"; dict[2].value = ip_address;\n+\t\tdict[3].placeholder = \"P\"; dict[3].value = tcp_port;\n+\t\tdict[4].placeholder = \"D\"; dict[4].value = directory;\n+\t\tdict[5].placeholder = NULL; dict[5].value = NULL;\n \t\tif (*dir != '/') {\n \t\t\t/* Allow only absolute */\n \t\t\tlogerror(\"'%s': Non-absolute path denied (interpolated-path active)\", dir);\n@@ -343,7 +342,9 @@ static int upload_pack(void)\n {\n \t/* Timeout as string */\n \tchar timeout_buf[64];\n-\tconst char *argv[] = { \"upload-pack\", \"--strict\", timeout_buf, \".\", NULL };\n+\tconst char *argv[] = { \"upload-pack\", \"--strict\", NULL, \".\", NULL };\n+\n+\targv[2] = timeout_buf;\n \n \tsnprintf(timeout_buf, sizeof timeout_buf, \"--timeout=%u\", timeout);\n \treturn run_service_command(argv);\nIndex: b/wt-status.c\n===================================================================\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -464,17 +464,18 @@ static void wt_status_print_submodule_su\n \tstruct child_process sm_summary;\n \tchar summary_limit[64];\n \tchar index[PATH_MAX];\n-\tconst char *env[] = { index, NULL };\n-\tconst char *argv[] = {\n-\t\t\"submodule\",\n-\t\t\"summary\",\n-\t\tuncommitted ? \"--files\" : \"--cached\",\n-\t\t\"--for-status\",\n-\t\t\"--summary-limit\",\n-\t\tsummary_limit,\n-\t\tuncommitted ? NULL : (s->amend ? \"HEAD^\" : \"HEAD\"),\n-\t\tNULL\n-\t};\n+\tconst char *env[] = { NULL, NULL };\n+\tconst char *argv[8];\n+\n+\tenv[0] =\tindex;\n+\targv[0] =\t\"submodule\";\n+\targv[1] =\t\"summary\";\n+\targv[2] =\tuncommitted ? \"--files\" : \"--cached\";\n+\targv[3] =\t\"--for-status\";\n+\targv[4] =\t\"--summary-limit\";\n+\targv[5] =\tsummary_limit;\n+\targv[6] =\tuncommitted ? NULL : (s->amend ? \"HEAD^\" : \"HEAD\");\n+\targv[7] =\tNULL;\n \n \tsprintf(summary_limit, \"%d\", s->submodule_summary);\n \tsnprintf(index, sizeof(index), \"GIT_INDEX_FILE=%s\", s->index_file);\nIndex: b/ll-merge.c\n===================================================================\n--- a/ll-merge.c\n+++ b/ll-merge.c\n@@ -172,17 +172,17 @@ static int ll_ext_merge(const struct ll_\n {\n \tchar temp[4][50];\n \tstruct strbuf cmd = STRBUF_INIT;\n-\tstruct strbuf_expand_dict_entry dict[] = {\n-\t\t{ \"O\", temp[0] },\n-\t\t{ \"A\", temp[1] },\n-\t\t{ \"B\", temp[2] },\n-\t\t{ \"L\", temp[3] },\n-\t\t{ NULL }\n-\t};\n+\tstruct strbuf_expand_dict_entry dict[5];\n \tconst char *args[] = { NULL, NULL };\n \tint status, fd, i;\n \tstruct stat st;\n \n+\tdict[0].placeholder = \"O\"; dict[0].value = temp[0];\n+\tdict[1].placeholder = \"A\"; dict[1].value = temp[1];\n+\tdict[2].placeholder = \"B\"; dict[2].value = temp[2];\n+\tdict[3].placeholder = \"L\"; dict[3].value = temp[3];\n+\tdict[3].placeholder = NULL; dict[3].value = NULL;\n+\n \tif (fn->cmdline == NULL)\n \t\tdie(\"custom merge driver %s lacks command line.\", fn->name);\n \nIndex: b/builtin-commit.c\n===================================================================\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -715,7 +715,8 @@ static int prepare_to_commit(const char \n \n \tif (use_editor) {\n \t\tchar index[PATH_MAX];\n-\t\tconst char *env[2] = { index, NULL };\n+\t\tconst char *env[] = { NULL, NULL };\n+\t\tenv[0] =  index;\n \t\tsnprintf(index, sizeof(index), \"GIT_INDEX_FILE=%s\", index_file);\n \t\tif (launch_editor(git_path(commit_editmsg), NULL, env)) {\n \t\t\tfprintf(stderr,\nIndex: b/builtin-remote.c\n===================================================================\n--- a/builtin-remote.c\n+++ b/builtin-remote.c\n@@ -705,11 +705,14 @@ static int rm(int argc, const char **arg\n \tstruct known_remotes known_remotes = { NULL, NULL };\n \tstruct string_list branches = { NULL, 0, 0, 1 };\n \tstruct string_list skipped = { NULL, 0, 0, 1 };\n-\tstruct branches_for_remote cb_data = {\n-\t\tNULL, &branches, &skipped, &known_remotes\n-\t};\n+\tstruct branches_for_remote cb_data;\n \tint i, result;\n \n+\tmemset(&cb_data,0,sizeof(cb_data));\n+\tcb_data.branches = &branches;\n+\tcb_data.skipped = &skipped;\n+\tcb_data.keep = &known_remotes;\n+\n \tif (argc != 2)\n \t\tusage_with_options(builtin_remote_rm_usage, options);\n \nIndex: b/builtin-blame.c\n===================================================================\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -733,10 +733,11 @@ static int pass_blame_to_parent(struct s\n {\n \tint last_in_target;\n \tmmfile_t file_p, file_o;\n-\tstruct blame_chunk_cb_data d = { sb, target, parent, 0, 0 };\n+\tstruct blame_chunk_cb_data d;\n \txpparam_t xpp;\n \txdemitconf_t xecfg;\n-\n+\tmemset(&d,0,sizeof(d));\n+\td.sb = sb; d.target = target; d.parent=parent;\n \tlast_in_target = find_last_in_target(sb, target);\n \tif (last_in_target < 0)\n \t\treturn 1; /* nothing remains for this target */\n@@ -875,10 +876,11 @@ static void find_copy_in_blob(struct sco\n \tconst char *cp;\n \tint cnt;\n \tmmfile_t file_o;\n-\tstruct handle_split_cb_data d = { sb, ent, parent, split, 0, 0 };\n+\tstruct handle_split_cb_data d;\n \txpparam_t xpp;\n \txdemitconf_t xecfg;\n-\n+\tmemset(&d,0,sizeof(d));\n+\td.sb = sb; d.ent = ent; d.parent = parent; d.split = split;\n \t/*\n \t * Prepare mmfile that contains only the lines in ent.\n \t */\nIndex: b/builtin-cat-file.c\n===================================================================\n--- a/builtin-cat-file.c\n+++ b/builtin-cat-file.c\n@@ -118,7 +118,9 @@ static int cat_one_file(int opt, const c\n \n \t\t/* custom pretty-print here */\n \t\tif (type == OBJ_TREE) {\n-\t\t\tconst char *ls_args[3] = {\"ls-tree\", obj_name, NULL};\n+\t\t\tconst char *ls_args[3] = { NULL, NULL, NULL };\n+\t\t\tls_args[0] =  \"ls-tree\";\n+\t\t\tls_args[1] =  obj_name;\n \t\t\treturn cmd_ls_tree(2, ls_args, NULL);\n \t\t}\n \nIndex: b/refs.c\n===================================================================\n--- a/refs.c\n+++ b/refs.c\n@@ -311,7 +311,11 @@ static int warn_if_dangling_symref(const\n \n void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refname)\n {\n-\tstruct warn_if_dangling_data data = { fp, refname, msg_fmt };\n+\tstruct warn_if_dangling_data data;\n+\n+\tdata.fp = fp;\n+\tdata.refname = refname;\n+\tdata.msg_fmt = msg_fmt;\n \tfor_each_rawref(warn_if_dangling_symref, &data);\n }\n \nIndex: b/builtin-add.c\n===================================================================\n--- a/builtin-add.c\n+++ b/builtin-add.c\n@@ -255,12 +255,14 @@ static int edit_patch(int argc, const ch\n {\n \tchar *file = xstrdup(git_path(\"ADD_EDIT.patch\"));\n \tconst char *apply_argv[] = { \"apply\", \"--recount\", \"--cached\",\n-\t\tfile, NULL };\n+\t\tNULL, NULL };\n \tstruct child_process child;\n \tstruct rev_info rev;\n \tint out;\n \tstruct stat st;\n \n+\tapply_argv[3] = file;\n+\n \tgit_config(git_diff_basic_config, NULL); /* no \"diff\" UI options */\n \n \tif (read_cache() < 0)\nIndex: b/builtin-checkout.c\n===================================================================\n--- a/builtin-checkout.c\n+++ b/builtin-checkout.c\n@@ -612,7 +612,8 @@ static int check_tracking_name(const cha\n \n static const char *unique_tracking_name(const char *name)\n {\n-\tstruct tracking_name_data cb_data = { name, NULL, 1 };\n+\tstruct tracking_name_data cb_data = { NULL, NULL, 1 };\n+\tcb_data.name = name;\n \tfor_each_ref(check_tracking_name, &cb_data);\n \tif (cb_data.unique)\n \t\treturn cb_data.remote;\nIndex: b/builtin-fetch.c\n===================================================================\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -573,9 +573,10 @@ static void find_non_local_tags(struct t\n {\n \tstruct string_list existing_refs = { NULL, 0, 0, 0 };\n \tstruct string_list remote_refs = { NULL, 0, 0, 0 };\n-\tstruct tag_data data = {head, tail};\n+\tstruct tag_data data;\n \tconst struct ref *ref;\n \tstruct string_list_item *item = NULL;\n+\tdata.head = head; data.tail = tail;\n \n \tfor_each_ref(add_existing, &existing_refs);\n \tfor (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {\n@@ -768,7 +769,8 @@ static int get_remote_group(const char *\n static int add_remote_or_group(const char *name, struct string_list *list)\n {\n \tint prev_nr = list->nr;\n-\tstruct remote_group_data g = { name, list };\n+\tstruct remote_group_data g;\n+\tg.name = name; g.list = list;\n \n \tgit_config(get_remote_group, &g);\n \tif (list->nr == prev_nr) {\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136928","messageId":"20100316054311.332443000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 03/15] pthread.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:23Z","receivedAt":"2010-03-16T05:42:23Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Without this patch, systems that provide stubs for pthread functions\nin libc, but which still require libpthread for full the pthread\nimplementation are not detected correctly.\n\nAlso, some systems require -pthread in CFLAGS for each compilation\nunit for a successful link of an mt binary, which is also addressed by\nthis patch.\n---\n Makefile      |    4 ++++\n config.mak.in |    1 +\n configure.ac  |   17 +++++++++++++++--\n 3 files changed, 20 insertions(+), 2 deletions(-)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -287,6 +287,7 @@ RPMBUILD = rpmbuild\n TCL_PATH = tclsh\n TCLTK_PATH = wish\n PTHREAD_LIBS = -lpthread\n+PTHREAD_CFLAGS =\n \n export TCL_PATH TCLTK_PATH\n \n@@ -856,6 +857,8 @@ ifeq ($(uname_S),AIX)\n \tBASIC_CFLAGS += -D_LARGE_FILES\n \tifeq ($(shell expr \"$(uname_V)\" : '[1234]'),1)\n \t\tNO_PTHREADS = YesPlease\n+\telse\n+\t\tPTHREAD_LIBS = -lpthread\n \tendif\n endif\n ifeq ($(uname_S),GNU)\n@@ -1297,6 +1300,7 @@ endif\n ifdef NO_PTHREADS\n \tBASIC_CFLAGS += -DNO_PTHREADS\n else\n+\tBASIC_CFLAGS += $(PTHREAD_CFLAGS)\n \tEXTLIBS += $(PTHREAD_LIBS)\n \tLIB_OBJS += thread-utils.o\n endif\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -782,7 +782,11 @@ AC_DEFUN([PTHREADTEST_SRC], [\n int main(void)\n {\n \tpthread_mutex_t test_mutex;\n-\treturn (0);\n+\tint retcode = 0;\n+\tretcode |= pthread_mutex_init(&test_mutex,(void*)0);\n+\tretcode |= pthread_mutex_lock(&test_mutex);\n+\tretcode |= pthread_mutex_unlock(&test_mutex);\n+\treturn retcode;\n }\n ])\n \n@@ -799,7 +803,8 @@ if test -n \"$USER_NOPTHREAD\"; then\n # handle these separately since PTHREAD_CFLAGS could be '-lpthreads\n # -D_REENTRANT' or some such.\n elif test -z \"$PTHREAD_CFLAGS\"; then\n-  for opt in -pthread -lpthread; do\n+  threads_found=no\n+  for opt in -mt -pthread -lpthread; do\n      old_CFLAGS=\"$CFLAGS\"\n      CFLAGS=\"$opt $CFLAGS\"\n      AC_MSG_CHECKING([Checking for POSIX Threads with '$opt'])\n@@ -807,11 +812,18 @@ elif test -z \"$PTHREAD_CFLAGS\"; then\n \t[AC_MSG_RESULT([yes])\n \t\tNO_PTHREADS=\n \t\tPTHREAD_LIBS=\"$opt\"\n+\t\tPTHREAD_CFLAGS=\"$opt\"\n+\t\tthreads_found=yes\n \t\tbreak\n \t],\n \t[AC_MSG_RESULT([no])])\n       CFLAGS=\"$old_CFLAGS\"\n   done\n+  if test $threads_found != yes; then\n+    AC_CHECK_LIB([pthread], [pthread_create],\n+\t[PTHREAD_LIBS=\"-lpthread\"],\n+\t[NO_PTHREADS=UnfortunatelyYes])\n+  fi\n else\n   old_CFLAGS=\"$CFLAGS\"\n   CFLAGS=\"$PTHREAD_CFLAGS $CFLAGS\"\n@@ -828,6 +840,7 @@ fi\n \n CFLAGS=\"$old_CFLAGS\"\n \n+AC_SUBST(PTHREAD_CFLAGS)\n AC_SUBST(PTHREAD_LIBS)\n AC_SUBST(NO_PTHREADS)\n \nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -57,4 +57,5 @@ NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\n FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@\n SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@\n NO_PTHREADS=@NO_PTHREADS@\n+PTHREAD_CFLAGS=@PTHREAD_CFLAGS@\n PTHREAD_LIBS=@PTHREAD_LIBS@\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136934","messageId":"20100316054316.503338000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 04/15] diff-export.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:24Z","receivedAt":"2010-03-16T05:42:24Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Some of the flags used with the first diff found in PATH cause the\nvendor diff to choke.\n---\n Documentation/install-webdoc.sh |    2 +-\n Makefile                        |    4 +++-\n config.mak.in                   |    1 +\n configure.ac                    |    1 +\n git-merge-one-file.sh           |    2 +-\n t/Makefile                      |    1 +\n 6 files changed, 8 insertions(+), 3 deletions(-)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -280,6 +280,7 @@ export prefix bindir sharedir sysconfdir\n CC = gcc\n AR = ar\n RM = rm -f\n+DIFF = diff\n TAR = tar\n FIND = find\n INSTALL = install\n@@ -1408,7 +1409,7 @@ endif\n ALL_CFLAGS += $(BASIC_CFLAGS)\n ALL_LDFLAGS += $(BASIC_LDFLAGS)\n \n-export TAR INSTALL DESTDIR SHELL_PATH\n+export DIFF TAR INSTALL DESTDIR SHELL_PATH\n \n \n ### Build rules\n@@ -1698,6 +1699,7 @@ GIT-CFLAGS: FORCE\n GIT-BUILD-OPTIONS: FORCE\n \t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n \t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >>$@\n+\t@echo DIFF=\\''$(subst ','\\'',$(subst ','\\'',$(DIFF)))'\\' >>$@\n \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -342,6 +342,7 @@ fi\n #AC_PROG_INSTALL\t\t# needs install-sh or install.sh in sources\n AC_CHECK_TOOLS(AR, [gar ar], :)\n AC_CHECK_PROGS(TAR, [gtar tar])\n+AC_CHECK_PROGS(DIFF, [gnudiff gdiff diff])\n # TCLTK_PATH will be set to some value if we want Tcl/Tk\n # or will be empty otherwise.\n if test -z \"$NO_TCLTK\"; then\nIndex: b/Documentation/install-webdoc.sh\n===================================================================\n--- a/Documentation/install-webdoc.sh\n+++ b/Documentation/install-webdoc.sh\n@@ -12,7 +12,7 @@ do\n \tthen\n \t\t: did not match\n \telif test -f \"$T/$h\" &&\n-\t   diff -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' \"$T/$h\" \"$h\"\n+\t   $DIFF -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' \"$T/$h\" \"$h\"\n \tthen\n \t\t:; # up to date\n \telse\nIndex: b/git-merge-one-file.sh\n===================================================================\n--- a/git-merge-one-file.sh\n+++ b/git-merge-one-file.sh\n@@ -107,7 +107,7 @@ case \"${1:-.}${2:-.}${3:-.}\" in\n \t\t# remove lines that are unique to ours.\n \t\torig=`git-unpack-file $2`\n \t\tsz0=`wc -c <\"$orig\"`\n-\t\tdiff -u -La/$orig -Lb/$orig $orig $src2 | git apply --no-add\n+\t\t$DIFF -u -La/$orig -Lb/$orig $orig $src2 | git apply --no-add\n \t\tsz1=`wc -c <\"$orig\"`\n \n \t\t# If we do not have enough common material, it is not\nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -8,6 +8,7 @@ LDFLAGS = @LDFLAGS@\n CC_LD_DYNPATH = @CC_LD_DYNPATH@\n AR = @AR@\n TAR = @TAR@\n+DIFF = @DIFF@\n #INSTALL = @INSTALL@\t\t# needs install-sh or install.sh in sources\n TCLTK_PATH = @TCLTK_PATH@\n \n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136938","messageId":"20100316054321.668397000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 05/15] diff-test_cmp.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:25Z","receivedAt":"2010-03-16T05:42:25Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"In tests, call test_cmp rather than raw diff where possible (i.e. if\nthe output does not go to a pipe), to allow the use of, say, 'cmp'\nwhen the default 'diff -u' is not compatible with a vendor diff.\n\nWhen that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.\n---\n t/Makefile                      |    1 +\n t/t0000-basic.sh                |    2 +-\n t/t3200-branch.sh               |    4 ++--\n t/t3210-pack-refs.sh            |    8 ++++----\n t/t3903-stash.sh                |    2 +-\n t/t4002-diff-basic.sh           |    2 +-\n t/t4124-apply-ws-rule.sh        |   10 +++++-----\n t/t4127-apply-same-fn.sh        |    6 +++---\n t/t5300-pack-object.sh          |    6 +++---\n t/t5510-fetch.sh                |    2 +-\n t/t5520-pull.sh                 |    2 +-\n t/t5700-clone-reference.sh      |    8 ++++----\n t/t6000lib.sh                   |    2 +-\n t/t6001-rev-list-graft.sh       |    2 +-\n t/t6022-merge-rename.sh         |    4 ++--\n t/t7002-grep.sh                 |   16 ++++++++--------\n t/t7005-editor.sh               |    6 +++---\n t/t9200-git-cvsexportcommit.sh  |   26 +++++++++++++-------------\n t/t9400-git-cvsserver-server.sh |   24 ++++++++++++------------\n 19 files changed, 67 insertions(+), 66 deletions(-)\n\nIndex: b/t/t0000-basic.sh\n===================================================================\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -280,7 +280,7 @@ $expectfilter >expected <<\\EOF\n EOF\n test_expect_success \\\n     'validate git diff-files output for a know cache/work tree state.' \\\n-    'git diff-files >current && diff >/dev/null -b current expected'\n+    'git diff-files >current && test_cmp current expected >/dev/null'\n \n test_expect_success \\\n     'git update-index --refresh should succeed.' \\\nIndex: b/t/t3200-branch.sh\n===================================================================\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -43,7 +43,7 @@ test_expect_success \\\n      git branch -l d/e/f &&\n \t test -f .git/refs/heads/d/e/f &&\n \t test -f .git/logs/refs/heads/d/e/f &&\n-\t diff expect .git/logs/refs/heads/d/e/f'\n+\t test_cmp expect .git/logs/refs/heads/d/e/f'\n \n test_expect_success \\\n     'git branch -d d/e/f should delete a branch and a log' \\\n@@ -222,7 +222,7 @@ test_expect_success \\\n      git checkout -b g/h/i -l master &&\n \t test -f .git/refs/heads/g/h/i &&\n \t test -f .git/logs/refs/heads/g/h/i &&\n-\t diff expect .git/logs/refs/heads/g/h/i'\n+\t test_cmp expect .git/logs/refs/heads/g/h/i'\n \n test_expect_success 'avoid ambiguous track' '\n \tgit config branch.autosetupmerge true &&\nIndex: b/t/t3210-pack-refs.sh\n===================================================================\n--- a/t/t3210-pack-refs.sh\n+++ b/t/t3210-pack-refs.sh\n@@ -28,7 +28,7 @@ test_expect_success \\\n      SHA1=`cat .git/refs/heads/a` &&\n      echo \"$SHA1 refs/heads/a\" >expect &&\n      git show-ref a >result &&\n-     diff expect result'\n+     test_cmp expect result'\n \n test_expect_success \\\n     'see if a branch still exists when packed' \\\n@@ -37,7 +37,7 @@ test_expect_success \\\n      rm -f .git/refs/heads/b &&\n      echo \"$SHA1 refs/heads/b\" >expect &&\n      git show-ref b >result &&\n-     diff expect result'\n+     test_cmp expect result'\n \n test_expect_success 'git branch c/d should barf if branch c exists' '\n      git branch c &&\n@@ -52,7 +52,7 @@ test_expect_success \\\n      git pack-refs --all --prune &&\n      echo \"$SHA1 refs/heads/e\" >expect &&\n      git show-ref e >result &&\n-     diff expect result'\n+     test_cmp expect result'\n \n test_expect_success 'see if git pack-refs --prune remove ref files' '\n      git branch f &&\n@@ -109,7 +109,7 @@ test_expect_success 'pack, prune and rep\n \tgit show-ref >all-of-them &&\n \tgit pack-refs &&\n \tgit show-ref >again &&\n-\tdiff all-of-them again\n+\ttest_cmp all-of-them again\n '\n \n test_done\nIndex: b/t/t4002-diff-basic.sh\n===================================================================\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -135,7 +135,7 @@ cmp_diff_files_output () {\n     # filesystem.\n     sed <\"$2\" >.test-tmp \\\n \t-e '/^:000000 /d;s/'$x40'\\( [MCRNDU][0-9]*\\)\t/'$z40'\\1\t/' &&\n-    diff \"$1\" .test-tmp\n+    test_cmp \"$1\" .test-tmp\n }\n \n test_expect_success \\\nIndex: b/t/t4124-apply-ws-rule.sh\n===================================================================\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -44,7 +44,7 @@ test_fix () {\n \tapply_patch --whitespace=fix || return 1\n \n \t# find touched lines\n-\tdiff file target | sed -n -e \"s/^> //p\" >fixed\n+\t$DIFF file target | sed -n -e \"s/^> //p\" >fixed\n \n \t# the changed lines are all expeced to change\n \tfixed_cnt=$(wc -l <fixed)\n@@ -85,14 +85,14 @@ test_expect_success setup '\n test_expect_success 'whitespace=nowarn, default rule' '\n \n \tapply_patch --whitespace=nowarn &&\n-\tdiff file target\n+\ttest_cmp file target\n \n '\n \n test_expect_success 'whitespace=warn, default rule' '\n \n \tapply_patch --whitespace=warn &&\n-\tdiff file target\n+\ttest_cmp file target\n \n '\n \n@@ -108,7 +108,7 @@ test_expect_success 'whitespace=error-al\n \n \tgit config core.whitespace -trailing,-space-before,-indent &&\n \tapply_patch --whitespace=error-all &&\n-\tdiff file target\n+\ttest_cmp file target\n \n '\n \n@@ -117,7 +117,7 @@ test_expect_success 'whitespace=error-al\n \tgit config --unset core.whitespace &&\n \techo \"target -whitespace\" >.gitattributes &&\n \tapply_patch --whitespace=error-all &&\n-\tdiff file target\n+\ttest_cmp file target\n \n '\n \nIndex: b/t/t5300-pack-object.sh\n===================================================================\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -147,7 +147,7 @@ test_expect_success \\\n \t    git cat-file $t $object || return 1\n \t done <obj-list\n     } >current &&\n-    diff expect current'\n+    test_cmp expect current'\n \n test_expect_success \\\n     'use packed deltified (REF_DELTA) objects' \\\n@@ -162,7 +162,7 @@ test_expect_success \\\n \t    git cat-file $t $object || return 1\n \t done <obj-list\n     } >current &&\n-    diff expect current'\n+    test_cmp expect current'\n \n test_expect_success \\\n     'use packed deltified (OFS_DELTA) objects' \\\n@@ -177,7 +177,7 @@ test_expect_success \\\n \t    git cat-file $t $object || return 1\n \t done <obj-list\n     } >current &&\n-    diff expect current'\n+    test_cmp expect current'\n \n unset GIT_OBJECT_DIRECTORY\n \nIndex: b/t/t5510-fetch.sh\n===================================================================\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -71,7 +71,7 @@ test_expect_success \"fetch test for-merg\n \t\techo \"$one_in_two\t\"\n \t} >expected &&\n \tcut -f -2 .git/FETCH_HEAD >actual &&\n-\tdiff expected actual'\n+\ttest_cmp expected actual'\n \n test_expect_success 'fetch tags when there is no tags' '\n \nIndex: b/t/t5520-pull.sh\n===================================================================\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -26,7 +26,7 @@ cd \"$D\"\n test_expect_success 'checking the results' '\n \ttest -f file &&\n \ttest -f cloned/file &&\n-\tdiff file cloned/file\n+\ttest_cmp file cloned/file\n '\n \n test_expect_success 'pulling into void using master:master' '\nIndex: b/t/t5700-clone-reference.sh\n===================================================================\n--- a/t/t5700-clone-reference.sh\n+++ b/t/t5700-clone-reference.sh\n@@ -48,7 +48,7 @@ test_expect_success 'that reference gets\n 'cd C &&\n echo \"0 objects, 0 kilobytes\" > expected &&\n git count-objects > current &&\n-diff expected current'\n+test_cmp expected current'\n \n cd \"$base_dir\"\n \n@@ -75,7 +75,7 @@ cd \"$base_dir\"\n test_expect_success 'that reference gets used' \\\n 'cd D && echo \"0 objects, 0 kilobytes\" > expected &&\n git count-objects > current &&\n-diff expected current'\n+test_cmp expected current'\n \n cd \"$base_dir\"\n \n@@ -100,7 +100,7 @@ test_expect_success 'that alternate to o\n 'cd C &&\n echo \"2 objects\" > expected &&\n git count-objects | cut -d, -f1 > current &&\n-diff expected current'\n+test_cmp expected current'\n \n cd \"$base_dir\"\n \n@@ -116,7 +116,7 @@ test_expect_success 'check objects expec\n 'cd D &&\n echo \"5 objects\" > expected &&\n git count-objects | cut -d, -f1 > current &&\n-diff expected current'\n+test_cmp expected current'\n \n cd \"$base_dir\"\n \nIndex: b/t/t6000lib.sh\n===================================================================\n--- a/t/t6000lib.sh\n+++ b/t/t6000lib.sh\n@@ -91,7 +91,7 @@ check_output()\n \tshift 1\n \tif eval \"$*\" | entag > $_name.actual\n \tthen\n-\t\tdiff $_name.expected $_name.actual\n+\t\ttest_cmp $_name.expected $_name.actual\n \telse\n \t\treturn 1;\n \tfi\nIndex: b/t/t6001-rev-list-graft.sh\n===================================================================\n--- a/t/t6001-rev-list-graft.sh\n+++ b/t/t6001-rev-list-graft.sh\n@@ -84,7 +84,7 @@ check () {\n \t\tgit rev-list --parents --pretty=raw $arg |\n \t\tsed -n -e 's/^commit //p' >test.actual\n \tfi\n-\tdiff test.expect test.actual\n+\ttest_cmp test.expect test.actual\n }\n \n for type in basic parents parents-raw\nIndex: b/t/t6022-merge-rename.sh\n===================================================================\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -280,7 +280,7 @@ test_expect_success 'updated working tre\n \t\techo \"BAD: should have complained\"\n \t\treturn 1\n \t}\n-\tdiff M M.saved || {\n+\ttest_cmp M M.saved || {\n \t\techo \"BAD: should have left M intact\"\n \t\treturn 1\n \t}\n@@ -301,7 +301,7 @@ test_expect_success 'updated working tre\n \t\techo \"BAD: should have complained\"\n \t\treturn 1\n \t}\n-\tdiff M M.saved || {\n+\ttest_cmp M M.saved || {\n \t\techo \"BAD: should have left M intact\"\n \t\treturn 1\n \t}\nIndex: b/t/t7002-grep.sh\n===================================================================\n--- a/t/t7002-grep.sh\n+++ b/t/t7002-grep.sh\n@@ -60,7 +60,7 @@ do\n \t\t\techo ${HC}file:5:foo_mmap bar mmap baz\n \t\t} >expected &&\n \t\tgit grep -n -w -e mmap $H >actual &&\n-\t\tdiff expected actual\n+\t\ttest_cmp expected actual\n \t'\n \n \ttest_expect_success \"grep -w $L (w)\" '\n@@ -74,7 +74,7 @@ do\n \t\t\techo ${HC}x:1:x x xx x\n \t\t} >expected &&\n \t\tgit grep -n -w -e \"x xx* x\" $H >actual &&\n-\t\tdiff expected actual\n+\t\ttest_cmp expected actual\n \t'\n \n \ttest_expect_success \"grep -w $L (y-1)\" '\n@@ -82,7 +82,7 @@ do\n \t\t\techo ${HC}y:1:y yy\n \t\t} >expected &&\n \t\tgit grep -n -w -e \"^y\" $H >actual &&\n-\t\tdiff expected actual\n+\t\ttest_cmp expected actual\n \t'\n \n \ttest_expect_success \"grep -w $L (y-2)\" '\n@@ -93,7 +93,7 @@ do\n \t\t\tcat actual\n \t\t\tfalse\n \t\telse\n-\t\t\tdiff expected actual\n+\t\t\ttest_cmp expected actual\n \t\tfi\n \t'\n \n@@ -105,14 +105,14 @@ do\n \t\t\tcat actual\n \t\t\tfalse\n \t\telse\n-\t\t\tdiff expected actual\n+\t\t\ttest_cmp expected actual\n \t\tfi\n \t'\n \n \ttest_expect_success \"grep $L (t-1)\" '\n \t\techo \"${HC}t/t:1:test\" >expected &&\n \t\tgit grep -n -e test $H >actual &&\n-\t\tdiff expected actual\n+\t\ttest_cmp expected actual\n \t'\n \n \ttest_expect_success \"grep $L (t-2)\" '\n@@ -121,7 +121,7 @@ do\n \t\t\tcd t &&\n \t\t\tgit grep -n -e test $H\n \t\t) >actual &&\n-\t\tdiff expected actual\n+\t\ttest_cmp expected actual\n \t'\n \n \ttest_expect_success \"grep $L (t-3)\" '\n@@ -130,7 +130,7 @@ do\n \t\t\tcd t &&\n \t\t\tgit grep --full-name -n -e test $H\n \t\t) >actual &&\n-\t\tdiff expected actual\n+\t\ttest_cmp expected actual\n \t'\n \n \ttest_expect_success \"grep -c $L (no /dev/null)\" '\nIndex: b/t/t7005-editor.sh\n===================================================================\n--- a/t/t7005-editor.sh\n+++ b/t/t7005-editor.sh\n@@ -38,7 +38,7 @@ test_expect_success setup '\n \ttest_commit \"$msg\" &&\n \techo \"$msg\" >expect &&\n \tgit show -s --format=%s > actual &&\n-\tdiff actual expect\n+\ttest_cmp actual expect\n \n '\n \n@@ -85,7 +85,7 @@ do\n \t\tgit --exec-path=. commit --amend &&\n \t\tgit show -s --pretty=oneline |\n \t\tsed -e \"s/^[0-9a-f]* //\" >actual &&\n-\t\tdiff actual expect\n+\t\ttest_cmp actual expect\n \t'\n done\n \n@@ -107,7 +107,7 @@ do\n \t\tgit --exec-path=. commit --amend &&\n \t\tgit show -s --pretty=oneline |\n \t\tsed -e \"s/^[0-9a-f]* //\" >actual &&\n-\t\tdiff actual expect\n+\t\ttest_cmp actual expect\n \t'\n done\n \nIndex: b/t/t9200-git-cvsexportcommit.sh\n===================================================================\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -63,10 +63,10 @@ test_expect_success \\\n      check_entries B \"newfile2.txt/1.1/\" &&\n      check_entries C \"newfile3.png/1.1/-kb\" &&\n      check_entries D \"newfile4.png/1.1/-kb\" &&\n-     diff A/newfile1.txt ../A/newfile1.txt &&\n-     diff B/newfile2.txt ../B/newfile2.txt &&\n-     diff C/newfile3.png ../C/newfile3.png &&\n-     diff D/newfile4.png ../D/newfile4.png\n+     test_cmp A/newfile1.txt ../A/newfile1.txt &&\n+     test_cmp B/newfile2.txt ../B/newfile2.txt &&\n+     test_cmp C/newfile3.png ../C/newfile3.png &&\n+     test_cmp D/newfile4.png ../D/newfile4.png\n      )'\n \n test_expect_success \\\n@@ -89,10 +89,10 @@ test_expect_success \\\n      check_entries D \"newfile4.png/1.2/-kb\" &&\n      check_entries E \"newfile5.txt/1.1/\" &&\n      check_entries F \"newfile6.png/1.1/-kb\" &&\n-     diff A/newfile1.txt ../A/newfile1.txt &&\n-     diff D/newfile4.png ../D/newfile4.png &&\n-     diff E/newfile5.txt ../E/newfile5.txt &&\n-     diff F/newfile6.png ../F/newfile6.png\n+     test_cmp A/newfile1.txt ../A/newfile1.txt &&\n+     test_cmp D/newfile4.png ../D/newfile4.png &&\n+     test_cmp E/newfile5.txt ../E/newfile5.txt &&\n+     test_cmp F/newfile6.png ../F/newfile6.png\n      )'\n \n # Should fail (but only on the git cvsexportcommit stage)\n@@ -137,9 +137,9 @@ test_expect_success \\\n      check_entries D \"\" &&\n      check_entries E \"newfile5.txt/1.1/\" &&\n      check_entries F \"newfile6.png/1.1/-kb\" &&\n-     diff A/newfile1.txt ../A/newfile1.txt &&\n-     diff E/newfile5.txt ../E/newfile5.txt &&\n-     diff F/newfile6.png ../F/newfile6.png\n+     test_cmp A/newfile1.txt ../A/newfile1.txt &&\n+     test_cmp E/newfile5.txt ../E/newfile5.txt &&\n+     test_cmp F/newfile6.png ../F/newfile6.png\n      )'\n \n test_expect_success \\\n@@ -155,8 +155,8 @@ test_expect_success \\\n      check_entries D \"\" &&\n      check_entries E \"newfile5.txt/1.1/\" &&\n      check_entries F \"newfile6.png/1.1/-kb\" &&\n-     diff E/newfile5.txt ../E/newfile5.txt &&\n-     diff F/newfile6.png ../F/newfile6.png\n+     test_cmp E/newfile5.txt ../E/newfile5.txt &&\n+     test_cmp F/newfile6.png ../F/newfile6.png\n      )'\n \n test_expect_success \\\nIndex: b/t/t9400-git-cvsserver-server.sh\n===================================================================\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -226,7 +226,7 @@ test_expect_success 'gitcvs.ext.enabled \n   'GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.ext.enabled true &&\n    GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled false &&\n    GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n-   diff -q cvswork cvswork2'\n+   test_cmp cvswork cvswork2' >/dev/null\n \n rm -fr cvswork2\n test_expect_success 'gitcvs.ext.enabled = false' \\\n@@ -247,7 +247,7 @@ test_expect_success 'gitcvs.dbname' \\\n   'GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.ext.enabled true &&\n    GIT_DIR=\"$SERVERDIR\" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&\n    GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n-   diff -q cvswork cvswork2 &&\n+   test_cmp cvswork cvswork2 >/dev/null &&\n    test -f \"$SERVERDIR/gitcvs.ext.master.sqlite\" &&\n    cmp \"$SERVERDIR/gitcvs.master.sqlite\" \"$SERVERDIR/gitcvs.ext.master.sqlite\"'\n \n@@ -257,7 +257,7 @@ test_expect_success 'gitcvs.ext.dbname' \n    GIT_DIR=\"$SERVERDIR\" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&\n    GIT_DIR=\"$SERVERDIR\" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&\n    GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n-   diff -q cvswork cvswork2 &&\n+   test_cmp cvswork cvswork2 >/dev/null &&\n    test -f \"$SERVERDIR/gitcvs1.ext.master.sqlite\" &&\n    test ! -f \"$SERVERDIR/gitcvs2.ext.master.sqlite\" &&\n    cmp \"$SERVERDIR/gitcvs.master.sqlite\" \"$SERVERDIR/gitcvs1.ext.master.sqlite\"'\n@@ -282,7 +282,7 @@ test_expect_success 'cvs update (create \n    cd cvswork &&\n    GIT_CONFIG=\"$git_config\" cvs -Q update &&\n    test \"$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))\" = \"testfile1/1.1/\" &&\n-   diff -q testfile1 ../testfile1'\n+   test_cmp testfile1 ../testfile1' >/dev/null\n \n cd \"$WORKDIR\"\n test_expect_success 'cvs update (update existing file)' \\\n@@ -293,7 +293,7 @@ test_expect_success 'cvs update (update \n    cd cvswork &&\n    GIT_CONFIG=\"$git_config\" cvs -Q update &&\n    test \"$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))\" = \"testfile1/1.2/\" &&\n-   diff -q testfile1 ../testfile1'\n+   test_cmp testfile1 ../testfile1' >/dev/null\n \n cd \"$WORKDIR\"\n #TODO: cvsserver doesn't support update w/o -d\n@@ -322,7 +322,7 @@ test_expect_success 'cvs update (subdire\n    (for dir in A A/B A/B/C A/D E; do\n       filename=\"file_in_$(echo $dir|sed -e \"s#/# #g\")\" &&\n       if test \"$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))\" = \"$filename/1.1/\" &&\n-           diff -q \"$dir/$filename\" \"../$dir/$filename\"; then\n+           test_cmp \"$dir/$filename\" \"../$dir/$filename\" >/dev/null; then\n         :\n       else\n         echo >failure\n@@ -349,7 +349,7 @@ test_expect_success 'cvs update (re-add \n    cd cvswork &&\n    GIT_CONFIG=\"$git_config\" cvs -Q update &&\n    test \"$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))\" = \"testfile1/1.4/\" &&\n-   diff -q testfile1 ../testfile1'\n+   test_cmp testfile1 ../testfile1' >/dev/null\n \n cd \"$WORKDIR\"\n test_expect_success 'cvs update (merge)' \\\n@@ -366,7 +366,7 @@ test_expect_success 'cvs update (merge)'\n    cd cvswork &&\n    GIT_CONFIG=\"$git_config\" cvs -Q update &&\n    test \"$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))\" = \"merge/1.1/\" &&\n-   diff -q merge ../merge &&\n+   test_cmp merge ../merge >/dev/null &&\n    ( echo Line 0; cat merge ) >merge.tmp &&\n    mv merge.tmp merge &&\n    cd \"$WORKDIR\" &&\n@@ -377,7 +377,7 @@ test_expect_success 'cvs update (merge)'\n    cd cvswork &&\n    sleep 1 && touch merge &&\n    GIT_CONFIG=\"$git_config\" cvs -Q update &&\n-   diff -q merge ../expected'\n+   test_cmp merge ../expected' >/dev/null\n \n cd \"$WORKDIR\"\n \n@@ -402,13 +402,13 @@ test_expect_success 'cvs update (conflic\n    git push gitcvs.git >/dev/null &&\n    cd cvswork &&\n    GIT_CONFIG=\"$git_config\" cvs -Q update &&\n-   diff -q merge ../expected.C'\n+   test_cmp merge ../expected.C' >/dev/null\n \n cd \"$WORKDIR\"\n test_expect_success 'cvs update (-C)' \\\n   'cd cvswork &&\n    GIT_CONFIG=\"$git_config\" cvs -Q update -C &&\n-   diff -q merge ../merge'\n+   test_cmp merge ../merge' >/dev/null\n \n cd \"$WORKDIR\"\n test_expect_success 'cvs update (merge no-op)' \\\n@@ -420,7 +420,7 @@ test_expect_success 'cvs update (merge n\n     cd cvswork &&\n     sleep 1 && touch merge &&\n     GIT_CONFIG=\"$git_config\" cvs -Q update &&\n-    diff -q merge ../merge'\n+    test_cmp merge ../merge' >/dev/null\n \n cd \"$WORKDIR\"\n test_expect_success 'cvs update (-p)' '\nIndex: b/t/t3903-stash.sh\n===================================================================\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -81,7 +81,7 @@ test_expect_success 'drop top stash' '\n \tgit stash &&\n \tgit stash drop &&\n \tgit stash list > stashlist2 &&\n-\tdiff stashlist1 stashlist2 &&\n+\ttest_cmp stashlist1 stashlist2 &&\n \tgit stash apply &&\n \ttest 3 = $(cat file) &&\n \ttest 1 = $(git show :file) &&\nIndex: b/t/t4127-apply-same-fn.sh\n===================================================================\n--- a/t/t4127-apply-same-fn.sh\n+++ b/t/t4127-apply-same-fn.sh\n@@ -27,7 +27,7 @@ test_expect_success 'apply same filename\n \tcp same_fn same_fn2 &&\n \tgit reset --hard &&\n \tgit apply patch0 &&\n-\tdiff same_fn same_fn2\n+\ttest_cmp same_fn same_fn2\n '\n \n test_expect_success 'apply same filename with overlapping changes' '\n@@ -40,7 +40,7 @@ test_expect_success 'apply same filename\n \tcp same_fn same_fn2 &&\n \tgit reset --hard &&\n \tgit apply patch0 &&\n-\tdiff same_fn same_fn2\n+\ttest_cmp same_fn same_fn2\n '\n \n test_expect_success 'apply same new filename after rename' '\n@@ -54,7 +54,7 @@ test_expect_success 'apply same new file\n \tcp new_fn new_fn2 &&\n \tgit reset --hard &&\n \tgit apply --index patch1 &&\n-\tdiff new_fn new_fn2\n+\ttest_cmp new_fn new_fn2\n '\n \n test_expect_success 'apply same old filename after rename -- should fail.' '\nIndex: b/t/Makefile\n===================================================================\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -6,6 +6,7 @@\n -include ../config.mak\n \n #GIT_TEST_OPTS=--verbose --debug\n+GIT_TEST_CMP ?= $(DIFF)\n SHELL_PATH ?= $(SHELL)\n TAR ?= $(TAR)\n RM ?= rm -f\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136937","messageId":"20100316054326.850936000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 06/15] diff-defaults.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:26Z","receivedAt":"2010-03-16T05:42:26Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"By default the testsuite calls 'diff -u' whenever a file comparison is\ncalled for.  Unfortunately that throws a \"diff: unknown option '-u'\"\nerror for most non-GNU diffs.\n\nThis patch sets GIT_TEST_CMP to 'cmp' on all the architectures where\nthat happens.  As a matter of fact, the testsuite as a whole still\nfails around 70% of all tests, but I'm able to clone a repository and\ncommit to a local branch on those machines, so I'm pretty sure that\nthe problem is the testsuite itself.\n---\n Makefile |   15 +++++++++++++++\n 1 file changed, 15 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -767,6 +767,16 @@ ifeq ($(uname_S),SunOS)\n \tNO_MKDTEMP = YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tNO_REGEX = YesPlease\n+\tifeq ($(uname_R),5.6)\n+\t\tNO_IPV6 = YesPlease\n+\t\tNO_SOCKADDR_STORAGE = YesPlease\n+\t\tNO_UNSETENV = YesPlease\n+\t\tNO_SETENV = YesPlease\n+\t\tNO_STRLCPY = YesPlease\n+\t\tNO_C99_FORMAT = YesPlease\n+\t\tNO_STRTOUMAX = YesPlease\n+\t\tGIT_TEST_CMP = cmp\n+\tendif\n \tifeq ($(uname_R),5.7)\n \t\tNEEDS_RESOLV = YesPlease\n \t\tNO_IPV6 = YesPlease\n@@ -776,18 +786,21 @@ ifeq ($(uname_S),SunOS)\n \t\tNO_STRLCPY = YesPlease\n \t\tNO_C99_FORMAT = YesPlease\n \t\tNO_STRTOUMAX = YesPlease\n+\t\tGIT_TEST_CMP = cmp\n \tendif\n \tifeq ($(uname_R),5.8)\n \t\tNO_UNSETENV = YesPlease\n \t\tNO_SETENV = YesPlease\n \t\tNO_C99_FORMAT = YesPlease\n \t\tNO_STRTOUMAX = YesPlease\n+\t\tGIT_TEST_CMP = cmp\n \tendif\n \tifeq ($(uname_R),5.9)\n \t\tNO_UNSETENV = YesPlease\n \t\tNO_SETENV = YesPlease\n \t\tNO_C99_FORMAT = YesPlease\n \t\tNO_STRTOUMAX = YesPlease\n+\t\tGIT_TEST_CMP = cmp\n \tendif\n \tINSTALL = /usr/ucb/install\n \tTAR = gtar\n@@ -861,6 +874,7 @@ ifeq ($(uname_S),AIX)\n \telse\n \t\tPTHREAD_LIBS = -lpthread\n \tendif\n+\tGIT_TEST_CMP = cmp\n endif\n ifeq ($(uname_S),GNU)\n \t# GNU/Hurd\n@@ -915,6 +929,7 @@ ifeq ($(uname_S),HP-UX)\n \tNO_HSTRERROR = YesPlease\n \tNO_SYS_SELECT_H = YesPlease\n \tSNPRINTF_RETURNS_BOGUS = YesPlease\n+\tGIT_TEST_CMP = cmp\n endif\n ifeq ($(uname_S),Windows)\n \tGIT_VERSION := $(GIT_VERSION).MSVC\nIndex: b/t/Makefile\n===================================================================\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -3,6 +3,7 @@\n # Copyright (c) 2005 Junio C Hamano\n #\n \n+-include ../config.mak.autogen\n -include ../config.mak\n \n #GIT_TEST_OPTS=--verbose --debug\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136929","messageId":"20100316054331.991677000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 07/15] host-IRIX.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:27Z","receivedAt":"2010-03-16T05:42:27Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Irix 6.5 does not define 'sgi', but does define '__sgi'.\n\nAlso, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD\nu_short types et. al. to be declared properly.\n---\n git-compat-util.h |    3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\nIndex: b/git-compat-util.h\n===================================================================\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -55,13 +55,14 @@\n # else\n # define _XOPEN_SOURCE 500\n # endif\n-#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)\n+#elif !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 _BSD_TYPES 1 /* IRIX needs this for u_short et al */\n #define _NETBSD_SOURCE 1\n #define _SGI_SOURCE 1\n \n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136933","messageId":"20100316054337.190506000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 08/15] host-HPUX10.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:28Z","receivedAt":"2010-03-16T05:42:28Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"HP-UX 10.20 has no PREAD, and while it does support mmap(), there is\nno system MAP_FAILED definition.\n---\n Makefile          |    1 +\n git-compat-util.h |    5 ++++-\n 2 files changed, 5 insertions(+), 1 deletion(-)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -929,6 +929,9 @@ ifeq ($(uname_S),HP-UX)\n \tNO_HSTRERROR = YesPlease\n \tNO_SYS_SELECT_H = YesPlease\n \tSNPRINTF_RETURNS_BOGUS = YesPlease\n+\tifeq ($(uname_R),B.10.20)\n+\t\tNO_PREAD = YesPlease\n+\tendif\n \tGIT_TEST_CMP = cmp\n endif\n ifeq ($(uname_S),Windows)\nIndex: b/git-compat-util.h\n===================================================================\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -217,7 +217,6 @@ static inline const char *skip_prefix(co\n #define PROT_READ 1\n #define PROT_WRITE 2\n #define MAP_PRIVATE 1\n-#define MAP_FAILED ((void*)-1)\n #endif\n \n #define mmap git_mmap\n@@ -246,6 +245,10 @@ extern int git_munmap(void *start, size_\n \n #endif /* NO_MMAP */\n \n+#ifndef MAP_FAILED\n+#define MAP_FAILED ((void*)-1)\n+#endif\n+\n #ifdef NO_ST_BLOCKS_IN_STRUCT_STAT\n #define on_disk_bytes(st) ((st).st_size)\n #else\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136925","messageId":"20100316054342.328815000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 09/15] host-HPUX11.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:29Z","receivedAt":"2010-03-16T05:42:29Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"There is no nanosecond field on HPUX.\n---\n Makefile |    1 +\n 1 file changed, 1 insertion(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -928,6 +928,7 @@ ifeq ($(uname_S),HP-UX)\n \tNO_UNSETENV = YesPlease\n \tNO_HSTRERROR = YesPlease\n \tNO_SYS_SELECT_H = YesPlease\n+\tNO_NSEC = YesPlease\n \tSNPRINTF_RETURNS_BOGUS = YesPlease\n \tifeq ($(uname_R),B.10.20)\n \t\tNO_PREAD = YesPlease\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136939","messageId":"20100316054347.542270000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 10/15] host-OSF1.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:30Z","receivedAt":"2010-03-16T05:42:30Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Add defaults for Tru64 Unix.  Without this patch I cannot compile\ngit on Tru64 5.1.\n---\n Makefile |    6 ++++++\n 1 file changed, 6 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -695,6 +695,12 @@ EXTLIBS =\n # because maintaining the nesting to match is a pain.  If\n # we had \"elif\" things would have been much nicer...\n \n+ifeq ($(uname_S),OSF1)\n+\t# Need this for u_short definitions et al\n+\tBASIC_CFLAGS += -D_OSF_SOURCE\n+\tNO_STRTOULL = YesPlease\n+\tNO_NSEC = YesPlease\n+endif\n ifeq ($(uname_S),Linux)\n \tNO_STRLCPY = YesPlease\n \tNO_MKSTEMPS = YesPlease\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136935","messageId":"20100316054352.704479000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 11/15] no-hstrerror.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:31Z","receivedAt":"2010-03-16T05:42:31Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"SunOS 5.6 and 5.5.1 do not have hstrerror, even in libresolv.\n\nThis patch improves the logic of the test for hstrerror, not to\nblindly assume that if there is no hstrerror in libc that it must\nexist in libresolv.\n---\n Makefile      |    1 +\n config.mak.in |    1 +\n configure.ac  |   17 ++++++++++++++---\n 3 files changed, 16 insertions(+), 3 deletions(-)\n\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -526,11 +526,22 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -\n \n #\n # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.\n-# Notably on Solaris hstrerror resides in libresolv and on Solaris 7\n-# inet_ntop and inet_pton additionally reside there.\n-AC_CHECK_LIB([c], [hstrerror],\n+# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.\n+AC_CHECK_LIB([c], [inet_ntop],\n [NEEDS_RESOLV=],\n [NEEDS_RESOLV=YesPlease])\n+#\n+# Define NO_HSTRERROR if linking with -lresolv is not enough.\n+# Solaris 2.6 in particular has no hstrerror, even in -lresolv.\n+NO_HSTRERROR=\n+AC_CHECK_FUNC([hstrerror],\n+\t[],\n+    [AC_CHECK_LIB([resolv], [hstrerror],\n+\t    [NEEDS_RESOLV=YesPlease],\n+\t[NO_HSTRERROR=YesPlease])\n+])\n+AC_SUBST(NO_HSTRERROR)\n+\n AC_SUBST(NEEDS_RESOLV)\n test -n \"$NEEDS_RESOLV\" && LIBS=\"$LIBS -lresolv\"\n \nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -774,6 +774,7 @@ ifeq ($(uname_S),SunOS)\n \tNO_MKSTEMPS = YesPlease\n \tNO_REGEX = YesPlease\n \tifeq ($(uname_R),5.6)\n+\t\tNO_HSTRERROR = YesPlease\n \t\tNO_IPV6 = YesPlease\n \t\tNO_SOCKADDR_STORAGE = YesPlease\n \t\tNO_UNSETENV = YesPlease\nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -43,6 +43,7 @@ NO_D_TYPE_IN_DIRENT=@NO_D_TYPE_IN_DIRENT\n NO_SOCKADDR_STORAGE=@NO_SOCKADDR_STORAGE@\n NO_IPV6=@NO_IPV6@\n NO_C99_FORMAT=@NO_C99_FORMAT@\n+NO_HSTRERROR=@NO_HSTRERROR@\n NO_STRCASESTR=@NO_STRCASESTR@\n NO_MEMMEM=@NO_MEMMEM@\n NO_STRLCPY=@NO_STRLCPY@\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136926","messageId":"20100316054357.859059000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 12/15] no-inet_ntop.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:32Z","receivedAt":"2010-03-16T05:42:32Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Being careful not to overwrite the results of testing for hstrerror in\nlibresolv, also test whether inet_ntop/inet_pton are available from\nthat library.\n---\n Makefile      |    6 ++++++\n config.mak.in |    2 ++\n configure.ac  |   38 ++++++++++++++++++++++++++++++--------\n 3 files changed, 38 insertions(+), 8 deletions(-)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -939,6 +939,12 @@ ifeq ($(uname_S),HP-UX)\n \tSNPRINTF_RETURNS_BOGUS = YesPlease\n \tifeq ($(uname_R),B.10.20)\n \t\tNO_PREAD = YesPlease\n+\t\tNO_INET_NTOP = YesPlease\n+\t\tNO_INET_PTON = YesPlease\n+\tendif\n+\tifeq ($(uname_R),B.11.00)\n+\t\tNO_INET_NTOP = YesPlease\n+\t\tNO_INET_PTON = YesPlease\n \tendif\n \tGIT_TEST_CMP = cmp\n endif\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -525,11 +525,33 @@ AC_SUBST(NEEDS_SOCKET)\n test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -lsocket\"\n \n #\n-# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.\n-# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.\n-AC_CHECK_LIB([c], [inet_ntop],\n-[NEEDS_RESOLV=],\n-[NEEDS_RESOLV=YesPlease])\n+# The next few tests will define NEEDS_RESOLV if linking with\n+# libresolv provides some of the functions we would normally get\n+# from libc.\n+NEEDS_RESOLV=\n+AC_SUBST(NEEDS_RESOLV)\n+#\n+# Define NO_INET_NTOP if linking with -lresolv is not enough.\n+# Solaris 2.7 in particular hos inet_ntop in -lresolv.\n+NO_INET_NTOP=\n+AC_SUBST(NO_INET_NTOP)\n+AC_CHECK_FUNC([inet_ntop],\n+\t[],\n+    [AC_CHECK_LIB([resolv], [inet_ntop],\n+\t    [NEEDS_RESOLV=YesPlease],\n+\t[NO_INET_NTOP=YesPlease])\n+])\n+#\n+# Define NO_INET_PTON if linking with -lresolv is not enough.\n+# Solaris 2.7 in particular hos inet_pton in -lresolv.\n+NO_INET_PTON=\n+AC_SUBST(NO_INET_PTON)\n+AC_CHECK_FUNC([inet_pton],\n+\t[],\n+    [AC_CHECK_LIB([resolv], [inet_pton],\n+\t    [NEEDS_RESOLV=YesPlease],\n+\t[NO_INET_PTON=YesPlease])\n+])\n #\n # Define NO_HSTRERROR if linking with -lresolv is not enough.\n # Solaris 2.6 in particular has no hstrerror, even in -lresolv.\n@@ -541,8 +563,9 @@ AC_CHECK_FUNC([hstrerror],\n \t[NO_HSTRERROR=YesPlease])\n ])\n AC_SUBST(NO_HSTRERROR)\n-\n-AC_SUBST(NEEDS_RESOLV)\n+#\n+# If any of the above tests determined that -lresolv is needed at\n+# build-time, also set it here for remaining configure-time checks.\n test -n \"$NEEDS_RESOLV\" && LIBS=\"$LIBS -lresolv\"\n \n AC_CHECK_LIB([c], [basename],\n@@ -772,7 +795,6 @@ GIT_CHECK_FUNC(mkstemps,\n [NO_MKSTEMPS=YesPlease])\n AC_SUBST(NO_MKSTEMPS)\n #\n-#\n # Define NO_MMAP if you want to avoid mmap.\n #\n # Define NO_ICONV if your libc does not properly support iconv.\nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -53,6 +53,8 @@ NO_SETENV=@NO_SETENV@\n NO_UNSETENV=@NO_UNSETENV@\n NO_MKDTEMP=@NO_MKDTEMP@\n NO_MKSTEMPS=@NO_MKSTEMPS@\n+NO_INET_NTOP=@NO_INET_NTOP@\n+NO_INET_PTON=@NO_INET_PTON@\n NO_ICONV=@NO_ICONV@\n OLD_ICONV=@OLD_ICONV@\n NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136932","messageId":"20100316054403.034575000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 13/15] no-socklen_t.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:33Z","receivedAt":"2010-03-16T05:42:33Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"SunOS 2.6 and earlier do not have a socklen_t type declaration.\n---\n Makefile      |    4 ++++\n aclocal.m4    |   41 +++++++++++++++++++++++++++++++++++++++++\n config.mak.in |    1 +\n configure.ac  |    6 ++++++\n 4 files changed, 52 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -1064,6 +1064,10 @@ else\n BROKEN_PATH_FIX = '/^\\# @@BROKEN_PATH_FIX@@$$/d'\n endif\n \n+ifneq (socklen_t,$(SOCKLEN_T))\n+\tBASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)\n+endif\n+\n ifeq ($(uname_S),Darwin)\n \tifndef NO_FINK\n \t\tifeq ($(shell test -d /sw/lib && echo y),y)\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -613,6 +613,12 @@ AC_SUBST(OLD_ICONV)\n ## Checks for typedefs, structures, and compiler characteristics.\n AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics])\n #\n+TYPE_SOCKLEN_T\n+case $ac_cv_type_socklen_t in\n+  yes) \t\tAC_SUBST([SOCKLEN_T], [socklen_t]) ;;\n+  *)  \t\tAC_SUBST([SOCKLEN_T], [$git_cv_socklen_t_equiv]) ;;\n+esac\n+\n # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.\n AC_CHECK_MEMBER(struct dirent.d_ino,\n [NO_D_INO_IN_DIRENT=],\nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -58,6 +58,7 @@ NO_INET_PTON=@NO_INET_PTON@\n NO_ICONV=@NO_ICONV@\n OLD_ICONV=@OLD_ICONV@\n NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\n+SOCKLEN_T=@SOCKLEN_T@\n FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@\n SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@\n NO_PTHREADS=@NO_PTHREADS@\nIndex: b/aclocal.m4\n===================================================================\n--- /dev/null\n+++ b/aclocal.m4\n@@ -0,0 +1,41 @@\n+dnl Check for socklen_t: historically on BSD it is an int, and in\n+dnl POSIX 1g it is a type of its own, but some platforms use different\n+dnl types for the argument to getsockopt, getpeername, etc.  So we\n+dnl have to test to find something that will work.\n+AC_DEFUN([TYPE_SOCKLEN_T],\n+[\n+   AC_CHECK_TYPE([socklen_t], ,[\n+      AC_MSG_CHECKING([for socklen_t equivalent])\n+      AC_CACHE_VAL([git_cv_socklen_t_equiv],\n+      [\n+         # Systems have either \"struct sockaddr *\" or\n+         # \"void *\" as the second argument to getpeername\n+         git_cv_socklen_t_equiv=\n+         for arg2 in \"struct sockaddr\" void; do\n+            for t in int size_t unsigned long \"unsigned long\"; do\n+               AC_TRY_COMPILE([\n+                  #include <sys/types.h>\n+                  #include <sys/socket.h>\n+\n+                  int getpeername (int, $arg2 *, $t *);\n+               ],[\n+                  $t len;\n+                  getpeername(0,0,&len);\n+               ],[\n+                  git_cv_socklen_t_equiv=\"$t\"\n+                  break 2\n+               ])\n+            done\n+         done\n+\n+         if test \"x$git_cv_socklen_t_equiv\" = x; then\n+            AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])\n+         fi\n+      ])\n+      AC_MSG_RESULT($git_cv_socklen_t_equiv)\n+      AC_DEFINE_UNQUOTED(socklen_t, $git_cv_socklen_t_equiv,\n+\t\t\t[type to use in place of socklen_t if not defined])],\n+      [#include <sys/types.h>\n+#include <sys/socket.h>])\n+])\n+\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136927","messageId":"20100316054408.187068000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 14/15] no-ss_family.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:34Z","receivedAt":"2010-03-16T05:42:34Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Systems that do not provide ss_family in sockaddr_storage do not compile.\n\nThis patch adds a configure test, and a new Makefile define along with\ndefault settings for HPUX-11.00, Solaris-2.6 and others.\n\nI've also added a configure test to set NO_SOCKADDR_STORAGE\nappropriately, rather than relying on the default settings in\nMakefile.\n---\n Makefile      |   15 +++++++++++++++\n config.mak.in |    1 +\n configure.ac  |   17 +++++++++++++++++\n daemon.c      |   31 ++++++++++++++++++++-----------\n 4 files changed, 53 insertions(+), 11 deletions(-)\n\nIndex: b/daemon.c\n===================================================================\n--- a/daemon.c\n+++ b/daemon.c\n@@ -591,19 +591,28 @@ static int execute(struct sockaddr *addr\n static int addrcmp(const struct sockaddr_storage *s1,\n     const struct sockaddr_storage *s2)\n {\n-\tif (s1->ss_family != s2->ss_family)\n-\t\treturn s1->ss_family - s2->ss_family;\n-\tif (s1->ss_family == AF_INET)\n-\t\treturn memcmp(&((struct sockaddr_in *)s1)->sin_addr,\n-\t\t    &((struct sockaddr_in *)s2)->sin_addr,\n-\t\t    sizeof(struct in_addr));\n+#ifndef NO_SS_FAMILY_IN_SOCKADDR_X\n+\tsa_family_t family = s1->ss_family;\n+\tsa_family_t family2 = s2->ss_family;\n+#else\n+\tsa_family_t family = ((struct sockaddr *)s1)->sa_family;\n+\tsa_family_t family2 = ((struct sockaddr *)s2)->sa_family;\n+#endif\n+\n+        if (family != family2)\n+                return family - family2;\n+        if (family == AF_INET)\n+                return memcmp(&((struct sockaddr_in *)s1)->sin_addr,\n+                    &((struct sockaddr_in *)s2)->sin_addr,\n+                    sizeof(struct in_addr));\n #ifndef NO_IPV6\n-\tif (s1->ss_family == AF_INET6)\n-\t\treturn memcmp(&((struct sockaddr_in6 *)s1)->sin6_addr,\n-\t\t    &((struct sockaddr_in6 *)s2)->sin6_addr,\n-\t\t    sizeof(struct in6_addr));\n+        if (family == AF_INET6)\n+                return memcmp(&((struct sockaddr_in6 *)s1)->sin6_addr,\n+                    &((struct sockaddr_in6 *)s2)->sin6_addr,\n+                    sizeof(struct in6_addr));\n #endif\n-\treturn 0;\n+\n+        return 0;\n }\n \n static int max_connections = 32;\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -122,6 +122,9 @@ all::\n # Define NO_SOCKADDR_STORAGE if your platform does not have struct\n # sockaddr_storage.\n #\n+# Define NO_SS_FAMILY_IN_SOCKADDR_X if your platform lacks ss_family\n+# in sockaddr_storage, sockaddr_in and sockaddr_in6.\n+#\n # Define NO_ICONV if your libc does not properly support iconv.\n #\n # Define OLD_ICONV if your library has an old iconv(), where the second\n@@ -700,6 +703,7 @@ ifeq ($(uname_S),OSF1)\n \tBASIC_CFLAGS += -D_OSF_SOURCE\n \tNO_STRTOULL = YesPlease\n \tNO_NSEC = YesPlease\n+\tNO_SS_FAMILY_IN_SOCKADDR_X = YesPlease\n endif\n ifeq ($(uname_S),Linux)\n \tNO_STRLCPY = YesPlease\n@@ -777,6 +781,7 @@ ifeq ($(uname_S),SunOS)\n \t\tNO_HSTRERROR = YesPlease\n \t\tNO_IPV6 = YesPlease\n \t\tNO_SOCKADDR_STORAGE = YesPlease\n+\t\tNO_SS_FAMILY_IN_SOCKADDR_X = YesPlease\n \t\tNO_UNSETENV = YesPlease\n \t\tNO_SETENV = YesPlease\n \t\tNO_STRLCPY = YesPlease\n@@ -788,6 +793,7 @@ ifeq ($(uname_S),SunOS)\n \t\tNEEDS_RESOLV = YesPlease\n \t\tNO_IPV6 = YesPlease\n \t\tNO_SOCKADDR_STORAGE = YesPlease\n+\t\tNO_SS_FAMILY_IN_SOCKADDR_X = YesPlease\n \t\tNO_UNSETENV = YesPlease\n \t\tNO_SETENV = YesPlease\n \t\tNO_STRLCPY = YesPlease\n@@ -847,6 +853,9 @@ ifeq ($(uname_S),FreeBSD)\n \t\tNO_UINTMAX_T = YesPlease\n \t\tNO_STRTOUMAX = YesPlease\n \tendif\n+\tifeq ($(shell expr \"$(uname_V).$(uname_R)\" : '5\\.[012]'),3)\n+\t\tNO_SS_FAMILY_IN_SOCKADDR_X = YesPlease\n+\tendif\n endif\n ifeq ($(uname_S),OpenBSD)\n \tNO_STRCASESTR = YesPlease\n@@ -895,6 +904,7 @@ ifeq ($(uname_S),IRIX)\n \tNO_MEMMEM = YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tNO_MKDTEMP = YesPlease\n+\tNO_SS_FAMILY_IN_SOCKADDR_X = YesPlease\n \t# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads\n \t# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),\n \t# git dies with a segmentation fault when trying to access the first\n@@ -941,10 +951,12 @@ ifeq ($(uname_S),HP-UX)\n \t\tNO_PREAD = YesPlease\n \t\tNO_INET_NTOP = YesPlease\n \t\tNO_INET_PTON = YesPlease\n+\t\tNO_SS_FAMILY_IN_SOCKADDR_X = YesPlease\n \tendif\n \tifeq ($(uname_R),B.11.00)\n \t\tNO_INET_NTOP = YesPlease\n \t\tNO_INET_PTON = YesPlease\n+\t\tNO_SS_FAMILY_IN_SOCKADDR_X = YesPlease\n \tendif\n \tGIT_TEST_CMP = cmp\n endif\n@@ -1284,6 +1296,9 @@ else\n \tBASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6\n endif\n endif\n+ifdef NO_SS_FAMILY_IN_SOCKADDR_X\n+\tBASIC_CFLAGS += -DNO_SS_FAMILY_IN_SOCKADDR_X\n+endif\n ifdef NO_INET_NTOP\n \tLIB_OBJS += compat/inet_ntop.o\n endif\nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -42,6 +42,7 @@ NO_D_INO_IN_DIRENT=@NO_D_INO_IN_DIRENT@\n NO_D_TYPE_IN_DIRENT=@NO_D_TYPE_IN_DIRENT@\n NO_SOCKADDR_STORAGE=@NO_SOCKADDR_STORAGE@\n NO_IPV6=@NO_IPV6@\n+NO_SS_FAMILY_IN_SOCKADDR_X=@NO_SS_FAMILY_IN_SOCKADDR_X@\n NO_C99_FORMAT=@NO_C99_FORMAT@\n NO_HSTRERROR=@NO_HSTRERROR@\n NO_STRCASESTR=@NO_STRCASESTR@\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -656,6 +656,23 @@ AC_CHECK_TYPE([struct addrinfo],[\n ])\n AC_SUBST(NO_IPV6)\n #\n+# Define NO_SS_FAMILY_IN_SOCKADDR_X if your platform lacks ss_family\n+# in struct sockaddr_storage, sockaddr_in6 and sockaddr_in.\n+save_CPPFLAGS=\"$CPPFLAGS\"\n+case $NO_SOCKADDR_STORAGE:$NO_IPV6 in\n+YesPlease:YesPlease)\n+  CPPFLAGS=\"-Dsockaddr_storage=sockaddr_in${CPPFLAGS+ $CPPFLAGS}\" ;;\n+YesPlease:)\n+  CPPFLAGS=\"-Dsockaddr_storage=sockaddr_in6${CPPFLAGS+ $CPPFLAGS}\" ;;\n+esac\n+AC_CHECK_MEMBER(struct sockaddr_storage.ss_family,\n+[NO_SS_FAMILY_IN_SOCKADDR_X=],\n+[NO_SS_FAMILY_IN_SOCKADDR_X=YesPlease],[\n+#include <sys/types.h>\n+#include <sys/socket.h>\n+])\n+AC_SUBST(NO_SS_FAMILY_IN_SOCKADDR_X)\n+#\n # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)\n # do not support the 'size specifiers' introduced by C99, namely ll, hh,\n # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136931","messageId":"20100316054413.390539000@mlists.thewrittenword.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"[patch 15/15] no-inline.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T05:42:35Z","receivedAt":"2010-03-16T05:42:35Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Without this patch, git does not compile correctly on HPUX 11.11 and\nearlier.\n\nCompiler support for inline is sometimes buggy, and occasionally\nmissing entirely.  This patch adds a test for inline support, and\nredefines the keyword with the preprocessor if necessary at compile\ntime.\n---\n Makefile      |    4 ++++\n config.mak.in |    1 +\n configure.ac  |    7 +++++++\n 3 files changed, 12 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -1076,6 +1076,10 @@ else\n BROKEN_PATH_FIX = '/^\\# @@BROKEN_PATH_FIX@@$$/d'\n endif\n \n+ifneq (inline,$(INLINE))\n+\tBASIC_CFLAGS += -Dinline=$(INLINE)\n+endif\n+\n ifneq (socklen_t,$(SOCKLEN_T))\n \tBASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)\n endif\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -307,6 +307,13 @@ GIT_PARSE_WITH(tcltk))\n AC_MSG_NOTICE([CHECKS for programs])\n #\n AC_PROG_CC([cc gcc])\n+AC_C_INLINE\n+case $ac_cv_c_inline in\n+  no)\t\tAC_SUBST([INLINE], []) ;;\n+  inline | yes)\tAC_SUBST([INLINE], [inline]) ;;\n+  *)\t\tAC_SUBST([INLINE], [$ac_cv_c_inline]) ;;\n+esac\n+\n # which switch to pass runtime path to dynamic libraries to the linker\n AC_CACHE_CHECK([if linker supports -R], git_cv_ld_dashr, [\n    SAVE_LDFLAGS=\"${LDFLAGS}\"\nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -59,6 +59,7 @@ NO_INET_PTON=@NO_INET_PTON@\n NO_ICONV=@NO_ICONV@\n OLD_ICONV=@OLD_ICONV@\n NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\n+INLINE=@INLINE@\n SOCKLEN_T=@SOCKLEN_T@\n FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@\n SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136942","messageId":"fabb9a1e1003152318m204f178cpbe9eb82cb2742586@mail.gmail.com","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"Re: [patch 00/15] Portability Patches v3","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-03-16T06:18:48Z","receivedAt":"2010-03-16T06:18:48Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Tue, Mar 16, 2010 at 06:42, Gary V. Vaughan\n<git@mlists.thewrittenword.com> wrote:\n> Here are the portability patches we needed at TWW to enable\n> git-1.7.0.2 to compile and run on all of the wide range of Unix\n> machines we support.\n\nOh wow, thanks! Glad to see you followed up on this, awesome!\n\n> Note that I have not invested the time to figure out why the testsuite\n> is mostly useless on everything but Linux and Solaris 8+, because I'm\n> reasonably satisfied that the build itself is working properly.\n\nI'm curious now, what kind of errors are you getting? Would you mind\nperhaps posting a few to the list in a new thread?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"136946","messageId":"7veijkohpe.fsf@alter.siamese.dyndns.org","threadId":"23037","inReplyTo":"20100316054321.668397000@mlists.thewrittenword.com","subject":"Re: [patch 05/15] diff-test_cmp.patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-16T07:21:01Z","receivedAt":"2010-03-16T07:21:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n\n> Index: b/t/t0000-basic.sh\n> ===================================================================\n> --- a/t/t0000-basic.sh\n> +++ b/t/t0000-basic.sh\n> @@ -280,7 +280,7 @@ $expectfilter >expected <<\\EOF\n>  EOF\n>  test_expect_success \\\n>      'validate git diff-files output for a know cache/work tree state.' \\\n> -    'git diff-files >current && diff >/dev/null -b current expected'\n> +    'git diff-files >current && test_cmp current expected >/dev/null'\n\nThe original says \"compare ignoring whitespace changes\" but the updated\none says \"they must match literally\".  Is this conversion safe?\n\nFor the purpose of debugging tests, I think it would be better to lose the\nredirection into /dev/null.  If the test passes, we wouldn't see anything\nanyway, and if the test fails, we would see what's different, and that\nhelps diagnosing the breakage.  For systems with implementations of diff\nthat is \"-u\" challenged, we could define test_cmp in terms of \"diff -c\"\ninstead of \"cmp\".\n\n> Index: b/t/t9400-git-cvsserver-server.sh\n> ===================================================================\n> --- a/t/t9400-git-cvsserver-server.sh\n> +++ b/t/t9400-git-cvsserver-server.sh\n> @@ -226,7 +226,7 @@ test_expect_success 'gitcvs.ext.enabled \n>    'GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.ext.enabled true &&\n>     GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled false &&\n>     GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n> -   diff -q cvswork cvswork2'\n> +   test_cmp cvswork cvswork2' >/dev/null\n\nIf the -q in the original really matters, then please add the redirection\nto /dev/null only for test_cmp; never redirect the output from the entire\ntest_expect_success.  On the other hand, if -q does not matter the outcome\nof the test, simply lose the \"quiet\".  We really should not care, and make\nsure it is available easily to people who broke cvsserver and need to see\nthe difference between expected and actual results while debugging.\n\nThere are similar dubious conversions in your patch to this file.\n\n> Index: b/t/Makefile\n> ===================================================================\n> --- a/t/Makefile\n> +++ b/t/Makefile\n> @@ -6,6 +6,7 @@\n>  -include ../config.mak\n>  \n>  #GIT_TEST_OPTS=--verbose --debug\n> +GIT_TEST_CMP ?= $(DIFF)\n\nIf this forces plain diff not more readable \"diff -u\" to everybody, that\nsounds like a regression to me.\n\nOther than that, the conversion in this patch looked sane.\n\nThanks.\n"},{"id":"136947","messageId":"7v7hpcohoy.fsf@alter.siamese.dyndns.org","threadId":"23037","inReplyTo":"20100316054311.332443000@mlists.thewrittenword.com","subject":"Re: [patch 03/15] pthread.patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-16T07:21:17Z","receivedAt":"2010-03-16T07:21:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Looked sane (I didn't apply nor test, only read it through, though);\nthanks.\n"},{"id":"136948","messageId":"7vzl28n34b.fsf@alter.siamese.dyndns.org","threadId":"23037","inReplyTo":"20100316054300.978104000@mlists.thewrittenword.com","subject":"Re: [patch 01/15] user-cppflags.patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-16T07:21:24Z","receivedAt":"2010-03-16T07:21:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Looked sane (I didn't apply nor test, only read it through, though);\nthanks.\n"},{"id":"136949","messageId":"7vsk80n31u.fsf@alter.siamese.dyndns.org","threadId":"23037","inReplyTo":"20100316054326.850936000@mlists.thewrittenword.com","subject":"Re: [patch 06/15] diff-defaults.patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-16T07:22:53Z","receivedAt":"2010-03-16T07:22:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n\n> By default the testsuite calls 'diff -u' whenever a file comparison is\n> called for.  Unfortunately that throws a \"diff: unknown option '-u'\"\n> error for most non-GNU diffs.\n>\n> This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where\n> that happens.\n\nWouldn't most of these platforms you listed have a working \"diff -c\" at\nleast?  Using it would make debugging the tests easier, as it would be\nmore readable than output from \"cmp\".\n\nI also saw your patch to install-webdoc used \"$DIFF -u\"; as the patch\nseries seem to assume a unified-capable diff implementation is available\nsomewhere, perhaps you do not need this patch after all, but instead just\nneed to default GIT_TEST_CMP to \"$DIFF -u\" in t/test-lib.sh, no?\n"},{"id":"136950","messageId":"7vljdsn2yz.fsf@alter.siamese.dyndns.org","threadId":"23037","inReplyTo":"20100316054331.991677000@mlists.thewrittenword.com","subject":"Re: [patch 07/15] host-IRIX.patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-16T07:24:36Z","receivedAt":"2010-03-16T07:24:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n\n> Irix 6.5 does not define 'sgi', but does define '__sgi'.\n>\n> Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD\n> u_short types et. al. to be declared properly.\n\nIf Irix 6.5 defines __sgi and the patch _adds_ \"defined(__sgi)\" I wouldn't\nhave to worry too much, but would replacing \"defined(sgi)\" with the\ndouble-underscore version make somebody who added \"defined(sgi)\" in the\nfirst place cry, if it was done for different version of Irix that does\ndefine \"sgi\" (worse yet, but not \"__sgi\")?\n\nAnother natural question is if defining _BSD_TYPES everywhere has negative\neffects on somebody else's platforms, but that is what people on different\nplatforms will have to apply this patch, test, and report success or\nbreakage.  Help from the list audience is appreciated.\n\nThanks.\n"},{"id":"136951","messageId":"7veijkn2yo.fsf@alter.siamese.dyndns.org","threadId":"23037","inReplyTo":"20100316054352.704479000@mlists.thewrittenword.com","subject":"Re: [patch 11/15] no-hstrerror.patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-16T07:24:47Z","receivedAt":"2010-03-16T07:24:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n\n> SunOS 5.6 and 5.5.1 do not have hstrerror, even in libresolv.\n>\n> This patch improves the logic of the test for hstrerror, not to\n> blindly assume that if there is no hstrerror in libc that it must\n> exist in libresolv.\n> ---\n>  Makefile      |    1 +\n>  config.mak.in |    1 +\n>  configure.ac  |   17 ++++++++++++++---\n>  3 files changed, 16 insertions(+), 3 deletions(-)\n>\n> Index: b/configure.ac\n> ===================================================================\n> --- a/configure.ac\n> +++ b/configure.ac\n> @@ -526,11 +526,22 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -\n>  \n>  #\n>  # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.\n> -# Notably on Solaris hstrerror resides in libresolv and on Solaris 7\n> -# inet_ntop and inet_pton additionally reside there.\n> -AC_CHECK_LIB([c], [hstrerror],\n> +# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.\n\nYou lost the thing they are \"additional\" to, so this needs a bit of\nrewording?\n\nOther than that the patch looked sane (I don't have access to any vintage\nof Solaris these days, so I only read it through, though).\n\nThanks.\n"},{"id":"136952","messageId":"7v7hpcn2yd.fsf@alter.siamese.dyndns.org","threadId":"23037","inReplyTo":"20100316054316.503338000@mlists.thewrittenword.com","subject":"Re: [patch 04/15] diff-export.patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-16T07:24:58Z","receivedAt":"2010-03-16T07:24:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Looked sane (I didn't apply nor test, only read it through, though).\nThanks.\n"},{"id":"136953","messageId":"7vzl28lodo.fsf@alter.siamese.dyndns.org","threadId":"23037","inReplyTo":"20100316054403.034575000@mlists.thewrittenword.com","subject":"Re: [patch 13/15] no-socklen_t.patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-16T07:25:07Z","receivedAt":"2010-03-16T07:25:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n\n> +ifneq (socklen_t,$(SOCKLEN_T))\n> +\tBASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)\n> +endif\n\nThis looks like making use of configure mandatory to me?  Could you do\nthis patch without doing so?\n\nThe same comment applies to [15/15].\n\nThanks.\n"},{"id":"136954","messageId":"4B9F33DC.3030309@viscovery.net","threadId":"23037","inReplyTo":"20100316054306.167331000@mlists.thewrittenword.com","subject":"Re: [patch 02/15] const-expr.patch","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-03-16T07:31:40Z","receivedAt":"2010-03-16T07:31:40Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Gary V. Vaughan schrieb:\n> Unfortunately, there are still plenty of production systems with\n> vendor compilers that choke unless all compound declarations can be\n> determined statically at compile time, for example hpux10.20 (I can\n> provide a comprehensive list of our supported platforms that exhibit\n> this problem if necessary).\n\nYes, a comprehensive list would be appreciated. This change is an\nuglification that I personally would prefer to stay out of the code base\nunless many consumers of git are hurt.\n\nThe problem with this non-feature is that it is all too easy that new code\nintroduces new incompatibilities.\n\n> Index: b/ll-merge.c\n> ===================================================================\n> --- a/ll-merge.c\n> +++ b/ll-merge.c\n\nBTW, did you notice that git is a version control system that hosts itself? ;)\n\n> +\tdict[0].placeholder = \"O\"; dict[0].value = temp[0];\n> +\tdict[1].placeholder = \"A\"; dict[1].value = temp[1];\n> +\tdict[2].placeholder = \"B\"; dict[2].value = temp[2];\n> +\tdict[3].placeholder = \"L\"; dict[3].value = temp[3];\n> +\tdict[3].placeholder = NULL; dict[3].value = NULL;\n\n\tdict[4]...\n\n-- Hannes\n"},{"id":"140316","messageId":"20100316082321.GA26540@thor.il.thewrittenword.com","threadId":"23037","inReplyTo":"4B9F33DC.3030309@viscovery.net","subject":"Re: [patch 02/15] const-expr.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-03-16T08:23:21Z","receivedAt":"2010-03-16T08:23:21Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"On Tue, Mar 16, 2010 at 08:31:40AM +0100, Johannes Sixt wrote:\n> Gary V. Vaughan schrieb:\n> > Unfortunately, there are still plenty of production systems with\n> > vendor compilers that choke unless all compound declarations can be\n> > determined statically at compile time, for example hpux10.20 (I can\n> > provide a comprehensive list of our supported platforms that exhibit\n> > this problem if necessary).\n> \n> Yes, a comprehensive list would be appreciated. This change is an\n> uglification that I personally would prefer to stay out of the code base\n> unless many consumers of git are hurt.\n\nPortable code is rarely pretty... just take a look at the output of\nautoconf or automake.\n\nOf the various architectures we support, the latest vendor compilers\nfor IRIX 6.5 and older, and for HP-UX 10.20 and older do not compile\ndynamic compound declarations, throwing errors such as:\n\ncc-1028 cc: ERROR File = const-expr.c, Line = 6\n  The expression used must have a constant value.\n\n      const char *array[2] = { str, NULL };\n                               ^\n\n1 error detected in the compilation of \"const-expr.c\".\n\n> The problem with this non-feature is that it is all too easy that new code\n> introduces new incompatibilities.\n\nDo you mean that new code may prevent the code from compiling on those\nmachines again?  Well, that's kinda the same problem you have when you\nwish to support any architecture that you don't have access to... the\nbeauty of free software is that if it bites any significant number of\npeople you will get bug reports, and probably patches for as long as\npeople want to use the software on those machines.\n\n> > Index: b/ll-merge.c\n> > ===================================================================\n> > --- a/ll-merge.c\n> > +++ b/ll-merge.c\n> \n> BTW, did you notice that git is a version control system that hosts itself? ;)\n\nI did... but we use the SCM neutral quilt package to manage our local\nstack of per-package patches.  I'm not particularly fluent with git\nyet, and it took only a couple of minutes to get quilt to submit a\nmessage threaded set of patch emails to the list in a git-like format.\n\nDoes git absolutely require that you clone the entire project history\nto your local disk?  For the thousands of ports we maintain, that\nwould fast become a giant chunk of disk!\n\n> > +\tdict[0].placeholder = \"O\"; dict[0].value = temp[0];\n> > +\tdict[1].placeholder = \"A\"; dict[1].value = temp[1];\n> > +\tdict[2].placeholder = \"B\"; dict[2].value = temp[2];\n> > +\tdict[3].placeholder = \"L\"; dict[3].value = temp[3];\n> > +\tdict[3].placeholder = NULL; dict[3].value = NULL;\n> \n> \tdict[4]...\n\nOops.  Nice catch, thanks.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"136960","messageId":"VUV1ChwKH_zLPsIikaNeBZfWtyUI9YmyOzkiMdEjHJ0PuUAnPbDsEw@cipher.nrlssc.navy.mil","threadId":"23037","inReplyTo":"20100316054331.991677000@mlists.thewrittenword.com","subject":"Re: [patch 07/15] host-IRIX.patch","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-03-16T15:27:07Z","receivedAt":"2010-03-16T15:27:07Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"On 03/16/2010 12:42 AM, Gary V. Vaughan wrote:\n> \n> Irix 6.5 does not define 'sgi', but does define '__sgi'.\n> \n> Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD\n> u_short types et. al. to be declared properly.\n\nWhich IRIX release (uname -R) and compiler version are you using?\n\nI have IRIX 6.5.29m and MIPSpro Compiler 7.4.4m.\n\nBoth 'sgi' and '__sgi' appear to be predefined by the preprocessor\non my system.  I wasn't aware of '__sgi' when I added 'sgi', otherwise\nI would have used it.\n\nOn my system, defining _SGI_SOURCE causes _SGIAPI to be enabled which\ncauses all of the BSD types to be enabled.  In my header files in\n/usr/include/ everywhere I see a test for _BSD_TYPES, I also see a\ntest for _SGIAPI (or something equivalent) like this:\n\n   #if _SGIAPI || defined(_BSD_TYPES)\n\nSo defining _BSD_TYPES will probably not affect compiling on IRIX for\nme (though I haven't tested your patches yet), but do your header\nfiles not do the same thing with _SGI_SOURCE, _SGIAPI, and _BSD_TYPES?\n\nWhich shell are you using? Bash? or the native Korn shell?  If you're\ntrying to use the Korn shell, then you'll need a patch to t/test-lib.sh\nin order for the test suite to work properly.  I can send it to you if\nyou'd like.\n\nI compile and test with the following config.mak settings:\n\nGIT_SKIP_TESTS := \\\n   t3900.1[129] t3900.2[0234] \\\n   t5100.5 t5100.1[09] \\\n   t8005.[234]\nexport GIT_SKIP_TESTS\n\n# perl 5.8.0\n# python 2.1\n# GNU tar 1.2\nPERL_PATH = /apps/bin/perl\nPYTHON_PATH = /apps/bin/python\nTAR = /sw/local/bin/gtar\n\nCC = c99\nCFLAGS = -n32 -O2\n\nNO_C99_FORMAT = 1\nNO_CURL = 1\nNO_TCLTK = 1\nNO_MMAP =\nNO_OPENSSL = 1\nBLK_SHA1 = 1\nDEFAULT_PAGER = more\n\n# For IRIX <= 6.5.20 compatibility (uname -R)\n# i.e. the next two are not necessary for IRIX > 6.5.20\nNO_STRLCPY = 1\nNO_DEFLATE_BOUND = 1\n\n-brandon\n"},{"id":"136961","messageId":"2PY18tW3y3KTt2QABeUBfvQDHHcMVjCimIrW5lt7EM3Y9NG6ntwZeA@cipher.nrlssc.navy.mil","threadId":"23037","inReplyTo":"20100316054220.075676000@mlists.thewrittenword.com","subject":"Re: [patch 00/15] Portability Patches v3","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-03-16T16:03:13Z","receivedAt":"2010-03-16T16:03:13Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"On 03/16/2010 12:42 AM, Gary V. Vaughan wrote:\n> Here are the portability patches we needed at TWW to enable\n> git-1.7.0.2 to compile and run on all of the wide range of Unix\n> machines we support.  These patches apply to the git-1.7.0.2 release,\n> and address all of the feedback from the previous two times I posted\n> them to this list, most particularly splitting everything into many\n> small self-contained chunks.\n> \n> Note that I have not invested the time to figure out why the testsuite\n> is mostly useless on everything but Linux and Solaris 8+, because I'm\n> reasonably satisfied that the build itself is working properly.  Most\n> likely, it is merely GNUisms in the way the test cases call external\n> tools.  But maybe I'm missing something, but even the 3 new patches to\n> address test errors when diff does not support the -u option don't\n> improve the testsuite situation on HPUX, AIX, OSF1 and Solaris 7 and\n> older.\n\nWhich shell are you using?  If you're trying to use Korn or /usr/xpg4/bin/sh\non Solaris, you'll have problems, but it is possible.  I can send you a\npatch.\n\nI have 3 patches that I apply on top of master which allows me to compile and\ntest on Solaris 7.  I remove all but the first when installing, since it is\nnecessary to compile and the others are only necessary for the test suite.\n\n  1) Remove const declaration from arrays with non-constant initializers\n  2) t5100/*.mbox: use '646' rather than 'us-ascii' for Solaris\n  3) t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE\n\n\nHere's the config.mak file I use:\n\nGIT_SKIP_TESTS := \\\n   t1304.3 \\\n   t3900.2[23] \\\n   t5000.1[5-79] t5000.2[013-6] t5000.41 \\\n   t6030.1[23] \\\n   t8005.[23]\n\nGIT_TEST_CMP = cmp -s\n\nexport GIT_SKIP_TESTS GIT_TEST_CMP\n\nSHELL_PATH = /usr/xpg4/bin/sh\n\n# This is an old GNU tar that's why some of the\n# tests in t5000? still fail\nTAR = /apps/bin/gtar\n\nCC = /opt/SUNWspro/bin/cc\n\n# zlib is installed in /apps\nCFLAGS = -fast -native -I/apps/include\nLDFLAGS = -L/apps/lib\n\nNO_CURL = 1\nNO_TCLTK = 1\nNO_OPENSSL = 1\nBLK_SHA1 = 1\nNO_PYTHON = 1\nDEFAULT_PAGER = more\n\n-brandon\n"},{"id":"136982","messageId":"32541b131003161643g1a1cbf6ck3089ae5fb016a985@mail.gmail.com","threadId":"23037","inReplyTo":"4B9F33DC.3030309@viscovery.net","subject":"Re: [patch 02/15] const-expr.patch","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-03-16T23:43:54Z","receivedAt":"2010-03-16T23:43:54Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Tue, Mar 16, 2010 at 3:31 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Gary V. Vaughan schrieb:\n>> Unfortunately, there are still plenty of production systems with\n>> vendor compilers that choke unless all compound declarations can be\n>> determined statically at compile time, for example hpux10.20 (I can\n>> provide a comprehensive list of our supported platforms that exhibit\n>> this problem if necessary).\n>\n> Yes, a comprehensive list would be appreciated. This change is an\n> uglification that I personally would prefer to stay out of the code base\n> unless many consumers of git are hurt.\n>\n> The problem with this non-feature is that it is all too easy that new code\n> introduces new incompatibilities.\n\nThis is probably a stupid question, but why not just build it using\ngcc on systems with a broken vendor compiler?  You don't have to\ndistribute gcc just to distribute binaries built with it, so it seems\nlike there's no downside... and less suffering for the build\nmaintainer.\n\nHave fun,\n\nAvery\n"},{"id":"140323","messageId":"20100317060108.GB27121@thor.il.thewrittenword.com","threadId":"23037","inReplyTo":"32541b131003161643g1a1cbf6ck3089ae5fb016a985@mail.gmail.com","subject":"Re: [patch 02/15] const-expr.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-04-25T08:38:13Z","receivedAt":"2010-04-25T08:38:13Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"[It seems like all my replies to this list don't make it through, even\nthough I'm able to post a new thread.  Please forward on my behalf.]\n\nOn Tue, Mar 16, 2010 at 07:43:54PM -0400, Avery Pennarun wrote:\n> On Tue, Mar 16, 2010 at 3:31 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> > Gary V. Vaughan schrieb:\n> >> Unfortunately, there are still plenty of production systems with\n> >> vendor compilers that choke unless all compound declarations can be\n> >> determined statically at compile time, for example hpux10.20 (I can\n> >> provide a comprehensive list of our supported platforms that exhibit\n> >> this problem if necessary).\n> >\n> > Yes, a comprehensive list would be appreciated. This change is an\n> > uglification that I personally would prefer to stay out of the code base\n> > unless many consumers of git are hurt.\n> >\n> > The problem with this non-feature is that it is all too easy that new code\n> > introduces new incompatibilities.\n> \n> This is probably a stupid question, but why not just build it using\n> gcc on systems with a broken vendor compiler?  You don't have to\n> distribute gcc just to distribute binaries built with it, so it seems\n> like there's no downside... and less suffering for the build\n> maintainer.\n\nMore often than not the vendor compiler produces better code than gcc\non any given architecture, and one of the features of the TWW package\nbuilds is that in the vast majority of cases we port the upstream code\nto build using the vendor compiler, because this is what our customers\nwant.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"140324","messageId":"20100316084302.GB26540@thor.il.thewrittenword.com","threadId":"23037","inReplyTo":"7veijkohpe.fsf@alter.siamese.dyndns.org","subject":"Re: [patch 05/15] diff-test_cmp.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-04-25T08:38:43Z","receivedAt":"2010-04-25T08:38:43Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Hi Junio,\n\nThanks for the reviews.\n\nOn Tue, Mar 16, 2010 at 12:21:01AM -0700, Junio C Hamano wrote:\n> \"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n> \n> > Index: b/t/t0000-basic.sh\n> > ===================================================================\n> > --- a/t/t0000-basic.sh\n> > +++ b/t/t0000-basic.sh\n> > @@ -280,7 +280,7 @@ $expectfilter >expected <<\\EOF\n> >  EOF\n> >  test_expect_success \\\n> >      'validate git diff-files output for a know cache/work tree state.' \\\n> > -    'git diff-files >current && diff >/dev/null -b current expected'\n> > +    'git diff-files >current && test_cmp current expected >/dev/null'\n> \n> The original says \"compare ignoring whitespace changes\" but the updated\n> one says \"they must match literally\".  Is this conversion safe?\n\nNot all diff implementations support the '-b' option, unfortunately.\n\nThis change doesn't cause any regressions, at least the test suite\ncontinues to report success on the architectures where running it is\nsafe (i.e. Linux and Solaris 8+).\n\n> For the purpose of debugging tests, I think it would be better to lose the\n> redirection into /dev/null.  If the test passes, we wouldn't see anything\n> anyway, and if the test fails, we would see what's different, and that\n> helps diagnosing the breakage.  For systems with implementations of diff\n> that is \"-u\" challenged, we could define test_cmp in terms of \"diff -c\"\n> instead of \"cmp\".\n\nAgreed.  For all the hosts I have access to, diff -c is always\navailable.\n\n> > Index: b/t/t9400-git-cvsserver-server.sh\n> > ===================================================================\n> > --- a/t/t9400-git-cvsserver-server.sh\n> > +++ b/t/t9400-git-cvsserver-server.sh\n> > @@ -226,7 +226,7 @@ test_expect_success 'gitcvs.ext.enabled \n> >    'GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.ext.enabled true &&\n> >     GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled false &&\n> >     GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n> > -   diff -q cvswork cvswork2'\n> > +   test_cmp cvswork cvswork2' >/dev/null\n> \n> If the -q in the original really matters, then please add the redirection\n> to /dev/null only for test_cmp; never redirect the output from the entire\n> test_expect_success.\n\nDon't worry, I didn't do that:\n\n $ echo 'test_expect_success' &&\n > echo 'test_cmp' >/dev/null\n test_expect_success\n\n> On the other hand, if -q does not matter the outcome\n> of the test, simply lose the \"quiet\".  We really should not care, and make\n> sure it is available easily to people who broke cvsserver and need to see\n> the difference between expected and actual results while debugging.\n> \n> There are similar dubious conversions in your patch to this file.\n\nI'd be even happier to see the >/dev/null redirections dropped if the\npatch is pushed.  Part of the reason I didn't invest too much effort\ninto debugging the massive testsuite failures everything but Linux and\nSolaris 8+ is because it's too difficult to find out why a particular\ntest actually failed.\n\n> > Index: b/t/Makefile\n> > ===================================================================\n> > --- a/t/Makefile\n> > +++ b/t/Makefile\n> > @@ -6,6 +6,7 @@\n> >  -include ../config.mak\n> >  \n> >  #GIT_TEST_OPTS=--verbose --debug\n> > +GIT_TEST_CMP ?= $(DIFF)\n> \n> If this forces plain diff not more readable \"diff -u\" to everybody, that\n> sounds like a regression to me.\n\nIt does, because \"diff -u\" is not portable.\n\nA more comprehensive patch might run a configure test to see whether\n-u is supported, and then fallback first to \"${ac_cv_prog_DIFF} -c\",\nor if that breaks too, finally settle on \"cmp\".  And then we'd have to\nset matching defaults in Makefile.\n\nI'm afraid I don't have time to help with that, since the testsuite is\nso very broken on nearly all of our architectures.  I'll post some\nexamples presently.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"140325","messageId":"20100316084823.GC26540@thor.il.thewrittenword.com","threadId":"23037","inReplyTo":"7vsk80n31u.fsf@alter.siamese.dyndns.org","subject":"Re: [patch 06/15] diff-defaults.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-04-25T08:38:57Z","receivedAt":"2010-04-25T08:38:57Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"On Tue, Mar 16, 2010 at 12:22:53AM -0700, Junio C Hamano wrote:\n> \"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n> \n> > By default the testsuite calls 'diff -u' whenever a file comparison is\n> > called for.  Unfortunately that throws a \"diff: unknown option '-u'\"\n> > error for most non-GNU diffs.\n> >\n> > This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where\n> > that happens.\n> \n> Wouldn't most of these platforms you listed have a working \"diff -c\" at\n> least?  Using it would make debugging the tests easier, as it would be\n> more readable than output from \"cmp\".\n\nYes, I've checked, and everything I have access to supports \"diff -c\"\nwith the vendor implementation.\n\n> I also saw your patch to install-webdoc used \"$DIFF -u\"; as the patch\n> series seem to assume a unified-capable diff implementation is available\n> somewhere, perhaps you do not need this patch after all, but instead just\n> need to default GIT_TEST_CMP to \"$DIFF -u\" in t/test-lib.sh, no?\n\nThat is more than adequate for me, since one of our packages is GNU\ndiffutils, and my git build recipe puts the path to our diffutils\npackage first in PATH before launching configure and make.\n\nHowever, anyone else that wants to build git on a non-\"diff -u\"\ncapable machine won't necessarily have this luxury.  At the moment\nit's hard for me to tell whether the diff changes are a net win, since\nI can't get the testsuite to run properly on any of the architectures\nthat would be affected.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"140326","messageId":"20100316085459.GD26540@thor.il.thewrittenword.com","threadId":"23037","inReplyTo":"7vljdsn2yz.fsf@alter.siamese.dyndns.org","subject":"Re: [patch 07/15] host-IRIX.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-04-25T08:39:13Z","receivedAt":"2010-04-25T08:39:13Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"On Tue, Mar 16, 2010 at 12:24:36AM -0700, Junio C Hamano wrote:\n> \"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n> \n> > Irix 6.5 does not define 'sgi', but does define '__sgi'.\n> >\n> > Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD\n> > u_short types et. al. to be declared properly.\n> \n> If Irix 6.5 defines __sgi and the patch _adds_ \"defined(__sgi)\" I wouldn't\n> have to worry too much, but would replacing \"defined(sgi)\" with the\n> double-underscore version make somebody who added \"defined(sgi)\" in the\n> first place cry, if it was done for different version of Irix that does\n> define \"sgi\" (worse yet, but not \"__sgi\")?\n\nAgreed.  I've amended my local version of this patch to check both\n(sgi) and (__sgi) now.  Thanks.\n\n> Another natural question is if defining _BSD_TYPES everywhere has negative\n> effects on somebody else's platforms, but that is what people on different\n> platforms will have to apply this patch, test, and report success or\n> breakage.  Help from the list audience is appreciated.\n\nGood point.  Perhaps better to make that change in the Makefile?\n\nifeq ($(uname_S),IRIX64)\n        # Need this for u_short definitions et al\n        BASIC_CFLAGS += -D_BSD_TYPES\nendif\n\nI only have use of mips-sgi-irix6.5 machines, so I'm not sure what\nother versions are affected... probably a safe bet that\nifeq($(uname_S),IRIX) should get that definition too.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"140327","messageId":"20100317061353.GC27121@thor.il.thewrittenword.com","threadId":"23037","inReplyTo":"VUV1ChwKH_zLPsIikaNeBZfWtyUI9YmyOzkiMdEjHJ0PuUAnPbDsEw@cipher.nrlssc.navy.mil","subject":"Re: [patch 07/15] host-IRIX.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-04-25T08:39:25Z","receivedAt":"2010-04-25T08:39:25Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"[It seems that while the list allows me to start a new thread, all my\nreplies are actually discarded or held for moderation :( Please\nforward a copy to the list on my behalf]\n\nOn Tue, Mar 16, 2010 at 10:27:07AM -0500, Brandon Casey wrote:\n> On 03/16/2010 12:42 AM, Gary V. Vaughan wrote:\n> > \n> > Irix 6.5 does not define 'sgi', but does define '__sgi'.\n> > \n> > Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD\n> > u_short types et. al. to be declared properly.\n> \n> Which IRIX release (uname -R) and compiler version are you using?\n> \n> I have IRIX 6.5.29m and MIPSpro Compiler 7.4.4m.\n\nIRIX 6.5.26m here, with the same compiler.\n\n> Both 'sgi' and '__sgi' appear to be predefined by the preprocessor\n> on my system.  I wasn't aware of '__sgi' when I added 'sgi', otherwise\n> I would have used it.\n\nI was quite surprised too, but __sgi is necessary here.\n\n> On my system, defining _SGI_SOURCE causes _SGIAPI to be enabled which\n> causes all of the BSD types to be enabled.  In my header files in\n> /usr/include/ everywhere I see a test for _BSD_TYPES, I also see a\n> test for _SGIAPI (or something equivalent) like this:\n> \n>    #if _SGIAPI || defined(_BSD_TYPES)\n> \n> So defining _BSD_TYPES will probably not affect compiling on IRIX for\n> me (though I haven't tested your patches yet), but do your header\n> files not do the same thing with _SGI_SOURCE, _SGIAPI, and _BSD_TYPES?\n\nThey do, but when I was looking for a macro to define to get the\nadditional declarations, _BSD_TYPES was the first one I found.\n_SGI_SOURCE, _SGIAPI and even _BSD_COMPAT appear to work equally well.\n\n> Which shell are you using? Bash? or the native Korn shell?  If you're\n> trying to use the Korn shell, then you'll need a patch to t/test-lib.sh\n> in order for the test suite to work properly.  I can send it to you if\n> you'd like.\n\nI believe we're using bash.  At least our environment has\nSHELL=/opt/fsw/bash32/bin/bash and we call configure with '${SHELL}\n./configure ...' and gmake with 'make SHELL=${SHELL}'.  But I suppose\nit's possible that if t/Makefile ignores those settings and the tests\nbegin with '#!/bin/sh', then perhaps they are using Korn shell?\n\nThanks, yes, I'll be interested to see your patch... but shouldn't we\ntry to fix git in the repo so that it respects the SHELL environment\nand make setting?\n\n> I compile and test with the following config.mak settings:\n> \n> GIT_SKIP_TESTS := \\\n>    t3900.1[129] t3900.2[0234] \\\n>    t5100.5 t5100.1[09] \\\n>    t8005.[234]\n> export GIT_SKIP_TESTS\n> \n> # perl 5.8.0\n> # python 2.1\n> # GNU tar 1.2\n> PERL_PATH = /apps/bin/perl\n> PYTHON_PATH = /apps/bin/python\n> TAR = /sw/local/bin/gtar\n> \n> CC = c99\n> CFLAGS = -n32 -O2\n> \n> NO_C99_FORMAT = 1\n> NO_CURL = 1\n> NO_TCLTK = 1\n> NO_MMAP =\n> NO_OPENSSL = 1\n> BLK_SHA1 = 1\n> DEFAULT_PAGER = more\n> \n> # For IRIX <= 6.5.20 compatibility (uname -R)\n> # i.e. the next two are not necessary for IRIX > 6.5.20\n> NO_STRLCPY = 1\n> NO_DEFLATE_BOUND = 1\n\nAnd similarly, shouldn't these settings be fed back upstream for the\nbenefit of other IRIX users of git?\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"140328","messageId":"20100316085731.GE26540@thor.il.thewrittenword.com","threadId":"23037","inReplyTo":"7veijkn2yo.fsf@alter.siamese.dyndns.org","subject":"Re: [patch 11/15] no-hstrerror.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-04-25T08:39:40Z","receivedAt":"2010-04-25T08:39:40Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"On Tue, Mar 16, 2010 at 12:24:47AM -0700, Junio C Hamano wrote:\n> \"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n> > @@ -526,11 +526,22 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -\n> >  \n> >  #\n> >  # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.\n> > -# Notably on Solaris hstrerror resides in libresolv and on Solaris 7\n> > -# inet_ntop and inet_pton additionally reside there.\n> > -AC_CHECK_LIB([c], [hstrerror],\n> > +# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.\n> \n> You lost the thing they are \"additional\" to, so this needs a bit of\n> rewording?\n\nI did that to minimise the changes in this patch.  no-inet_ntop.patch\nrewrites the inet_ntop test and deletes the incomplete comment line\ntoo.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"140329","messageId":"20100316092122.GF26540@thor.il.thewrittenword.com","threadId":"23037","inReplyTo":"7vzl28lodo.fsf@alter.siamese.dyndns.org","subject":"Re: [patch 13/15] no-socklen_t.patch","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-04-25T08:39:55Z","receivedAt":"2010-04-25T08:39:55Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"On Tue, Mar 16, 2010 at 12:25:07AM -0700, Junio C Hamano wrote:\n> \"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n> \n> > +ifneq (socklen_t,$(SOCKLEN_T))\n> > +\tBASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)\n> > +endif\n> \n> This looks like making use of configure mandatory to me?  Could you do\n> this patch without doing so?\nSure.\n\nSunOS 2.6 and earlier, HP-UX 10.20 and OSF1 do not have a socklen_t type\ndeclaration.\n---\n Makefile      |   10 ++++++++++\n aclocal.m4    |   41 +++++++++++++++++++++++++++++++++++++++++\n config.mak.in |    1 +\n configure.ac  |    6 ++++++\n 4 files changed, 58 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -8,6 +8,9 @@ all::\n # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend\n # to PATH if your tools in /usr/bin are broken.\n #\n+# Define SOCKLEN_T to a suitable type (such as 'size_t') if your\n+# system headers do not define a socklen_t type.\n+#\n # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()\n # or vsnprintf() return -1 instead of number of characters which would\n # have been written to the final string if enough space had been available.\n@@ -698,6 +701,7 @@ EXTLIBS =\n ifeq ($(uname_S),OSF1)\n \t# Need this for u_short definitions et al\n \tBASIC_CFLAGS += -D_OSF_SOURCE\n+\tSOCKLEN_T = int\n \tNO_STRTOULL = YesPlease\n \tNO_NSEC = YesPlease\n endif\n@@ -774,6 +778,7 @@ ifeq ($(uname_S),SunOS)\n \tNO_MKSTEMPS = YesPlease\n \tNO_REGEX = YesPlease\n \tifeq ($(uname_R),5.6)\n+\t\tSOCKLEN_T = int\n \t\tNO_HSTRERROR = YesPlease\n \t\tNO_IPV6 = YesPlease\n \t\tNO_SOCKADDR_STORAGE = YesPlease\n@@ -938,6 +943,7 @@ ifeq ($(uname_S),HP-UX)\n \tNO_NSEC = YesPlease\n \tSNPRINTF_RETURNS_BOGUS = YesPlease\n \tifeq ($(uname_R),B.10.20)\n+\t\tSOCKLEN_T = size_t\n \t\tNO_PREAD = YesPlease\n \t\tNO_INET_NTOP = YesPlease\n \t\tNO_INET_PTON = YesPlease\n@@ -1064,6 +1070,10 @@ else\n BROKEN_PATH_FIX = '/^\\# @@BROKEN_PATH_FIX@@$$/d'\n endif\n \n+ifeq (,$(SOCKLEN_T)\n+\tBASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)\n+endif\n+\n ifeq ($(uname_S),Darwin)\n \tifndef NO_FINK\n \t\tifeq ($(shell test -d /sw/lib && echo y),y)\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -613,6 +613,12 @@ AC_SUBST(OLD_ICONV)\n ## Checks for typedefs, structures, and compiler characteristics.\n AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics])\n #\n+TYPE_SOCKLEN_T\n+case $ac_cv_type_socklen_t in\n+  yes)\t;;\n+  *)  \tAC_SUBST([SOCKLEN_T], [$git_cv_socklen_t_equiv]) ;;\n+esac\n+\n # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.\n AC_CHECK_MEMBER(struct dirent.d_ino,\n [NO_D_INO_IN_DIRENT=],\nIndex: b/config.mak.in\n===================================================================\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -58,6 +58,7 @@ NO_INET_PTON=@NO_INET_PTON@\n NO_ICONV=@NO_ICONV@\n OLD_ICONV=@OLD_ICONV@\n NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\n+SOCKLEN_T=@SOCKLEN_T@\n FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@\n SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@\n NO_PTHREADS=@NO_PTHREADS@\nIndex: b/aclocal.m4\n===================================================================\n--- /dev/null\n+++ b/aclocal.m4\n@@ -0,0 +1,41 @@\n+dnl Check for socklen_t: historically on BSD it is an int, and in\n+dnl POSIX 1g it is a type of its own, but some platforms use different\n+dnl types for the argument to getsockopt, getpeername, etc.  So we\n+dnl have to test to find something that will work.\n+AC_DEFUN([TYPE_SOCKLEN_T],\n+[\n+   AC_CHECK_TYPE([socklen_t], ,[\n+      AC_MSG_CHECKING([for socklen_t equivalent])\n+      AC_CACHE_VAL([git_cv_socklen_t_equiv],\n+      [\n+         # Systems have either \"struct sockaddr *\" or\n+         # \"void *\" as the second argument to getpeername\n+         git_cv_socklen_t_equiv=\n+         for arg2 in \"struct sockaddr\" void; do\n+            for t in int size_t unsigned long \"unsigned long\"; do\n+               AC_TRY_COMPILE([\n+                  #include <sys/types.h>\n+                  #include <sys/socket.h>\n+\n+                  int getpeername (int, $arg2 *, $t *);\n+               ],[\n+                  $t len;\n+                  getpeername(0,0,&len);\n+               ],[\n+                  git_cv_socklen_t_equiv=\"$t\"\n+                  break 2\n+               ])\n+            done\n+         done\n+\n+         if test \"x$git_cv_socklen_t_equiv\" = x; then\n+            AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])\n+         fi\n+      ])\n+      AC_MSG_RESULT($git_cv_socklen_t_equiv)\n+      AC_DEFINE_UNQUOTED(socklen_t, $git_cv_socklen_t_equiv,\n+\t\t\t[type to use in place of socklen_t if not defined])],\n+      [#include <sys/types.h>\n+#include <sys/socket.h>])\n+])\n+\nCheeers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"}]}