{"thread":{"id":"23806","subject":"[PATCH v5 00/18] Portability patches for git-1.7.1","startedAt":"2010-05-14T09:31:31Z","lastAt":"2010-06-11T04:30:30Z","messageCount":34,"participants":["Gary V. Vaughan","Robin H. Johnson","Brandon Casey","Junio C Hamano","Tor Arntsen"],"isPatch":true,"patchVersion":5,"patchTotal":18},"messages":[{"id":"141640","messageId":"20100514093131.249094000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":null,"subject":"[PATCH v5 00/18] Portability patches for git-1.7.1","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:31Z","receivedAt":"2010-05-14T09:31:31Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Momentum appears to have stalled on this portability patch set, but\nI received a lot of great feed back on restructuring and tweaking, the\nresults of which follow. If there's anything else I can do to help the\nadoption of some or all of these patches into upstream please don't\nhesitate to ask.  There are no new changes in this v5 patchset, and\nthe additional 2 patches in the series over the last submission is\npurely an artifact of the restructuring based on feedback.\n\nSo, as I said before: Here are the portability patches we needed at\nTWW to enable git-1.7.1 to compile and run on all of the wide range of\nUnix machines we support.  These patches apply to the git-1.7.1\nrelease,  and address all of the feedback from the previous four\ntimes I posted them to this list.\n\nWith the exception of a hand-full of test failures outside of Linux\nand Solaris8+, git now compiles and passes all tests on the following\narchitectures:\n\n        Solaris 2.6/SPARC\n        Solaris 7/SPARC\n        Solaris 8/SPARC\n        Solaris 9/SPARC\n        Solaris 10/SPARC\n        Solaris 10/Intel\n        HP-UX 10.20/PA\n        HP-UX 11.00/PA\n        HP-UX 11.11/PA\n        HP-UX 11.23/PA\n        HP-UX 11.23/IA\n        HP-UX 11.31/PA\n        HP-UX 11.31/IA\n        AIX 5.1\n        AIX 5.2\n        AIX 5.3\n        AIX 6.1\n        Tru64 UNIX 5.1\n        IRIX 6.5\n        RHEL 3/x86\n        RHEL 3/amd64\n        RHEL 4/x86\n        RHEL 4/amd64\n        RHEL 5/x86\n        RHEL 5/amd64\n        SLES 10/x86\n        SLES 10/amd64\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141641","messageId":"20100514093725.884968000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 01/18] Makefile: pass CPPFLAGS through to fllow customization","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:32Z","receivedAt":"2010-05-14T09:31:32Z","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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile      |    2 +-\n config.mak.in |    1 +\n 2 files changed, 2 insertions(+), 1 deletion(-)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -246,7 +246,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":"141642","messageId":"20100514093731.063765000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 02/18] Rewrite dynamic structure initializations to runtime assignment","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:33Z","receivedAt":"2010-05-14T09:31:33Z","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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\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 };\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@@ -498,17 +498,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@@ -139,17 +139,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[4].placeholder = NULL; dict[4].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@@ -717,7 +717,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[2] = { 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 };\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@@ -314,7 +314,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@@ -261,12 +261,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@@ -609,7 +609,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@@ -574,9 +574,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@@ -778,7 +779,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":"141643","messageId":"20100514093736.227762000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 03/18] Makefile: -lpthread may still be necessary when libc has only pthread stubs","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:34Z","receivedAt":"2010-05-14T09:31:34Z","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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\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@@ -294,6 +294,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@@ -898,6 +899,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@@ -1349,6 +1352,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@@ -802,7 +802,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@@ -819,7 +823,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@@ -827,11 +832,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@@ -848,6 +860,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":"141644","messageId":"20100514093741.463112000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 04/18] enums: omit trailing comma for portability","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:35Z","receivedAt":"2010-05-14T09:31:35Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX\n5.1 fails to compile git.\n\nenum style is inconsistent already, with some enums declared on one\nline, some over 3 lines with the enum values all on the middle line,\nsometimes with 1 enum value per line... and independently of that the\ntrailing comma is sometimes present and other times absent, often\nmixing with/without trailing comma styles in a single file, and\nsometimes in consecutive enum declarations.\n\nClearly, omitting the comma is the more portable style, and this patch\nchanges all enum declarations to use the portable omitted dangling\ncomma style consistently.\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n attr.h                 |    2 +-\n builtin/apply.c        |    4 ++--\n builtin/branch.c       |    4 ++--\n builtin/commit.c       |    6 +++---\n builtin/help.c         |    2 +-\n builtin/mailinfo.c     |    4 ++--\n builtin/receive-pack.c |    2 +-\n builtin/remote.c       |    2 +-\n cache.h                |   16 ++++++++--------\n commit.h               |    2 +-\n connect.c              |    2 +-\n ctype.c                |    2 +-\n diff.h                 |    2 +-\n dir.c                  |    6 +++---\n fast-import.c          |    2 +-\n grep.h                 |    8 ++++----\n http-push.c            |    2 +-\n http-walker.c          |    2 +-\n imap-send.c            |    2 +-\n merge-recursive.h      |    2 +-\n parse-options.h        |    6 +++---\n pretty.c               |    2 +-\n remote.h               |    2 +-\n rerere.c               |    2 +-\n revision.c             |    2 +-\n wt-status.h            |    2 +-\n 26 files changed, 45 insertions(+), 45 deletions(-)\n\nIndex: b/attr.h\n===================================================================\n--- a/attr.h\n+++ b/attr.h\n@@ -34,7 +34,7 @@ int git_checkattr(const char *path, int,\n enum git_attr_direction {\n \tGIT_ATTR_CHECKIN,\n \tGIT_ATTR_CHECKOUT,\n-\tGIT_ATTR_INDEX,\n+\tGIT_ATTR_INDEX\n };\n void git_attr_set_direction(enum git_attr_direction, struct index_state *);\n \nIndex: b/builtin/apply.c\n===================================================================\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -56,7 +56,7 @@ static enum ws_error_action {\n \tnowarn_ws_error,\n \twarn_on_ws_error,\n \tdie_on_ws_error,\n-\tcorrect_ws_error,\n+\tcorrect_ws_error\n } ws_error_action = warn_on_ws_error;\n static int whitespace_error;\n static int squelch_whitespace_errors = 5;\n@@ -64,7 +64,7 @@ static int applied_after_fixing_ws;\n \n static enum ws_ignore {\n \tignore_ws_none,\n-\tignore_ws_change,\n+\tignore_ws_change\n } ws_ignore_action = ignore_ws_none;\n \n \nIndex: b/builtin/branch.c\n===================================================================\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -43,13 +43,13 @@ enum color_branch {\n \tBRANCH_COLOR_PLAIN = 1,\n \tBRANCH_COLOR_REMOTE = 2,\n \tBRANCH_COLOR_LOCAL = 3,\n-\tBRANCH_COLOR_CURRENT = 4,\n+\tBRANCH_COLOR_CURRENT = 4\n };\n \n static enum merge_filter {\n \tNO_FILTER = 0,\n \tSHOW_NOT_MERGED,\n-\tSHOW_MERGED,\n+\tSHOW_MERGED\n } merge_filter;\n static unsigned char merge_filter_ref[20];\n \nIndex: b/builtin/commit.c\n===================================================================\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -57,7 +57,7 @@ static struct lock_file false_lock; /* u\n static enum {\n \tCOMMIT_AS_IS = 1,\n \tCOMMIT_NORMAL,\n-\tCOMMIT_PARTIAL,\n+\tCOMMIT_PARTIAL\n } commit_style;\n \n static const char *logfile, *force_author;\n@@ -78,7 +78,7 @@ static char *untracked_files_arg, *force\n static enum {\n \tCLEANUP_SPACE,\n \tCLEANUP_NONE,\n-\tCLEANUP_ALL,\n+\tCLEANUP_ALL\n } cleanup_mode;\n static char *cleanup_arg;\n \n@@ -90,7 +90,7 @@ static int null_termination;\n static enum {\n \tSTATUS_FORMAT_LONG,\n \tSTATUS_FORMAT_SHORT,\n-\tSTATUS_FORMAT_PORCELAIN,\n+\tSTATUS_FORMAT_PORCELAIN\n } status_format = STATUS_FORMAT_LONG;\n \n static int opt_parse_m(const struct option *opt, const char *arg, int unset)\nIndex: b/builtin/help.c\n===================================================================\n--- a/builtin/help.c\n+++ b/builtin/help.c\n@@ -26,7 +26,7 @@ enum help_format {\n \tHELP_FORMAT_NONE,\n \tHELP_FORMAT_MAN,\n \tHELP_FORMAT_INFO,\n-\tHELP_FORMAT_WEB,\n+\tHELP_FORMAT_WEB\n };\n \n static int show_all = 0;\nIndex: b/builtin/mailinfo.c\n===================================================================\n--- a/builtin/mailinfo.c\n+++ b/builtin/mailinfo.c\n@@ -17,10 +17,10 @@ static struct strbuf name = STRBUF_INIT;\n static struct strbuf email = STRBUF_INIT;\n \n static enum  {\n-\tTE_DONTCARE, TE_QP, TE_BASE64,\n+\tTE_DONTCARE, TE_QP, TE_BASE64\n } transfer_encoding;\n static enum  {\n-\tTYPE_TEXT, TYPE_OTHER,\n+\tTYPE_TEXT, TYPE_OTHER\n } message_type;\n \n static struct strbuf charset = STRBUF_INIT;\nIndex: b/builtin/receive-pack.c\n===================================================================\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -16,7 +16,7 @@ enum deny_action {\n \tDENY_UNCONFIGURED,\n \tDENY_IGNORE,\n \tDENY_WARN,\n-\tDENY_REFUSE,\n+\tDENY_REFUSE\n };\n \n static int deny_deletes;\nIndex: b/builtin/remote.c\n===================================================================\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -317,7 +317,7 @@ struct push_info {\n \t\tPUSH_STATUS_UPTODATE,\n \t\tPUSH_STATUS_FASTFORWARD,\n \t\tPUSH_STATUS_OUTOFDATE,\n-\t\tPUSH_STATUS_NOTQUERIED,\n+\t\tPUSH_STATUS_NOTQUERIED\n \t} status;\n };\n \nIndex: b/cache.h\n===================================================================\n--- a/cache.h\n+++ b/cache.h\n@@ -361,7 +361,7 @@ enum object_type {\n \tOBJ_OFS_DELTA = 6,\n \tOBJ_REF_DELTA = 7,\n \tOBJ_ANY,\n-\tOBJ_MAX,\n+\tOBJ_MAX\n };\n \n static inline enum object_type object_type(unsigned int mode)\n@@ -556,7 +556,7 @@ extern int core_apply_sparse_checkout;\n enum safe_crlf {\n \tSAFE_CRLF_FALSE = 0,\n \tSAFE_CRLF_FAIL = 1,\n-\tSAFE_CRLF_WARN = 2,\n+\tSAFE_CRLF_WARN = 2\n };\n \n extern enum safe_crlf safe_crlf;\n@@ -567,21 +567,21 @@ enum branch_track {\n \tBRANCH_TRACK_REMOTE,\n \tBRANCH_TRACK_ALWAYS,\n \tBRANCH_TRACK_EXPLICIT,\n-\tBRANCH_TRACK_OVERRIDE,\n+\tBRANCH_TRACK_OVERRIDE\n };\n \n enum rebase_setup_type {\n \tAUTOREBASE_NEVER = 0,\n \tAUTOREBASE_LOCAL,\n \tAUTOREBASE_REMOTE,\n-\tAUTOREBASE_ALWAYS,\n+\tAUTOREBASE_ALWAYS\n };\n \n enum push_default_type {\n \tPUSH_DEFAULT_NOTHING = 0,\n \tPUSH_DEFAULT_MATCHING,\n \tPUSH_DEFAULT_TRACKING,\n-\tPUSH_DEFAULT_CURRENT,\n+\tPUSH_DEFAULT_CURRENT\n };\n \n extern enum branch_track git_branch_track;\n@@ -590,7 +590,7 @@ extern enum push_default_type push_defau\n \n enum object_creation_mode {\n \tOBJECT_CREATION_USES_HARDLINKS = 0,\n-\tOBJECT_CREATION_USES_RENAMES = 1,\n+\tOBJECT_CREATION_USES_RENAMES = 1\n };\n \n extern enum object_creation_mode object_creation_mode;\n@@ -670,7 +670,7 @@ enum sharedrepo {\n \tOLD_PERM_GROUP      = 1,\n \tOLD_PERM_EVERYBODY  = 2,\n \tPERM_GROUP          = 0660,\n-\tPERM_EVERYBODY      = 0664,\n+\tPERM_EVERYBODY      = 0664\n };\n int git_config_perm(const char *var, const char *value);\n int set_shared_perm(const char *path, int mode);\n@@ -880,7 +880,7 @@ struct ref {\n \t\tREF_STATUS_REJECT_NODELETE,\n \t\tREF_STATUS_UPTODATE,\n \t\tREF_STATUS_REMOTE_REJECT,\n-\t\tREF_STATUS_EXPECTING_REPORT,\n+\t\tREF_STATUS_EXPECTING_REPORT\n \t} status;\n \tchar *remote_status;\n \tstruct ref *peer_ref; /* when renaming */\nIndex: b/commit.h\n===================================================================\n--- a/commit.h\n+++ b/commit.h\n@@ -60,7 +60,7 @@ enum cmit_fmt {\n \tCMIT_FMT_EMAIL,\n \tCMIT_FMT_USERFORMAT,\n \n-\tCMIT_FMT_UNSPECIFIED,\n+\tCMIT_FMT_UNSPECIFIED\n };\n \n struct pretty_print_context\nIndex: b/connect.c\n===================================================================\n--- a/connect.c\n+++ b/connect.c\n@@ -131,7 +131,7 @@ int path_match(const char *path, int nr,\n enum protocol {\n \tPROTO_LOCAL = 1,\n \tPROTO_SSH,\n-\tPROTO_GIT,\n+\tPROTO_GIT\n };\n \n static enum protocol get_protocol(const char *name)\nIndex: b/ctype.c\n===================================================================\n--- a/ctype.c\n+++ b/ctype.c\n@@ -10,7 +10,7 @@ enum {\n \tA = GIT_ALPHA,\n \tD = GIT_DIGIT,\n \tG = GIT_GLOB_SPECIAL,\t/* *, ?, [, \\\\ */\n-\tR = GIT_REGEX_SPECIAL,\t/* $, (, ), +, ., ^, {, | */\n+\tR = GIT_REGEX_SPECIAL\t/* $, (, ), +, ., ^, {, | */\n };\n \n unsigned char sane_ctype[256] = {\nIndex: b/diff.h\n===================================================================\n--- a/diff.h\n+++ b/diff.h\n@@ -133,7 +133,7 @@ enum color_diff {\n \tDIFF_FILE_NEW = 5,\n \tDIFF_COMMIT = 6,\n \tDIFF_WHITESPACE = 7,\n-\tDIFF_FUNCINFO = 8,\n+\tDIFF_FUNCINFO = 8\n };\n const char *diff_get_color(int diff_use_color, enum color_diff ix);\n #define diff_get_color_opt(o, ix) \\\nIndex: b/dir.c\n===================================================================\n--- a/dir.c\n+++ b/dir.c\n@@ -465,7 +465,7 @@ static struct dir_entry *dir_add_ignored\n enum exist_status {\n \tindex_nonexistent = 0,\n \tindex_directory,\n-\tindex_gitdir,\n+\tindex_gitdir\n };\n \n /*\n@@ -533,7 +533,7 @@ static enum exist_status directory_exist\n enum directory_treatment {\n \tshow_directory,\n \tignore_directory,\n-\trecurse_into_directory,\n+\trecurse_into_directory\n };\n \n static enum directory_treatment treat_directory(struct dir_struct *dir,\n@@ -684,7 +684,7 @@ static int get_dtype(struct dirent *de, \n enum path_treatment {\n \tpath_ignored,\n \tpath_handled,\n-\tpath_recurse,\n+\tpath_recurse\n };\n \n static enum path_treatment treat_one_path(struct dir_struct *dir,\nIndex: b/fast-import.c\n===================================================================\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -267,7 +267,7 @@ struct hash_list\n typedef enum {\n \tWHENSPEC_RAW = 1,\n \tWHENSPEC_RFC2822,\n-\tWHENSPEC_NOW,\n+\tWHENSPEC_NOW\n } whenspec_type;\n \n struct recent_command\nIndex: b/grep.h\n===================================================================\n--- a/grep.h\n+++ b/grep.h\n@@ -10,17 +10,17 @@ enum grep_pat_token {\n \tGREP_OPEN_PAREN,\n \tGREP_CLOSE_PAREN,\n \tGREP_NOT,\n-\tGREP_OR,\n+\tGREP_OR\n };\n \n enum grep_context {\n \tGREP_CONTEXT_HEAD,\n-\tGREP_CONTEXT_BODY,\n+\tGREP_CONTEXT_BODY\n };\n \n enum grep_header_field {\n \tGREP_HEADER_AUTHOR = 0,\n-\tGREP_HEADER_COMMITTER,\n+\tGREP_HEADER_COMMITTER\n };\n \n struct grep_pat {\n@@ -40,7 +40,7 @@ enum grep_expr_node {\n \tGREP_NODE_ATOM,\n \tGREP_NODE_NOT,\n \tGREP_NODE_AND,\n-\tGREP_NODE_OR,\n+\tGREP_NODE_OR\n };\n \n struct grep_expr {\nIndex: b/http-push.c\n===================================================================\n--- a/http-push.c\n+++ b/http-push.c\n@@ -105,7 +105,7 @@ enum transfer_state {\n \tRUN_PUT,\n \tRUN_MOVE,\n \tABORTED,\n-\tCOMPLETE,\n+\tCOMPLETE\n };\n \n struct transfer_request\nIndex: b/http-walker.c\n===================================================================\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -15,7 +15,7 @@ enum object_request_state {\n \tWAITING,\n \tABORTED,\n \tACTIVE,\n-\tCOMPLETE,\n+\tCOMPLETE\n };\n \n struct object_request\nIndex: b/imap-send.c\n===================================================================\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -230,7 +230,7 @@ enum CAPABILITY {\n \tLITERALPLUS,\n \tNAMESPACE,\n \tSTARTTLS,\n-\tAUTH_CRAM_MD5,\n+\tAUTH_CRAM_MD5\n };\n \n static const char *cap_list[] = {\nIndex: b/merge-recursive.h\n===================================================================\n--- a/merge-recursive.h\n+++ b/merge-recursive.h\n@@ -10,7 +10,7 @@ struct merge_options {\n \tenum {\n \t\tMERGE_RECURSIVE_NORMAL = 0,\n \t\tMERGE_RECURSIVE_OURS,\n-\t\tMERGE_RECURSIVE_THEIRS,\n+\t\tMERGE_RECURSIVE_THEIRS\n \t} recursive_variant;\n \tconst char *subtree_shift;\n \tunsigned buffer_output : 1;\nIndex: b/parse-options.h\n===================================================================\n--- a/parse-options.h\n+++ b/parse-options.h\n@@ -25,7 +25,7 @@ enum parse_opt_flags {\n \tPARSE_OPT_STOP_AT_NON_OPTION = 2,\n \tPARSE_OPT_KEEP_ARGV0 = 4,\n \tPARSE_OPT_KEEP_UNKNOWN = 8,\n-\tPARSE_OPT_NO_INTERNAL_HELP = 16,\n+\tPARSE_OPT_NO_INTERNAL_HELP = 16\n };\n \n enum parse_opt_option_flags {\n@@ -36,7 +36,7 @@ enum parse_opt_option_flags {\n \tPARSE_OPT_LASTARG_DEFAULT = 16,\n \tPARSE_OPT_NODASH = 32,\n \tPARSE_OPT_LITERAL_ARGHELP = 64,\n-\tPARSE_OPT_NEGHELP = 128,\n+\tPARSE_OPT_NEGHELP = 128\n };\n \n struct option;\n@@ -160,7 +160,7 @@ extern NORETURN void usage_msg_opt(const\n enum {\n \tPARSE_OPT_HELP = -1,\n \tPARSE_OPT_DONE,\n-\tPARSE_OPT_UNKNOWN,\n+\tPARSE_OPT_UNKNOWN\n };\n \n /*\nIndex: b/pretty.c\n===================================================================\n--- a/pretty.c\n+++ b/pretty.c\n@@ -828,7 +828,7 @@ static size_t format_commit_item(struct \n \tenum {\n \t\tNO_MAGIC,\n \t\tADD_LF_BEFORE_NON_EMPTY,\n-\t\tDEL_LF_BEFORE_EMPTY,\n+\t\tDEL_LF_BEFORE_EMPTY\n \t} magic = NO_MAGIC;\n \n \tswitch (placeholder[0]) {\nIndex: b/remote.h\n===================================================================\n--- a/remote.h\n+++ b/remote.h\n@@ -145,7 +145,7 @@ int branch_merge_matches(struct branch *\n enum match_refs_flags {\n \tMATCH_REFS_NONE\t\t= 0,\n \tMATCH_REFS_ALL \t\t= (1 << 0),\n-\tMATCH_REFS_MIRROR\t= (1 << 1),\n+\tMATCH_REFS_MIRROR\t= (1 << 1)\n };\n \n /* Reporting of tracking info */\nIndex: b/rerere.c\n===================================================================\n--- a/rerere.c\n+++ b/rerere.c\n@@ -153,7 +153,7 @@ static int handle_path(unsigned char *sh\n \tgit_SHA_CTX ctx;\n \tint hunk_no = 0;\n \tenum {\n-\t\tRR_CONTEXT = 0, RR_SIDE_1, RR_SIDE_2, RR_ORIGINAL,\n+\t\tRR_CONTEXT = 0, RR_SIDE_1, RR_SIDE_2, RR_ORIGINAL\n \t} hunk = RR_CONTEXT;\n \tstruct strbuf one = STRBUF_INIT, two = STRBUF_INIT;\n \tstruct strbuf buf = STRBUF_INIT;\nIndex: b/revision.c\n===================================================================\n--- a/revision.c\n+++ b/revision.c\n@@ -1781,7 +1781,7 @@ int prepare_revision_walk(struct rev_inf\n enum rewrite_result {\n \trewrite_one_ok,\n \trewrite_one_noparents,\n-\trewrite_one_error,\n+\trewrite_one_error\n };\n \n static enum rewrite_result rewrite_one(struct rev_info *revs, struct commit **pp)\nIndex: b/wt-status.h\n===================================================================\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -11,7 +11,7 @@ enum color_wt_status {\n \tWT_STATUS_CHANGED,\n \tWT_STATUS_UNTRACKED,\n \tWT_STATUS_NOBRANCH,\n-\tWT_STATUS_UNMERGED,\n+\tWT_STATUS_UNMERGED\n };\n \n enum untracked_status_type {\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141645","messageId":"20100514093746.689775000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 05/18] Do not use \"diff\" found on PATH while building and installing","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:36Z","receivedAt":"2010-05-14T09:31:36Z","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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\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 5 files changed, 7 insertions(+), 3 deletions(-)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -287,6 +287,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@@ -1460,7 +1461,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@@ -1877,6 +1878,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@@ -362,6 +362,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":"141646","messageId":"20100514093751.825924000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 06/18] tests: use \"test_cmp\", not \"diff\", when verifying the result","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:37Z","receivedAt":"2010-05-14T09:31:37Z","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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n t/Makefile                      |    4 ++++\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 |    2 +-\n 19 files changed, 59 insertions(+), 55 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@@ -435,7 +435,7 @@ test_expect_success 'cvs update (-p)' '\n     rm -f failures &&\n     for i in merge no-lf empty really-empty; do\n         GIT_CONFIG=\"$git_config\" cvs update -p \"$i\" >$i.out\n-        diff $i.out ../$i >>failures 2>&1\n+        test_cmp $i.out ../$i >>failures 2>&1\n     done &&\n     test -z \"$(cat failures)\"\n '\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,10 +6,14 @@\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+# Make sure test-lib.sh uses make's value of GIT_TEST_CMP\n+export GIT_TEST_CMP\n+\n # Shell quote;\n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n \n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141647","messageId":"20100514093757.079291000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 07/18] test_cmp: do not use \"diff -u\" on platforms that lack one","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:38Z","receivedAt":"2010-05-14T09:31:38Z","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.  The previous version of this patch forgot to export\nGIT_TEST_CMP from t/Makefile, which is why 'make test' continued to\nfail most tests on most architectures - test-lib.sh was falling back\non its default of `diff -u' for GIT_TEST_CMP.  This version of this\npatch shows a vast improvement in testsuite results where either GNU\ndiff is in the path at configure time, or where Makefile knows that\nGIT_TEST_CMP=cmp is required.\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile   |    5 +++++\n t/Makefile |    1 +\n 2 files changed, 6 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -815,18 +815,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@@ -903,6 +906,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@@ -957,6 +961,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":"141648","messageId":"20100514093802.235245000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 08/18] git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:39Z","receivedAt":"2010-05-14T09:31:39Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Some platforms with mmap() lack MAP_FAILED definition.\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n git-compat-util.h |    5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\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":"141649","messageId":"20100514093807.382121000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 09/18] Makefile: some platforms do not have hstrerror anywhere","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:40Z","receivedAt":"2010-05-14T09:31:40Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"This 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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n config.mak.in |    1 +\n configure.ac  |   17 ++++++++++++++---\n 2 files changed, 15 insertions(+), 3 deletions(-)\n\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -546,11 +546,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/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":"141652","messageId":"20100514093812.591978000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 10/18] Make NO_{INET_NTOP,INET_PTON} configured independently","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:41Z","receivedAt":"2010-05-14T09:31:41Z","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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n config.mak.in |    2 ++\n configure.ac  |   37 ++++++++++++++++++++++++++++++-------\n 2 files changed, 32 insertions(+), 7 deletions(-)\n\nIndex: b/configure.ac\n===================================================================\n--- a/configure.ac\n+++ b/configure.ac\n@@ -545,11 +545,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@@ -561,8 +583,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],\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":"141651","messageId":"20100514093817.727518000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 11/18] Some platforms lack socklen_t type","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:42Z","receivedAt":"2010-05-14T09:31:42Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Some platforms do not have a socklen_t type declaration.\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile      |    7 +++++++\n aclocal.m4    |   41 +++++++++++++++++++++++++++++++++++++++++\n config.mak.in |    1 +\n configure.ac  |    6 ++++++\n 4 files changed, 55 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@@ -1087,6 +1090,10 @@ else\n BROKEN_PATH_FIX = '/^\\# @@BROKEN_PATH_FIX@@$$/d'\n endif\n \n+ifneq (,$(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@@ -633,6 +633,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+\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141650","messageId":"20100514093822.893923000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 12/18] Allow disabling \"inline\"","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:43Z","receivedAt":"2010-05-14T09:31:43Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Compiler 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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile      |    7 +++++++\n config.mak.in |    1 +\n configure.ac  |    6 ++++++\n 3 files changed, 14 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -11,6 +11,9 @@ all::\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 INLINE to a suitable substitute (such as '__inline' or '') if git\n+# fails to compile with errors about undefined inline functions or similar.\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@@ -1090,6 +1093,10 @@ else\n BROKEN_PATH_FIX = '/^\\# @@BROKEN_PATH_FIX@@$$/d'\n endif\n \n+ifneq (,$(INLINE))\n+\tBASIC_CFLAGS += -Dinline=$(INLINE)\n+endif\n+\n ifneq (,$(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@@ -327,6 +327,12 @@ 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+  inline | yes | no)\t;;\n+  *)\t\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@@ -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+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":"141654","messageId":"20100514093828.066208000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 13/18] inline declaration does not work on AIX","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:44Z","receivedAt":"2010-05-14T09:31:44Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Define away inline declaration on AIX.\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile |    3 +++\n 1 file changed, 3 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -912,6 +912,9 @@ ifeq ($(uname_S),AIX)\n \telse\n \t\tPTHREAD_LIBS = -lpthread\n \tendif\n+\tifeq ($(shell expr \"$(uname_V).$(uname_R)\" : '5\\.1'),3)\n+\t\tINLINE=''\n+\tendif\n \tGIT_TEST_CMP = cmp\n endif\n ifeq ($(uname_S),GNU)\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141653","messageId":"20100514093833.233343000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 14/18] Makefile: SunOS 5.6 portability fix","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:45Z","receivedAt":"2010-05-14T09:31:45Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Although configure takes care of most of this, set some default values\nfor Solaris 2.6 (aka SunOS-5.6) to ensure git compiles even when\nconfigure is not used to build it.\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile |   12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -812,6 +812,18 @@ ifeq ($(uname_S),SunOS)\n \tNO_MKDTEMP = YesPlease\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+\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\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141655","messageId":"20100514093838.421864000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 15/18] git-compat-util.h: Irix 6.5 defines sgi but not __sgi.","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:46Z","receivedAt":"2010-05-14T09:31:46Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Irix 6.5 does not define 'sgi', but does define '__sgi'.\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\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@@ -56,7 +56,8 @@\n # define _XOPEN_SOURCE 500\n # endif\n #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \\\n-      !defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)\n+      !defined(_M_UNIX) && !defined(sgi) && !defined(__sgi) && \\\n+      !defined(__DragonFly__)\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\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141656","messageId":"20100514093843.575490000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 16/18] Makefile: HPUX11 portability fixes.","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:47Z","receivedAt":"2010-05-14T09:31:47Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"There is no nanosecond field on HPUX, the inline keyword is\nspelled \"__inline\", and there are no inet_ntop/inet_pton definitions\non HP-UX 11.00\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile |    6 ++++++\n 1 file changed, 6 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -971,6 +971,7 @@ ifeq ($(uname_S),IRIX64)\n \tNEEDS_LIBGEN = YesPlease\n endif\n ifeq ($(uname_S),HP-UX)\n+\tINLINE = __inline\n \tNO_IPV6=YesPlease\n \tNO_SETENV=YesPlease\n \tNO_STRCASESTR=YesPlease\n@@ -982,6 +983,11 @@ ifeq ($(uname_S),HP-UX)\n \tNO_HSTRERROR = YesPlease\n \tNO_SYS_SELECT_H = YesPlease\n \tSNPRINTF_RETURNS_BOGUS = YesPlease\n+\tNO_NSEC = YesPlease\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\n ifeq ($(uname_S),Windows)\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141658","messageId":"20100514093848.745470000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 17/18] Makefile: HP-UX 10.20 portability fixes.","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:48Z","receivedAt":"2010-05-14T09:31:48Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"HP-UX 10.20 has no pread definition, the inline keyword doesn't work,\nand has no inet_ntop/inet_pton definitions.\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile |    8 ++++++++\n 1 file changed, 8 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -988,6 +988,14 @@ ifeq ($(uname_S),HP-UX)\n \t\tNO_INET_NTOP = YesPlease\n \t\tNO_INET_PTON = YesPlease\n \tendif\n+\tifeq ($(uname_R),B.10.20)\n+\t\t# Override HP-UX 11.x setting:\n+\t\tINLINE =\n+\t\tSOCKLEN_T = size_t\n+\t\tNO_PREAD = YesPlease\n+ \t\tNO_INET_NTOP = YesPlease\n+ \t\tNO_INET_PTON = YesPlease\n+\tendif\n \tGIT_TEST_CMP = cmp\n endif\n ifeq ($(uname_S),Windows)\n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141657","messageId":"20100514093853.905838000@mlists.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"[PATCH v5 18/18] Makefile: Tru64 portability fix","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T09:31:49Z","receivedAt":"2010-05-14T09:31:49Z","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\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n---\n Makefile |    7 +++++++\n 1 file changed, 7 insertions(+)\n\nIndex: b/Makefile\n===================================================================\n--- a/Makefile\n+++ b/Makefile\n@@ -740,6 +740,13 @@ 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+\tSOCKLEN_T = int\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":"141659","messageId":"robbat2-20100514T094909-157386852Z@orbis-terrarum.net","threadId":"23806","inReplyTo":"20100514093725.884968000@mlists.thewrittenword.com","subject":"Re: [PATCH v5 01/18] Makefile: pass CPPFLAGS through to fllow customization","fromName":"Robin H. Johnson","fromEmail":"robbat2@gentoo.org","sentAt":"2010-05-14T09:53:30Z","receivedAt":"2010-05-14T09:53:30Z","isPatch":true,"sender":{"key":"robbat2@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/373898?v=4"},"body":"On Fri, May 14, 2010 at 09:31:32AM +0000, Gary V. Vaughan wrote:\n> Without this patch there is no straight forward way to pass additional\n> CPPFLAGS at configure-time.  At TWW, everything non-vendor package is\n> installed to its own subdirectory, so we need the following to show\n> the preprocessor where the headers for the libraries we will link\n> later can be found:\nAs a point of comparision, this is what we use in Gentoo, to allow us to\noverride many of the variables:\nsed -i \\\n    -e 's:^\\(CFLAGS =\\).*$:\\1 $(OPTCFLAGS) -Wall:' \\\n    -e 's:^\\(LDFLAGS =\\).*$:\\1 $(OPTLDFLAGS):' \\\n    -e 's:^\\(CC = \\).*$:\\1$(OPTCC):' \\\n    -e 's:^\\(AR = \\).*$:\\1$(OPTAR):' \\\n    Makefile || die \"sed failed\"\n\nWhich would be equivilent to changing the Makefile to have:\nCFLAGS = $(OPTCFLAGS) -Wall\nLDFLAGS = $(OPTLDFLAGS)\nCC = $(OPTCC)\nAR = $(OPTAR)\n\nThereafter, we pass in the relevant values for those variables.\n\nCPPFLAGS is reserved for flags destined for ONLY the preprocessor, and we don't\nwant to introduce for that reason.\n\n-- \nRobin Hugh Johnson\nGentoo Linux: Developer, Trustee & Infrastructure Lead\nE-Mail     : robbat2@gentoo.org\nGnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85\n"},{"id":"141663","messageId":"20100514105832.GB31921@thor.il.thewrittenword.com","threadId":"23806","inReplyTo":"robbat2-20100514T094909-157386852Z@orbis-terrarum.net","subject":"Re: [PATCH v5 01/18] Makefile: pass CPPFLAGS through to fllow customization","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T10:58:32Z","receivedAt":"2010-05-14T10:58:32Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Hi Robin,\n\nOn Fri, May 14, 2010 at 09:53:30AM +0000, Robin H. Johnson wrote:\n> On Fri, May 14, 2010 at 09:31:32AM +0000, Gary V. Vaughan wrote:\n> > Without this patch there is no straight forward way to pass additional\n> > CPPFLAGS at configure-time.  At TWW, everything non-vendor package is\n> > installed to its own subdirectory, so we need the following to show\n> > the preprocessor where the headers for the libraries we will link\n> > later can be found:\n> As a point of comparision, this is what we use in Gentoo, to allow us to\n> override many of the variables:\n> sed -i \\\n>     -e 's:^\\(CFLAGS =\\).*$:\\1 $(OPTCFLAGS) -Wall:' \\\n>     -e 's:^\\(LDFLAGS =\\).*$:\\1 $(OPTLDFLAGS):' \\\n>     -e 's:^\\(CC = \\).*$:\\1$(OPTCC):' \\\n>     -e 's:^\\(AR = \\).*$:\\1$(OPTAR):' \\\n>     Makefile || die \"sed failed\"\n> \n> Which would be equivilent to changing the Makefile to have:\n> CFLAGS = $(OPTCFLAGS) -Wall\n> LDFLAGS = $(OPTLDFLAGS)\n> CC = $(OPTCC)\n> AR = $(OPTAR)\n> \n> Thereafter, we pass in the relevant values for those variables.\n> \n> CPPFLAGS is reserved for flags destined for ONLY the preprocessor, and we don't\n> want to introduce for that reason.\n\nLetting the user pass preprocessor flags to the preprocessor with\nCPPFLAGS at build and/or configure time is a *very* standard feature.\nWhy would you want to stop a person who builds git from using it?\n\nAs a matter of fact, Automake even jumps through hoops with\nAM_CPPFLAGS to make sure that the package maintainer doesn't\naccidentally trample over the package builder's CPPFLAGS settings - I\ncan't think of a scenario where the person who writes the build system\nfor a package knows more about what CPPFLAGS the person who builds it\nwill need that the person doing the actual building.\n\nI'm pretty sure I'm missing the point though, since letting the\npackage builder choose their own CPPFLAGS has been at the core of\nbuilding Unix packages for as long as I can remember...\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"141664","messageId":"robbat2-20100514T110034-766521339Z@orbis-terrarum.net","threadId":"23806","inReplyTo":"20100514105832.GB31921@thor.il.thewrittenword.com","subject":"Re: [PATCH v5 01/18] Makefile: pass CPPFLAGS through to fllow customization","fromName":"Robin H. Johnson","fromEmail":"robbat2@gentoo.org","sentAt":"2010-05-14T11:04:59Z","receivedAt":"2010-05-14T11:04:59Z","isPatch":true,"sender":{"key":"robbat2@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/373898?v=4"},"body":"On Fri, May 14, 2010 at 10:58:32AM +0000, Gary V. Vaughan wrote:\n> As a matter of fact, Automake even jumps through hoops with\n> AM_CPPFLAGS to make sure that the package maintainer doesn't\n> accidentally trample over the package builder's CPPFLAGS settings - I\n> can't think of a scenario where the person who writes the build system\n> for a package knows more about what CPPFLAGS the person who builds it\n> will need that the person doing the actual building.\nAM_CFLAGS != AM_CPPFLAGS. My concern was the mixing of them.\n\nIIRC the correct direction was that all CPPFLAGS should be valid CFLAGS,\nbut not all valid CFLAGS are valid CPPFLAGS (depending on your cpp, they\nmight be passed to other layers).\n\n> I'm pretty sure I'm missing the point though, since letting the\n> package builder choose their own CPPFLAGS has been at the core of\n> building Unix packages for as long as I can remember...\nAs a middle ground:\nCFLAGS = $(OPTCFLAGS) -Wall\nCPPFLAGS = $(OPTCPPFLAGS)\nLDFLAGS = $(OPTLDFLAGS)\nCC = $(OPTCC)\nAR = $(OPTAR)\n\n(and pass them suitably to the various binaries).\n\n-- \nRobin Hugh Johnson\nGentoo Linux: Developer, Trustee & Infrastructure Lead\nE-Mail     : robbat2@gentoo.org\nGnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85\n"},{"id":"141666","messageId":"20100514120116.GC31921@thor.il.thewrittenword.com","threadId":"23806","inReplyTo":"robbat2-20100514T110034-766521339Z@orbis-terrarum.net","subject":"Re: [PATCH v5 01/18] Makefile: pass CPPFLAGS through to fllow customization","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-14T12:01:16Z","receivedAt":"2010-05-14T12:01:16Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Hi Robin,\n\nOn Fri, May 14, 2010 at 11:04:59AM +0000, Robin H. Johnson wrote:\n> On Fri, May 14, 2010 at 10:58:32AM +0000, Gary V. Vaughan wrote:\n> > As a matter of fact, Automake even jumps through hoops with\n> > AM_CPPFLAGS to make sure that the package maintainer doesn't\n> > accidentally trample over the package builder's CPPFLAGS settings - I\n> > can't think of a scenario where the person who writes the build system\n> > for a package knows more about what CPPFLAGS the person who builds it\n> > will need that the person doing the actual building.\n> AM_CFLAGS != AM_CPPFLAGS. My concern was the mixing of them.\n\nWhile I agree that mixing up AM_CFLAGS and AM_CPPFLAGS, or even\nAM_CXXFLAGS and AM_CFLAGS is likely to break your build, that's no\nreason to deprecate the user's CPPFLAGS setting!\n\n> As a middle ground:\n> CFLAGS = $(OPTCFLAGS) -Wall\n> CPPFLAGS = $(OPTCPPFLAGS)\n> LDFLAGS = $(OPTLDFLAGS)\n> CC = $(OPTCC)\n> AR = $(OPTAR)\n\nOkay, I think we are mostly in agreement here.  In all the packages we\nbuild here at TWW, we let the user use CFLAGS, CPPFLAGS, LDFLAGS etc,\nand to preserve that we'll jump through some Automake-like hoops so\nthat the build system doesn't overwrite them at build time.\n\nYou actually propose the same separation, except that you want the\npackage builder to use the OPTCFLAGS, OPTCPPFLAGS, OPTLDFLAGS etc so\nthat the build system can use CFLAGS et al.  I don't think this\nbuys you anything but confusion when anyone used to building on Unix\nover the last 20 or 30 years tries to pass flags into the build using\nthe tried and tested mechanism (CFLAGS, CPPFLAGS et al) to no effect.\n\nGit already follows the tried and tested mechanism, but forgot to\nhonor the user's CPPFLAGS setting, which is what this patch is trying\nto address.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"142316","messageId":"20100526055637.GA78095@thor.il.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"Re: [PATCH v5 00/18] Portability patches for git-1.7.1","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-05-26T05:56:37Z","receivedAt":"2010-05-26T05:56:37Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"On Fri, May 14, 2010 at 09:31:31AM +0000, Gary V. Vaughan wrote:\n> Momentum appears to have stalled on this portability patch set, but\n> I received a lot of great feed back on restructuring and tweaking, the\n> results of which follow. If there's anything else I can do to help the\n> adoption of some or all of these patches into upstream please don't\n> hesitate to ask.  There are no new changes in this v5 patchset, and\n> the additional 2 patches in the series over the last submission is\n> purely an artifact of the restructuring based on feedback.\n\nPing?\n\nAnything I can do to help oil the wheels that process git patch\ncontributions?\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"142757","messageId":"4gJWLBIdRVtK7gq22o-LadCixyvOA-9FlEvk-ZrCHyUsGwArvR9oPkV-qlez-T-Nsn0v6UO633Y@cipher.nrlssc.navy.mil","threadId":"23806","inReplyTo":"20100514093838.421864000@mlists.thewrittenword.com","subject":"[PATCH] git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2010-06-02T01:55:36Z","receivedAt":"2010-06-02T01:55:36Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Gary V. Vaughan <git@mlists.thewrittenword.com>\n\nIRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'\nmacro.  Since later IRIX versions (6.5.29m) define both macros, and since\nan underscore prefixed macro is preferred anyway, use '__sgi' to detect\ncompilation on SGI IRIX.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nHi Gary,\n\nHere's a resubmit of your patch with an updated commit message.  Since the\n__sgi macro seems to be more common than the sgi macro, I modified your\npatch to check for only the __sgi macro.  I know Junio suggested checking\nfor both macros, but I'm the one that Junio was talking about when he made\nhis comments, and __sgi works for me.\n\nIt's such a simple little patch, but still I removed your signed-off-by line\nsince I modified the patch, and I am not you.  Please do reply to this message\nwith a signed-off-by if you sign off on the patch.  Junio will add it to the\npatch when he applies the it.\n\n-brandon\n\n\n git-compat-util.h |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex edf352d..c0198dd 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -56,7 +56,7 @@\n # define _XOPEN_SOURCE 500\n # endif\n #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \\\n-      !defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)\n+      !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__)\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-- \n1.6.6.2\n"},{"id":"142761","messageId":"7vaareqc97.fsf@alter.siamese.dyndns.org","threadId":"23806","inReplyTo":"20100514093731.063765000@mlists.thewrittenword.com","subject":"Re: [PATCH v5 02/18] Rewrite dynamic structure initializations to runtime assignment","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-06-02T04:39:16Z","receivedAt":"2010-06-02T04:39:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This one is really unfortunate, not just because it adds quite a lot of\nnoise, but because anybody touching the codebase in the future needs to be\naware of the limitation we are imposing on us.  The same comment applies\nto 04/18 (enum without trailing comma) but the level of annoyance is much\nlower there and I would say it is at an acceptable level.\n"},{"id":"142763","messageId":"7v4ohmqc93.fsf@alter.siamese.dyndns.org","threadId":"23806","inReplyTo":"20100514093746.689775000@mlists.thewrittenword.com","subject":"Re: [PATCH v5 05/18] Do not use \"diff\" found on PATH while building and installing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-06-02T04:39:20Z","receivedAt":"2010-06-02T04:39:20Z","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/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\nDo we or do we not want to quote \"$DIFF\"?  iow, how well do we deal with $IFS\nwhitespace in the path?\n"},{"id":"142762","messageId":"7vy6eyoxoj.fsf@alter.siamese.dyndns.org","threadId":"23806","inReplyTo":"20100514093751.825924000@mlists.thewrittenword.com","subject":"Re: [PATCH v5 06/18] tests: use \"test_cmp\", not \"diff\", when verifying the result","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-06-02T04:39:24Z","receivedAt":"2010-06-02T04:39:24Z","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> In tests, call test_cmp rather than raw diff where possible (i.e. if\n> the output does not go to a pipe), to allow the use of, say, 'cmp'\n> when the default 'diff -u' is not compatible with a vendor diff.\n>\n> When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.\n\nBoth are very worthy goal.\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... and I think we could lose >/dev/null redirection once we rewrite these\nusing test_cmp, but that can be a separate patch.\n\n> Index: b/t/Makefile\n> ===================================================================\n> --- a/t/Makefile\n> +++ b/t/Makefile\n> @@ -6,10 +6,14 @@\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> +# Make sure test-lib.sh uses make's value of GIT_TEST_CMP\n> +export GIT_TEST_CMP\n> +\n>  # Shell quote;\n>  SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n\nBut isn't this a regression?  When GIT_TEST_CMP is not defined, we used to\n\n    GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}\n\nwhich in turn is used like this:\n\n    test_cmp() {\n            $GIT_TEST_CMP \"$@\"\n    }\n\nso people would get a more readable \"diff -u\" output when GIT_TEST_CMP is\nnot defined and exported.  With your patch we would lose -u everywhere,\nno?\n\nAlso even if your vendor diff lacks unified context format, I would\npresume that it would support good old copied context format with -c, and\nit would give us a better readability.\n\nHow about doing something like this on top of your patch?\n\nYour 7/18 will instead be setting \"GIT_TEST_CMP_USE_COPIED_CONTEXT =\nYesPlease\" for (hopefully) most of the targets whose native \"diff\" knows\ncopied context format, and others will set GIT_TEST_CMP to cmp, perhaps?\n\n---\n Makefile      |    4 ++++\n t/Makefile    |    4 ----\n t/test-lib.sh |   11 ++++++++++-\n 3 files changed, 14 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 668dbc9..c8cc9e2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1374,6 +1374,10 @@ ifdef USE_NED_ALLOCATOR\n        COMPAT_OBJS += compat/nedmalloc/nedmalloc.o\n endif\n \n+ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT\n+\texport GIT_TEST_CMP_USE_COPIED_CONTEXT\n+endif\n+\n ifeq ($(TCLTK_PATH),)\n NO_TCLTK=NoThanks\n endif\ndiff --git a/t/Makefile b/t/Makefile\nindex 93a6475..25c559b 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -6,14 +6,10 @@\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-# Make sure test-lib.sh uses make's value of GIT_TEST_CMP\n-export GIT_TEST_CMP\n-\n # Shell quote;\n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex c582964..a290011 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -63,7 +63,16 @@ export GIT_MERGE_VERBOSITY\n export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n export EDITOR\n-GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}\n+\n+if test -z \"$GIT_TEST_CMP\"\n+then\n+\tif test -n \"$GIT_TEST_CMP_USE_COPIED_CONTEXT\"\n+\tthen\n+\t\tGIT_TEST_CMP=\"$DIFF -c\"\n+\telse\n+\t\tGIT_TEST_CMP=\"$DIFF -u\"\n+\tfi\n+fi\n \n # Protect ourselves from common misconfiguration to export\n # CDPATH into the environment\n"},{"id":"142797","messageId":"20100602084331.GA1782@thor.il.thewrittenword.com","threadId":"23806","inReplyTo":"4gJWLBIdRVtK7gq22o-LadCixyvOA-9FlEvk-ZrCHyUsGwArvR9oPkV-qlez-T-Nsn0v6UO633Y@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-06-02T08:43:31Z","receivedAt":"2010-06-02T08:43:31Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Hi Brandon,\n\nOn Tue, Jun 01, 2010 at 08:55:36PM -0500, Brandon Casey wrote:\n> From: Gary V. Vaughan <git@mlists.thewrittenword.com>\n> \n> IRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'\n> macro.  Since later IRIX versions (6.5.29m) define both macros, and since\n> an underscore prefixed macro is preferred anyway, use '__sgi' to detect\n> compilation on SGI IRIX.\n> \n> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n\nSigned-off-by: Gary V. Vaughan <gary@thewrittenword.com>\n\n> Here's a resubmit of your patch with an updated commit message.  Since the\n> __sgi macro seems to be more common than the sgi macro, I modified your\n> patch to check for only the __sgi macro.  I know Junio suggested checking\n> for both macros, but I'm the one that Junio was talking about when he made\n> his comments, and __sgi works for me.\n\nSure, that's fine.  I only need the __sgi part for git to compile\ncorrectly on my IRIX machines, so if you feel that the non-underscore\nflavour is superfluous then I won't miss it! ;)\n\n> It's such a simple little patch, but still I removed your signed-off-by line\n> since I modified the patch, and I am not you.  Please do reply to this message\n> with a signed-off-by if you sign off on the patch.  Junio will add it to the\n> patch when he applies the it.\n\nDone.\n\nCheers,\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"142805","messageId":"AANLkTinvmNM_nKQnZNgQMWstrevG4RfcjW7RdCILVLYF@mail.gmail.com","threadId":"23806","inReplyTo":"4gJWLBIdRVtK7gq22o-LadCixyvOA-9FlEvk-ZrCHyUsGwArvR9oPkV-qlez-T-Nsn0v6UO633Y@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX","fromName":"Tor Arntsen","fromEmail":"tor@spacetec.no","sentAt":"2010-06-02T09:56:56Z","receivedAt":"2010-06-02T09:56:56Z","isPatch":true,"sender":{"key":"tor@spacetec.no","avatar":null},"body":"On Wed, Jun 2, 2010 at 03:55, Brandon Casey <casey@nrlssc.navy.mil> wrote:\n> From: Gary V. Vaughan <git@mlists.thewrittenword.com>\n>\n> IRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'\n> macro.  Since later IRIX versions (6.5.29m) define both macros, and since\n> an underscore prefixed macro is preferred anyway, use '__sgi' to detect\n> compilation on SGI IRIX.\n\nYes, __sgi is the one to use. It's been there on all the SGI systems\nI've used, at least back to IRIX 5.3 (I don't recall for sure about\n4.0.5 but my guess is yes). 'sgi' is often there too, also on IRIX 6.2\n(with the old MIPS compiler), but on both 6.2 and 6.5 it goes away if\nyou use certain other options, e.g. -ansi. __sgi, on the other hand,\nis always there - it doesn't depend on any other compiler options.\n\n-Tor\n"},{"id":"143171","messageId":"20100607154511.GA9718@thor.il.thewrittenword.com","threadId":"23806","inReplyTo":"20100514093131.249094000@mlists.thewrittenword.com","subject":"Re: [PATCH v5 00/18] Portability patches for git-1.7.1","fromName":"Gary V. Vaughan","fromEmail":"git@mlists.thewrittenword.com","sentAt":"2010-06-07T15:45:11Z","receivedAt":"2010-06-07T15:45:11Z","isPatch":true,"sender":{"key":"git@mlists.thewrittenword.com","avatar":null},"body":"Just bumping this thread so that it doesn't fall off the radar.\n\nIs there anything I can do to help reviewers or committers accept\nor reject the patches in this set?\n\nCheers,\n    Gary\n\nOn Fri, May 14, 2010 at 09:31:31AM +0000, Gary V. Vaughan wrote:\n> Momentum appears to have stalled on this portability patch set, but\n> I received a lot of great feed back on restructuring and tweaking, the\n> results of which follow. If there's anything else I can do to help the\n> adoption of some or all of these patches into upstream please don't\n> hesitate to ask.  There are no new changes in this v5 patchset, and\n> the additional 2 patches in the series over the last submission is\n> purely an artifact of the restructuring based on feedback.\n> \n> So, as I said before: Here are the portability patches we needed at\n> TWW to enable git-1.7.1 to compile and run on all of the wide range of\n> Unix machines we support.  These patches apply to the git-1.7.1\n> release,  and address all of the feedback from the previous four\n> times I posted them to this list.\n> \n> With the exception of a hand-full of test failures outside of Linux\n> and Solaris8+, git now compiles and passes all tests on the following\n> architectures:\n> \n>         Solaris 2.6/SPARC\n>         Solaris 7/SPARC\n>         Solaris 8/SPARC\n>         Solaris 9/SPARC\n>         Solaris 10/SPARC\n>         Solaris 10/Intel\n>         HP-UX 10.20/PA\n>         HP-UX 11.00/PA\n>         HP-UX 11.11/PA\n>         HP-UX 11.23/PA\n>         HP-UX 11.23/IA\n>         HP-UX 11.31/PA\n>         HP-UX 11.31/IA\n>         AIX 5.1\n>         AIX 5.2\n>         AIX 5.3\n>         AIX 6.1\n>         Tru64 UNIX 5.1\n>         IRIX 6.5\n>         RHEL 3/x86\n>         RHEL 3/amd64\n>         RHEL 4/x86\n>         RHEL 4/amd64\n>         RHEL 5/x86\n>         RHEL 5/amd64\n>         SLES 10/x86\n>         SLES 10/amd64\n> \n> Cheers,\n> -- \n> Gary V. Vaughan (gary@thewrittenword.com)\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n\n-- \nGary V. Vaughan (gary@thewrittenword.com)\n"},{"id":"143175","messageId":"7vy6eqvhrq.fsf@alter.siamese.dyndns.org","threadId":"23806","inReplyTo":"20100607154511.GA9718@thor.il.thewrittenword.com","subject":"Re: [PATCH v5 00/18] Portability patches for git-1.7.1","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-06-07T18:07:05Z","receivedAt":"2010-06-07T18:07:05Z","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> Just bumping this thread so that it doesn't fall off the radar.\n>\n> Is there anything I can do to help reviewers or committers accept\n> or reject the patches in this set?\n\nIsn't the series already cooking in 'next'?\n"},{"id":"143320","messageId":"AANLkTilFx4FRa_7L2nSPNcM3RVOAKfPrhTE1tGDMKl7f@mail.gmail.com","threadId":"23806","inReplyTo":"7vy6eqvhrq.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v5 00/18] Portability patches for git-1.7.1","fromName":"Tor Arntsen","fromEmail":"tor@spacetec.no","sentAt":"2010-06-09T09:37:18Z","receivedAt":"2010-06-09T09:37:18Z","isPatch":true,"sender":{"key":"tor@spacetec.no","avatar":null},"body":"On Mon, Jun 7, 2010 at 20:07, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Gary V. Vaughan\" <git@mlists.thewrittenword.com> writes:\n>\n>> Just bumping this thread so that it doesn't fall off the radar.\n>>\n>> Is there anything I can do to help reviewers or committers accept\n>> or reject the patches in this set?\n>\n> Isn't the series already cooking in 'next'?\n\nTalking about 'next' and this patch set, I have a patch that goes on\ntop of Gary's patch to the Makefile, to make Tru64 compile also\nwithout ./configure (i.e. just 'make'). Should I post it here as a\ndiff to 'next', or is it better to wait until the cooking patches are\nin mainline and take it from there? (My patch may still need some\ndiscussion and tweaking w.r.t. what's enabled/disabled by default).\n\n-Tor\n"},{"id":"143484","messageId":"7vhblakx7d.fsf@alter.siamese.dyndns.org","threadId":"23806","inReplyTo":"AANLkTilFx4FRa_7L2nSPNcM3RVOAKfPrhTE1tGDMKl7f@mail.gmail.com","subject":"Re: [PATCH v5 00/18] Portability patches for git-1.7.1","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-06-11T04:30:30Z","receivedAt":"2010-06-11T04:30:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tor Arntsen <tor@spacetec.no> writes:\n\n> Talking about 'next' and this patch set, I have a patch that goes on\n> top of Gary's patch to the Makefile, to make Tru64 compile also\n> without ./configure (i.e. just 'make'). Should I post it here as a\n> diff to 'next', or is it better to wait until the cooking patches are\n> in mainline and take it from there? (My patch may still need some\n> discussion and tweaking w.r.t. what's enabled/disabled by default).\n\nIt sounds like that your change would depend on Gary's patch (rather, if\nit is done independently, it could cause unnecessary conflicts).  As the\ngv/portable topic is now fully part of 'next', I think the easiest would\nbe to base your topic directly on top of it, iow, on top of 09ce4bb\n(build: propagate $DIFF to scripts, 2010-06-05).\n"}]}