From: Junio C Hamano Date: Sun, 25 Nov 2007 00:31:25 +0000 (-0800) Subject: Merge branch 'js/mingw-fallouts' X-Git-Tag: v1.5.4-rc0~154 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ab002e34e26c39a716dc80359450f739ba907122?ds=inline;hp=-c Merge branch 'js/mingw-fallouts' * js/mingw-fallouts: fetch-pack: Prepare for a side-band demultiplexer in a thread. rehabilitate some t5302 tests on 32-bit off_t machines Allow ETC_GITCONFIG to be a relative path. Introduce git_etc_gitconfig() that encapsulates access of ETC_GITCONFIG. Allow a relative builtin template directory. Close files opened by lock_file() before unlinking. builtin run_command: do not exit with -1. Move #include and to git-compat-util.h. Use is_absolute_path() in sha1_file.c. Skip t3902-quoted.sh if the file system does not support funny names. t5302-pack-index: Skip tests of 64-bit offsets if necessary. t7501-commit.sh: Not all seds understand option -i t5300-pack-object.sh: Split the big verify-pack test into smaller parts. --- ab002e34e26c39a716dc80359450f739ba907122 diff --combined Makefile index 7a0ee780dc,817f3c7ba9..bcf1e9eb29 --- a/Makefile +++ b/Makefile @@@ -221,7 -221,7 +221,7 @@@ SCRIPT_SH = git-sh-setup.sh \ git-am.sh \ git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \ - git-merge-resolve.sh git-merge-ours.sh \ + git-merge-resolve.sh \ git-lost-found.sh git-quiltimport.sh git-submodule.sh \ git-filter-branch.sh \ git-stash.sh @@@ -353,7 -353,6 +353,7 @@@ BUILTIN_OBJS = builtin-mailsplit.o \ builtin-merge-base.o \ builtin-merge-file.o \ + builtin-merge-ours.o \ builtin-mv.o \ builtin-name-rev.o \ builtin-pack-objects.o \ @@@ -417,17 -416,18 +417,17 @@@ ifeq ($(uname_S),SunOS NO_STRCASESTR = YesPlease NO_MEMMEM = YesPlease NO_HSTRERROR = YesPlease + NO_MKDTEMP = YesPlease ifeq ($(uname_R),5.8) NEEDS_LIBICONV = YesPlease NO_UNSETENV = YesPlease NO_SETENV = YesPlease - NO_MKDTEMP = YesPlease NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease endif ifeq ($(uname_R),5.9) NO_UNSETENV = YesPlease NO_SETENV = YesPlease - NO_MKDTEMP = YesPlease NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease endif @@@ -754,7 -754,7 +754,7 @@@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_ LIBS = $(GITLIBS) $(EXTLIBS) BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \ - -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $(COMPAT_CFLAGS) + $(COMPAT_CFLAGS) LIB_OBJS += $(COMPAT_OBJS) ALL_CFLAGS += $(BASIC_CFLAGS) @@@ -903,6 -903,9 +903,9 @@@ exec_cmd.o: exec_cmd.c GIT-CFLAG builtin-init-db.o: builtin-init-db.c GIT-CFLAGS $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $< + config.o: config.c GIT-CFLAGS + $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $< + http.o: http.c GIT-CFLAGS $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $< diff --combined git-compat-util.h index 86c8962966,e83195bde5..79eb10eacb --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -4,24 -4,10 +4,24 @@@ #define _FILE_OFFSET_BITS 64 #ifndef FLEX_ARRAY -#if defined(__GNUC__) && (__GNUC__ < 3) -#define FLEX_ARRAY 0 -#else -#define FLEX_ARRAY /* empty */ +/* + * See if our compiler is known to support flexible array members. + */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define FLEX_ARRAY /* empty */ +#elif defined(__GNUC__) +# if (__GNUC__ >= 3) +# define FLEX_ARRAY /* empty */ +# else +# define FLEX_ARRAY 0 /* older GNU extension */ +# endif +#endif + +/* + * Otherwise, default to safer but a bit wasteful traditional style + */ +#ifndef FLEX_ARRAY +# define FLEX_ARRAY 1 #endif #endif @@@ -34,7 -20,6 +34,7 @@@ #endif #define MSB(x, bits) ((x) & TYPEOF(x)(~0ULL << (sizeof(x) * 8 - (bits)))) +#define HAS_MULTI_BITS(i) ((i) & ((i) - 1)) /* checks if an integer has more than 1 bit set */ /* Approximation of the length of the decimal representation of this type. */ #define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) @@@ -67,6 -52,8 +67,8 @@@ #include #include #include + #include + #include #include #include #include diff --combined git.c index 80c2f14a8b,37d99d6f50..51ee647295 --- a/git.c +++ b/git.c @@@ -256,7 -256,7 +256,7 @@@ static int run_command(struct cmd_struc status = p->fn(argc, argv, prefix); if (status) - return status; + return status & 0xff; /* Somebody closed stdout? */ if (fstat(fileno(stdout), &st)) @@@ -325,7 -325,6 +325,7 @@@ static void handle_internal_command(in { "mailsplit", cmd_mailsplit }, { "merge-base", cmd_merge_base, RUN_SETUP }, { "merge-file", cmd_merge_file }, + { "merge-ours", cmd_merge_ours, RUN_SETUP }, { "mv", cmd_mv, RUN_SETUP | NEED_WORK_TREE }, { "name-rev", cmd_name_rev, RUN_SETUP }, { "pack-objects", cmd_pack_objects, RUN_SETUP }, @@@ -339,7 -338,7 +339,7 @@@ { "rerere", cmd_rerere, RUN_SETUP }, { "reset", cmd_reset, RUN_SETUP }, { "rev-list", cmd_rev_list, RUN_SETUP }, - { "rev-parse", cmd_rev_parse, RUN_SETUP }, + { "rev-parse", cmd_rev_parse }, { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE }, { "rm", cmd_rm, RUN_SETUP }, { "runstatus", cmd_runstatus, RUN_SETUP | NEED_WORK_TREE }, diff --combined t/t7501-commit.sh index 9dba104b1f,31a6f63399..31a6f63399 mode 100755,100644..100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@@ -79,7 -79,8 +79,8 @@@ test_expect_success cat >editor <<\EOF #!/bin/sh - sed -i -e "s/a file/an amend commit/g" $1 + sed -e "s/a file/an amend commit/g" < $1 > $1- + mv $1- $1 EOF chmod 755 editor @@@ -98,7 -99,8 +99,8 @@@ test_expect_success cat >editor <<\EOF #!/bin/sh - sed -i -e "s/amend/older/g" $1 + sed -e "s/amend/older/g" < $1 > $1- + mv $1- $1 EOF chmod 755 editor