From: Junio C Hamano Date: Tue, 21 Feb 2006 08:52:18 +0000 (-0800) Subject: Merge part of jc/portable branch X-Git-Tag: v1.3.0-rc1~174 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=664368886781b7c070233c002597b84628eec571;hp=-c;p=git.git Merge part of jc/portable branch --- 664368886781b7c070233c002597b84628eec571 diff --combined Makefile index 3b7fccbb,c8ee4a42..821f6375 --- a/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 \ @@@ -153,7 -158,7 +158,7 @@@ 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 index d184ceb7,cf410faa..dc0ad552 --- a/git-clone.sh +++ b/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 index 2b4a603d,a05eeb29..4609fe54 --- a/git-merge.sh +++ b/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" && @@@ -181,9 -183,6 +185,9 @@@ ;; 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 index 66f62b9c,43c8e55a..05f6e795 --- a/t/test-lib.sh +++ b/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 +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"