Merge part of jc/portable branch
authorJunio C Hamano <junkio@cox.net>
Tue, 21 Feb 2006 08:52:18 +0000 (00:52 -0800)
committerJunio C Hamano <junkio@cox.net>
Tue, 21 Feb 2006 08:52:18 +0000 (00:52 -0800)
1  2 
Makefile
git-clone.sh
git-merge.sh
t/test-lib.sh

diff --combined Makefile
+++ b/Makefile
@@@ -55,6 -55,11 +55,11 @@@ all
  #
  # Define NO_ICONV if your libc does not properly support iconv.
  #
+ # Define NO_ACCURATE_DIFF if your diff program at least sometimes misses
+ # a missing newline at the end of the file.
+ #
+ # Define NO_PYTHON if you want to loose all benefits of the recursive merge.
+ #
  # Define COLLISION_CHECK below if you believe that SHA1's
  # 1461501637330902918203684832716283019655932542976 hashes do not give you
  # sufficient guarantee that no collisions between objects will ever happen.
@@@ -143,7 -148,7 +148,7 @@@ PROGRAMS = 
        git-diff-tree$X git-fetch-pack$X git-fsck-objects$X \
        git-hash-object$X git-index-pack$X git-init-db$X \
        git-local-fetch$X git-ls-files$X git-ls-tree$X git-merge-base$X \
 -      git-merge-index$X git-mktag$X git-pack-objects$X git-patch-id$X \
 +      git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \
        git-peek-remote$X git-prune-packed$X git-read-tree$X \
        git-receive-pack$X git-rev-list$X git-rev-parse$X \
        git-send-pack$X git-show-branch$X git-shell$X \
        git-upload-pack$X git-verify-pack$X git-write-tree$X \
        git-update-ref$X git-symbolic-ref$X git-check-ref-format$X \
        git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \
 -      git-describe$X
 +      git-describe$X git-merge-tree$X
  
  # what 'all' will build and 'install' will install, in gitexecdir
  ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@@ -273,6 -278,16 +278,16 @@@ ifeq ($(uname_S),AIX
        NO_STRCASESTR=YesPlease
        NEEDS_LIBICONV=YesPlease
  endif
+ ifeq ($(uname_S),IRIX64)
+       NO_IPV6=YesPlease
+       NO_SETENV=YesPlease
+       NO_STRCASESTR=YesPlease
+       NO_SOCKADDR_STORAGE=YesPlease
+       SHELL_PATH=/usr/gnu/bin/bash
+       ALL_CFLAGS += -DPATH_MAX=1024
+       # for now, build 32-bit version
+       ALL_LDFLAGS += -L/usr/lib32
+ endif
  ifneq (,$(findstring arm,$(uname_M)))
        ARM_SHA1 = YesPlease
  endif
@@@ -403,6 -418,9 +418,9 @@@ els
  endif
  endif
  endif
+ ifdef NO_ACCURATE_DIFF
+       ALL_CFLAGS += -DNO_ACCURATE_DIFF
+ endif
  
  ALL_CFLAGS += -DSHA1_HEADER=$(call shellquote,$(SHA1_HEADER)) $(COMPAT_CFLAGS)
  LIB_OBJS += $(COMPAT_OBJS)
@@@ -426,6 -444,7 +444,7 @@@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %
        sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
            -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
            -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
+           -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \
            $@.sh >$@
        chmod +x $@
  
@@@ -505,6 -524,12 +524,12 @@@ doc
  
  ### Testing rules
  
+ # GNU make supports exporting all variables by "export" without parameters.
+ # However, the environment gets quite big, and some programs have problems
+ # with that.
+ export NO_PYTHON
  test: all
        $(MAKE) -C t/ all
  
diff --combined git-clone.sh
@@@ -118,7 -118,6 +118,7 @@@ dir="$2
  [ -e "$dir" ] && echo "$dir already exists." && usage
  mkdir -p "$dir" &&
  D=$(cd "$dir" && pwd) &&
 +trap 'err=$?; rm -r $D; exit $err' exit
  case "$bare" in
  yes) GIT_DIR="$D" ;;
  *) GIT_DIR="$D/.git" ;;
@@@ -154,7 -153,7 +154,7 @@@ yes,yes
            fi &&
            rm -f "$GIT_DIR/objects/sample" &&
            cd "$repo" &&
-           find objects -depth -print | cpio -puamd$l "$GIT_DIR/" || exit 1
+           find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
            ;;
        yes)
            mkdir -p "$GIT_DIR/objects/info"
@@@ -256,6 -255,3 +256,6 @@@ Pull: $head_points_at:$origin" &
                git checkout
        esac
  fi
 +
 +trap - exit
 +
diff --combined git-merge.sh
@@@ -13,6 -13,10 +13,10 @@@ LF=
  all_strategies='recursive octopus resolve stupid ours'
  default_strategies='recursive'
  use_strategies=
+ if test "@@NO_PYTHON@@"; then
+       all_strategies='resolve octopus stupid ours'
+       default_strategies='resolve'
+ fi
  
  dropsave() {
        rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
@@@ -142,8 -146,6 +146,8 @@@ case "$#,$common,$no_commit" i
  1,*,)
        # We are not doing octopus, not fast forward, and have only
        # one common.  See if it is really trivial.
 +      git var GIT_COMMITTER_IDENT >/dev/null || exit
 +
        echo "Trying really trivial in-index merge..."
        git-update-index --refresh 2>/dev/null
        if git-read-tree --trivial -m -u $common $head "$1" &&
        ;;
  esac
  
 +# We are going to make a new commit.
 +git var GIT_COMMITTER_IDENT >/dev/null || exit
 +
  case "$use_strategies" in
  '')
        case "$#" in
diff --combined t/test-lib.sh
@@@ -63,6 -63,8 +63,8 @@@ d
                exit 0 ;;
        -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
                verbose=t; shift ;;
+       --no-python)
+               no_python=t; shift ;;
        *)
                break ;;
        esac
@@@ -149,21 -151,6 +151,21 @@@ test_expect_code () 
        fi
  }
  
 +# Most tests can use the created repository, but some amy need to create more.
 +# Usage: test_create_repo <directory>
 +test_create_repo () {
 +      test "$#" = 1 ||
 +      error "bug in the test script: not 1 parameter to test-create-repo"
 +      owd=`pwd`
 +      repo="$1"
 +      mkdir "$repo"
 +      cd "$repo" || error "Cannot setup test environment"
 +      "$GIT_EXEC_PATH/git" init-db --template=$GIT_EXEC_PATH/templates/blt/ 2>/dev/null ||
 +      error "cannot run git init-db -- have you built things yet?"
 +      mv .git/hooks .git/hooks-disabled
 +      cd "$owd"
 +}
 +      
  test_done () {
        trap - exit
        case "$test_failure" in
@@@ -211,5 -198,9 +213,5 @@@ test -d ../templates/blt || 
  # Test repository
  test=trash
  rm -fr "$test"
 -mkdir "$test"
 -cd "$test" || error "Cannot setup test environment"
 -"$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null ||
 -error "cannot run git init-db -- have you built things yet?"
 -
 -mv .git/hooks .git/hooks-disabled
 +test_create_repo $test
 +cd "$test"