All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 00/16] Portability Patches for git-1.7.1 (v4)
@ 2010-04-27 13:57 Gary V. Vaughan
  2010-04-27 13:57 ` [patch 01/16] user-cppflags.patch Gary V. Vaughan
                   ` (17 more replies)
  0 siblings, 18 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

Here are the portability patches we needed at TWW to enable git-1.7.1
to compile and run on all of the wide range of Unix machines we
support.  These patches apply to the git-1.7.1 release,  and address
all of the feedback from the previous three times I posted them to
this list, including fixing the massive testsuite failures I was
experiencing and taking into account that the ss_family fixes and
partial GMT_CMP_TEST fixes that have been pushed since my last post of
this patch queue.

With the exception of a hand-full of test failures outside of Linux 
and Solaris8+, git now compiles and passes all tests on the following
architectures:

        Solaris 2.6/SPARC
        Solaris 7/SPARC
        Solaris 8/SPARC  
        Solaris 9/SPARC
        Solaris 10/SPARC         
        Solaris 10/Intel         
        HP-UX 10.20/PA
        HP-UX 11.00/PA 
        HP-UX 11.11/PA   
        HP-UX 11.23/PA   
        HP-UX 11.23/IA
        HP-UX 11.31/PA
        HP-UX 11.31/IA   
        AIX 5.1  
        AIX 5.2
        AIX 5.3  
        AIX 6.1  
        Tru64 UNIX 5.1   
        IRIX 6.5         
        RHEL 3/x86       
        RHEL 3/amd64     
        RHEL 4/x86 
        RHEL 4/amd64     
        RHEL 5/x86       
        RHEL 5/amd64     
        SLES 10/x86      
        SLES 10/amd64    

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 01/16] user-cppflags.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 02/16] const-expr.patch Gary V. Vaughan
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: user-cppflags.patch --]
[-- Type: text/plain, Size: 1135 bytes --]

Without this patch there is no straight forward way to pass additional
CPPFLAGS at configure-time.  At TWW, everything non-vendor package is
installed to its own subdirectory, so we need the following to show
the preprocessor where the headers for the libraries we will link
later can be found:

	$SHELL ./configure \
	CPPFLAGS="-I${SB_VAR_CURL_INC}\
	 -I${SB_VAR_LIBEXPAT_INC}\
	 -I${SB_VAR_LIBZ_INC}\
	${CPPFLAGS+ $CPPFLAGS}" <<...>>
---
 Makefile      |    2 +-
 config.mak.in |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -246,7 +246,7 @@ endif
 
 CFLAGS = -g -O2 -Wall
 LDFLAGS =
-ALL_CFLAGS = $(CFLAGS)
+ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
 STRIP ?= strip
 
Index: b/config.mak.in
===================================================================
--- a/config.mak.in
+++ b/config.mak.in
@@ -3,6 +3,7 @@
 
 CC = @CC@
 CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 CC_LD_DYNPATH = @CC_LD_DYNPATH@
 AR = @AR@

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 02/16] const-expr.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
  2010-04-27 13:57 ` [patch 01/16] user-cppflags.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 14:08   ` Erik Faye-Lund
       [not found]   ` <1AFA5FB2-EB8B-4775-8941-86428C7F740E@gmail.com>
  2010-04-27 13:57 ` [patch 03/16] pthread.patch Gary V. Vaughan
                   ` (15 subsequent siblings)
  17 siblings, 2 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: const-expr.patch --]
[-- Type: text/plain, Size: 11101 bytes --]

Unfortunately, there are still plenty of production systems with
vendor compilers that choke unless all compound declarations can be
determined statically at compile time, for example hpux10.20 (I can
provide a comprehensive list of our supported platforms that exhibit
this problem if necessary).

This patch simply breaks apart any compound declarations with dynamic
initialisation expressions, and moves the initialisation until after
the last declaration in the same block, in all the places necessary to
have the offending compilers accept the code.
---
 builtin/add.c      |    4 +++-
 builtin/blame.c    |   10 ++++++----
 builtin/cat-file.c |    4 +++-
 builtin/checkout.c |    3 ++-
 builtin/commit.c   |    3 ++-
 builtin/fetch.c    |    6 ++++--
 builtin/remote.c   |    9 ++++++---
 convert.c          |    4 +++-
 daemon.c           |   19 ++++++++++---------
 ll-merge.c         |   14 +++++++-------
 refs.c             |    6 +++++-
 remote.c           |    3 +--
 unpack-trees.c     |    4 +++-
 wt-status.c        |   23 ++++++++++++-----------
 14 files changed, 67 insertions(+), 45 deletions(-)

Index: b/convert.c
===================================================================
--- a/convert.c
+++ b/convert.c
@@ -249,7 +249,9 @@ static int filter_buffer(int in, int out
 	struct child_process child_process;
 	struct filter_params *params = (struct filter_params *)data;
 	int write_err, status;
-	const char *argv[] = { params->cmd, NULL };
+	const char *argv[] = { NULL, NULL };
+
+	argv[0] = params->cmd;
 
 	memset(&child_process, 0, sizeof(child_process));
 	child_process.argv = argv;
Index: b/remote.c
===================================================================
--- a/remote.c
+++ b/remote.c
@@ -657,10 +657,9 @@ static struct refspec *parse_refspec_int
 
 int valid_fetch_refspec(const char *fetch_refspec_str)
 {
-	const char *fetch_refspec[] = { fetch_refspec_str };
 	struct refspec *refspec;
 
-	refspec = parse_refspec_internal(1, fetch_refspec, 1, 1);
+	refspec = parse_refspec_internal(1, &fetch_refspec_str, 1, 1);
 	free_refspecs(refspec, 1);
 	return !!refspec;
 }
Index: b/unpack-trees.c
===================================================================
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -287,9 +287,11 @@ static void add_same_unmerged(struct cac
 static int unpack_index_entry(struct cache_entry *ce,
 			      struct unpack_trees_options *o)
 {
-	struct cache_entry *src[5] = { ce, NULL, };
+	struct cache_entry *src[5] = { NULL, NULL };
 	int ret;
 
+	src[0] = ce;
+
 	mark_ce_used(ce, o);
 	if (ce_stage(ce)) {
 		if (o->skip_unmerged) {
Index: b/daemon.c
===================================================================
--- a/daemon.c
+++ b/daemon.c
@@ -141,15 +141,14 @@ static char *path_ok(char *directory)
 	}
 	else if (interpolated_path && saw_extended_args) {
 		struct strbuf expanded_path = STRBUF_INIT;
-		struct strbuf_expand_dict_entry dict[] = {
-			{ "H", hostname },
-			{ "CH", canon_hostname },
-			{ "IP", ip_address },
-			{ "P", tcp_port },
-			{ "D", directory },
-			{ NULL }
-		};
+		struct strbuf_expand_dict_entry dict[6];
 
+		dict[0].placeholder = "H"; dict[0].value = hostname;
+		dict[1].placeholder = "CH"; dict[1].value = canon_hostname;
+		dict[2].placeholder = "IP"; dict[2].value = ip_address;
+		dict[3].placeholder = "P"; dict[3].value = tcp_port;
+		dict[4].placeholder = "D"; dict[4].value = directory;
+		dict[5].placeholder = NULL; dict[5].value = NULL;
 		if (*dir != '/') {
 			/* Allow only absolute */
 			logerror("'%s': Non-absolute path denied (interpolated-path active)", dir);
@@ -343,7 +342,9 @@ static int upload_pack(void)
 {
 	/* Timeout as string */
 	char timeout_buf[64];
-	const char *argv[] = { "upload-pack", "--strict", timeout_buf, ".", NULL };
+	const char *argv[] = { "upload-pack", "--strict", NULL, ".", NULL };
+
+	argv[2] = timeout_buf;
 
 	snprintf(timeout_buf, sizeof timeout_buf, "--timeout=%u", timeout);
 	return run_service_command(argv);
Index: b/wt-status.c
===================================================================
--- a/wt-status.c
+++ b/wt-status.c
@@ -498,17 +498,18 @@ static void wt_status_print_submodule_su
 	struct child_process sm_summary;
 	char summary_limit[64];
 	char index[PATH_MAX];
-	const char *env[] = { index, NULL };
-	const char *argv[] = {
-		"submodule",
-		"summary",
-		uncommitted ? "--files" : "--cached",
-		"--for-status",
-		"--summary-limit",
-		summary_limit,
-		uncommitted ? NULL : (s->amend ? "HEAD^" : "HEAD"),
-		NULL
-	};
+	const char *env[] = { NULL, NULL };
+	const char *argv[8];
+
+	env[0] =	index;
+	argv[0] =	"submodule";
+	argv[1] =	"summary";
+	argv[2] =	uncommitted ? "--files" : "--cached";
+	argv[3] =	"--for-status";
+	argv[4] =	"--summary-limit";
+	argv[5] =	summary_limit;
+	argv[6] =	uncommitted ? NULL : (s->amend ? "HEAD^" : "HEAD");
+	argv[7] =	NULL;
 
 	sprintf(summary_limit, "%d", s->submodule_summary);
 	snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", s->index_file);
Index: b/ll-merge.c
===================================================================
--- a/ll-merge.c
+++ b/ll-merge.c
@@ -139,17 +139,17 @@ static int ll_ext_merge(const struct ll_
 {
 	char temp[4][50];
 	struct strbuf cmd = STRBUF_INIT;
-	struct strbuf_expand_dict_entry dict[] = {
-		{ "O", temp[0] },
-		{ "A", temp[1] },
-		{ "B", temp[2] },
-		{ "L", temp[3] },
-		{ NULL }
-	};
+	struct strbuf_expand_dict_entry dict[5];
 	const char *args[] = { NULL, NULL };
 	int status, fd, i;
 	struct stat st;
 
+	dict[0].placeholder = "O"; dict[0].value = temp[0];
+	dict[1].placeholder = "A"; dict[1].value = temp[1];
+	dict[2].placeholder = "B"; dict[2].value = temp[2];
+	dict[3].placeholder = "L"; dict[3].value = temp[3];
+	dict[4].placeholder = NULL; dict[4].value = NULL;
+
 	if (fn->cmdline == NULL)
 		die("custom merge driver %s lacks command line.", fn->name);
 
Index: b/builtin/commit.c
===================================================================
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -717,7 +717,8 @@ static int prepare_to_commit(const char 
 
 	if (use_editor) {
 		char index[PATH_MAX];
-		const char *env[2] = { index, NULL };
+		const char *env[] = { NULL, NULL };
+		env[0] =  index;
 		snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", index_file);
 		if (launch_editor(git_path(commit_editmsg), NULL, env)) {
 			fprintf(stderr,
Index: b/builtin/remote.c
===================================================================
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -705,11 +705,14 @@ static int rm(int argc, const char **arg
 	struct known_remotes known_remotes = { NULL, NULL };
 	struct string_list branches = { NULL, 0, 0, 1 };
 	struct string_list skipped = { NULL, 0, 0, 1 };
-	struct branches_for_remote cb_data = {
-		NULL, &branches, &skipped, &known_remotes
-	};
+	struct branches_for_remote cb_data;
 	int i, result;
 
+	memset(&cb_data,0,sizeof(cb_data));
+	cb_data.branches = &branches;
+	cb_data.skipped = &skipped;
+	cb_data.keep = &known_remotes;
+
 	if (argc != 2)
 		usage_with_options(builtin_remote_rm_usage, options);
 
Index: b/builtin/blame.c
===================================================================
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -733,10 +733,11 @@ static int pass_blame_to_parent(struct s
 {
 	int last_in_target;
 	mmfile_t file_p, file_o;
-	struct blame_chunk_cb_data d = { sb, target, parent, 0, 0 };
+	struct blame_chunk_cb_data d;
 	xpparam_t xpp;
 	xdemitconf_t xecfg;
-
+	memset(&d,0,sizeof(d));
+	d.sb = sb; d.target = target; d.parent=parent;
 	last_in_target = find_last_in_target(sb, target);
 	if (last_in_target < 0)
 		return 1; /* nothing remains for this target */
@@ -875,10 +876,11 @@ static void find_copy_in_blob(struct sco
 	const char *cp;
 	int cnt;
 	mmfile_t file_o;
-	struct handle_split_cb_data d = { sb, ent, parent, split, 0, 0 };
+	struct handle_split_cb_data d;
 	xpparam_t xpp;
 	xdemitconf_t xecfg;
-
+	memset(&d,0,sizeof(d));
+	d.sb = sb; d.ent = ent; d.parent = parent; d.split = split;
 	/*
 	 * Prepare mmfile that contains only the lines in ent.
 	 */
Index: b/builtin/cat-file.c
===================================================================
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -118,7 +118,9 @@ static int cat_one_file(int opt, const c
 
 		/* custom pretty-print here */
 		if (type == OBJ_TREE) {
-			const char *ls_args[3] = {"ls-tree", obj_name, NULL};
+			const char *ls_args[3] = { NULL, NULL, NULL };
+			ls_args[0] =  "ls-tree";
+			ls_args[1] =  obj_name;
 			return cmd_ls_tree(2, ls_args, NULL);
 		}
 
Index: b/refs.c
===================================================================
--- a/refs.c
+++ b/refs.c
@@ -314,7 +314,11 @@ static int warn_if_dangling_symref(const
 
 void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refname)
 {
-	struct warn_if_dangling_data data = { fp, refname, msg_fmt };
+	struct warn_if_dangling_data data;
+
+	data.fp = fp;
+	data.refname = refname;
+	data.msg_fmt = msg_fmt;
 	for_each_rawref(warn_if_dangling_symref, &data);
 }
 
Index: b/builtin/add.c
===================================================================
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -261,12 +261,14 @@ static int edit_patch(int argc, const ch
 {
 	char *file = xstrdup(git_path("ADD_EDIT.patch"));
 	const char *apply_argv[] = { "apply", "--recount", "--cached",
-		file, NULL };
+		NULL, NULL };
 	struct child_process child;
 	struct rev_info rev;
 	int out;
 	struct stat st;
 
+	apply_argv[3] = file;
+
 	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 
 	if (read_cache() < 0)
Index: b/builtin/checkout.c
===================================================================
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -609,7 +609,8 @@ static int check_tracking_name(const cha
 
 static const char *unique_tracking_name(const char *name)
 {
-	struct tracking_name_data cb_data = { name, NULL, 1 };
+	struct tracking_name_data cb_data = { NULL, NULL, 1 };
+	cb_data.name = name;
 	for_each_ref(check_tracking_name, &cb_data);
 	if (cb_data.unique)
 		return cb_data.remote;
Index: b/builtin/fetch.c
===================================================================
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -574,9 +574,10 @@ static void find_non_local_tags(struct t
 {
 	struct string_list existing_refs = { NULL, 0, 0, 0 };
 	struct string_list remote_refs = { NULL, 0, 0, 0 };
-	struct tag_data data = {head, tail};
+	struct tag_data data;
 	const struct ref *ref;
 	struct string_list_item *item = NULL;
+	data.head = head; data.tail = tail;
 
 	for_each_ref(add_existing, &existing_refs);
 	for (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {
@@ -778,7 +779,8 @@ static int get_remote_group(const char *
 static int add_remote_or_group(const char *name, struct string_list *list)
 {
 	int prev_nr = list->nr;
-	struct remote_group_data g = { name, list };
+	struct remote_group_data g;
+	g.name = name; g.list = list;
 
 	git_config(get_remote_group, &g);
 	if (list->nr == prev_nr) {

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 03/16] pthread.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
  2010-04-27 13:57 ` [patch 01/16] user-cppflags.patch Gary V. Vaughan
  2010-04-27 13:57 ` [patch 02/16] const-expr.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git Gary V. Vaughan
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: pthread.patch --]
[-- Type: text/plain, Size: 3011 bytes --]

Without this patch, systems that provide stubs for pthread functions
in libc, but which still require libpthread for full the pthread
implementation are not detected correctly.

Also, some systems require -pthread in CFLAGS for each compilation
unit for a successful link of an mt binary, which is also addressed by
this patch.
---
 Makefile      |    4 ++++
 config.mak.in |    1 +
 configure.ac  |   17 +++++++++++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -294,6 +294,7 @@ RPMBUILD = rpmbuild
 TCL_PATH = tclsh
 TCLTK_PATH = wish
 PTHREAD_LIBS = -lpthread
+PTHREAD_CFLAGS =
 
 export TCL_PATH TCLTK_PATH
 
@@ -898,6 +899,8 @@ ifeq ($(uname_S),AIX)
 	BASIC_CFLAGS += -D_LARGE_FILES
 	ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
 		NO_PTHREADS = YesPlease
+	else
+		PTHREAD_LIBS = -lpthread
 	endif
 endif
 ifeq ($(uname_S),GNU)
@@ -1349,6 +1352,7 @@ endif
 ifdef NO_PTHREADS
 	BASIC_CFLAGS += -DNO_PTHREADS
 else
+	BASIC_CFLAGS += $(PTHREAD_CFLAGS)
 	EXTLIBS += $(PTHREAD_LIBS)
 	LIB_OBJS += thread-utils.o
 endif
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -802,7 +802,11 @@ AC_DEFUN([PTHREADTEST_SRC], [
 int main(void)
 {
 	pthread_mutex_t test_mutex;
-	return (0);
+	int retcode = 0;
+	retcode |= pthread_mutex_init(&test_mutex,(void*)0);
+	retcode |= pthread_mutex_lock(&test_mutex);
+	retcode |= pthread_mutex_unlock(&test_mutex);
+	return retcode;
 }
 ])
 
@@ -819,7 +823,8 @@ if test -n "$USER_NOPTHREAD"; then
 # handle these separately since PTHREAD_CFLAGS could be '-lpthreads
 # -D_REENTRANT' or some such.
 elif test -z "$PTHREAD_CFLAGS"; then
-  for opt in -pthread -lpthread; do
+  threads_found=no
+  for opt in -mt -pthread -lpthread; do
      old_CFLAGS="$CFLAGS"
      CFLAGS="$opt $CFLAGS"
      AC_MSG_CHECKING([Checking for POSIX Threads with '$opt'])
@@ -827,11 +832,18 @@ elif test -z "$PTHREAD_CFLAGS"; then
 	[AC_MSG_RESULT([yes])
 		NO_PTHREADS=
 		PTHREAD_LIBS="$opt"
+		PTHREAD_CFLAGS="$opt"
+		threads_found=yes
 		break
 	],
 	[AC_MSG_RESULT([no])])
       CFLAGS="$old_CFLAGS"
   done
+  if test $threads_found != yes; then
+    AC_CHECK_LIB([pthread], [pthread_create],
+	[PTHREAD_LIBS="-lpthread"],
+	[NO_PTHREADS=UnfortunatelyYes])
+  fi
 else
   old_CFLAGS="$CFLAGS"
   CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
@@ -848,6 +860,7 @@ fi
 
 CFLAGS="$old_CFLAGS"
 
+AC_SUBST(PTHREAD_CFLAGS)
 AC_SUBST(PTHREAD_LIBS)
 AC_SUBST(NO_PTHREADS)
 
Index: b/config.mak.in
===================================================================
--- a/config.mak.in
+++ b/config.mak.in
@@ -57,4 +57,5 @@ NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
 FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
 SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@
 NO_PTHREADS=@NO_PTHREADS@
+PTHREAD_CFLAGS=@PTHREAD_CFLAGS@
 PTHREAD_LIBS=@PTHREAD_LIBS@

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git.
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (2 preceding siblings ...)
  2010-04-27 13:57 ` [patch 03/16] pthread.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 16:08   ` Tor Arntsen
  2010-04-27 13:57 ` [patch 05/16] diff-export.patch Gary V. Vaughan
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: enum-dangling-comma.patch --]
[-- Type: text/plain, Size: 13735 bytes --]

enum style is inconsistent already, with some enums declared on one
line, some over 3 lines with the enum values all on the middle line,
sometimes with 1 enum value per line... and independently of that the
trailing comma is sometimes present and other times absent, often
mixing with/without trailing comma styles in a single file, and
sometimes in consecutive enum declarations.

Clearly, omitting the comma is the more portable style, and this patch
changes all enum declarations to use the portable omitted dangling
comma style consistently.
---
 attr.h                 |    2 +-
 builtin/apply.c        |    4 ++--
 builtin/branch.c       |    4 ++--
 builtin/commit.c       |    6 +++---
 builtin/help.c         |    2 +-
 builtin/mailinfo.c     |    4 ++--
 builtin/receive-pack.c |    2 +-
 builtin/remote.c       |    2 +-
 cache.h                |   16 ++++++++--------
 commit.h               |    2 +-
 connect.c              |    2 +-
 ctype.c                |    2 +-
 diff.h                 |    2 +-
 dir.c                  |    6 +++---
 fast-import.c          |    2 +-
 grep.h                 |    8 ++++----
 http-push.c            |    2 +-
 http-walker.c          |    2 +-
 imap-send.c            |    2 +-
 merge-recursive.h      |    2 +-
 parse-options.h        |    6 +++---
 pretty.c               |    2 +-
 remote.h               |    2 +-
 rerere.c               |    2 +-
 revision.c             |    2 +-
 wt-status.h            |    2 +-
 26 files changed, 45 insertions(+), 45 deletions(-)

Index: b/attr.h
===================================================================
--- a/attr.h
+++ b/attr.h
@@ -34,7 +34,7 @@ int git_checkattr(const char *path, int,
 enum git_attr_direction {
 	GIT_ATTR_CHECKIN,
 	GIT_ATTR_CHECKOUT,
-	GIT_ATTR_INDEX,
+	GIT_ATTR_INDEX
 };
 void git_attr_set_direction(enum git_attr_direction, struct index_state *);
 
Index: b/builtin/apply.c
===================================================================
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -56,7 +56,7 @@ static enum ws_error_action {
 	nowarn_ws_error,
 	warn_on_ws_error,
 	die_on_ws_error,
-	correct_ws_error,
+	correct_ws_error
 } ws_error_action = warn_on_ws_error;
 static int whitespace_error;
 static int squelch_whitespace_errors = 5;
@@ -64,7 +64,7 @@ static int applied_after_fixing_ws;
 
 static enum ws_ignore {
 	ignore_ws_none,
-	ignore_ws_change,
+	ignore_ws_change
 } ws_ignore_action = ignore_ws_none;
 
 
Index: b/builtin/branch.c
===================================================================
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -43,13 +43,13 @@ enum color_branch {
 	BRANCH_COLOR_PLAIN = 1,
 	BRANCH_COLOR_REMOTE = 2,
 	BRANCH_COLOR_LOCAL = 3,
-	BRANCH_COLOR_CURRENT = 4,
+	BRANCH_COLOR_CURRENT = 4
 };
 
 static enum merge_filter {
 	NO_FILTER = 0,
 	SHOW_NOT_MERGED,
-	SHOW_MERGED,
+	SHOW_MERGED
 } merge_filter;
 static unsigned char merge_filter_ref[20];
 
Index: b/builtin/commit.c
===================================================================
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -57,7 +57,7 @@ static struct lock_file false_lock; /* u
 static enum {
 	COMMIT_AS_IS = 1,
 	COMMIT_NORMAL,
-	COMMIT_PARTIAL,
+	COMMIT_PARTIAL
 } commit_style;
 
 static const char *logfile, *force_author;
@@ -78,7 +78,7 @@ static char *untracked_files_arg, *force
 static enum {
 	CLEANUP_SPACE,
 	CLEANUP_NONE,
-	CLEANUP_ALL,
+	CLEANUP_ALL
 } cleanup_mode;
 static char *cleanup_arg;
 
@@ -90,7 +90,7 @@ static int null_termination;
 static enum {
 	STATUS_FORMAT_LONG,
 	STATUS_FORMAT_SHORT,
-	STATUS_FORMAT_PORCELAIN,
+	STATUS_FORMAT_PORCELAIN
 } status_format = STATUS_FORMAT_LONG;
 
 static int opt_parse_m(const struct option *opt, const char *arg, int unset)
Index: b/builtin/help.c
===================================================================
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -26,7 +26,7 @@ enum help_format {
 	HELP_FORMAT_NONE,
 	HELP_FORMAT_MAN,
 	HELP_FORMAT_INFO,
-	HELP_FORMAT_WEB,
+	HELP_FORMAT_WEB
 };
 
 static int show_all = 0;
Index: b/builtin/mailinfo.c
===================================================================
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -17,10 +17,10 @@ static struct strbuf name = STRBUF_INIT;
 static struct strbuf email = STRBUF_INIT;
 
 static enum  {
-	TE_DONTCARE, TE_QP, TE_BASE64,
+	TE_DONTCARE, TE_QP, TE_BASE64
 } transfer_encoding;
 static enum  {
-	TYPE_TEXT, TYPE_OTHER,
+	TYPE_TEXT, TYPE_OTHER
 } message_type;
 
 static struct strbuf charset = STRBUF_INIT;
Index: b/builtin/receive-pack.c
===================================================================
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -16,7 +16,7 @@ enum deny_action {
 	DENY_UNCONFIGURED,
 	DENY_IGNORE,
 	DENY_WARN,
-	DENY_REFUSE,
+	DENY_REFUSE
 };
 
 static int deny_deletes;
Index: b/builtin/remote.c
===================================================================
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -317,7 +317,7 @@ struct push_info {
 		PUSH_STATUS_UPTODATE,
 		PUSH_STATUS_FASTFORWARD,
 		PUSH_STATUS_OUTOFDATE,
-		PUSH_STATUS_NOTQUERIED,
+		PUSH_STATUS_NOTQUERIED
 	} status;
 };
 
Index: b/cache.h
===================================================================
--- a/cache.h
+++ b/cache.h
@@ -361,7 +361,7 @@ enum object_type {
 	OBJ_OFS_DELTA = 6,
 	OBJ_REF_DELTA = 7,
 	OBJ_ANY,
-	OBJ_MAX,
+	OBJ_MAX
 };
 
 static inline enum object_type object_type(unsigned int mode)
@@ -556,7 +556,7 @@ extern int core_apply_sparse_checkout;
 enum safe_crlf {
 	SAFE_CRLF_FALSE = 0,
 	SAFE_CRLF_FAIL = 1,
-	SAFE_CRLF_WARN = 2,
+	SAFE_CRLF_WARN = 2
 };
 
 extern enum safe_crlf safe_crlf;
@@ -567,21 +567,21 @@ enum branch_track {
 	BRANCH_TRACK_REMOTE,
 	BRANCH_TRACK_ALWAYS,
 	BRANCH_TRACK_EXPLICIT,
-	BRANCH_TRACK_OVERRIDE,
+	BRANCH_TRACK_OVERRIDE
 };
 
 enum rebase_setup_type {
 	AUTOREBASE_NEVER = 0,
 	AUTOREBASE_LOCAL,
 	AUTOREBASE_REMOTE,
-	AUTOREBASE_ALWAYS,
+	AUTOREBASE_ALWAYS
 };
 
 enum push_default_type {
 	PUSH_DEFAULT_NOTHING = 0,
 	PUSH_DEFAULT_MATCHING,
 	PUSH_DEFAULT_TRACKING,
-	PUSH_DEFAULT_CURRENT,
+	PUSH_DEFAULT_CURRENT
 };
 
 extern enum branch_track git_branch_track;
@@ -590,7 +590,7 @@ extern enum push_default_type push_defau
 
 enum object_creation_mode {
 	OBJECT_CREATION_USES_HARDLINKS = 0,
-	OBJECT_CREATION_USES_RENAMES = 1,
+	OBJECT_CREATION_USES_RENAMES = 1
 };
 
 extern enum object_creation_mode object_creation_mode;
@@ -670,7 +670,7 @@ enum sharedrepo {
 	OLD_PERM_GROUP      = 1,
 	OLD_PERM_EVERYBODY  = 2,
 	PERM_GROUP          = 0660,
-	PERM_EVERYBODY      = 0664,
+	PERM_EVERYBODY      = 0664
 };
 int git_config_perm(const char *var, const char *value);
 int set_shared_perm(const char *path, int mode);
@@ -880,7 +880,7 @@ struct ref {
 		REF_STATUS_REJECT_NODELETE,
 		REF_STATUS_UPTODATE,
 		REF_STATUS_REMOTE_REJECT,
-		REF_STATUS_EXPECTING_REPORT,
+		REF_STATUS_EXPECTING_REPORT
 	} status;
 	char *remote_status;
 	struct ref *peer_ref; /* when renaming */
Index: b/commit.h
===================================================================
--- a/commit.h
+++ b/commit.h
@@ -60,7 +60,7 @@ enum cmit_fmt {
 	CMIT_FMT_EMAIL,
 	CMIT_FMT_USERFORMAT,
 
-	CMIT_FMT_UNSPECIFIED,
+	CMIT_FMT_UNSPECIFIED
 };
 
 struct pretty_print_context
Index: b/connect.c
===================================================================
--- a/connect.c
+++ b/connect.c
@@ -131,7 +131,7 @@ int path_match(const char *path, int nr,
 enum protocol {
 	PROTO_LOCAL = 1,
 	PROTO_SSH,
-	PROTO_GIT,
+	PROTO_GIT
 };
 
 static enum protocol get_protocol(const char *name)
Index: b/ctype.c
===================================================================
--- a/ctype.c
+++ b/ctype.c
@@ -10,7 +10,7 @@ enum {
 	A = GIT_ALPHA,
 	D = GIT_DIGIT,
 	G = GIT_GLOB_SPECIAL,	/* *, ?, [, \\ */
-	R = GIT_REGEX_SPECIAL,	/* $, (, ), +, ., ^, {, | */
+	R = GIT_REGEX_SPECIAL	/* $, (, ), +, ., ^, {, | */
 };
 
 unsigned char sane_ctype[256] = {
Index: b/diff.h
===================================================================
--- a/diff.h
+++ b/diff.h
@@ -133,7 +133,7 @@ enum color_diff {
 	DIFF_FILE_NEW = 5,
 	DIFF_COMMIT = 6,
 	DIFF_WHITESPACE = 7,
-	DIFF_FUNCINFO = 8,
+	DIFF_FUNCINFO = 8
 };
 const char *diff_get_color(int diff_use_color, enum color_diff ix);
 #define diff_get_color_opt(o, ix) \
Index: b/dir.c
===================================================================
--- a/dir.c
+++ b/dir.c
@@ -465,7 +465,7 @@ static struct dir_entry *dir_add_ignored
 enum exist_status {
 	index_nonexistent = 0,
 	index_directory,
-	index_gitdir,
+	index_gitdir
 };
 
 /*
@@ -533,7 +533,7 @@ static enum exist_status directory_exist
 enum directory_treatment {
 	show_directory,
 	ignore_directory,
-	recurse_into_directory,
+	recurse_into_directory
 };
 
 static enum directory_treatment treat_directory(struct dir_struct *dir,
@@ -684,7 +684,7 @@ static int get_dtype(struct dirent *de, 
 enum path_treatment {
 	path_ignored,
 	path_handled,
-	path_recurse,
+	path_recurse
 };
 
 static enum path_treatment treat_one_path(struct dir_struct *dir,
Index: b/fast-import.c
===================================================================
--- a/fast-import.c
+++ b/fast-import.c
@@ -267,7 +267,7 @@ struct hash_list
 typedef enum {
 	WHENSPEC_RAW = 1,
 	WHENSPEC_RFC2822,
-	WHENSPEC_NOW,
+	WHENSPEC_NOW
 } whenspec_type;
 
 struct recent_command
Index: b/grep.h
===================================================================
--- a/grep.h
+++ b/grep.h
@@ -10,17 +10,17 @@ enum grep_pat_token {
 	GREP_OPEN_PAREN,
 	GREP_CLOSE_PAREN,
 	GREP_NOT,
-	GREP_OR,
+	GREP_OR
 };
 
 enum grep_context {
 	GREP_CONTEXT_HEAD,
-	GREP_CONTEXT_BODY,
+	GREP_CONTEXT_BODY
 };
 
 enum grep_header_field {
 	GREP_HEADER_AUTHOR = 0,
-	GREP_HEADER_COMMITTER,
+	GREP_HEADER_COMMITTER
 };
 
 struct grep_pat {
@@ -40,7 +40,7 @@ enum grep_expr_node {
 	GREP_NODE_ATOM,
 	GREP_NODE_NOT,
 	GREP_NODE_AND,
-	GREP_NODE_OR,
+	GREP_NODE_OR
 };
 
 struct grep_expr {
Index: b/http-push.c
===================================================================
--- a/http-push.c
+++ b/http-push.c
@@ -105,7 +105,7 @@ enum transfer_state {
 	RUN_PUT,
 	RUN_MOVE,
 	ABORTED,
-	COMPLETE,
+	COMPLETE
 };
 
 struct transfer_request
Index: b/http-walker.c
===================================================================
--- a/http-walker.c
+++ b/http-walker.c
@@ -15,7 +15,7 @@ enum object_request_state {
 	WAITING,
 	ABORTED,
 	ACTIVE,
-	COMPLETE,
+	COMPLETE
 };
 
 struct object_request
Index: b/imap-send.c
===================================================================
--- a/imap-send.c
+++ b/imap-send.c
@@ -230,7 +230,7 @@ enum CAPABILITY {
 	LITERALPLUS,
 	NAMESPACE,
 	STARTTLS,
-	AUTH_CRAM_MD5,
+	AUTH_CRAM_MD5
 };
 
 static const char *cap_list[] = {
Index: b/merge-recursive.h
===================================================================
--- a/merge-recursive.h
+++ b/merge-recursive.h
@@ -10,7 +10,7 @@ struct merge_options {
 	enum {
 		MERGE_RECURSIVE_NORMAL = 0,
 		MERGE_RECURSIVE_OURS,
-		MERGE_RECURSIVE_THEIRS,
+		MERGE_RECURSIVE_THEIRS
 	} recursive_variant;
 	const char *subtree_shift;
 	unsigned buffer_output : 1;
Index: b/parse-options.h
===================================================================
--- a/parse-options.h
+++ b/parse-options.h
@@ -25,7 +25,7 @@ enum parse_opt_flags {
 	PARSE_OPT_STOP_AT_NON_OPTION = 2,
 	PARSE_OPT_KEEP_ARGV0 = 4,
 	PARSE_OPT_KEEP_UNKNOWN = 8,
-	PARSE_OPT_NO_INTERNAL_HELP = 16,
+	PARSE_OPT_NO_INTERNAL_HELP = 16
 };
 
 enum parse_opt_option_flags {
@@ -36,7 +36,7 @@ enum parse_opt_option_flags {
 	PARSE_OPT_LASTARG_DEFAULT = 16,
 	PARSE_OPT_NODASH = 32,
 	PARSE_OPT_LITERAL_ARGHELP = 64,
-	PARSE_OPT_NEGHELP = 128,
+	PARSE_OPT_NEGHELP = 128
 };
 
 struct option;
@@ -160,7 +160,7 @@ extern NORETURN void usage_msg_opt(const
 enum {
 	PARSE_OPT_HELP = -1,
 	PARSE_OPT_DONE,
-	PARSE_OPT_UNKNOWN,
+	PARSE_OPT_UNKNOWN
 };
 
 /*
Index: b/pretty.c
===================================================================
--- a/pretty.c
+++ b/pretty.c
@@ -828,7 +828,7 @@ static size_t format_commit_item(struct 
 	enum {
 		NO_MAGIC,
 		ADD_LF_BEFORE_NON_EMPTY,
-		DEL_LF_BEFORE_EMPTY,
+		DEL_LF_BEFORE_EMPTY
 	} magic = NO_MAGIC;
 
 	switch (placeholder[0]) {
Index: b/remote.h
===================================================================
--- a/remote.h
+++ b/remote.h
@@ -145,7 +145,7 @@ int branch_merge_matches(struct branch *
 enum match_refs_flags {
 	MATCH_REFS_NONE		= 0,
 	MATCH_REFS_ALL 		= (1 << 0),
-	MATCH_REFS_MIRROR	= (1 << 1),
+	MATCH_REFS_MIRROR	= (1 << 1)
 };
 
 /* Reporting of tracking info */
Index: b/rerere.c
===================================================================
--- a/rerere.c
+++ b/rerere.c
@@ -153,7 +153,7 @@ static int handle_path(unsigned char *sh
 	git_SHA_CTX ctx;
 	int hunk_no = 0;
 	enum {
-		RR_CONTEXT = 0, RR_SIDE_1, RR_SIDE_2, RR_ORIGINAL,
+		RR_CONTEXT = 0, RR_SIDE_1, RR_SIDE_2, RR_ORIGINAL
 	} hunk = RR_CONTEXT;
 	struct strbuf one = STRBUF_INIT, two = STRBUF_INIT;
 	struct strbuf buf = STRBUF_INIT;
Index: b/revision.c
===================================================================
--- a/revision.c
+++ b/revision.c
@@ -1781,7 +1781,7 @@ int prepare_revision_walk(struct rev_inf
 enum rewrite_result {
 	rewrite_one_ok,
 	rewrite_one_noparents,
-	rewrite_one_error,
+	rewrite_one_error
 };
 
 static enum rewrite_result rewrite_one(struct rev_info *revs, struct commit **pp)
Index: b/wt-status.h
===================================================================
--- a/wt-status.h
+++ b/wt-status.h
@@ -11,7 +11,7 @@ enum color_wt_status {
 	WT_STATUS_CHANGED,
 	WT_STATUS_UNTRACKED,
 	WT_STATUS_NOBRANCH,
-	WT_STATUS_UNMERGED,
+	WT_STATUS_UNMERGED
 };
 
 enum untracked_status_type {

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 05/16] diff-export.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (3 preceding siblings ...)
  2010-04-27 13:57 ` [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 06/16] diff-test_cmp.patch Gary V. Vaughan
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: diff-export.patch --]
[-- Type: text/plain, Size: 3050 bytes --]

Some of the flags used with the first diff found in PATH cause the
vendor diff to choke.
---
 Documentation/install-webdoc.sh |    2 +-
 Makefile                        |    4 +++-
 config.mak.in                   |    1 +
 configure.ac                    |    1 +
 git-merge-one-file.sh           |    2 +-
 5 files changed, 7 insertions(+), 3 deletions(-)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -287,6 +287,7 @@ export prefix bindir sharedir sysconfdir
 CC = gcc
 AR = ar
 RM = rm -f
+DIFF = diff
 TAR = tar
 FIND = find
 INSTALL = install
@@ -1460,7 +1461,7 @@ endif
 ALL_CFLAGS += $(BASIC_CFLAGS)
 ALL_LDFLAGS += $(BASIC_LDFLAGS)
 
-export TAR INSTALL DESTDIR SHELL_PATH
+export DIFF TAR INSTALL DESTDIR SHELL_PATH
 
 
 ### Build rules
@@ -1877,6 +1878,7 @@ GIT-CFLAGS: FORCE
 GIT-BUILD-OPTIONS: FORCE
 	@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
 	@echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
+	@echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@
 	@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
 	@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
 	@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -362,6 +362,7 @@ fi
 #AC_PROG_INSTALL		# needs install-sh or install.sh in sources
 AC_CHECK_TOOLS(AR, [gar ar], :)
 AC_CHECK_PROGS(TAR, [gtar tar])
+AC_CHECK_PROGS(DIFF, [gnudiff gdiff diff])
 # TCLTK_PATH will be set to some value if we want Tcl/Tk
 # or will be empty otherwise.
 if test -z "$NO_TCLTK"; then
Index: b/Documentation/install-webdoc.sh
===================================================================
--- a/Documentation/install-webdoc.sh
+++ b/Documentation/install-webdoc.sh
@@ -12,7 +12,7 @@ do
 	then
 		: did not match
 	elif test -f "$T/$h" &&
-	   diff -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
+	   $DIFF -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
 	then
 		:; # up to date
 	else
Index: b/git-merge-one-file.sh
===================================================================
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -107,7 +107,7 @@ case "${1:-.}${2:-.}${3:-.}" in
 		# remove lines that are unique to ours.
 		orig=`git-unpack-file $2`
 		sz0=`wc -c <"$orig"`
-		diff -u -La/$orig -Lb/$orig $orig $src2 | git apply --no-add
+		$DIFF -u -La/$orig -Lb/$orig $orig $src2 | git apply --no-add
 		sz1=`wc -c <"$orig"`
 
 		# If we do not have enough common material, it is not
Index: b/config.mak.in
===================================================================
--- a/config.mak.in
+++ b/config.mak.in
@@ -8,6 +8,7 @@ LDFLAGS = @LDFLAGS@
 CC_LD_DYNPATH = @CC_LD_DYNPATH@
 AR = @AR@
 TAR = @TAR@
+DIFF = @DIFF@
 #INSTALL = @INSTALL@		# needs install-sh or install.sh in sources
 TCLTK_PATH = @TCLTK_PATH@
 

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 06/16] diff-test_cmp.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (4 preceding siblings ...)
  2010-04-27 13:57 ` [patch 05/16] diff-export.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 17:15   ` Jonathan Nieder
  2010-04-27 13:57 ` [patch 07/16] diff-defaults.patch Gary V. Vaughan
                   ` (11 subsequent siblings)
  17 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: diff-test_cmp.patch --]
[-- Type: text/plain, Size: 16387 bytes --]

In tests, call test_cmp rather than raw diff where possible (i.e. if
the output does not go to a pipe), to allow the use of, say, 'cmp'
when the default 'diff -u' is not compatible with a vendor diff.

When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.
---
 t/Makefile                      |    4 ++++
 t/t0000-basic.sh                |    2 +-
 t/t3200-branch.sh               |    4 ++--
 t/t3210-pack-refs.sh            |    8 ++++----
 t/t3903-stash.sh                |    2 +-
 t/t4002-diff-basic.sh           |    2 +-
 t/t4124-apply-ws-rule.sh        |   10 +++++-----
 t/t4127-apply-same-fn.sh        |    6 +++---
 t/t5300-pack-object.sh          |    6 +++---
 t/t5510-fetch.sh                |    2 +-
 t/t5520-pull.sh                 |    2 +-
 t/t5700-clone-reference.sh      |    8 ++++----
 t/t6000lib.sh                   |    2 +-
 t/t6001-rev-list-graft.sh       |    2 +-
 t/t6022-merge-rename.sh         |    4 ++--
 t/t7002-grep.sh                 |   16 ++++++++--------
 t/t7005-editor.sh               |    6 +++---
 t/t9200-git-cvsexportcommit.sh  |   26 +++++++++++++-------------
 t/t9400-git-cvsserver-server.sh |    2 +-
 19 files changed, 59 insertions(+), 55 deletions(-)

Index: b/t/t0000-basic.sh
===================================================================
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -280,7 +280,7 @@ $expectfilter >expected <<\EOF
 EOF
 test_expect_success \
     'validate git diff-files output for a know cache/work tree state.' \
-    'git diff-files >current && diff >/dev/null -b current expected'
+    'git diff-files >current && test_cmp current expected >/dev/null'
 
 test_expect_success \
     'git update-index --refresh should succeed.' \
Index: b/t/t3200-branch.sh
===================================================================
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -43,7 +43,7 @@ test_expect_success \
      git branch -l d/e/f &&
 	 test -f .git/refs/heads/d/e/f &&
 	 test -f .git/logs/refs/heads/d/e/f &&
-	 diff expect .git/logs/refs/heads/d/e/f'
+	 test_cmp expect .git/logs/refs/heads/d/e/f'
 
 test_expect_success \
     'git branch -d d/e/f should delete a branch and a log' \
@@ -222,7 +222,7 @@ test_expect_success \
      git checkout -b g/h/i -l master &&
 	 test -f .git/refs/heads/g/h/i &&
 	 test -f .git/logs/refs/heads/g/h/i &&
-	 diff expect .git/logs/refs/heads/g/h/i'
+	 test_cmp expect .git/logs/refs/heads/g/h/i'
 
 test_expect_success 'avoid ambiguous track' '
 	git config branch.autosetupmerge true &&
Index: b/t/t3210-pack-refs.sh
===================================================================
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -28,7 +28,7 @@ test_expect_success \
      SHA1=`cat .git/refs/heads/a` &&
      echo "$SHA1 refs/heads/a" >expect &&
      git show-ref a >result &&
-     diff expect result'
+     test_cmp expect result'
 
 test_expect_success \
     'see if a branch still exists when packed' \
@@ -37,7 +37,7 @@ test_expect_success \
      rm -f .git/refs/heads/b &&
      echo "$SHA1 refs/heads/b" >expect &&
      git show-ref b >result &&
-     diff expect result'
+     test_cmp expect result'
 
 test_expect_success 'git branch c/d should barf if branch c exists' '
      git branch c &&
@@ -52,7 +52,7 @@ test_expect_success \
      git pack-refs --all --prune &&
      echo "$SHA1 refs/heads/e" >expect &&
      git show-ref e >result &&
-     diff expect result'
+     test_cmp expect result'
 
 test_expect_success 'see if git pack-refs --prune remove ref files' '
      git branch f &&
@@ -109,7 +109,7 @@ test_expect_success 'pack, prune and rep
 	git show-ref >all-of-them &&
 	git pack-refs &&
 	git show-ref >again &&
-	diff all-of-them again
+	test_cmp all-of-them again
 '
 
 test_done
Index: b/t/t4002-diff-basic.sh
===================================================================
--- a/t/t4002-diff-basic.sh
+++ b/t/t4002-diff-basic.sh
@@ -135,7 +135,7 @@ cmp_diff_files_output () {
     # filesystem.
     sed <"$2" >.test-tmp \
 	-e '/^:000000 /d;s/'$x40'\( [MCRNDU][0-9]*\)	/'$z40'\1	/' &&
-    diff "$1" .test-tmp
+    test_cmp "$1" .test-tmp
 }
 
 test_expect_success \
Index: b/t/t4124-apply-ws-rule.sh
===================================================================
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -44,7 +44,7 @@ test_fix () {
 	apply_patch --whitespace=fix || return 1
 
 	# find touched lines
-	diff file target | sed -n -e "s/^> //p" >fixed
+	$DIFF file target | sed -n -e "s/^> //p" >fixed
 
 	# the changed lines are all expeced to change
 	fixed_cnt=$(wc -l <fixed)
@@ -85,14 +85,14 @@ test_expect_success setup '
 test_expect_success 'whitespace=nowarn, default rule' '
 
 	apply_patch --whitespace=nowarn &&
-	diff file target
+	test_cmp file target
 
 '
 
 test_expect_success 'whitespace=warn, default rule' '
 
 	apply_patch --whitespace=warn &&
-	diff file target
+	test_cmp file target
 
 '
 
@@ -108,7 +108,7 @@ test_expect_success 'whitespace=error-al
 
 	git config core.whitespace -trailing,-space-before,-indent &&
 	apply_patch --whitespace=error-all &&
-	diff file target
+	test_cmp file target
 
 '
 
@@ -117,7 +117,7 @@ test_expect_success 'whitespace=error-al
 	git config --unset core.whitespace &&
 	echo "target -whitespace" >.gitattributes &&
 	apply_patch --whitespace=error-all &&
-	diff file target
+	test_cmp file target
 
 '
 
Index: b/t/t5300-pack-object.sh
===================================================================
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -147,7 +147,7 @@ test_expect_success \
 	    git cat-file $t $object || return 1
 	 done <obj-list
     } >current &&
-    diff expect current'
+    test_cmp expect current'
 
 test_expect_success \
     'use packed deltified (REF_DELTA) objects' \
@@ -162,7 +162,7 @@ test_expect_success \
 	    git cat-file $t $object || return 1
 	 done <obj-list
     } >current &&
-    diff expect current'
+    test_cmp expect current'
 
 test_expect_success \
     'use packed deltified (OFS_DELTA) objects' \
@@ -177,7 +177,7 @@ test_expect_success \
 	    git cat-file $t $object || return 1
 	 done <obj-list
     } >current &&
-    diff expect current'
+    test_cmp expect current'
 
 unset GIT_OBJECT_DIRECTORY
 
Index: b/t/t5510-fetch.sh
===================================================================
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -71,7 +71,7 @@ test_expect_success "fetch test for-merg
 		echo "$one_in_two	"
 	} >expected &&
 	cut -f -2 .git/FETCH_HEAD >actual &&
-	diff expected actual'
+	test_cmp expected actual'
 
 test_expect_success 'fetch tags when there is no tags' '
 
Index: b/t/t5520-pull.sh
===================================================================
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -26,7 +26,7 @@ cd "$D"
 test_expect_success 'checking the results' '
 	test -f file &&
 	test -f cloned/file &&
-	diff file cloned/file
+	test_cmp file cloned/file
 '
 
 test_expect_success 'pulling into void using master:master' '
Index: b/t/t5700-clone-reference.sh
===================================================================
--- a/t/t5700-clone-reference.sh
+++ b/t/t5700-clone-reference.sh
@@ -48,7 +48,7 @@ test_expect_success 'that reference gets
 'cd C &&
 echo "0 objects, 0 kilobytes" > expected &&
 git count-objects > current &&
-diff expected current'
+test_cmp expected current'
 
 cd "$base_dir"
 
@@ -75,7 +75,7 @@ cd "$base_dir"
 test_expect_success 'that reference gets used' \
 'cd D && echo "0 objects, 0 kilobytes" > expected &&
 git count-objects > current &&
-diff expected current'
+test_cmp expected current'
 
 cd "$base_dir"
 
@@ -100,7 +100,7 @@ test_expect_success 'that alternate to o
 'cd C &&
 echo "2 objects" > expected &&
 git count-objects | cut -d, -f1 > current &&
-diff expected current'
+test_cmp expected current'
 
 cd "$base_dir"
 
@@ -116,7 +116,7 @@ test_expect_success 'check objects expec
 'cd D &&
 echo "5 objects" > expected &&
 git count-objects | cut -d, -f1 > current &&
-diff expected current'
+test_cmp expected current'
 
 cd "$base_dir"
 
Index: b/t/t6000lib.sh
===================================================================
--- a/t/t6000lib.sh
+++ b/t/t6000lib.sh
@@ -91,7 +91,7 @@ check_output()
 	shift 1
 	if eval "$*" | entag > $_name.actual
 	then
-		diff $_name.expected $_name.actual
+		test_cmp $_name.expected $_name.actual
 	else
 		return 1;
 	fi
Index: b/t/t6001-rev-list-graft.sh
===================================================================
--- a/t/t6001-rev-list-graft.sh
+++ b/t/t6001-rev-list-graft.sh
@@ -84,7 +84,7 @@ check () {
 		git rev-list --parents --pretty=raw $arg |
 		sed -n -e 's/^commit //p' >test.actual
 	fi
-	diff test.expect test.actual
+	test_cmp test.expect test.actual
 }
 
 for type in basic parents parents-raw
Index: b/t/t6022-merge-rename.sh
===================================================================
--- a/t/t6022-merge-rename.sh
+++ b/t/t6022-merge-rename.sh
@@ -280,7 +280,7 @@ test_expect_success 'updated working tre
 		echo "BAD: should have complained"
 		return 1
 	}
-	diff M M.saved || {
+	test_cmp M M.saved || {
 		echo "BAD: should have left M intact"
 		return 1
 	}
@@ -301,7 +301,7 @@ test_expect_success 'updated working tre
 		echo "BAD: should have complained"
 		return 1
 	}
-	diff M M.saved || {
+	test_cmp M M.saved || {
 		echo "BAD: should have left M intact"
 		return 1
 	}
Index: b/t/t7002-grep.sh
===================================================================
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
@@ -60,7 +60,7 @@ do
 			echo ${HC}file:5:foo_mmap bar mmap baz
 		} >expected &&
 		git grep -n -w -e mmap $H >actual &&
-		diff expected actual
+		test_cmp expected actual
 	'
 
 	test_expect_success "grep -w $L (w)" '
@@ -74,7 +74,7 @@ do
 			echo ${HC}x:1:x x xx x
 		} >expected &&
 		git grep -n -w -e "x xx* x" $H >actual &&
-		diff expected actual
+		test_cmp expected actual
 	'
 
 	test_expect_success "grep -w $L (y-1)" '
@@ -82,7 +82,7 @@ do
 			echo ${HC}y:1:y yy
 		} >expected &&
 		git grep -n -w -e "^y" $H >actual &&
-		diff expected actual
+		test_cmp expected actual
 	'
 
 	test_expect_success "grep -w $L (y-2)" '
@@ -93,7 +93,7 @@ do
 			cat actual
 			false
 		else
-			diff expected actual
+			test_cmp expected actual
 		fi
 	'
 
@@ -105,14 +105,14 @@ do
 			cat actual
 			false
 		else
-			diff expected actual
+			test_cmp expected actual
 		fi
 	'
 
 	test_expect_success "grep $L (t-1)" '
 		echo "${HC}t/t:1:test" >expected &&
 		git grep -n -e test $H >actual &&
-		diff expected actual
+		test_cmp expected actual
 	'
 
 	test_expect_success "grep $L (t-2)" '
@@ -121,7 +121,7 @@ do
 			cd t &&
 			git grep -n -e test $H
 		) >actual &&
-		diff expected actual
+		test_cmp expected actual
 	'
 
 	test_expect_success "grep $L (t-3)" '
@@ -130,7 +130,7 @@ do
 			cd t &&
 			git grep --full-name -n -e test $H
 		) >actual &&
-		diff expected actual
+		test_cmp expected actual
 	'
 
 	test_expect_success "grep -c $L (no /dev/null)" '
Index: b/t/t7005-editor.sh
===================================================================
--- a/t/t7005-editor.sh
+++ b/t/t7005-editor.sh
@@ -38,7 +38,7 @@ test_expect_success setup '
 	test_commit "$msg" &&
 	echo "$msg" >expect &&
 	git show -s --format=%s > actual &&
-	diff actual expect
+	test_cmp actual expect
 
 '
 
@@ -85,7 +85,7 @@ do
 		git --exec-path=. commit --amend &&
 		git show -s --pretty=oneline |
 		sed -e "s/^[0-9a-f]* //" >actual &&
-		diff actual expect
+		test_cmp actual expect
 	'
 done
 
@@ -107,7 +107,7 @@ do
 		git --exec-path=. commit --amend &&
 		git show -s --pretty=oneline |
 		sed -e "s/^[0-9a-f]* //" >actual &&
-		diff actual expect
+		test_cmp actual expect
 	'
 done
 
Index: b/t/t9200-git-cvsexportcommit.sh
===================================================================
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -63,10 +63,10 @@ test_expect_success \
      check_entries B "newfile2.txt/1.1/" &&
      check_entries C "newfile3.png/1.1/-kb" &&
      check_entries D "newfile4.png/1.1/-kb" &&
-     diff A/newfile1.txt ../A/newfile1.txt &&
-     diff B/newfile2.txt ../B/newfile2.txt &&
-     diff C/newfile3.png ../C/newfile3.png &&
-     diff D/newfile4.png ../D/newfile4.png
+     test_cmp A/newfile1.txt ../A/newfile1.txt &&
+     test_cmp B/newfile2.txt ../B/newfile2.txt &&
+     test_cmp C/newfile3.png ../C/newfile3.png &&
+     test_cmp D/newfile4.png ../D/newfile4.png
      )'
 
 test_expect_success \
@@ -89,10 +89,10 @@ test_expect_success \
      check_entries D "newfile4.png/1.2/-kb" &&
      check_entries E "newfile5.txt/1.1/" &&
      check_entries F "newfile6.png/1.1/-kb" &&
-     diff A/newfile1.txt ../A/newfile1.txt &&
-     diff D/newfile4.png ../D/newfile4.png &&
-     diff E/newfile5.txt ../E/newfile5.txt &&
-     diff F/newfile6.png ../F/newfile6.png
+     test_cmp A/newfile1.txt ../A/newfile1.txt &&
+     test_cmp D/newfile4.png ../D/newfile4.png &&
+     test_cmp E/newfile5.txt ../E/newfile5.txt &&
+     test_cmp F/newfile6.png ../F/newfile6.png
      )'
 
 # Should fail (but only on the git cvsexportcommit stage)
@@ -137,9 +137,9 @@ test_expect_success \
      check_entries D "" &&
      check_entries E "newfile5.txt/1.1/" &&
      check_entries F "newfile6.png/1.1/-kb" &&
-     diff A/newfile1.txt ../A/newfile1.txt &&
-     diff E/newfile5.txt ../E/newfile5.txt &&
-     diff F/newfile6.png ../F/newfile6.png
+     test_cmp A/newfile1.txt ../A/newfile1.txt &&
+     test_cmp E/newfile5.txt ../E/newfile5.txt &&
+     test_cmp F/newfile6.png ../F/newfile6.png
      )'
 
 test_expect_success \
@@ -155,8 +155,8 @@ test_expect_success \
      check_entries D "" &&
      check_entries E "newfile5.txt/1.1/" &&
      check_entries F "newfile6.png/1.1/-kb" &&
-     diff E/newfile5.txt ../E/newfile5.txt &&
-     diff F/newfile6.png ../F/newfile6.png
+     test_cmp E/newfile5.txt ../E/newfile5.txt &&
+     test_cmp F/newfile6.png ../F/newfile6.png
      )'
 
 test_expect_success \
Index: b/t/t9400-git-cvsserver-server.sh
===================================================================
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -435,7 +435,7 @@ test_expect_success 'cvs update (-p)' '
     rm -f failures &&
     for i in merge no-lf empty really-empty; do
         GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out
-        diff $i.out ../$i >>failures 2>&1
+        test_cmp $i.out ../$i >>failures 2>&1
     done &&
     test -z "$(cat failures)"
 '
Index: b/t/t3903-stash.sh
===================================================================
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -81,7 +81,7 @@ test_expect_success 'drop top stash' '
 	git stash &&
 	git stash drop &&
 	git stash list > stashlist2 &&
-	diff stashlist1 stashlist2 &&
+	test_cmp stashlist1 stashlist2 &&
 	git stash apply &&
 	test 3 = $(cat file) &&
 	test 1 = $(git show :file) &&
Index: b/t/t4127-apply-same-fn.sh
===================================================================
--- a/t/t4127-apply-same-fn.sh
+++ b/t/t4127-apply-same-fn.sh
@@ -27,7 +27,7 @@ test_expect_success 'apply same filename
 	cp same_fn same_fn2 &&
 	git reset --hard &&
 	git apply patch0 &&
-	diff same_fn same_fn2
+	test_cmp same_fn same_fn2
 '
 
 test_expect_success 'apply same filename with overlapping changes' '
@@ -40,7 +40,7 @@ test_expect_success 'apply same filename
 	cp same_fn same_fn2 &&
 	git reset --hard &&
 	git apply patch0 &&
-	diff same_fn same_fn2
+	test_cmp same_fn same_fn2
 '
 
 test_expect_success 'apply same new filename after rename' '
@@ -54,7 +54,7 @@ test_expect_success 'apply same new file
 	cp new_fn new_fn2 &&
 	git reset --hard &&
 	git apply --index patch1 &&
-	diff new_fn new_fn2
+	test_cmp new_fn new_fn2
 '
 
 test_expect_success 'apply same old filename after rename -- should fail.' '
Index: b/t/Makefile
===================================================================
--- a/t/Makefile
+++ b/t/Makefile
@@ -6,10 +6,14 @@
 -include ../config.mak
 
 #GIT_TEST_OPTS=--verbose --debug
+GIT_TEST_CMP ?= $(DIFF)
 SHELL_PATH ?= $(SHELL)
 TAR ?= $(TAR)
 RM ?= rm -f
 
+# Make sure test-lib.sh uses make's value of GIT_TEST_CMP
+export GIT_TEST_CMP
+
 # Shell quote;
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 07/16] diff-defaults.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (5 preceding siblings ...)
  2010-04-27 13:57 ` [patch 06/16] diff-test_cmp.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 08/16] host-SunOS56.patch Gary V. Vaughan
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: diff-defaults.patch --]
[-- Type: text/plain, Size: 2105 bytes --]

By default the testsuite calls 'diff -u' whenever a file comparison is
called for.  Unfortunately that throws a "diff: unknown option '-u'"
error for most non-GNU diffs.

This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where
that happens.  The previous version of this patch forgot to export
GIT_TEST_CMP from t/Makefile, which is why 'make test' continued to
fail most tests on most architectures - test-lib.sh was falling back
on its default of `diff -u' for GIT_TEST_CMP.  This version of this
patch shows a vast improvement in testsuite results where either GNU
diff is in the path at configure time, or where Makefile knows that
GIT_TEST_CMP=cmp is required.
---
 Makefile   |    5 +++++
 t/Makefile |    1 +
 2 files changed, 6 insertions(+)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -815,18 +815,21 @@ ifeq ($(uname_S),SunOS)
 		NO_STRLCPY = YesPlease
 		NO_C99_FORMAT = YesPlease
 		NO_STRTOUMAX = YesPlease
+		GIT_TEST_CMP = cmp
 	endif
 	ifeq ($(uname_R),5.8)
 		NO_UNSETENV = YesPlease
 		NO_SETENV = YesPlease
 		NO_C99_FORMAT = YesPlease
 		NO_STRTOUMAX = YesPlease
+		GIT_TEST_CMP = cmp
 	endif
 	ifeq ($(uname_R),5.9)
 		NO_UNSETENV = YesPlease
 		NO_SETENV = YesPlease
 		NO_C99_FORMAT = YesPlease
 		NO_STRTOUMAX = YesPlease
+		GIT_TEST_CMP = cmp
 	endif
 	INSTALL = /usr/ucb/install
 	TAR = gtar
@@ -903,6 +906,7 @@ ifeq ($(uname_S),AIX)
 	else
 		PTHREAD_LIBS = -lpthread
 	endif
+	GIT_TEST_CMP = cmp
 endif
 ifeq ($(uname_S),GNU)
 	# GNU/Hurd
@@ -957,6 +961,7 @@ ifeq ($(uname_S),HP-UX)
 	NO_HSTRERROR = YesPlease
 	NO_SYS_SELECT_H = YesPlease
 	SNPRINTF_RETURNS_BOGUS = YesPlease
+	GIT_TEST_CMP = cmp
 endif
 ifeq ($(uname_S),Windows)
 	GIT_VERSION := $(GIT_VERSION).MSVC
Index: b/t/Makefile
===================================================================
--- a/t/Makefile
+++ b/t/Makefile
@@ -3,6 +3,7 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
+-include ../config.mak.autogen
 -include ../config.mak
 
 #GIT_TEST_OPTS=--verbose --debug

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 08/16] host-SunOS56.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (6 preceding siblings ...)
  2010-04-27 13:57 ` [patch 07/16] diff-defaults.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 09/16] host-IRIX.patch Gary V. Vaughan
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: host-SunOS56.patch --]
[-- Type: text/plain, Size: 842 bytes --]

Although configure takes care of most of this, set some default values
for Solaris 2.6 (aka SunOS-5.6) to ensure git compiles even when
configure is not used to build it.
---
 Makefile |   10 ++++++++++
 1 file changed, 10 insertions(+)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -806,6 +806,16 @@ ifeq ($(uname_S),SunOS)
 	NO_MKDTEMP = YesPlease
 	NO_MKSTEMPS = YesPlease
 	NO_REGEX = YesPlease
+	ifeq ($(uname_R),5.6)
+		NO_IPV6 = YesPlease
+		NO_SOCKADDR_STORAGE = YesPlease
+		NO_UNSETENV = YesPlease
+		NO_SETENV = YesPlease
+		NO_STRLCPY = YesPlease
+		NO_C99_FORMAT = YesPlease
+		NO_STRTOUMAX = YesPlease
+		GIT_TEST_CMP = cmp
+	endif
 	ifeq ($(uname_R),5.7)
 		NEEDS_RESOLV = YesPlease
 		NO_IPV6 = YesPlease

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 09/16] host-IRIX.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (7 preceding siblings ...)
  2010-04-27 13:57 ` [patch 08/16] host-SunOS56.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 10/16] host-HPUX10.patch Gary V. Vaughan
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: host-IRIX.patch --]
[-- Type: text/plain, Size: 911 bytes --]

Irix 6.5 does not define 'sgi', but does define '__sgi'.

Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD
u_short types et. al. to be declared properly.
---
 git-compat-util.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: b/git-compat-util.h
===================================================================
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -56,7 +56,8 @@
 # define _XOPEN_SOURCE 500
 # endif
 #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
-      !defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)
+      !defined(_M_UNIX) && !defined(sgi) && !defined(__sgi) && \
+      !defined(__DragonFly__)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 10/16] host-HPUX10.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (8 preceding siblings ...)
  2010-04-27 13:57 ` [patch 09/16] host-IRIX.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 11/16] host-HPUX11.patch Gary V. Vaughan
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: host-HPUX10.patch --]
[-- Type: text/plain, Size: 1204 bytes --]

HP-UX 10.20 has no PREAD, and while it does support mmap(), there is
no system MAP_FAILED definition.
---
 Makefile          |    3 +++
 git-compat-util.h |    5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -971,6 +971,9 @@ ifeq ($(uname_S),HP-UX)
 	NO_HSTRERROR = YesPlease
 	NO_SYS_SELECT_H = YesPlease
 	SNPRINTF_RETURNS_BOGUS = YesPlease
+	ifeq ($(uname_R),B.10.20)
+		NO_PREAD = YesPlease
+	endif
 	GIT_TEST_CMP = cmp
 endif
 ifeq ($(uname_S),Windows)
Index: b/git-compat-util.h
===================================================================
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -218,7 +218,6 @@ static inline const char *skip_prefix(co
 #define PROT_READ 1
 #define PROT_WRITE 2
 #define MAP_PRIVATE 1
-#define MAP_FAILED ((void*)-1)
 #endif
 
 #define mmap git_mmap
@@ -247,6 +246,10 @@ extern int git_munmap(void *start, size_
 
 #endif /* NO_MMAP */
 
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void*)-1)
+#endif
+
 #ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
 #define on_disk_bytes(st) ((st).st_size)
 #else

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 11/16] host-HPUX11.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (9 preceding siblings ...)
  2010-04-27 13:57 ` [patch 10/16] host-HPUX10.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 12/16] host-OSF1.patch Gary V. Vaughan
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: host-HPUX11.patch --]
[-- Type: text/plain, Size: 495 bytes --]

There is no nanosecond field on HPUX.
---
 Makefile |    1 +
 1 file changed, 1 insertion(+)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -970,6 +970,7 @@ ifeq ($(uname_S),HP-UX)
 	NO_UNSETENV = YesPlease
 	NO_HSTRERROR = YesPlease
 	NO_SYS_SELECT_H = YesPlease
+	NO_NSEC = YesPlease
 	SNPRINTF_RETURNS_BOGUS = YesPlease
 	ifeq ($(uname_R),B.10.20)
 		NO_PREAD = YesPlease

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 12/16] host-OSF1.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (10 preceding siblings ...)
  2010-04-27 13:57 ` [patch 11/16] host-HPUX11.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 14:10   ` Tor Arntsen
  2010-04-27 13:57 ` [patch 13/16] no-hstrerror.patch Gary V. Vaughan
                   ` (5 subsequent siblings)
  17 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: host-OSF1.patch --]
[-- Type: text/plain, Size: 686 bytes --]

Add defaults for Tru64 Unix.  Without this patch I cannot compile
git on Tru64 5.1.
---
 Makefile |    6 ++++++
 1 file changed, 6 insertions(+)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -734,6 +734,12 @@ EXTLIBS =
 # because maintaining the nesting to match is a pain.  If
 # we had "elif" things would have been much nicer...
 
+ifeq ($(uname_S),OSF1)
+	# Need this for u_short definitions et al
+	BASIC_CFLAGS += -D_OSF_SOURCE
+	NO_STRTOULL = YesPlease
+	NO_NSEC = YesPlease
+endif
 ifeq ($(uname_S),Linux)
 	NO_STRLCPY = YesPlease
 	NO_MKSTEMPS = YesPlease

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 13/16] no-hstrerror.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (11 preceding siblings ...)
  2010-04-27 13:57 ` [patch 12/16] host-OSF1.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 14/16] no-inet_ntop.patch Gary V. Vaughan
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: no-hstrerror.patch --]
[-- Type: text/plain, Size: 2109 bytes --]

SunOS 5.6 and 5.5.1 do not have hstrerror, even in libresolv.

This patch improves the logic of the test for hstrerror, not to
blindly assume that if there is no hstrerror in libc that it must
exist in libresolv.
---
 Makefile      |    1 +
 config.mak.in |    1 +
 configure.ac  |   17 ++++++++++++++---
 3 files changed, 16 insertions(+), 3 deletions(-)

Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -546,11 +546,22 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -
 
 #
 # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.
-# Notably on Solaris hstrerror resides in libresolv and on Solaris 7
-# inet_ntop and inet_pton additionally reside there.
-AC_CHECK_LIB([c], [hstrerror],
+# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.
+AC_CHECK_LIB([c], [inet_ntop],
 [NEEDS_RESOLV=],
 [NEEDS_RESOLV=YesPlease])
+#
+# Define NO_HSTRERROR if linking with -lresolv is not enough.
+# Solaris 2.6 in particular has no hstrerror, even in -lresolv.
+NO_HSTRERROR=
+AC_CHECK_FUNC([hstrerror],
+	[],
+    [AC_CHECK_LIB([resolv], [hstrerror],
+	    [NEEDS_RESOLV=YesPlease],
+	[NO_HSTRERROR=YesPlease])
+])
+AC_SUBST(NO_HSTRERROR)
+
 AC_SUBST(NEEDS_RESOLV)
 test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"
 
Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -813,6 +813,7 @@ ifeq ($(uname_S),SunOS)
 	NO_MKSTEMPS = YesPlease
 	NO_REGEX = YesPlease
 	ifeq ($(uname_R),5.6)
+		NO_HSTRERROR = YesPlease
 		NO_IPV6 = YesPlease
 		NO_SOCKADDR_STORAGE = YesPlease
 		NO_UNSETENV = YesPlease
Index: b/config.mak.in
===================================================================
--- a/config.mak.in
+++ b/config.mak.in
@@ -43,6 +43,7 @@ NO_D_TYPE_IN_DIRENT=@NO_D_TYPE_IN_DIRENT
 NO_SOCKADDR_STORAGE=@NO_SOCKADDR_STORAGE@
 NO_IPV6=@NO_IPV6@
 NO_C99_FORMAT=@NO_C99_FORMAT@
+NO_HSTRERROR=@NO_HSTRERROR@
 NO_STRCASESTR=@NO_STRCASESTR@
 NO_MEMMEM=@NO_MEMMEM@
 NO_STRLCPY=@NO_STRLCPY@

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 14/16] no-inet_ntop.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (12 preceding siblings ...)
  2010-04-27 13:57 ` [patch 13/16] no-hstrerror.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 15/16] no-socklen_t.patch Gary V. Vaughan
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: no-inet_ntop.patch --]
[-- Type: text/plain, Size: 3129 bytes --]

Being careful not to overwrite the results of testing for hstrerror in
libresolv, also test whether inet_ntop/inet_pton are available from
that library.
---
 Makefile      |    6 ++++++
 config.mak.in |    2 ++
 configure.ac  |   38 ++++++++++++++++++++++++++++++--------
 3 files changed, 38 insertions(+), 8 deletions(-)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -981,6 +981,12 @@ ifeq ($(uname_S),HP-UX)
 	SNPRINTF_RETURNS_BOGUS = YesPlease
 	ifeq ($(uname_R),B.10.20)
 		NO_PREAD = YesPlease
+		NO_INET_NTOP = YesPlease
+		NO_INET_PTON = YesPlease
+	endif
+	ifeq ($(uname_R),B.11.00)
+		NO_INET_NTOP = YesPlease
+		NO_INET_PTON = YesPlease
 	endif
 	GIT_TEST_CMP = cmp
 endif
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -545,11 +545,33 @@ AC_SUBST(NEEDS_SOCKET)
 test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
 
 #
-# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.
-# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.
-AC_CHECK_LIB([c], [inet_ntop],
-[NEEDS_RESOLV=],
-[NEEDS_RESOLV=YesPlease])
+# The next few tests will define NEEDS_RESOLV if linking with
+# libresolv provides some of the functions we would normally get
+# from libc.
+NEEDS_RESOLV=
+AC_SUBST(NEEDS_RESOLV)
+#
+# Define NO_INET_NTOP if linking with -lresolv is not enough.
+# Solaris 2.7 in particular hos inet_ntop in -lresolv.
+NO_INET_NTOP=
+AC_SUBST(NO_INET_NTOP)
+AC_CHECK_FUNC([inet_ntop],
+	[],
+    [AC_CHECK_LIB([resolv], [inet_ntop],
+	    [NEEDS_RESOLV=YesPlease],
+	[NO_INET_NTOP=YesPlease])
+])
+#
+# Define NO_INET_PTON if linking with -lresolv is not enough.
+# Solaris 2.7 in particular hos inet_pton in -lresolv.
+NO_INET_PTON=
+AC_SUBST(NO_INET_PTON)
+AC_CHECK_FUNC([inet_pton],
+	[],
+    [AC_CHECK_LIB([resolv], [inet_pton],
+	    [NEEDS_RESOLV=YesPlease],
+	[NO_INET_PTON=YesPlease])
+])
 #
 # Define NO_HSTRERROR if linking with -lresolv is not enough.
 # Solaris 2.6 in particular has no hstrerror, even in -lresolv.
@@ -561,8 +583,9 @@ AC_CHECK_FUNC([hstrerror],
 	[NO_HSTRERROR=YesPlease])
 ])
 AC_SUBST(NO_HSTRERROR)
-
-AC_SUBST(NEEDS_RESOLV)
+#
+# If any of the above tests determined that -lresolv is needed at
+# build-time, also set it here for remaining configure-time checks.
 test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"
 
 AC_CHECK_LIB([c], [basename],
@@ -792,7 +815,6 @@ GIT_CHECK_FUNC(mkstemps,
 [NO_MKSTEMPS=YesPlease])
 AC_SUBST(NO_MKSTEMPS)
 #
-#
 # Define NO_MMAP if you want to avoid mmap.
 #
 # Define NO_ICONV if your libc does not properly support iconv.
Index: b/config.mak.in
===================================================================
--- a/config.mak.in
+++ b/config.mak.in
@@ -53,6 +53,8 @@ NO_SETENV=@NO_SETENV@
 NO_UNSETENV=@NO_UNSETENV@
 NO_MKDTEMP=@NO_MKDTEMP@
 NO_MKSTEMPS=@NO_MKSTEMPS@
+NO_INET_NTOP=@NO_INET_NTOP@
+NO_INET_PTON=@NO_INET_PTON@
 NO_ICONV=@NO_ICONV@
 OLD_ICONV=@OLD_ICONV@
 NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 15/16] no-socklen_t.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (13 preceding siblings ...)
  2010-04-27 13:57 ` [patch 14/16] no-inet_ntop.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 13:57 ` [patch 16/16] no-inline.patch Gary V. Vaughan
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: no-socklen_t.patch --]
[-- Type: text/plain, Size: 4434 bytes --]

SunOS 2.6 and earlier do not have a socklen_t type declaration.
---
 Makefile      |   10 ++++++++++
 aclocal.m4    |   41 +++++++++++++++++++++++++++++++++++++++++
 config.mak.in |    1 +
 configure.ac  |    6 ++++++
 4 files changed, 58 insertions(+)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,9 @@ all::
 # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend
 # to PATH if your tools in /usr/bin are broken.
 #
+# Define SOCKLEN_T to a suitable type (such as 'size_t') if your
+# system headers do not define a socklen_t type.
+#
 # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
 # or vsnprintf() return -1 instead of number of characters which would
 # have been written to the final string if enough space had been available.
@@ -737,6 +740,7 @@ EXTLIBS =
 ifeq ($(uname_S),OSF1)
 	# Need this for u_short definitions et al
 	BASIC_CFLAGS += -D_OSF_SOURCE
+	SOCKLEN_T = int
 	NO_STRTOULL = YesPlease
 	NO_NSEC = YesPlease
 endif
@@ -813,6 +817,7 @@ ifeq ($(uname_S),SunOS)
 	NO_MKSTEMPS = YesPlease
 	NO_REGEX = YesPlease
 	ifeq ($(uname_R),5.6)
+		SOCKLEN_T = int
 		NO_HSTRERROR = YesPlease
 		NO_IPV6 = YesPlease
 		NO_SOCKADDR_STORAGE = YesPlease
@@ -980,6 +985,7 @@ ifeq ($(uname_S),HP-UX)
 	NO_NSEC = YesPlease
 	SNPRINTF_RETURNS_BOGUS = YesPlease
 	ifeq ($(uname_R),B.10.20)
+		SOCKLEN_T = size_t
 		NO_PREAD = YesPlease
 		NO_INET_NTOP = YesPlease
 		NO_INET_PTON = YesPlease
@@ -1114,6 +1120,10 @@ else
 BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
 endif
 
+ifneq (,$(SOCKLEN_T))
+	BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)
+endif
+
 ifeq ($(uname_S),Darwin)
 	ifndef NO_FINK
 		ifeq ($(shell test -d /sw/lib && echo y),y)
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -633,6 +633,12 @@ AC_SUBST(OLD_ICONV)
 ## Checks for typedefs, structures, and compiler characteristics.
 AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics])
 #
+TYPE_SOCKLEN_T
+case $ac_cv_type_socklen_t in
+  yes)	;;
+  *)  	AC_SUBST([SOCKLEN_T], [$git_cv_socklen_t_equiv]) ;;
+esac
+
 # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
 AC_CHECK_MEMBER(struct dirent.d_ino,
 [NO_D_INO_IN_DIRENT=],
Index: b/config.mak.in
===================================================================
--- a/config.mak.in
+++ b/config.mak.in
@@ -58,6 +58,7 @@ NO_INET_PTON=@NO_INET_PTON@
 NO_ICONV=@NO_ICONV@
 OLD_ICONV=@OLD_ICONV@
 NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
+SOCKLEN_T=@SOCKLEN_T@
 FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
 SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@
 NO_PTHREADS=@NO_PTHREADS@
Index: b/aclocal.m4
===================================================================
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,41 @@
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc.  So we
+dnl have to test to find something that will work.
+AC_DEFUN([TYPE_SOCKLEN_T],
+[
+   AC_CHECK_TYPE([socklen_t], ,[
+      AC_MSG_CHECKING([for socklen_t equivalent])
+      AC_CACHE_VAL([git_cv_socklen_t_equiv],
+      [
+         # Systems have either "struct sockaddr *" or
+         # "void *" as the second argument to getpeername
+         git_cv_socklen_t_equiv=
+         for arg2 in "struct sockaddr" void; do
+            for t in int size_t unsigned long "unsigned long"; do
+               AC_TRY_COMPILE([
+                  #include <sys/types.h>
+                  #include <sys/socket.h>
+
+                  int getpeername (int, $arg2 *, $t *);
+               ],[
+                  $t len;
+                  getpeername(0,0,&len);
+               ],[
+                  git_cv_socklen_t_equiv="$t"
+                  break 2
+               ])
+            done
+         done
+
+         if test "x$git_cv_socklen_t_equiv" = x; then
+            AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+         fi
+      ])
+      AC_MSG_RESULT($git_cv_socklen_t_equiv)
+      AC_DEFINE_UNQUOTED(socklen_t, $git_cv_socklen_t_equiv,
+			[type to use in place of socklen_t if not defined])],
+      [#include <sys/types.h>
+#include <sys/socket.h>])
+])
+

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* [patch 16/16] no-inline.patch
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (14 preceding siblings ...)
  2010-04-27 13:57 ` [patch 15/16] no-socklen_t.patch Gary V. Vaughan
@ 2010-04-27 13:57 ` Gary V. Vaughan
  2010-04-27 15:30 ` [patch 00/16] Portability Patches for git-1.7.1 (v4) Michael J Gruber
  2010-04-28 10:12 ` Gary V. Vaughan
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 13:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: no-inline.patch --]
[-- Type: text/plain, Size: 2679 bytes --]

Without this patch, git does not compile correctly on HPUX 11.11 and
earlier.

Compiler support for inline is sometimes buggy, and occasionally
missing entirely.  This patch adds a test for inline support, and
redefines the keyword with the preprocessor if necessary at compile
time.
---
 Makefile      |   10 ++++++++++
 config.mak.in |    1 +
 configure.ac  |    6 ++++++
 3 files changed, 17 insertions(+)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,9 @@ all::
 # Define SOCKLEN_T to a suitable type (such as 'size_t') if your
 # system headers do not define a socklen_t type.
 #
+# Define INLINE to a suitable substitute (such as '__inline' or '') if git
+# fails to compile with errors about undefined inline functions or similar.
+#
 # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
 # or vsnprintf() return -1 instead of number of characters which would
 # have been written to the final string if enough space had been available.
@@ -972,6 +975,7 @@ ifeq ($(uname_S),IRIX64)
 	NEEDS_LIBGEN = YesPlease
 endif
 ifeq ($(uname_S),HP-UX)
+	INLINE = __inline
 	NO_IPV6=YesPlease
 	NO_SETENV=YesPlease
 	NO_STRCASESTR=YesPlease
@@ -985,6 +989,8 @@ ifeq ($(uname_S),HP-UX)
 	NO_NSEC = YesPlease
 	SNPRINTF_RETURNS_BOGUS = YesPlease
 	ifeq ($(uname_R),B.10.20)
+		# Override HP-UX 11.x setting:
+		INLINE =
 		SOCKLEN_T = size_t
 		NO_PREAD = YesPlease
 		NO_INET_NTOP = YesPlease
@@ -1120,6 +1126,10 @@ else
 BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
 endif
 
+ifneq (,$(INLINE))
+	BASIC_CFLAGS += -Dinline=$(INLINE)
+endif
+
 ifneq (,$(SOCKLEN_T))
 	BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)
 endif
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -327,6 +327,12 @@ GIT_PARSE_WITH(tcltk))
 AC_MSG_NOTICE([CHECKS for programs])
 #
 AC_PROG_CC([cc gcc])
+AC_C_INLINE
+case $ac_cv_c_inline in
+  inline | yes | no)	;;
+  *)			AC_SUBST([INLINE], [$ac_cv_c_inline]) ;;
+esac
+
 # which switch to pass runtime path to dynamic libraries to the linker
 AC_CACHE_CHECK([if linker supports -R], git_cv_ld_dashr, [
    SAVE_LDFLAGS="${LDFLAGS}"
Index: b/config.mak.in
===================================================================
--- a/config.mak.in
+++ b/config.mak.in
@@ -58,6 +58,7 @@ NO_INET_PTON=@NO_INET_PTON@
 NO_ICONV=@NO_ICONV@
 OLD_ICONV=@OLD_ICONV@
 NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
+INLINE=@INLINE@
 SOCKLEN_T=@SOCKLEN_T@
 FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
 SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@

-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 02/16] const-expr.patch
  2010-04-27 13:57 ` [patch 02/16] const-expr.patch Gary V. Vaughan
@ 2010-04-27 14:08   ` Erik Faye-Lund
  2010-04-27 14:32     ` Gary V. Vaughan
       [not found]   ` <1AFA5FB2-EB8B-4775-8941-86428C7F740E@gmail.com>
  1 sibling, 1 reply; 49+ messages in thread
From: Erik Faye-Lund @ 2010-04-27 14:08 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git

On Tue, Apr 27, 2010 at 3:57 PM, Gary V. Vaughan
<git@mlists.thewrittenword.com> wrote:
> Index: b/unpack-trees.c
> ===================================================================
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -287,9 +287,11 @@ static void add_same_unmerged(struct cac
>  static int unpack_index_entry(struct cache_entry *ce,
>                              struct unpack_trees_options *o)
>  {
> -       struct cache_entry *src[5] = { ce, NULL, };
> +       struct cache_entry *src[5] = { NULL, NULL };

You don't need NULL twice when the array-size is specified, it's just
confusing as the array has 5 elements.

> Index: b/builtin/commit.c
> ===================================================================
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -717,7 +717,8 @@ static int prepare_to_commit(const char
>
>        if (use_editor) {
>                char index[PATH_MAX];
> -               const char *env[2] = { index, NULL };
> +               const char *env[] = { NULL, NULL };

Why not "const char *env[2] = { NULL };", as it's shorter?

> Index: b/builtin/cat-file.c
> ===================================================================
> --- a/builtin/cat-file.c
> +++ b/builtin/cat-file.c
> @@ -118,7 +118,9 @@ static int cat_one_file(int opt, const c
>
>                /* custom pretty-print here */
>                if (type == OBJ_TREE) {
> -                       const char *ls_args[3] = {"ls-tree", obj_name, NULL};
> +                       const char *ls_args[3] = { NULL, NULL, NULL };

Again, you don't need to repeat NULL.

-- 
Erik "kusma" Faye-Lund

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 12/16] host-OSF1.patch
  2010-04-27 13:57 ` [patch 12/16] host-OSF1.patch Gary V. Vaughan
@ 2010-04-27 14:10   ` Tor Arntsen
  2010-04-27 14:39     ` Gary V. Vaughan
  0 siblings, 1 reply; 49+ messages in thread
From: Tor Arntsen @ 2010-04-27 14:10 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git

On Tue, Apr 27, 2010 at 15:57, Gary V. Vaughan
<git@mlists.thewrittenword.com> wrote:
> Add defaults for Tru64 Unix.  Without this patch I cannot compile
> git on Tru64 5.1.
> ---
>  Makefile |    6 ++++++
>  1 file changed, 6 insertions(+)
>
> Index: b/Makefile
> ===================================================================
> --- a/Makefile
> +++ b/Makefile
> @@ -734,6 +734,12 @@ EXTLIBS =
>  # because maintaining the nesting to match is a pain.  If
>  # we had "elif" things would have been much nicer...
>
> +ifeq ($(uname_S),OSF1)
> +       # Need this for u_short definitions et al
> +       BASIC_CFLAGS += -D_OSF_SOURCE
> +       NO_STRTOULL = YesPlease
> +       NO_NSEC = YesPlease
> +endif

I'll try your patch for OSF1, but (ref. a patch I sent earlier, in its
first revision) I needed several other changes in order to compile on
5.1 (I also needed those you have above), e.g.
-D_POSIX_C_SOURCE=1 NO_STRCASESTR = YesPlease NO_STRTOUMAX = YesPlease
NO_STRLCPY = YesPlease NO_MEMMEM = YesPlease NO_UINTMAX_T = YesPlease
NO_C99_FORMAT = YesPlease
and
NO_TCLTK = YesPlease
because V5.1 comes with tcl/tk 8.2 and gitk refuses to start with
anything older than 8.4.
I had some other too, but those could be worked around by building and
installing own versions of iconv, openssl, zlib, python, expat.

-Tor

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 02/16] const-expr.patch
  2010-04-27 14:08   ` Erik Faye-Lund
@ 2010-04-27 14:32     ` Gary V. Vaughan
  0 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 14:32 UTC (permalink / raw)
  To: kusmabite; +Cc: git

On Tue, Apr 27, 2010 at 04:08:24PM +0200, Erik Faye-Lund wrote:
> On Tue, Apr 27, 2010 at 3:57 PM, Gary V. Vaughan
> <git@mlists.thewrittenword.com> wrote:
> > Index: b/unpack-trees.c
> > ===================================================================
> > --- a/unpack-trees.c
> > +++ b/unpack-trees.c
> > @@ -287,9 +287,11 @@ static void add_same_unmerged(struct cac
> > ?static int unpack_index_entry(struct cache_entry *ce,
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?struct unpack_trees_options *o)
> > ?{
> > - ? ? ? struct cache_entry *src[5] = { ce, NULL, };
> > + ? ? ? struct cache_entry *src[5] = { NULL, NULL };
> 
> You don't need NULL twice when the array-size is specified, it's just
> confusing as the array has 5 elements. [[..and 2 other similar
> instances...]]

Thanks, agreed.  I won't spam the list with another copy of the patch
with such straight forward changes though.

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 12/16] host-OSF1.patch
  2010-04-27 14:10   ` Tor Arntsen
@ 2010-04-27 14:39     ` Gary V. Vaughan
  2010-04-27 14:48       ` Tor Arntsen
  0 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-27 14:39 UTC (permalink / raw)
  To: Tor Arntsen; +Cc: git

On Tue, Apr 27, 2010 at 04:10:56PM +0200, Tor Arntsen wrote:
> On Tue, Apr 27, 2010 at 15:57, Gary V. Vaughan
> <git@mlists.thewrittenword.com> wrote:
> > Add defaults for Tru64 Unix. ?Without this patch I cannot compile
> > git on Tru64 5.1.
> > ---
> > ?Makefile | ? ?6 ++++++
> > ?1 file changed, 6 insertions(+)
> >
> > Index: b/Makefile
> > ===================================================================
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -734,6 +734,12 @@ EXTLIBS =
> > ?# because maintaining the nesting to match is a pain. ?If
> > ?# we had "elif" things would have been much nicer...
> >
> > +ifeq ($(uname_S),OSF1)
> > + ? ? ? # Need this for u_short definitions et al
> > + ? ? ? BASIC_CFLAGS += -D_OSF_SOURCE
> > + ? ? ? NO_STRTOULL = YesPlease
> > + ? ? ? NO_NSEC = YesPlease
> > +endif
> 
> I'll try your patch for OSF1,

Much appreciated :)

> but (ref. a patch I sent earlier, in its
> first revision) I needed several other changes in order to compile on
> 5.1 (I also needed those you have above), e.g.
> -D_POSIX_C_SOURCE=1 NO_STRCASESTR = YesPlease NO_STRTOUMAX = YesPlease
> NO_STRLCPY = YesPlease NO_MEMMEM = YesPlease NO_UINTMAX_T = YesPlease
> NO_C99_FORMAT = YesPlease
> and
> NO_TCLTK = YesPlease

Indeed, I don't mean to imply that this patch is all that is needed
for OSF1, merely that the changes it contains benefit only OSF1.

Please bear in mind that I build using configure, and may have missed
something necessary for a make-only driven build.

> because V5.1 comes with tcl/tk 8.2 and gitk refuses to start with
> anything older than 8.4.
> I had some other too, but those could be worked around by building and
> installing own versions of iconv, openssl, zlib, python, expat.

Ack.  And since that is our business, we do indeed build git against
our own packages of relatively cutting edge releases of prerequisite
OS software on all our hosts (including all of the above).

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 12/16] host-OSF1.patch
  2010-04-27 14:39     ` Gary V. Vaughan
@ 2010-04-27 14:48       ` Tor Arntsen
  2010-04-28  9:07         ` Gary V. Vaughan
  0 siblings, 1 reply; 49+ messages in thread
From: Tor Arntsen @ 2010-04-27 14:48 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git

On Tue, Apr 27, 2010 at 16:39, Gary V. Vaughan
<git@mlists.thewrittenword.com> wrote:
> On Tue, Apr 27, 2010 at 04:10:56PM +0200, Tor Arntsen wrote:

>> but (ref. a patch I sent earlier, in its
>> first revision) I needed several other changes in order to compile on
>> 5.1 (I also needed those you have above), e.g.
>> -D_POSIX_C_SOURCE=1 NO_STRCASESTR = YesPlease NO_STRTOUMAX = YesPlease
>> NO_STRLCPY = YesPlease NO_MEMMEM = YesPlease NO_UINTMAX_T = YesPlease
>> NO_C99_FORMAT = YesPlease
>> and
>> NO_TCLTK = YesPlease
>
> Indeed, I don't mean to imply that this patch is all that is needed
> for OSF1, merely that the changes it contains benefit only OSF1.

I see. In that case, as I have verified that those changes are indeed
necessary for OSF1:

Acked-by: Tor Arntsen <tor@spacetec.no>

> Please bear in mind that I build using configure, and may have missed
> something necessary for a make-only driven build.

Ah, Ok, that would explain it. I too found that with ./configure fewer
changes were needed. The patch I was working on I tested both with and
without configure.  If your patch goes in I could follow up with the
changes needed for when not using configure, if you don't wish to
tacke that.

>> because V5.1 comes with tcl/tk 8.2 and gitk refuses to start with
>> anything older than 8.4.
>> I had some other too, but those could be worked around by building and
>> installing own versions of iconv, openssl, zlib, python, expat.
>
> Ack.  And since that is our business, we do indeed build git against
> our own packages of relatively cutting edge releases of prerequisite
> OS software on all our hosts (including all of the above).
>
> Cheers,
> --
> Gary V. Vaughan (gary@thewrittenword.com)

-Tor

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (15 preceding siblings ...)
  2010-04-27 13:57 ` [patch 16/16] no-inline.patch Gary V. Vaughan
@ 2010-04-27 15:30 ` Michael J Gruber
  2010-04-27 17:54   ` Jeff King
                     ` (4 more replies)
  2010-04-28 10:12 ` Gary V. Vaughan
  17 siblings, 5 replies; 49+ messages in thread
From: Michael J Gruber @ 2010-04-27 15:30 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git

Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:
> Here are the portability patches we needed at TWW to enable git-1.7.1
> to compile and run on all of the wide range of Unix machines we
> support.  These patches apply to the git-1.7.1 release,  and address
> all of the feedback from the previous three times I posted them to
> this list, including fixing the massive testsuite failures I was
> experiencing and taking into account that the ss_family fixes and
> partial GMT_CMP_TEST fixes that have been pushed since my last post of
> this patch queue.

General remark: None of your patches have a s-o-b line. If you want to
have your patches in git you are required to sign-off on them (commit
-s) in order to certify that you can submit them under the license terms
of the project.

Your diff -> test_cmp are certainly something we want to have in any
case. The code changes look ugly, honestly, making the code much less
readable, but it seems to be the only way to make those older platforms
and compilers happy. (Erik pointed out some good ways to reduce the
uglyness somewhat.)

I can't test your target platform, but I would test the impact of the
code and test changes on mine. Do you have your series somewhere to pull
from?

Michael

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git.
  2010-04-27 13:57 ` [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git Gary V. Vaughan
@ 2010-04-27 16:08   ` Tor Arntsen
  2010-04-28  8:40     ` Gary V. Vaughan
  0 siblings, 1 reply; 49+ messages in thread
From: Tor Arntsen @ 2010-04-27 16:08 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git

On Tue, Apr 27, 2010 at 15:57, Gary V. Vaughan <git@mlists.thewrittenword.com> wrote:
> enum style is inconsistent already, with some enums declared on one
> line, some over 3 lines with the enum values all on the middle line,
> sometimes with 1 enum value per line... and independently of that the
> trailing comma is sometimes present and other times absent, often
> mixing with/without trailing comma styles in a single file, and
> sometimes in consecutive enum declarations.
>
> Clearly, omitting the comma is the more portable style, and this patch
> changes all enum declarations to use the portable omitted dangling
> comma style consistently.
> ---
>  attr.h                 |    2 +-
>  builtin/apply.c        |    4 ++--
>  builtin/branch.c       |    4 ++--
>  builtin/commit.c       |    6 +++---
>  builtin/help.c         |    2 +-
>  builtin/mailinfo.c     |    4 ++--
>  builtin/receive-pack.c |    2 +-
>  builtin/remote.c       |    2 +-
>  cache.h                |   16 ++++++++--------
>  commit.h               |    2 +-
>  connect.c              |    2 +-
>  ctype.c                |    2 +-
>  diff.h                 |    2 +-
>  dir.c                  |    6 +++---
>  fast-import.c          |    2 +-
>  grep.h                 |    8 ++++----
>  http-push.c            |    2 +-
>  http-walker.c          |    2 +-
>  imap-send.c            |    2 +-
>  merge-recursive.h      |    2 +-
>  parse-options.h        |    6 +++---
>  pretty.c               |    2 +-
>  remote.h               |    2 +-
>  rerere.c               |    2 +-
>  revision.c             |    2 +-
>  wt-status.h            |    2 +-
>  26 files changed, 45 insertions(+), 45 deletions(-)

The patch is against master. Are we supposed to make patches against master or maint? (I thought I saw the latter somewhere. I'm pretty new in here though..)

I can confirm that master doesn't compile on AIX 5.1 with the IBM VisualAge compiler V5 (V5.0.2) without the patch above, and it does compile with the patch:

Tested-by: Tor Arntsen <tor@spacetec.no>

but with the following caveats:

1: With the patch, it'll build with configure (and only configure), run like so:

./configure --enable-pthreads=-lpthread CFLAGS=-Dinline=''

In other words, this system would also need an AIX version of the 'no-inline' patch you did for HP-UX.

And without the --enable-pthreads=-lpthread above it'll try to link with -pthread, which won't work for this system.

The const-expr patch is also useful for AIX-5.1 / XlC V5.0.2. It does build without, but with warnings.

2: The compiler cannot build on AIX 5.1 without the following additional patch (against master. maint has similar problems but files have been moved):

>From a8989213b4c8baa53c14c1f227b916910265c517 Mon Sep 17 00:00:00 2001
From: Tor Arntsen <tor@spacetec.no>
Date: Tue, 27 Apr 2010 16:05:12 +0000
Subject: [PATCH 2/2] C99 comments changed to old-style C comments

Signed-off-by: Tor Arntsen <tor@spacetec.no>
---
 builtin/blame.c        |    2 +-
 builtin/for-each-ref.c |    4 ++--
 remote.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/blame.c b/builtin/blame.c
index fc15863..4dd4c3f 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1589,7 +1589,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent)
 	strcpy(hex, sha1_to_hex(suspect->commit->object.sha1));
 	printf("%s%c%d %d %d\n",
 	       hex,
-	       ent->guilty ? ' ' : '*', // purely for debugging
+	       ent->guilty ? ' ' : '*', /* purely for debugging */
 	       ent->s_lno + 1,
 	       ent->lno + 1,
 	       ent->num_lines);
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 62be1bb..7f5011f 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -549,10 +549,10 @@ static void grab_values(struct atom_value *val, int deref, struct object *obj, v
 		grab_person("committer", val, deref, obj, buf, sz);
 		break;
 	case OBJ_TREE:
-		// grab_tree_values(val, deref, obj, buf, sz);
+		/* grab_tree_values(val, deref, obj, buf, sz); */
 		break;
 	case OBJ_BLOB:
-		// grab_blob_values(val, deref, obj, buf, sz);
+		/* grab_blob_values(val, deref, obj, buf, sz); */
 		break;
 	default:
 		die("Eh?  Object of type %d?", obj->type);
diff --git a/remote.c b/remote.c
index c70181c..26ce560 100644
--- a/remote.c
+++ b/remote.c
@@ -476,7 +476,7 @@ static void read_config(void)
 	unsigned char sha1[20];
 	const char *head_ref;
 	int flag;
-	if (default_remote_name) // did this already
+	if (default_remote_name) /* did this already */
 		return;
 	default_remote_name = xstrdup("origin");
 	current_branch = NULL;
-- 
1.7.1.rc1.GIT

^ permalink raw reply related	[flat|nested] 49+ messages in thread

* Re: [patch 06/16] diff-test_cmp.patch
  2010-04-27 13:57 ` [patch 06/16] diff-test_cmp.patch Gary V. Vaughan
@ 2010-04-27 17:15   ` Jonathan Nieder
  2010-04-28  9:00     ` Gary V. Vaughan
  0 siblings, 1 reply; 49+ messages in thread
From: Jonathan Nieder @ 2010-04-27 17:15 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git, Jeff King

Hi,

Gary V. Vaughan wrote:

> Subject: diff-test_cmp.patch
>
> In tests, call test_cmp rather than raw diff where possible (i.e. if
> the output does not go to a pipe), to allow the use of, say, 'cmp'
> when the default 'diff -u' is not compatible with a vendor diff.
> 
> When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.

Sign-off?  (See SubmittingPatches for what I am asking about here.)  And
is it possible to change your mailing script to use more meaningful
subject lines?

This patch makes a good change, but I do not think your description
captures it.  Most of the changes are from ‘diff’, not from ‘diff -u’.
Is your bare ‘diff’ really incapable of distinguishing between
identical and differing files?

But using test_cmp consistently would make debugging test scripts
with -v much easier, since the output is more readable.

> --- a/t/t0000-basic.sh
> +++ b/t/t0000-basic.sh
> @@ -280,7 +280,7 @@ $expectfilter >expected <<\EOF
>  EOF
>  test_expect_success \
>      'validate git diff-files output for a know cache/work tree state.' \
> -    'git diff-files >current && diff >/dev/null -b current expected'
> +    'git diff-files >current && test_cmp current expected >/dev/null'

The original ignores whitespace changes; this version does not.  It
turns out that’s okay, but it’s worth mentioning in the commit
message.  (I think we do guarantee that diff-files will not change the
whitespace it produces without good reason.)

The original suppressed its output, without any good reason to.  Could
you remove the >/dev/null while at it, to make it easier to debug?

> --- a/t/t4124-apply-ws-rule.sh
> +++ b/t/t4124-apply-ws-rule.sh
> @@ -44,7 +44,7 @@ test_fix () {
>  	apply_patch --whitespace=fix || return 1
>  
>  	# find touched lines
> -	diff file target | sed -n -e "s/^> //p" >fixed
> +	$DIFF file target | sed -n -e "s/^> //p" >fixed
>  
>  	# the changed lines are all expeced to change
>  	fixed_cnt=$(wc -l <fixed)

Is this needed?  I don’t mind it, just curious.

I hope some earlier patch takes care of setting DIFF in test-lib.sh.
Tests need to be usable without running them through the makefile.

> --- a/t/Makefile
> +++ b/t/Makefile
> @@ -6,10 +6,14 @@
>  -include ../config.mak
>  
>  #GIT_TEST_OPTS=--verbose --debug
> +GIT_TEST_CMP ?= $(DIFF)
>  SHELL_PATH ?= $(SHELL)
>  TAR ?= $(TAR)
>  RM ?= rm -f
>  
> +# Make sure test-lib.sh uses make's value of GIT_TEST_CMP
> +export GIT_TEST_CMP
> +
>  # Shell quote;
>  SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))

If neither DIFF nor GIT_TEST_CMP is already set, this will export
GIT_TEST_CMP as the empty string.  Will t/test-lib.sh treat that as
asking for the default?  Yes --- phew.

Except for as commented above,

  Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-27 15:30 ` [patch 00/16] Portability Patches for git-1.7.1 (v4) Michael J Gruber
@ 2010-04-27 17:54   ` Jeff King
  2010-04-27 20:13     ` Andreas Schwab
  2010-04-28  9:27   ` Gary V. Vaughan
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 49+ messages in thread
From: Jeff King @ 2010-04-27 17:54 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Gary V. Vaughan, git

On Tue, Apr 27, 2010 at 05:30:53PM +0200, Michael J Gruber wrote:

> Your diff -> test_cmp are certainly something we want to have in any
> case. The code changes look ugly, honestly, making the code much less
> readable, but it seems to be the only way to make those older platforms
> and compilers happy. (Erik pointed out some good ways to reduce the
> uglyness somewhat.)

I agree. We really need to make a decision here about how far backward
we are willing to bend for older systems.

Solaris 2.6 was released in 1997, and Sun dropped support for it in
2006, four years ago. How long do we want to continue supporting it? And
at what cost?  If we have not hit end-of-life on it now, then what would
be a reasonable time? And what defines end-of-life support for git? I am
perfectly happy to carry a Solaris 2.6 section of the Makefile forever.
But if it is going to cause code changes that make the code harder to
read and maintain, is it worth it? Especially when one could probably
just use gcc to build for those platforms. Sure, it may be less
convenient for the builder, and it may not generate quite as good code
as a vendor compiler, but to what degree should we care? Those platforms
are an extreme minority, and we need to balance their impact on code
that developers on every platform have to work with.

Furthermore, if we do take such changes, how are we going to manage
portability going forward? Some constructs (like non-constant
initializers) make the code much easier to read. People _will_ submit
patches that use them. Is somebody going to be auto-building on all of
these platforms with vendor compilers to confirm that nothing is broken?

If all of these questions seem like rhetorical "I am trying to convince
you these patches aren't a good idea" questions, they're not meant as
such. I think these are serious questions that need to be answered when
evaluating portability patches.

-Peff

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-27 17:54   ` Jeff King
@ 2010-04-27 20:13     ` Andreas Schwab
  2010-04-28  2:08       ` Jeff King
  0 siblings, 1 reply; 49+ messages in thread
From: Andreas Schwab @ 2010-04-27 20:13 UTC (permalink / raw)
  To: Jeff King; +Cc: Michael J Gruber, Gary V. Vaughan, git

Jeff King <peff@peff.net> writes:

> Furthermore, if we do take such changes, how are we going to manage
> portability going forward? Some constructs (like non-constant
> initializers) make the code much easier to read. People _will_ submit
> patches that use them. Is somebody going to be auto-building on all of
> these platforms with vendor compilers to confirm that nothing is broken?

You can use "gcc -pedantic" to find these portability problems.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-27 20:13     ` Andreas Schwab
@ 2010-04-28  2:08       ` Jeff King
  2010-04-28  9:19         ` Gary V. Vaughan
  0 siblings, 1 reply; 49+ messages in thread
From: Jeff King @ 2010-04-28  2:08 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Michael J Gruber, Gary V. Vaughan, git

On Tue, Apr 27, 2010 at 10:13:02PM +0200, Andreas Schwab wrote:

> Jeff King <peff@peff.net> writes:
> 
> > Furthermore, if we do take such changes, how are we going to manage
> > portability going forward? Some constructs (like non-constant
> > initializers) make the code much easier to read. People _will_ submit
> > patches that use them. Is somebody going to be auto-building on all of
> > these platforms with vendor compilers to confirm that nothing is broken?
> 
> You can use "gcc -pedantic" to find these portability problems.

Sort of. It reports much more than we necessarily need to fix to remain
portable to even remotely sane platforms. So it's a nice tool for
finding problems, but somebody needs to do the work of figuring out
which are important and which are not, and then periodically run with
-pedantic and sort out the results.

-Peff

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git.
  2010-04-27 16:08   ` Tor Arntsen
@ 2010-04-28  8:40     ` Gary V. Vaughan
  2010-04-28  8:55       ` Tor Arntsen
  0 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-28  8:40 UTC (permalink / raw)
  To: Tor Arntsen; +Cc: Gary V. Vaughan, git

On Tue, Apr 27, 2010 at 06:08:58PM +0200, Tor Arntsen wrote:
> On Tue, Apr 27, 2010 at 15:57, Gary V. Vaughan <git@mlists.thewrittenword.com> wrote:
> > enum style is inconsistent already, with some enums declared on one
> > line, some over 3 lines with the enum values all on the middle line,
> > sometimes with 1 enum value per line... and independently of that the
> > trailing comma is sometimes present and other times absent, often
> > mixing with/without trailing comma styles in a single file, and
> > sometimes in consecutive enum declarations.
> >
> > Clearly, omitting the comma is the more portable style, and this patch
> > changes all enum declarations to use the portable omitted dangling
> > comma style consistently.
> 
> The patch is against master. Are we supposed to make patches against
> master or maint? (I thought I saw the latter somewhere. I'm pretty
> new in here though..)

No, the patch is against the latest 7.1.1 stable release (not yet shown
on the website last time I checked, however):

	http://www.kernel.org/pub/software/scm/git/git-1.7.1.tar.bz2

> I can confirm that master doesn't compile on AIX 5.1 with the IBM
> VisualAge compiler V5 (V5.0.2) without the patch above, and it does
> compile with the patch:
> 
> Tested-by: Tor Arntsen <tor@spacetec.no>

Thanks for testing.

> but with the following caveats:
> 
> 1: With the patch, it'll build with configure (and only configure),
> run like so:
> 
> ./configure --enable-pthreads=-lpthread CFLAGS=-Dinline=''

The pthread issue is taken care of by pthread.patch (later in this
series), which also adds defaults to Makefile.

The inline issue is taken care of by no-inline.patch (the last patch
in this series), for configure based builds at least.

> In other words, this system would also need an AIX version of the
> 'no-inline' patch you did for HP-UX.

This should be as simple as adding the following to the appropriate
AIX defaults section of Makefile:

        ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
                INLINE=''
        endif

But, honestly (with the obvious exception of the few architectures
that don't have access to a posix shell and command line tools) I
really don't see the value of burning perfectly good development time
by trying to maintain 2 separate build systems... irrespective of what
its detractors would like you to believe, configure is specifically
designed to discover things like this empirically *on the actual build
machine* - no matter what particular combination of libc, compiler,
operating system and/or patchlevels a build host happens to be running
on the day of the build: trying to maintain an accurate database of
what quirks are present in all combinations of the above is a far more
difficult, likely impossible, undertaking.

> And without the --enable-pthreads=-lpthread above it'll try to link
> with -pthread, which won't work for this system.

Did you apply the whole series of patches?  If so, then it is a bug in
my pthread.patch if --enable-pthreads=-lpthreads is necessary.  This
configure line builds successfully on all the architectures I have
access to (note, pthread support is probed automatically by configure):

  {SHELL} ./configure CC="${CC:-gcc}" CFLAGS="${CFLAGS:--O2}" \
  CPPFLAGS="-I${SB_VAR_CURL_INC} \
  ${SB_VAR_LIBEXPAT+-I${SB_VAR_LIBEXPAT_INC}} \
  ${SB_VAR_LIBZ+-I${SB_VAR_LIBZ_INC}} ${CPPFLAGS+${CPPFLAGS}}" \
  LDFLAGS="${SB_VAR_GCC_RT+-L${SB_VAR_GCC_RT_LIB}} \
  ${SB_VAR_LIBEXPAT+-L${SB_VAR_LIBEXPAT_LIB}} \
  ${SB_VAR_LIBZ+-L${SB_VAR_LIBZ_LIB}} \
  -L${SB_VAR_CURL_LIB} \
  ${SB_VAR_GCC_RT+${CC_LD_RT}${SB_VAR_GCC_RT_LIB}} \
  ${SB_VAR_LIBEXPAT+${CC_LD_RT}${SB_VAR_LIBEXPAT_LIB}} \
  ${SB_VAR_LIBZ+${CC_LD_RT}${SB_VAR_LIBZ_LIB}} \
  ${CC_LD_RT}${SB_VAR_CURL_LIB} ${LDFLAGS+${LDFLAGS}}" \
  ${SB_VAR_LIBEXPAT+--with-expat} \
  ${SB_VAR_LIBICONV+--with-iconv=${SB_VAR_LIBICONV}} \
  --without-openssl --with-curl ${ARGS+"${ARGS}"} \
  --prefix=${SB_INSTALL_PREFIX}

where ${SB_VAR_...LIB} and ${SB_VAR_...INC} hold the paths to the
relevant libdir and includedir directories for the named packages,
${CC_LD_RT} is "-Wl,--rpath," or equivalent, and SB_VAR_GCC_RT_LIB
refers to the GCC runtime and is predicated on whether gcc is used
(i.e. on Linux).

> The const-expr patch is also useful for AIX-5.1 / XlC V5.0.2. It
> does build without, but with warnings.

IRIX6.5 however fails to compile altogether without const-expr.patch.

> 2: The compiler cannot build on AIX 5.1 without the following
> additional patch (against master. maint has similar problems but
> files have been moved):

I maintained a similar patch for our packaging of older git releases
too, but noticed that it wasn't necessary on our machines anymore...
perhaps recent compiler patches on our hosts have relaxed the
requirement for non-C++ comment syntax?

However, I do confirm that this is a problem I have encountered in the
past.

> From a8989213b4c8baa53c14c1f227b916910265c517 Mon Sep 17 00:00:00 2001
> From: Tor Arntsen <tor@spacetec.no>
> Date: Tue, 27 Apr 2010 16:05:12 +0000
> Subject: [PATCH 2/2] C99 comments changed to old-style C comments
> 
> Signed-off-by: Tor Arntsen <tor@spacetec.no>
> ---
>  builtin/blame.c        |    2 +-
>  builtin/for-each-ref.c |    4 ++--
>  remote.c               |    2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git.
  2010-04-28  8:40     ` Gary V. Vaughan
@ 2010-04-28  8:55       ` Tor Arntsen
  2010-04-28 16:23         ` Jeff King
  0 siblings, 1 reply; 49+ messages in thread
From: Tor Arntsen @ 2010-04-28  8:55 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git

Gary V. Vaughan wrote:
> On Tue, Apr 27, 2010 at 06:08:58PM +0200, Tor Arntsen wrote:
>> On Tue, Apr 27, 2010 at 15:57, Gary V. Vaughan <git@mlists.thewrittenword.com> wrote:
>>> enum style is inconsistent already, with some enums declared on one
>>> line, some over 3 lines with the enum values all on the middle line,
>>> sometimes with 1 enum value per line... and independently of that the
>>> trailing comma is sometimes present and other times absent, often
>>> mixing with/without trailing comma styles in a single file, and
>>> sometimes in consecutive enum declarations.
>>>
>>> Clearly, omitting the comma is the more portable style, and this patch
>>> changes all enum declarations to use the portable omitted dangling
>>> comma style consistently.
>> The patch is against master. Are we supposed to make patches against
>> master or maint? (I thought I saw the latter somewhere. I'm pretty
>> new in here though..)
> 
> No, the patch is against the latest 7.1.1 stable release (not yet shown
> on the website last time I checked, however):
> 
> 	http://www.kernel.org/pub/software/scm/git/git-1.7.1.tar.bz2

Ok. That would correspond to master from git anyway. I make my patches
against a git checkout, and I was just throwing out the question to
the general audience, for my own knowledge.

[..]
 with -pthread, which won't work for this system.
> 
> Did you apply the whole series of patches?  If so, then it is a bug in
> my pthread.patch if --enable-pthreads=-lpthreads is necessary.  This
> configure line builds successfully on all the architectures I have
> access to (note, pthread support is probed automatically by configure):

No, I only applied and tested the enum patch. I looked through those
patches I mentioned though. Looks fine to me.

[..]
>> 2: The compiler cannot build on AIX 5.1 without the following
>> additional patch (against master. maint has similar problems but
>> files have been moved):
> 
> I maintained a similar patch for our packaging of older git releases
> too, but noticed that it wasn't necessary on our machines anymore...
> perhaps recent compiler patches on our hosts have relaxed the
> requirement for non-C++ comment syntax?

That could be. I have this exact version (5.0.2) because of software
we build for some customers. We need to have exactly the same compilers
(as we provide source as well). There are always certain bugs and issues
with different versions of compilers, so we and the customers figure out
the issues with them and then rigidly stick to a specific version fromthen
on (until we may have to evaluate another version, for different reasons).

> However, I do confirm that this is a problem I have encountered in the
> past.

If you check the Git log for the git repo you'll see that there have
been similar patches in the past, it looks like the C99 comments fixed
in my patch has just managed to sneak by since then.

-Tor

>> From a8989213b4c8baa53c14c1f227b916910265c517 Mon Sep 17 00:00:00 2001
>> From: Tor Arntsen <tor@spacetec.no>
>> Date: Tue, 27 Apr 2010 16:05:12 +0000
>> Subject: [PATCH 2/2] C99 comments changed to old-style C comments
>>
>> Signed-off-by: Tor Arntsen <tor@spacetec.no>
>> ---
>>  builtin/blame.c        |    2 +-
>>  builtin/for-each-ref.c |    4 ++--
>>  remote.c               |    2 +-
>>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> Cheers,

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 06/16] diff-test_cmp.patch
  2010-04-27 17:15   ` Jonathan Nieder
@ 2010-04-28  9:00     ` Gary V. Vaughan
  2010-04-28  9:51       ` Jonathan Nieder
  0 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-28  9:00 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Jeff King

On Tue, Apr 27, 2010 at 12:15:52PM -0500, Jonathan Nieder wrote:
> Hi,
> 
> Gary V. Vaughan wrote:
> 
> > Subject: diff-test_cmp.patch
> >
> > In tests, call test_cmp rather than raw diff where possible (i.e. if
> > the output does not go to a pipe), to allow the use of, say, 'cmp'
> > when the default 'diff -u' is not compatible with a vendor diff.
> > 
> > When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.
> 
> Sign-off?  (See SubmittingPatches for what I am asking about here.)

Ah, okay.  I didn't read carefully enough. Sorry.

Can I add a Sign-off message to each patch subthread?  Or do you need
me to resubmit the entire series?

> And is it possible to change your mailing script to use more
> meaningful subject lines?

Sure.  What is preferable?  As short a sentence summarising the fixed
issue as I can muster? (Like SuSE Linux, we use quilt to manage and
submit our patch stacks... git seems to require hosting the entire
history of each project which is too heavyweight for the 1000's of
packages we build - if git provides the means to store just the head
of an upstream release branch along with our patch stacks on local
disk, I would love to be proven wrong here).

> This patch makes a good change, but I do not think your description
> captures it.  Most of the changes are from ???diff???, not from ???diff -u???.
> Is your bare ???diff??? really incapable of distinguishing between
> identical and differing files?

A good point, thanks.  I think the scope has crept since I first
started applying such a patch to earlier releases of git in our
package tree.

> But using test_cmp consistently would make debugging test scripts
> with -v much easier, since the output is more readable.
> 
> > --- a/t/t0000-basic.sh
> > +++ b/t/t0000-basic.sh
> > @@ -280,7 +280,7 @@ $expectfilter >expected <<\EOF
> >  EOF
> >  test_expect_success \
> >      'validate git diff-files output for a know cache/work tree state.' \
> > -    'git diff-files >current && diff >/dev/null -b current expected'
> > +    'git diff-files >current && test_cmp current expected >/dev/null'
> 
> The original ignores whitespace changes; this version does not.  It
> turns out that???s okay, but it???s worth mentioning in the commit
> message.  (I think we do guarantee that diff-files will not change the
> whitespace it produces without good reason.)

Okay, I'll rewrite the patch headers where they have bit-rotted.
Maybe in combination with the missing Signed-off-by: headers and
unsuitable Subject headers I need to amend and resubmit the whole
patch series again?

> The original suppressed its output, without any good reason to.  Could
> you remove the >/dev/null while at it, to make it easier to debug?
> 
> > --- a/t/t4124-apply-ws-rule.sh
> > +++ b/t/t4124-apply-ws-rule.sh
> > @@ -44,7 +44,7 @@ test_fix () {
> >  	apply_patch --whitespace=fix || return 1
> >  
> >  	# find touched lines
> > -	diff file target | sed -n -e "s/^> //p" >fixed
> > +	$DIFF file target | sed -n -e "s/^> //p" >fixed
> >  
> >  	# the changed lines are all expeced to change
> >  	fixed_cnt=$(wc -l <fixed)
> 
> Is this needed?  I don???t mind it, just curious.

Probably not, though I prefer the consistency rather than having to
consider diff vs $DIFF at every occurence.  libtool has had numerous
silly bugs tickled by making the wrong choice between echo, $echo,
$lt_echo and $ECHO in rarely exercised corners of the code.

> I hope some earlier patch takes care of setting DIFF in test-lib.sh.
> Tests need to be usable without running them through the makefile.

Unfortunately, that is not the case in 7.1.1.  This is it:

GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}

The obvious fix would be to use:

: ${DIFF=@DIFF@}
: ${GIT_TEST_CMP=@DIFF@ -u}

And substitute at configure time.  Makefile only builds will require
additional support though.

> > --- a/t/Makefile
> > +++ b/t/Makefile
> > @@ -6,10 +6,14 @@
> >  -include ../config.mak
> >  
> >  #GIT_TEST_OPTS=--verbose --debug
> > +GIT_TEST_CMP ?= $(DIFF)
> >  SHELL_PATH ?= $(SHELL)
> >  TAR ?= $(TAR)
> >  RM ?= rm -f
> >  
> > +# Make sure test-lib.sh uses make's value of GIT_TEST_CMP
> > +export GIT_TEST_CMP
> > +
> >  # Shell quote;
> >  SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
> 
> If neither DIFF nor GIT_TEST_CMP is already set, this will export
> GIT_TEST_CMP as the empty string.  Will t/test-lib.sh treat that as
> asking for the default?  Yes --- phew.

That change was just added to my patch yesterday, to fix the massive
testsuite failures I had previously experienced.

>   Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Much appreciated!

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 12/16] host-OSF1.patch
  2010-04-27 14:48       ` Tor Arntsen
@ 2010-04-28  9:07         ` Gary V. Vaughan
  0 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-28  9:07 UTC (permalink / raw)
  To: Tor Arntsen; +Cc: git

On Tue, Apr 27, 2010 at 04:48:53PM +0200, Tor Arntsen wrote:
> On Tue, Apr 27, 2010 at 16:39, Gary V. Vaughan
> <git@mlists.thewrittenword.com> wrote:
> > On Tue, Apr 27, 2010 at 04:10:56PM +0200, Tor Arntsen wrote:
> 
> >> but (ref. a patch I sent earlier, in its
> >> first revision) I needed several other changes in order to compile on
> >> 5.1 (I also needed those you have above), e.g.
> >> -D_POSIX_C_SOURCE=1 NO_STRCASESTR = YesPlease NO_STRTOUMAX = YesPlease
> >> NO_STRLCPY = YesPlease NO_MEMMEM = YesPlease NO_UINTMAX_T = YesPlease
> >> NO_C99_FORMAT = YesPlease
> >> and
> >> NO_TCLTK = YesPlease
> >
> > Indeed, I don't mean to imply that this patch is all that is needed
> > for OSF1, merely that the changes it contains benefit only OSF1.
> 
> I see. In that case, as I have verified that those changes are indeed
> necessary for OSF1:
> 
> Acked-by: Tor Arntsen <tor@spacetec.no>

Wow, all these different pseudo-headers are starting to make my head
spin! ;)

> > Please bear in mind that I build using configure, and may have missed
> > something necessary for a make-only driven build.
> 
> Ah, Ok, that would explain it. I too found that with ./configure fewer
> changes were needed. The patch I was working on I tested both with and
> without configure.  If your patch goes in I could follow up with the
> changes needed for when not using configure, if you don't wish to
> tacke that.

Much appreciated, thank you.

Unless it's a requirement for having these patches accepted upstream,
then I'd rather not worry about the make only builds... I've mentioned
elsewhere that the idea of reliable builds predicated on the idea that
it is possible to maintain a static database of what options are
required on each combination of libc/cc/os/patchlevel with any kind of
reliability seems fundamentally flawed to me.

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-28  2:08       ` Jeff King
@ 2010-04-28  9:19         ` Gary V. Vaughan
  2010-04-28 12:17           ` Jeff King
  0 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-28  9:19 UTC (permalink / raw)
  To: Jeff King; +Cc: Andreas Schwab, Michael J Gruber, git

Hi Jeff,

On Tue, Apr 27, 2010 at 10:08:16PM -0400, Jeff King wrote:
> On Tue, Apr 27, 2010 at 10:13:02PM +0200, Andreas Schwab wrote:
> > Jeff King <peff@peff.net> writes:
> > 
> > > Furthermore, if we do take such changes, how are we going to manage
> > > portability going forward? Some constructs (like non-constant
> > > initializers) make the code much easier to read. People _will_ submit
> > > patches that use them. Is somebody going to be auto-building on all of
> > > these platforms with vendor compilers to confirm that nothing is broken?

And that's fine.  People who are trying to build will notice the
breakage on their platforms and likely submit patches in due course.
A portability guide in the source tree might help reduce the code
churn, I'd even be willing to draft it for you if you agree that it
would help. I think it would be just a few hundred words setting out
the 5 or 6 problems that I have to patch over-and-over when I port OS
packages to our older architectures...

> > You can use "gcc -pedantic" to find these portability problems.
> 
> Sort of. It reports much more than we necessarily need to fix to remain
> portable to even remotely sane platforms. So it's a nice tool for
> finding problems, but somebody needs to do the work of figuring out
> which are important and which are not, and then periodically run with
> -pedantic and sort out the results.

IMHO, unless it is a significant impediment to development of git,
then it makes sense to support any platform for which you have someone
prepared to maintain the port.

While our release cycle revs only 2 or 3 times per year, for as long
as I have customers who want me to port to their platforms, I will
continue to patch support for those platforms into our packages.  I
think that it would be a shame if those ports were kept hidden away on
our servers and only benefited our customers rather than integrated
into upstream for the benefit of the whole community.

So the real question is whether uglification of unportable code is so
unacceptable that git wants to wilfully reject external maintenance of
ports to end-of-life but none-the-less deployed and active
architectures?

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-27 15:30 ` [patch 00/16] Portability Patches for git-1.7.1 (v4) Michael J Gruber
  2010-04-27 17:54   ` Jeff King
@ 2010-04-28  9:27   ` Gary V. Vaughan
  2010-04-28  9:32   ` Gary V. Vaughan
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-28  9:27 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git

Hi Michael,

On Tue, Apr 27, 2010 at 05:30:53PM +0200, Michael J Gruber wrote:
> Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:
> > Here are the portability patches we needed at TWW to enable git-1.7.1
> > to compile and run on all of the wide range of Unix machines we
> > support.  These patches apply to the git-1.7.1 release,  and address
> > all of the feedback from the previous three times I posted them to
> > this list, including fixing the massive testsuite failures I was
> > experiencing and taking into account that the ss_family fixes and
> > partial GMT_CMP_TEST fixes that have been pushed since my last post of
> > this patch queue.
> 
> General remark: None of your patches have a s-o-b line. If you want to
> have your patches in git you are required to sign-off on them (commit
> -s) in order to certify that you can submit them under the license terms
> of the project.

I didn't read SubmittingPatches carefully enough, sorry.  If
necessary, I can resubmit with the additional line?

> Your diff -> test_cmp are certainly something we want to have in any
> case. The code changes look ugly, honestly, making the code much less
> readable, but it seems to be the only way to make those older platforms
> and compilers happy. (Erik pointed out some good ways to reduce the
> uglyness somewhat.)

I think only the const-expr.patch changes are seriously ugly... but
then I'm perhaps used to staring at portable code all day.

> I can't test your target platform, but I would test the impact of the
> code and test changes on mine. Do you have your series somewhere to pull
> from?

I'm afraid not, though I can send you (off-list) a zip of the patch
series and a quiltrc to apply using quilt or repeated calls to gnu
potch, or if you prefer, a sumo-patch containing all the changes in
one file for gnu patch?

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-27 15:30 ` [patch 00/16] Portability Patches for git-1.7.1 (v4) Michael J Gruber
  2010-04-27 17:54   ` Jeff King
  2010-04-28  9:27   ` Gary V. Vaughan
@ 2010-04-28  9:32   ` Gary V. Vaughan
  2010-04-28 12:26     ` Ævar Arnfjörð Bjarmason
       [not found]   ` <4BD94599.5090309@drmicha.warpmail.net>
  2010-05-01 18:34   ` Michael J Gruber
  4 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-28  9:32 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git

Hi Michael,

On Tue, Apr 27, 2010 at 05:30:53PM +0200, Michael J Gruber wrote:
> Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:                         
> > Here are the portability patches we needed at TWW to enable git-1.7.1       
> > to compile and run on all of the wide range of Unix machines we             
> > support.  These patches apply to the git-1.7.1 release,  and address        
> > all of the feedback from the previous three times I posted them to          
> > this list, including fixing the massive testsuite failures I was            
> > experiencing and taking into account that the ss_family fixes and           
> > partial GMT_CMP_TEST fixes that have been pushed since my last post of      
> > this patch queue.                                                           
>                                                                               
> General remark: None of your patches have a s-o-b line. If you want to        
> have your patches in git you are required to sign-off on them (commit         
> -s) in order to certify that you can submit them under the license terms      
> of the project.                                                               

I didn't read SubmittingPatches carefully enough, sorry.  If
necessary, I can resubmit with the additional line?

> Your diff -> test_cmp are certainly something we want to have in any          
> case. The code changes look ugly, honestly, making the code much less         
> readable, but it seems to be the only way to make those older platforms       
> and compilers happy. (Erik pointed out some good ways to reduce the           
> uglyness somewhat.)                                                           

I think only the const-expr.patch changes are seriously ugly... but
then I'm perhaps used to staring at portable code all day.

> I can't test your target platform, but I would test the impact of the         
> code and test changes on mine. Do you have your series somewhere to pull      
> from?                                                                         

I'm afraid not, though I can send you (off-list) a zip of the patch
series and a quiltrc to apply using quilt or repeated calls to gnu
potch, or if you prefer, a sumo-patch containing all the changes in
one file for gnu patch?

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 06/16] diff-test_cmp.patch
  2010-04-28  9:00     ` Gary V. Vaughan
@ 2010-04-28  9:51       ` Jonathan Nieder
  2010-04-28 10:22         ` Gary V. Vaughan
  0 siblings, 1 reply; 49+ messages in thread
From: Jonathan Nieder @ 2010-04-28  9:51 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git, Jeff King

Gary V. Vaughan wrote:

> Can I add a Sign-off message to each patch subthread?  Or do you need
> me to resubmit the entire series?

I think one sign-off for the whole series would be good enough; then
the person applying the patches can forge your signed-off-by lines.

I pointed it out mostly for future patches.

> On Tue, Apr 27, 2010 at 12:15:52PM -0500, Jonathan Nieder wrote:

>> And is it possible to change your mailing script to use more
>> meaningful subject lines?
>
> Sure.  What is preferable?  As short a sentence summarising the fixed
> issue as I can muster?

Yep. :)  It need not be a sentence (and should skip the full stop).
You can see some example subject lines by looking at the "shortlog"
from git or Linux release announcements or running
git log --oneline --no-merges.

Something like “tests: Use test_cmp when appropriate” would do.

> (Like SuSE Linux, we use quilt to manage and
> submit our patch stacks... git seems to require hosting the entire
> history of each project which is too heavyweight for the 1000's of
> packages we build - if git provides the means to store just the head
> of an upstream release branch along with our patch stacks on local
> disk, I would love to be proven wrong here).

The most general way:

 curl http://address/of/tarball.tar.gz | tar -xf - 
 git init *
 cd *
 git add .
 git commit -m "upstream release"
 ... use git like normal

You can automate some of those steps by

 wget http://address/of/tarball.tar.gz
 git init project
 cd project
 perl /usr/share/doc/git/contrib/fast-import/import-tars.perl tarball.tar.gz
 git checkout import-tars
 ... use git as usual

If upstream uses git, there is also the shallow-clone facility:

 git clone -b master --depth=1 git://repo.or.cz/git.git/
 cd git
 ... use git as usual, except history is cauterized

It has one rough edge you may run into: push is not supported.  If that
is a problem for you, let me know and maybe I can try to help fix it.

Honestly, I’m okay with quilt, too.  The main difference I notice is that
‘git diff’ uses the equivalent of the diff -p (--show-c-function)
option by default.

> Maybe in combination with the missing Signed-off-by: headers and
> unsuitable Subject headers I need to amend and resubmit the whole
> patch series again?

I think the cognitive load on reviewers is lighter if you send small,
isolated changes until you think it is as ready as it is going to get
for the current round, and only then resubmit the series.

Thanks for the hard work.
Jonathan

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
                   ` (16 preceding siblings ...)
  2010-04-27 15:30 ` [patch 00/16] Portability Patches for git-1.7.1 (v4) Michael J Gruber
@ 2010-04-28 10:12 ` Gary V. Vaughan
  17 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-28 10:12 UTC (permalink / raw)
  To: git

I forgot to provide this for the patch series:

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 06/16] diff-test_cmp.patch
  2010-04-28  9:51       ` Jonathan Nieder
@ 2010-04-28 10:22         ` Gary V. Vaughan
  2010-04-28 17:43           ` Jonathan Nieder
  0 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-28 10:22 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Jeff King

On Wed, Apr 28, 2010 at 04:51:59AM -0500, Jonathan Nieder wrote:
> I think one sign-off for the whole series would be good enough; then
> the person applying the patches can forge your signed-off-by lines.

Okay, done Thanks.

> Gary V. Vaughan wrote:
> > (Like SuSE Linux, we use quilt to manage and
> > submit our patch stacks... git seems to require hosting the entire
> > history of each project which is too heavyweight for the 1000's of
> > packages we build - if git provides the means to store just the head
> > of an upstream release branch along with our patch stacks on local
> > disk, I would love to be proven wrong here).
> 
> The most general way:
> 
>  curl http://address/of/tarball.tar.gz | tar -xf - 
>  git init *
>  cd *
>  git add .
>  git commit -m "upstream release"
>  ... use git like normal

D'oh.  Of course... I was too fixated on git clone to notice.

> You can automate some of those steps by
> 
>  wget http://address/of/tarball.tar.gz
>  git init project
>  cd project
>  perl /usr/share/doc/git/contrib/fast-import/import-tars.perl tarball.tar.gz
>  git checkout import-tars
>  ... use git as usual

What's happening here?  Is this sharing a single repository for all
locally hosted git projects, or is this more or less the same as the
above?

> If upstream uses git, there is also the shallow-clone facility:
> 
>  git clone -b master --depth=1 git://repo.or.cz/git.git/
>  cd git
>  ... use git as usual, except history is cauterized

This is probably the flavour that would be of the most use to us.
Thanks for educating me :)

> It has one rough edge you may run into: push is not supported.  If that
> is a problem for you, let me know and maybe I can try to help fix it.

No, I think the main benefit of using git locally would be to provide
a pull source for upstream.

> Honestly, I???m okay with quilt, too.  The main difference I notice is that
> ???git diff??? uses the equivalent of the diff -p (--show-c-function)
> option by default.

In /etc/quilt.quiltrc we have:

# Options passed to GNU diff when generating patches
QUILT_DIFF_OPTS="--show-c-function"

And I've been careful to regenerate a/b patches for submission to this
list, so the only difference then is that you can't pull the patches
from me when I use quilt.

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-28  9:19         ` Gary V. Vaughan
@ 2010-04-28 12:17           ` Jeff King
  0 siblings, 0 replies; 49+ messages in thread
From: Jeff King @ 2010-04-28 12:17 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: Andreas Schwab, Michael J Gruber, git

On Wed, Apr 28, 2010 at 09:19:22AM +0000, Gary V. Vaughan wrote:

> > > > Furthermore, if we do take such changes, how are we going to manage
> > > > portability going forward? Some constructs (like non-constant
> > > > initializers) make the code much easier to read. People _will_ submit
> > > > patches that use them. Is somebody going to be auto-building on all of
> > > > these platforms with vendor compilers to confirm that nothing is broken?
> 
> And that's fine.  People who are trying to build will notice the
> breakage on their platforms and likely submit patches in due course.

That was sort of implicit in my questions. _Is_ there somebody who is
going to be building on these platforms that will notice the breakage?

But it sounds from the rest of your mail like you are willing to do so,
which is at least encouraging.

-Peff

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-28  9:32   ` Gary V. Vaughan
@ 2010-04-28 12:26     ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 49+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-04-28 12:26 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: Michael J Gruber, git

On Wed, Apr 28, 2010 at 09:32, Gary V. Vaughan
<git@mlists.thewrittenword.com> wrote:
> I'm afraid not, though I can send you (off-list) a zip of the patch
> series and a quiltrc to apply using quilt or repeated calls to gnu
> potch, or if you prefer, a sumo-patch containing all the changes in
> one file for gnu patch?

I know of someone who'd like to test these on HP-UX, but it can be
hard to extract patches from the list:)

You can attach your patch series to the list with, e.g.:

    git format-patch --stdout -M origin.. > series.patch

Or maybe put up a forked repository somewhere, like on GitHub.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git.
  2010-04-28  8:55       ` Tor Arntsen
@ 2010-04-28 16:23         ` Jeff King
  0 siblings, 0 replies; 49+ messages in thread
From: Jeff King @ 2010-04-28 16:23 UTC (permalink / raw)
  To: Tor Arntsen; +Cc: Gary V. Vaughan, git

On Wed, Apr 28, 2010 at 10:55:54AM +0200, Tor Arntsen wrote:

> >> The patch is against master. Are we supposed to make patches against
> >> master or maint? (I thought I saw the latter somewhere. I'm pretty
> >> new in here though..)
> [...]
> Ok. That would correspond to master from git anyway. I make my patches
> against a git checkout, and I was just throwing out the question to
> the general audience, for my own knowledge.

The answer is that you should base your patch on whatever is the best
place for Junio to apply it. :)

For new feature work that will go into the next 3-number release (e.g.,
1.7.1), that should generally just go on 'master'.

For bugfixes that will be part of stable release (e.g., 1.7.0.7), they
should generally go right on top of the commit introducing the bug, and
can then be merged into whichever versions exhibit the bug. If it's not
a bugfix but rather a documentation or portability fix that should go to
maint, and doesn't necessarily have a specific commit to based on,
building on 'maint' is probably OK, which would be appropriate for the
next stable release. There is some benefit to going farther back if the
fix should be merged to multiple maint tracks (e.g., both 1.6.6.x and
1.7.0.x). I'm not sure how Junio decides which maint releases are "too
old" to care about.

It's almost never a good idea to base work on "next" as a whole.  It is
appropriate to base work on commits on a topic that is _in_ next, but
only if you are building on to that topic. Otherwise, we try to keep
topics independent (by building them on "master") so that they can be
merged independently as they mature.

For this particular patch set, "master" is probably a good starting
point. Portability fixes can often go to maint as described above, but
this particular patchset is more like feature work. It's big and
invasive, and it is not about fixing minor portability issues introduced
by recent commits, but rather is about porting to many brand new
platforms.

-Peff

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 06/16] diff-test_cmp.patch
  2010-04-28 10:22         ` Gary V. Vaughan
@ 2010-04-28 17:43           ` Jonathan Nieder
  0 siblings, 0 replies; 49+ messages in thread
From: Jonathan Nieder @ 2010-04-28 17:43 UTC (permalink / raw)
  To: Gary V. Vaughan; +Cc: git, Jeff King

Gary V. Vaughan wrote:
> On Wed, Apr 28, 2010 at 04:51:59AM -0500, Jonathan Nieder wrote:

>> The most general way:
[git init and git add . and git commit]
> D'oh.  Of course... I was too fixated on git clone to notice.
>
>> You can automate some of those steps by
>> 
>>  wget http://address/of/tarball.tar.gz
>>  git init project
>>  cd project
>>  perl /usr/share/doc/git/contrib/fast-import/import-tars.perl tarball.tar.gz
>>  git checkout import-tars
>>  ... use git as usual
>
> What's happening here?  Is this sharing a single repository for all
> locally hosted git projects, or is this more or less the same as the
> above?

It’s the same as the above.  The only advantages I can think of are that
it might be slightly faster (though I haven’t tested) and that this way
I don’t have to remember the tar --strip-components option.

You could share a single repository for all locally hosted git projects,
but that would kill the behavior of make.

>> If upstream uses git, there is also the shallow-clone facility:
>> 
>>  git clone -b master --depth=1 git://repo.or.cz/git.git/
>>  cd git
>>  ... use git as usual, except history is cauterized
>
> This is probably the flavour that would be of the most use to us.
> Thanks for educating me :)
>
>> It has one rough edge you may run into: push is not supported.  If that
>> is a problem for you, let me know and maybe I can try to help fix it.
>
> No, I think the main benefit of using git locally would be to provide
> a pull source for upstream.

Oh, that’s another rough edge (the same one, fundamentally).  Sorry.

Another benefit of using git to fetch from upstream is to get the latest
version.

Hope that helps,
Jonathan

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
       [not found]   ` <4BD94599.5090309@drmicha.warpmail.net>
@ 2010-04-29 10:50     ` Gary V. Vaughan
  0 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-04-29 10:50 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git

Hi Michael,

On Thu, Apr 29, 2010 at 10:38:49AM +0200, Michael J Gruber wrote:
> Michael J Gruber venit, vidit, dixit 27.04.2010 17:30:
> > I can't test your target platform, but I would test the impact of the
> > code and test changes on mine. Do you have your series somewhere to pull
> > from?
> 
> OK, unsurprsingly, tests still pass on Linux (Fedora 12 x86_64).
> If anyone wants to try, the series can be found at
> 
> git://repo.or.cz/git/mjg.git
> 
> in branch
> 
> gvv/platform-compatibility
> 
> applied cleanly on current master.

Thank you for taking care of that.  Much appreciated.

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-04-27 15:30 ` [patch 00/16] Portability Patches for git-1.7.1 (v4) Michael J Gruber
                     ` (3 preceding siblings ...)
       [not found]   ` <4BD94599.5090309@drmicha.warpmail.net>
@ 2010-05-01 18:34   ` Michael J Gruber
  2010-05-01 23:25     ` Junio C Hamano
  2010-05-02 13:00     ` Øyvind A. Holm
  4 siblings, 2 replies; 49+ messages in thread
From: Michael J Gruber @ 2010-05-01 18:34 UTC (permalink / raw)
  Cc: Gary V. Vaughan, git

[resent after vger recovery]
Michael J Gruber venit, vidit, dixit 27.04.2010 17:30:
> Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:
>> Here are the portability patches we needed at TWW to enable git-1.7.1
>> to compile and run on all of the wide range of Unix machines we
>> support.  These patches apply to the git-1.7.1 release,  and address
>> all of the feedback from the previous three times I posted them to
>> this list, including fixing the massive testsuite failures I was
>> experiencing and taking into account that the ss_family fixes and
>> partial GMT_CMP_TEST fixes that have been pushed since my last post of
>> this patch queue.
> 
> General remark: None of your patches have a s-o-b line. If you want to
> have your patches in git you are required to sign-off on them (commit
> -s) in order to certify that you can submit them under the license terms
> of the project.
> 
> Your diff -> test_cmp are certainly something we want to have in any
> case. The code changes look ugly, honestly, making the code much less
> readable, but it seems to be the only way to make those older platforms
> and compilers happy. (Erik pointed out some good ways to reduce the
> uglyness somewhat.)
> 
> I can't test your target platform, but I would test the impact of the
> code and test changes on mine. Do you have your series somewhere to pull
> from?

OK, unsurprsingly, tests still pass on Linux (Fedora 12 x86_64).
If anyone wants to try, the series can be found at

git://repo.or.cz/git/mjg.git

in branch

gvv/platform-compatibility

applied cleanly on current master.

Cheers,
Michael

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-05-01 18:34   ` Michael J Gruber
@ 2010-05-01 23:25     ` Junio C Hamano
  2010-05-03  1:48       ` Gary V. Vaughan
  2010-05-02 13:00     ` Øyvind A. Holm
  1 sibling, 1 reply; 49+ messages in thread
From: Junio C Hamano @ 2010-05-01 23:25 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Gary V. Vaughan, git

Michael J Gruber <git@drmicha.warpmail.net> writes:

> Michael J Gruber venit, vidit, dixit 27.04.2010 17:30:
>> Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:
>>> Here are the portability patches we needed at TWW to enable git-1.7.1
>>> to compile and run on all of the wide range of Unix machines we
>>> support.  These patches apply to the git-1.7.1 release,  and address
>>> all of the feedback from the previous three times I posted them to
>>> this list, including fixing the massive testsuite failures I was
>>> experiencing and taking into account that the ss_family fixes and
>>> partial GMT_CMP_TEST fixes that have been pushed since my last post of
>>> this patch queue.
>> 
>> General remark: None of your patches have a s-o-b line. If you want to
>> have your patches in git you are required to sign-off on them (commit
>> -s) in order to certify that you can submit them under the license terms
>> of the project.
>> 
>> Your diff -> test_cmp are certainly something we want to have in any
>> case. The code changes look ugly, honestly, making the code much less
>> readable, but it seems to be the only way to make those older platforms
>> and compilers happy. (Erik pointed out some good ways to reduce the
>> uglyness somewhat.)
>> 
>> I can't test your target platform, but I would test the impact of the
>> code and test changes on mine. Do you have your series somewhere to pull
>> from?
>
> OK, unsurprsingly, tests still pass on Linux (Fedora 12 x86_64).
> If anyone wants to try, the series can be found at
>
> git://repo.or.cz/git/mjg.git
>
> in branch
>
> gvv/platform-compatibility
>
> applied cleanly on current master.

Thanks.  

Like everybody else, I like the s/diff/test_cmp/ one in general.  On
platforms without "diff -u", test_cmp may want to use "diff -c" instead
for readability, but that can be fixed/enhanced independently.

I agree with your general remark and also noticed that the titles are way
suboptimal.

* user-cppflags.patch

  Makefile: pass CPPFLAGS through to fllow customization

* const-expr.patch

  Rewrite dynamic structure initializations to runtime assignment

* pthread.patch

  Makefile: -lpthread may still be necessary when libc has only pthread stubs

* Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git.

  enums: omit trailing comma for portability

* diff-export.patch

  Do not use "diff" found on PATH while building and installing

I think the change to git-merge-one-file.sh in this patch is wrong, by the
way.

* diff-test_cmp.patch

  tests: use "test_cmp", not "diff", when verifying the result

The patch to t9400 has indent-with-spaces, by the way.

* diff-defaults.patch

  test_cmp: do not use "diff -u" on platforms that lack one

It may be better to use "diff -c" on most of them, though.

* host-SunOS56.patch

  Makefile: SunOS 5.6 portability fix

* host-IRIX.patch

  git-compat-util.h: Irix 6.5 defines 'sgi' but not '__sgi'.

* host-HPUX10.patch

This would be better as two patches

  Makefile: HP-UX 10.20 lacks pread()
  git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition

* host-HPUX11.patch

  Makefile: HPUX does not have nanosecond timestamp in struct stat

* host-OSF1.patch

  Makefile: Tru64 portability fix

* no-hstrerror.patch

I think this should come before "Makefile: SunOS 5.6 portability fix"
(split the change to Makefile from this one and move it to the other
patch).  Then this patch does not talk about SunOS specific issues.

  Makefile: some platforms do not have hstrerror anywhere

* no-inet_ntop.patch

It might make sense to squash this patch into the previous one (and again
do this before HPUX patches to Makefile) that deals with three functions
that are traditionally related to libresolv (hstrerror, inet_ntop/pton).

  Make NO_{HSTRERROR,INET_NTOP,INET_PTON} configured independently

* no-socklen_t.patch

Do this before the platform dependent bits, i.e. move the hunks that
changes "ifeq ($(uname_S,XXX)" block from this patch to host-XXX patch,
and do the remainder of this patch before any of the platform ones.

  Some platforms lack socklen_t type

* no-inline.patch

Do this before ... (ditto) ...

  Allow disabling "inline"

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-05-01 18:34   ` Michael J Gruber
  2010-05-01 23:25     ` Junio C Hamano
@ 2010-05-02 13:00     ` Øyvind A. Holm
  1 sibling, 0 replies; 49+ messages in thread
From: Øyvind A. Holm @ 2010-05-02 13:00 UTC (permalink / raw)
  To: git; +Cc: Gary V. Vaughan, Michael J Gruber

On 1 May 2010 20:34, Michael J Gruber <git@drmicha.warpmail.net> wrote:
> Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:
> > Here are the portability patches we needed at TWW to enable git-1.7.1 to
> > compile and run on all of the wide range of Unix machines we support.
>
> OK, unsurprsingly, tests still pass on Linux (Fedora 12 x86_64).
> If anyone wants to try, the series can be found at
>
> git://repo.or.cz/git/mjg.git
>
> in branch
>
> gvv/platform-compatibility

The patches compiles fine and runs the test suite without errors on Ubuntu 9.10
(x86_64). Tested original branch (v1.7.1-16-ga32be36, branched on v1.7.1) and
rebase on current master (ddb27a5a)

Cheers,
Øyvind A. Holm

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 02/16] const-expr.patch
       [not found]   ` <1AFA5FB2-EB8B-4775-8941-86428C7F740E@gmail.com>
@ 2010-05-03  1:39     ` Gary V. Vaughan
       [not found]       ` <A4E8B513-AD31-4F3B-9DEF-6A85AA8DC7B3@gmail.com>
  0 siblings, 1 reply; 49+ messages in thread
From: Gary V. Vaughan @ 2010-05-03  1:39 UTC (permalink / raw)
  To: Joshua Juran; +Cc: git

Hi Joshua,

On Sat, May 01, 2010 at 03:21:24AM -0700, Joshua Juran wrote:
> On Apr 27, 2010, at 6:57 AM, Gary V. Vaughan wrote:
> 
> > Index: b/remote.c
> > ===================================================================
> > --- a/remote.c
> > +++ b/remote.c
> > @@ -657,10 +657,9 @@ static struct refspec *parse_refspec_int
> >
> >  int valid_fetch_refspec(const char *fetch_refspec_str)
> >  {
> > -	const char *fetch_refspec[] = { fetch_refspec_str };
> >  	struct refspec *refspec;
> >
> > -	refspec = parse_refspec_internal(1, fetch_refspec, 1, 1);
> > +	refspec = parse_refspec_internal(1, &fetch_refspec_str, 1, 1);
> >  	free_refspecs(refspec, 1);
> >  	return !!refspec;
> >  }
> 
> I'm the author of this patch.

I don't follow this list, and made this patch independently without
reference to yours.

However, attribution doesn't concern me, and I don't mean to tread on
toes... so feel free to reassign attribution on push.

> Signed-off-by: Joshua Juran <jjuran@gmail.com>

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 00/16] Portability Patches for git-1.7.1 (v4)
  2010-05-01 23:25     ` Junio C Hamano
@ 2010-05-03  1:48       ` Gary V. Vaughan
  0 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-05-03  1:48 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Michael J Gruber, git

Hi Michael,

Thanks for putting up a public repo of those patches; much
appreciated.

On Sat, May 01, 2010 at 04:25:12PM -0700, Junio C Hamano wrote:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> > Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:
> > > Here are the portability patches we needed at TWW to enable git-1.7.1
> > > to compile and run on all of the wide range of Unix machines we
> > > support. [[...]]
> >
> > OK, unsurprsingly, tests still pass on Linux (Fedora 12 x86_64).
> > If anyone wants to try, the series can be found at
> >
> > git://repo.or.cz/git/mjg.git
> >
> > in branch
> >
> > gvv/platform-compatibility
> >
> > applied cleanly on current master.
> 
> Thanks.  

Hi Junio,

> Like everybody else, I like the s/diff/test_cmp/ one in general.  On
> platforms without "diff -u", test_cmp may want to use "diff -c" instead
> for readability, but that can be fixed/enhanced independently.
> 
> I agree with your general remark and also noticed that the titles are way
> suboptimal.

I think this is my first patch series submission to the git list, but
in any case I just used used the patch file-names as is my habit for
locally maintained patchsets.

Thanks for suggesting better title, which I've already adopted into my
local tree.  If upstream integration stalls, or if it will help smooth
integration, I'll make the merging and reordering adjustments you
request and resubmit the whole queue.

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch 02/16] const-expr.patch
       [not found]       ` <A4E8B513-AD31-4F3B-9DEF-6A85AA8DC7B3@gmail.com>
@ 2010-05-04  5:01         ` Gary V. Vaughan
  0 siblings, 0 replies; 49+ messages in thread
From: Gary V. Vaughan @ 2010-05-04  5:01 UTC (permalink / raw)
  To: Joshua Juran; +Cc: Gary V. Vaughan, git

Hi Josh,

On Sun, May 02, 2010 at 10:57:40PM -0700, Joshua Juran wrote:
> On May 2, 2010, at 6:39 PM, Gary V. Vaughan wrote:
> 
> > On Sat, May 01, 2010 at 03:21:24AM -0700, Joshua Juran wrote:
> >> On Apr 27, 2010, at 6:57 AM, Gary V. Vaughan wrote:
> >>
> >>> Index: b/remote.c
> >>> ===================================================================
> >>> --- a/remote.c
> >>> +++ b/remote.c
> >>> @@ -657,10 +657,9 @@ static struct refspec *parse_refspec_int
> >>>
> >>>  int valid_fetch_refspec(const char *fetch_refspec_str)
> >>>  {
> >>> -	const char *fetch_refspec[] = { fetch_refspec_str };
> >>>  	struct refspec *refspec;
> >>>
> >>> -	refspec = parse_refspec_internal(1, fetch_refspec, 1, 1);
> >>> +	refspec = parse_refspec_internal(1, &fetch_refspec_str, 1, 1);
> >>>  	free_refspecs(refspec, 1);
> >>>  	return !!refspec;
> >>>  }
> >>
> >> I'm the author of this patch.

Agreed.

> > I don't follow this list, and made this patch independently without
> > reference to yours.
> 
> You sent a different patch to the list, to which I responded[1] (both  
> to the list and to you directly) with one identical to the one shown  
> above, after which your subsequent patches included a change equal to  
> the one I suggested.  If in fact you came up with it independently,  
> that's fine.  I was just under the impression that you had adopted my  
> change.

Apologies, yes you're quite right.  Either my age, or the vast sea of
patches for all the projects I'm porting at the moment somehow erased
that important exchange from my memory. I hope I didn't cause offence,
none was intended.

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2010-05-04  5:02 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-27 13:57 [patch 00/16] Portability Patches for git-1.7.1 (v4) Gary V. Vaughan
2010-04-27 13:57 ` [patch 01/16] user-cppflags.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 02/16] const-expr.patch Gary V. Vaughan
2010-04-27 14:08   ` Erik Faye-Lund
2010-04-27 14:32     ` Gary V. Vaughan
     [not found]   ` <1AFA5FB2-EB8B-4775-8941-86428C7F740E@gmail.com>
2010-05-03  1:39     ` Gary V. Vaughan
     [not found]       ` <A4E8B513-AD31-4F3B-9DEF-6A85AA8DC7B3@gmail.com>
2010-05-04  5:01         ` Gary V. Vaughan
2010-04-27 13:57 ` [patch 03/16] pthread.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 04/16] Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git Gary V. Vaughan
2010-04-27 16:08   ` Tor Arntsen
2010-04-28  8:40     ` Gary V. Vaughan
2010-04-28  8:55       ` Tor Arntsen
2010-04-28 16:23         ` Jeff King
2010-04-27 13:57 ` [patch 05/16] diff-export.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 06/16] diff-test_cmp.patch Gary V. Vaughan
2010-04-27 17:15   ` Jonathan Nieder
2010-04-28  9:00     ` Gary V. Vaughan
2010-04-28  9:51       ` Jonathan Nieder
2010-04-28 10:22         ` Gary V. Vaughan
2010-04-28 17:43           ` Jonathan Nieder
2010-04-27 13:57 ` [patch 07/16] diff-defaults.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 08/16] host-SunOS56.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 09/16] host-IRIX.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 10/16] host-HPUX10.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 11/16] host-HPUX11.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 12/16] host-OSF1.patch Gary V. Vaughan
2010-04-27 14:10   ` Tor Arntsen
2010-04-27 14:39     ` Gary V. Vaughan
2010-04-27 14:48       ` Tor Arntsen
2010-04-28  9:07         ` Gary V. Vaughan
2010-04-27 13:57 ` [patch 13/16] no-hstrerror.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 14/16] no-inet_ntop.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 15/16] no-socklen_t.patch Gary V. Vaughan
2010-04-27 13:57 ` [patch 16/16] no-inline.patch Gary V. Vaughan
2010-04-27 15:30 ` [patch 00/16] Portability Patches for git-1.7.1 (v4) Michael J Gruber
2010-04-27 17:54   ` Jeff King
2010-04-27 20:13     ` Andreas Schwab
2010-04-28  2:08       ` Jeff King
2010-04-28  9:19         ` Gary V. Vaughan
2010-04-28 12:17           ` Jeff King
2010-04-28  9:27   ` Gary V. Vaughan
2010-04-28  9:32   ` Gary V. Vaughan
2010-04-28 12:26     ` Ævar Arnfjörð Bjarmason
     [not found]   ` <4BD94599.5090309@drmicha.warpmail.net>
2010-04-29 10:50     ` Gary V. Vaughan
2010-05-01 18:34   ` Michael J Gruber
2010-05-01 23:25     ` Junio C Hamano
2010-05-03  1:48       ` Gary V. Vaughan
2010-05-02 13:00     ` Øyvind A. Holm
2010-04-28 10:12 ` Gary V. Vaughan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.