Merge part of js/portable into next
authorJunio C Hamano <junkio@cox.net>
Sun, 19 Feb 2006 07:19:33 +0000 (23:19 -0800)
committerJunio C Hamano <junkio@cox.net>
Sun, 19 Feb 2006 07:19:33 +0000 (23:19 -0800)
1  2 
Makefile
git-merge.sh
t/test-lib.sh

diff --combined Makefile
+++ b/Makefile
@@@ -58,6 -58,8 +58,8 @@@ all
  # 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.
@@@ -156,7 -158,7 +158,7 @@@ PROGRAMS = 
        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)
@@@ -442,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 $@
  
@@@ -521,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-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"