Merge branch 'js/mingw-fallouts'
authorJunio C Hamano <gitster@pobox.com>
Sun, 25 Nov 2007 00:31:25 +0000 (16:31 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 25 Nov 2007 00:31:25 +0000 (16:31 -0800)
* 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 <sys/select.h> and <sys/ioctl.h> 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.

1  2 
Makefile
git-compat-util.h
git.c
t/t7501-commit.sh
diff --combined Makefile
index 7a0ee780dc9c8d7129431ebeafb6805b4a4c9dd6,817f3c7ba90aa7585558ac75ea38a5f6b6f12bb6..bcf1e9eb2913d2b4eda2839cc2c3d31016deffe1
+++ 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 86c896296686c94db6e9d0f2238a72aa383f647f,e83195bde5ce202bd20b1d1a5dc95fa3f54ed6a1..79eb10eacba955e0c58a0a540c4ac577f84953e9
@@@ -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 <fnmatch.h>
  #include <sys/poll.h>
  #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <sys/select.h>
  #include <assert.h>
  #include <regex.h>
  #include <netinet/in.h>
diff --combined git.c
index 80c2f14a8b805008fc822e9483d2277e69bdcbe3,37d99d6f50dac4052616f337904807c76b17d01e..51ee64729599e11938912d745a359a60fa4e3735
--- 1/git.c
--- 2/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 },
                { "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 9dba104b1f8bf9125f1a947a2fd115b684a94095,31a6f63399a97902e493c453a3f3117bc44ef2f7..31a6f63399a97902e493c453a3f3117bc44ef2f7
mode 100755,100644..100755
@@@ -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