From 8e1618f9612a78ea09b2a926797c781fe06027c9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 17 Feb 2006 15:22:45 +0100 Subject: Fix cpio call To some cpio's, -a and -m options are mutually exclusive. Use only -m. Signed-off-by: Johannes E. Schindelin Signed-off-by: Junio C Hamano diff --git a/git-clone.sh b/git-clone.sh index e192b08..cf410fa 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -153,7 +153,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" -- cgit v0.10.2-6-g49f6 From 5b5d4d9e1b31997b3179e6a253d47b7eea03d0fa Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 17 Feb 2006 15:23:16 +0100 Subject: Optionally support old diffs Some versions of diff do not correctly detect a missing new-line at the end of the file under certain circumstances. When defining NO_ACCURATE_DIFF, work around this bug. Signed-off-by: Johannes E. Schindelin Signed-off-by: Junio C Hamano diff --git a/Makefile b/Makefile index 317be3c..697a6dd 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,9 @@ 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 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. @@ -403,6 +406,9 @@ else 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) diff --git a/apply.c b/apply.c index 2ad47fb..1083d4f 100644 --- a/apply.c +++ b/apply.c @@ -1142,6 +1142,14 @@ static int apply_one_fragment(struct buffer_desc *desc, struct fragment *frag) size -= len; } +#ifdef NO_ACCURATE_DIFF + if (oldsize > 0 && old[oldsize - 1] == '\n' && + newsize > 0 && new[newsize - 1] == '\n') { + oldsize--; + newsize--; + } +#endif + offset = find_offset(buf, desc->size, old, oldsize, frag->newpos); if (offset >= 0) { int diff = newsize - oldsize; -- cgit v0.10.2-6-g49f6 From 289c4b36e336af5266b86d924ef0aa828e8e4841 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 17 Feb 2006 15:23:41 +0100 Subject: Support Irix Signed-off-by: Johannes E. Schindelin Signed-off-by: Junio C Hamano diff --git a/Makefile b/Makefile index 697a6dd..1d3a0a4 100644 --- a/Makefile +++ b/Makefile @@ -276,6 +276,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 -- cgit v0.10.2-6-g49f6 From abb7c7b31c0896bd838bbb6437b310db5a42227a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 18 Feb 2006 13:01:18 +0100 Subject: Optionally work without python In some setups (notably server setups) you do not need that dependency. Gracefully handle the absence of python when NO_PYTHON is defined. Signed-off-by: Johannes E. Schindelin Signed-off-by: Junio C Hamano diff --git a/Makefile b/Makefile index 1d3a0a4..c8ee4a4 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +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. @@ -442,6 +444,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.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 @@ 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 --git a/git-merge.sh b/git-merge.sh index 74f0761..a05eeb2 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -13,6 +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" \ diff --git a/t/Makefile b/t/Makefile index 5c5a620..ba6ddbe 100644 --- a/t/Makefile +++ b/t/Makefile @@ -15,6 +15,10 @@ shellquote = '$(call shq,$(1))' T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh) +ifdef NO_PYTHON + GIT_TEST_OPTS += --no-python +endif + all: $(T) clean $(T): diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index c339a36..6729a18 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -42,7 +42,7 @@ fi . ./test-lib.sh -"$PYTHON" -c 'import subprocess' || { +test "$no_python" || "$PYTHON" -c 'import subprocess' || { echo >&2 'Your python seem to lack "subprocess" module. Please check INSTALL document.' exit 1 diff --git a/t/t6021-merge-criss-cross.sh b/t/t6021-merge-criss-cross.sh index e8606c7..2623813 100755 --- a/t/t6021-merge-criss-cross.sh +++ b/t/t6021-merge-criss-cross.sh @@ -10,6 +10,12 @@ test_description='Test criss-cross merge' . ./test-lib.sh +if test "$no_python"; then + echo "Skipping: no python => no recursive merge" + test_done + exit 0 +fi + test_expect_success 'prepare repository' \ 'echo "1 2 diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh index 1292caf..a2d24b5 100755 --- a/t/t6022-merge-rename.sh +++ b/t/t6022-merge-rename.sh @@ -3,6 +3,12 @@ test_description='Merge-recursive merging renames' . ./test-lib.sh +if test "$no_python"; then + echo "Skipping: no python => no recursive merge" + test_done + exit 0 +fi + test_expect_success setup \ ' cat >A <<\EOF && diff --git a/t/test-lib.sh b/t/test-lib.sh index 7a58a86..43c8e55 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -63,6 +63,8 @@ do exit 0 ;; -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose) verbose=t; shift ;; + --no-python) + no_python=t; shift ;; *) break ;; esac -- cgit v0.10.2-6-g49f6