Skip to contentSkip to conversation

Portability Patches for git-1.7.1 (v4)

PATCH Superseded Gary V. Vaughan 11 participants 49 messages Jun 15, 2016 3 messages not in the archive

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover Portability Patches for git-1.7.1 (v4)

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#1 lore raw

PATCH 1/16 user-cppflags.patch

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(-)
Makefile +1 -1
Index: b/Makefile
===================================================================
@@ -246,7 +246,7 @@ endif
 
 CFLAGS = -g -O2 -Wall
 LDFLAGS =
-ALL_CFLAGS = $(CFLAGS)
+ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
 STRIP ?= strip
 
config.mak.in +1 -0
Index: b/config.mak.in
===================================================================
@@ -3,6 +3,7 @@
 
 CC = @CC@
 CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 CC_LD_DYNPATH = @CC_LD_DYNPATH@
 AR = @AR@
Signature · 1 line
Gary V. Vaughan ([email protected])
#2 lore raw

PATCH 2/16 const-expr.patch

In reply to Gary V. Vaughan

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(-)
convert.c +3 -1
Index: 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;
remote.c +1 -2
Index: 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;
 }
unpack-trees.c +3 -1
Index: 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) {
daemon.c +10 -9
Index: 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);
wt-status.c +12 -11
Index: 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);
ll-merge.c +7 -7
Index: 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);
 
builtin/commit.c +2 -1
Index: 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,
builtin/remote.c +6 -3
Index: 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);
 
builtin/blame.c +6 -4
Index: 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.
 	 */
builtin/cat-file.c +3 -1
Index: 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);
 		}
 
refs.c +5 -1
Index: 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);
 }
 
builtin/add.c +3 -1
Index: 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)
builtin/checkout.c +2 -1
Index: 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;
builtin/fetch.c +4 -2
Index: 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) {
Signature · 1 line
Gary V. Vaughan ([email protected])
#3 lore raw

Re: [patch 02/16] const-expr.patch

unpack-trees.c static void add_same_unmerged(struct cac · line 290

Quoted 10 lines · Gary V. Vaughan

Index: b/unpack-trees.c
===================================================================

unpack-trees.c +1 -1
@@ -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.

builtin/commit.c static int prepare_to_commit(const char · line 720

Quoted 10 lines

Index: b/builtin/commit.c
===================================================================

builtin/commit.c +1 -1
@@ -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?

builtin/cat-file.c static int cat_one_file(int opt, const c · line 121

Quoted 10 lines

Index: b/builtin/cat-file.c
===================================================================

builtin/cat-file.c +1 -1
@@ -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.

Signature · 1 line
Erik "kusma" Faye-Lund
#4 lore raw

Re: [patch 02/16] const-expr.patch

Quoted 16 lines · Erik Faye-Lund

unpack-trees.c static void add_same_unmerged(struct cac · line 290

Quoted 10 lines · Gary V. Vaughan

Index: b/unpack-trees.c
===================================================================

unpack-trees.c +1 -1
@@ -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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#9 lore raw

PATCH 3/16 pthread.patch

In reply to Gary V. Vaughan

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(-)
Makefile +4 -0
Index: 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
configure.ac +15 -2
Index: 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)
 
config.mak.in +1 -0
Index: 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@
Signature · 1 line
Gary V. Vaughan ([email protected])
#10 lore raw

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

In reply to Gary V. Vaughan

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(-)
attr.h +1 -1
Index: 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 *);
 
builtin/apply.c +2 -2
Index: 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;
 
 
builtin/branch.c +2 -2
Index: 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];
 
builtin/commit.c +3 -3
Index: 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)
builtin/help.c +1 -1
Index: 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;
builtin/mailinfo.c +2 -2
Index: 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;
builtin/receive-pack.c +1 -1
Index: 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;
builtin/remote.c +1 -1
Index: 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;
 };
 
cache.h +8 -8
Index: 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 */
commit.h +1 -1
Index: 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
connect.c +1 -1
Index: 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)
ctype.c +1 -1
Index: 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] = {
diff.h +1 -1
Index: 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) \
dir.c +3 -3
Index: 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,
fast-import.c +1 -1
Index: 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
grep.h +4 -4
Index: 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 {
http-push.c +1 -1
Index: b/http-push.c
===================================================================
@@ -105,7 +105,7 @@ enum transfer_state {
 	RUN_PUT,
 	RUN_MOVE,
 	ABORTED,
-	COMPLETE,
+	COMPLETE
 };
 
 struct transfer_request
http-walker.c +1 -1
Index: b/http-walker.c
===================================================================
@@ -15,7 +15,7 @@ enum object_request_state {
 	WAITING,
 	ABORTED,
 	ACTIVE,
-	COMPLETE,
+	COMPLETE
 };
 
 struct object_request
imap-send.c +1 -1
Index: b/imap-send.c
===================================================================
@@ -230,7 +230,7 @@ enum CAPABILITY {
 	LITERALPLUS,
 	NAMESPACE,
 	STARTTLS,
-	AUTH_CRAM_MD5,
+	AUTH_CRAM_MD5
 };
 
 static const char *cap_list[] = {
merge-recursive.h +1 -1
Index: 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;
parse-options.h +3 -3
Index: 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
 };
 
 /*
pretty.c +1 -1
Index: 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]) {
remote.h +1 -1
Index: 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 */
rerere.c +1 -1
Index: 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;
revision.c +1 -1
Index: 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)
wt-status.h +1 -1
Index: 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 {
Signature · 1 line
Gary V. Vaughan ([email protected])
Tested-by on v1 4/16
#11 lore raw

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.

Quoted 30 lines · Gary V. Vaughan

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 +-
Quoted 8 lines
 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:

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):

Quoted 1 line

From a8989213b4c8baa53c14c1f227b916910265c517 Mon Sep 17 00:00:00 2001

From: Tor Arntsen <[email protected]>
Date: Tue, 27 Apr 2010 16:05:12 +0000
Subject: [PATCH 2/2] C99 comments changed to old-style C comments

---
 builtin/blame.c        |    2 +-
 builtin/for-each-ref.c |    4 ++--
 remote.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
builtin/blame.c +1 -1
index fc15863..4dd4c3f 100644
@@ -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);
builtin/for-each-ref.c +2 -2
index 62be1bb..7f5011f 100644
@@ -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);
remote.c +1 -1
index c70181c..26ce560 100644
@@ -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;
Signature · 1 line
1.7.1.rc1.GIT
#12 lore raw

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.

Quoted 8 lines · Tor Arntsen
Quoted 7 lines · Gary V. Vaughan

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.

Quoted 7 lines
Quoted 3 lines

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
Quoted 5 lines

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:

Thanks for testing.

Quoted 6 lines

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.

Quoted 2 lines

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.

Quoted 2 lines

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).

Quoted 2 lines

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.

Quoted 3 lines

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.

Quoted 11 lines

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

---
 builtin/blame.c        |    2 +-
 builtin/for-each-ref.c |    4 ++--
 remote.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Cheers,

Signature · 1 line
Gary V. Vaughan ([email protected])
#13 lore raw

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.

Quoted 12 lines · Gary V. Vaughan
Quoted 11 lines · Tor Arntsen
Quoted 10 lines · Gary V. Vaughan

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.

Quoted 8 lines
Quoted 3 lines

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.

Quoted 5 lines

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.

[..]

Quoted 8 lines
Quoted 3 lines

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).

Quoted 2 lines

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

Quoted 13 lines
Quoted 11 lines

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

---
 builtin/blame.c        |    2 +-
 builtin/for-each-ref.c |    4 ++--
 remote.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Cheers,

#14 lore raw

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.

Quoted 7 lines · Tor Arntsen
Quoted 3 lines
Quoted 3 lines

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

#15 lore raw

PATCH 5/16 diff-export.patch

In reply to Gary V. Vaughan

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(-)
Makefile +3 -1
Index: 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)))'\' >>$@
configure.ac +1 -0
Index: 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
Documentation/install-webdoc.sh +1 -1
Index: 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
git-merge-one-file.sh +1 -1
Index: 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
config.mak.in +1 -0
Index: 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@
 
Signature · 1 line
Gary V. Vaughan ([email protected])
#16 lore raw

PATCH 6/16 diff-test_cmp.patch

In reply to Gary V. Vaughan

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(-)
t/t0000-basic.sh +1 -1
Index: 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.' \
t/t3200-branch.sh +2 -2
Index: 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 &&
t/t3210-pack-refs.sh +4 -4
Index: 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
t/t4002-diff-basic.sh +1 -1
Index: 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 \
t/t4124-apply-ws-rule.sh +5 -5
Index: 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
 
 '
 
t/t5300-pack-object.sh +3 -3
Index: 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
 
t/t5510-fetch.sh +1 -1
Index: 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' '
 
t/t5520-pull.sh +1 -1
Index: 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' '
t/t5700-clone-reference.sh +4 -4
Index: 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"
 
t/t6000lib.sh +1 -1
Index: 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
t/t6001-rev-list-graft.sh +1 -1
Index: 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
t/t6022-merge-rename.sh +2 -2
Index: 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
 	}
t/t7002-grep.sh +8 -8
Index: 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)" '
t/t7005-editor.sh +3 -3
Index: 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
 
t/t9200-git-cvsexportcommit.sh +13 -13
Index: 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 \
t/t9400-git-cvsserver-server.sh +1 -1
Index: 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)"
 '
t/t3903-stash.sh +1 -1
Index: 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) &&
t/t4127-apply-same-fn.sh +3 -3
Index: 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.' '
t/Makefile +4 -0
Index: 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))
 
Signature · 1 line
Gary V. Vaughan ([email protected])
Reviewed-by on v1 6/16
#17 lore raw

Re: [patch 06/16] diff-test_cmp.patch

Hi,

Quoted 7 lines · Gary V. Vaughan

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.

t/t0000-basic.sh $expectfilter >expected <<\EOF · line 283

Quoted 8 lines
t/t0000-basic.sh +1 -1
@@ -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?

t/t4124-apply-ws-rule.sh test_fix () { · line 50

Quoted 11 lines
t/t4124-apply-ws-rule.sh +1 -1
@@ -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.

Quoted 6 lines
t/Makefile +0 -0
@@ -6,10 +6,14 @@
 -include ../config.mak
 
 #GIT_TEST_OPTS=--verbose --debug

t/Makefile line 18

Quoted 10 lines
t/Makefile +4 -0
+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,

Thanks.

#18 lore raw

Re: [patch 06/16] diff-test_cmp.patch

Quoted 6 lines · Jonathan Nieder

Hi,

Quoted 2 lines · Gary V. Vaughan

Subject: diff-test_cmp.patch

Quoted 7 lines
Quoted 5 lines

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?

Quoted 2 lines

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).

Quoted 4 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?

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.

Quoted 16 lines

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

t/t0000-basic.sh $expectfilter >expected <<\EOF · line 283

Quoted 8 lines
t/t0000-basic.sh +1 -1
@@ -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?

Quoted 8 lines

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?

Quoted 5 lines
t/t4124-apply-ws-rule.sh +0 -0
@@ -44,7 +44,7 @@ test_fix () {
 	apply_patch --whitespace=fix || return 1
 
Quoted 8 lines

t/t4124-apply-ws-rule.sh test_fix () { · line 50

Quoted 6 lines
t/t4124-apply-ws-rule.sh +1 -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.

Quoted 2 lines

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.

Quoted 11 lines
Quoted 11 lines
t/Makefile +1 -0
@@ -6,10 +6,14 @@
 -include ../config.mak
 
 #GIT_TEST_OPTS=--verbose --debug
+GIT_TEST_CMP ?= $(DIFF)
 SHELL_PATH ?= $(SHELL)
 TAR ?= $(TAR)
 RM ?= rm -f
 
Quoted 9 lines

t/Makefile line 18

Quoted 5 lines
t/Makefile +3 -0
+# 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.

Quoted 1 line

Much appreciated!

Cheers,

Signature · 1 line
Gary V. Vaughan ([email protected])
#19 lore raw

Re: [patch 06/16] diff-test_cmp.patch

Quoted 2 lines · Gary V. Vaughan

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.

Quoted 7 lines · Jonathan Nieder
Quoted 3 lines

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.

Quoted 6 lines

(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.

Quoted 3 lines

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

#20 lore raw

Re: [patch 06/16] diff-test_cmp.patch

Quoted 2 lines · Jonathan Nieder

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.

Quoted 8 lines
Quoted 6 lines · Gary V. Vaughan

(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).

Quoted 8 lines

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.

Quoted 8 lines

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?

Quoted 5 lines

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 :)

Quoted 2 lines

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.

Quoted 3 lines

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#21 lore raw

Re: [patch 06/16] diff-test_cmp.patch

Quoted 3 lines · Gary V. Vaughan
Quoted 1 line · Jonathan Nieder

The most general way:

[git init and git add . and git commit]

Quoted 11 lines

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

Quoted 8 lines

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

Quoted 3 lines

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.

Quoted 6 lines
Quoted 5 lines

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

Quoted 8 lines

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

Quoted 2 lines

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

#22 lore raw

PATCH 7/16 diff-defaults.patch

In reply to Gary V. Vaughan

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(+)
Makefile +5 -0
Index: 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
t/Makefile +1 -0
Index: 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
Signature · 1 line
Gary V. Vaughan ([email protected])
#23 lore raw

PATCH 8/16 host-SunOS56.patch

In reply to Gary V. Vaughan

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(+)
Makefile +10 -0
Index: 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
Signature · 1 line
Gary V. Vaughan ([email protected])
#24 lore raw

PATCH 9/16 host-IRIX.patch

In reply to Gary V. Vaughan

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(-)
git-compat-util.h +2 -1
Index: 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
Signature · 1 line
Gary V. Vaughan ([email protected])
#25 lore raw

PATCH 10/16 host-HPUX10.patch

In reply to Gary V. Vaughan

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(-)
Makefile +3 -0
Index: 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)
git-compat-util.h +4 -1
Index: 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
Signature · 1 line
Gary V. Vaughan ([email protected])
#26 lore raw

PATCH 11/16 host-HPUX11.patch

In reply to Gary V. Vaughan

There is no nanosecond field on HPUX.

---
 Makefile |    1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
Index: 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
Signature · 1 line
Gary V. Vaughan ([email protected])
#27 lore raw

PATCH 12/16 host-OSF1.patch

In reply to Gary V. Vaughan

Add defaults for Tru64 Unix. Without this patch I cannot compile git on Tru64 5.1.

---
 Makefile |    6 ++++++
 1 file changed, 6 insertions(+)
Makefile +6 -0
Index: 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
Signature · 1 line
Gary V. Vaughan ([email protected])
#28 lore raw

Re: [patch 12/16] host-OSF1.patch

Quoted 11 lines · Gary V. Vaughan

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
===================================================================

Makefile EXTLIBS = · line 742

Quoted 9 lines
Makefile +6 -0
@@ -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

#29 lore raw

Re: [patch 12/16] host-OSF1.patch

Quoted 16 lines · Tor Arntsen
Quoted 14 lines · Gary V. Vaughan

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
===================================================================

Makefile +0 -0
@@ -734,6 +734,12 @@ EXTLIBS =

?# because maintaining the nesting to match is a pain. ?If ?# we had "elif" things would have been much nicer...

Quoted 8 lines

Makefile

Quoted 6 lines
Makefile +6 -0
+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 :)

Quoted 8 lines

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.

Quoted 4 lines

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
Acked-by
#30 lore raw

Re: [patch 12/16] host-OSF1.patch

Quoted 11 lines · Gary V. Vaughan
Quoted 8 lines · Tor Arntsen

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

Quoted 2 lines

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:

Quoted 2 lines

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.

Quoted 5 lines
Quoted 4 lines

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.

Quoted 7 lines

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 ([email protected])

-Tor

#31 lore raw

Re: [patch 12/16] host-OSF1.patch

Quoted 13 lines · Tor Arntsen
Quoted 11 lines · Gary V. Vaughan
Quoted 8 lines · Tor Arntsen

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

Quoted 7 lines
Quoted 2 lines

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:

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

Quoted 8 lines
Quoted 2 lines

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#32 lore raw

PATCH 13/16 no-hstrerror.patch

In reply to Gary V. Vaughan

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(-)
configure.ac +14 -3
Index: 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"
 
Makefile +1 -0
Index: 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
config.mak.in +1 -0
Index: 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@
Signature · 1 line
Gary V. Vaughan ([email protected])
#33 lore raw

PATCH 14/16 no-inet_ntop.patch

In reply to Gary V. Vaughan

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(-)
Makefile +6 -0
Index: 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
configure.ac +30 -8
Index: 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.
config.mak.in +2 -0
Index: 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@
Signature · 1 line
Gary V. Vaughan ([email protected])
#34 lore raw

PATCH 15/16 no-socklen_t.patch

In reply to Gary V. Vaughan

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(+)
Makefile +10 -0
Index: 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)
configure.ac +6 -0
Index: 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=],
config.mak.in +1 -0
Index: 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@
aclocal.m4 new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
Gary V. Vaughan ([email protected])
#35 lore raw

PATCH 16/16 no-inline.patch

In reply to Gary V. Vaughan

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(+)
Makefile +10 -0
Index: 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
configure.ac +6 -0
Index: 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}"
config.mak.in +1 -0
Index: 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@
Signature · 1 line
Gary V. Vaughan ([email protected])
#37 lore raw
In reply to Gary V. Vaughan

Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:

Quoted 8 lines

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

#38 lore raw
Quoted 5 lines · Michael J Gruber

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

#39 lore raw
Quoted 5 lines · Jeff King

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.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#40 lore raw
Quoted 9 lines · Andreas Schwab
Quoted 5 lines · Jeff King

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

#41 lore raw

Hi Jeff,

Quoted 8 lines · Jeff King
Quoted 7 lines · Andreas Schwab
Quoted 5 lines · Jeff King

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...

Quoted 7 lines
Quoted 1 line

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#42 lore raw
Quoted 8 lines · Gary V. Vaughan
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

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

#43 lore raw
In reply to Michael J Gruber

Hi Michael,

Quoted 10 lines · Michael J Gruber

Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:

Quoted 8 lines

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.

Quoted 4 lines

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?

Quoted 5 lines

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.

Quoted 3 lines

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#44 lore raw
In reply to Michael J Gruber

Hi Michael,

Quoted 10 lines · Michael J Gruber

Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:

Quoted 8 lines

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.

Quoted 4 lines

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?

Quoted 5 lines

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.

Quoted 3 lines

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#45 lore raw
Quoted 4 lines · Gary V. Vaughan

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.

#47 lore raw
In reply to a message not in the archive

Hi Michael,

Quoted 8 lines · Michael J Gruber

Michael J Gruber venit, vidit, dixit 27.04.2010 17:30:

Quoted 3 lines

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

Quoted 7 lines

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#6 lore raw

Re: [patch 02/16] const-expr.patch

In reply to a message not in the archive

Hi Joshua,

Quoted 13 lines · Joshua Juran
Quoted 11 lines · Gary V. Vaughan

Index: b/remote.c
===================================================================

remote.c +0 -1
@@ -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;
 
Quoted 7 lines

remote.c static struct refspec *parse_refspec_int · line 665

Quoted 5 lines
remote.c +1 -1
-	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.

Quoted 1 line

Cheers,

Signature · 1 line
Gary V. Vaughan ([email protected])
#8 lore raw

Re: [patch 02/16] const-expr.patch

In reply to a message not in the archive

Hi Josh,

Quoted 16 lines · Joshua Juran
Quoted 14 lines · Gary V. Vaughan
Quoted 13 lines · Joshua Juran
Quoted 11 lines · Gary V. Vaughan

Index: b/remote.c
===================================================================

remote.c +0 -1
@@ -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;
 
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

remote.c static struct refspec *parse_refspec_int · line 665

Quoted 5 lines
remote.c +1 -1
-	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.

Quoted 9 lines
Quoted 2 lines

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#48 lore raw
In reply to Michael J Gruber

[resent after vger recovery]
Michael J Gruber venit, vidit, dixit 27.04.2010 17:30:

Quoted 21 lines

Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:

Quoted 8 lines

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.)

Quoted 3 lines

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

#49 lore raw
Quoted 29 lines · Michael J Gruber

Michael J Gruber venit, vidit, dixit 27.04.2010 17:30:

Quoted 21 lines

Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:

Quoted 8 lines

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.)

Quoted 3 lines

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

Quoted 7 lines

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"

#50 lore raw

Hi Michael,

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

Quoted 11 lines · Junio C Hamano
Quoted 10 lines · Michael J Gruber

Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:

Quoted 3 lines

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

Quoted 7 lines
Quoted 5 lines

in branch

gvv/platform-compatibility

applied cleanly on current master.

Thanks.

Hi Junio,

Quoted 6 lines

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,

Signature · 1 line
Gary V. Vaughan ([email protected])
#51 lore raw
In reply to Michael J Gruber
Quoted 4 lines · Michael J Gruber

Gary V. Vaughan venit, vidit, dixit 27.04.2010 15:57:

Quoted 2 lines

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.

Quoted 8 lines

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