Skip to content

Commit 6643688

Browse files
author
Junio C Hamano
committed
Merge part of jc/portable branch
2 parents 83f5053 + abb7c7b commit 6643688

File tree

9 files changed

+57
-2
lines changed

9 files changed

+57
-2
lines changed

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ all:
5555
#
5656
# Define NO_ICONV if your libc does not properly support iconv.
5757
#
58+
# Define NO_ACCURATE_DIFF if your diff program at least sometimes misses
59+
# a missing newline at the end of the file.
60+
#
61+
# Define NO_PYTHON if you want to loose all benefits of the recursive merge.
62+
#
5863
# Define COLLISION_CHECK below if you believe that SHA1's
5964
# 1461501637330902918203684832716283019655932542976 hashes do not give you
6065
# sufficient guarantee that no collisions between objects will ever happen.
@@ -273,6 +278,16 @@ ifeq ($(uname_S),AIX)
273278
NO_STRCASESTR=YesPlease
274279
NEEDS_LIBICONV=YesPlease
275280
endif
281+
ifeq ($(uname_S),IRIX64)
282+
NO_IPV6=YesPlease
283+
NO_SETENV=YesPlease
284+
NO_STRCASESTR=YesPlease
285+
NO_SOCKADDR_STORAGE=YesPlease
286+
SHELL_PATH=/usr/gnu/bin/bash
287+
ALL_CFLAGS += -DPATH_MAX=1024
288+
# for now, build 32-bit version
289+
ALL_LDFLAGS += -L/usr/lib32
290+
endif
276291
ifneq (,$(findstring arm,$(uname_M)))
277292
ARM_SHA1 = YesPlease
278293
endif
@@ -403,6 +418,9 @@ else
403418
endif
404419
endif
405420
endif
421+
ifdef NO_ACCURATE_DIFF
422+
ALL_CFLAGS += -DNO_ACCURATE_DIFF
423+
endif
406424

407425
ALL_CFLAGS += -DSHA1_HEADER=$(call shellquote,$(SHA1_HEADER)) $(COMPAT_CFLAGS)
408426
LIB_OBJS += $(COMPAT_OBJS)
@@ -426,6 +444,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
426444
sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
427445
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
428446
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
447+
-e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \
429448
$@.sh >$@
430449
chmod +x $@
431450

@@ -505,6 +524,12 @@ doc:
505524

506525
### Testing rules
507526

527+
# GNU make supports exporting all variables by "export" without parameters.
528+
# However, the environment gets quite big, and some programs have problems
529+
# with that.
530+
531+
export NO_PYTHON
532+
508533
test: all
509534
$(MAKE) -C t/ all
510535

apply.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,14 @@ static int apply_one_fragment(struct buffer_desc *desc, struct fragment *frag)
11421142
size -= len;
11431143
}
11441144

1145+
#ifdef NO_ACCURATE_DIFF
1146+
if (oldsize > 0 && old[oldsize - 1] == '\n' &&
1147+
newsize > 0 && new[newsize - 1] == '\n') {
1148+
oldsize--;
1149+
newsize--;
1150+
}
1151+
#endif
1152+
11451153
offset = find_offset(buf, desc->size, old, oldsize, frag->newpos);
11461154
if (offset >= 0) {
11471155
int diff = newsize - oldsize;

git-clone.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ yes,yes)
154154
fi &&
155155
rm -f "$GIT_DIR/objects/sample" &&
156156
cd "$repo" &&
157-
find objects -depth -print | cpio -puamd$l "$GIT_DIR/" || exit 1
157+
find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
158158
;;
159159
yes)
160160
mkdir -p "$GIT_DIR/objects/info"

git-merge.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ LF='
1313
all_strategies='recursive octopus resolve stupid ours'
1414
default_strategies='recursive'
1515
use_strategies=
16+
if test "@@NO_PYTHON@@"; then
17+
all_strategies='resolve octopus stupid ours'
18+
default_strategies='resolve'
19+
fi
1620

1721
dropsave() {
1822
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \

t/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ shellquote = '$(call shq,$(1))'
1515

1616
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
1717

18+
ifdef NO_PYTHON
19+
GIT_TEST_OPTS += --no-python
20+
endif
21+
1822
all: $(T) clean
1923

2024
$(T):

t/t0000-basic.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fi
4242

4343
. ./test-lib.sh
4444

45-
"$PYTHON" -c 'import subprocess' || {
45+
test "$no_python" || "$PYTHON" -c 'import subprocess' || {
4646
echo >&2 'Your python seem to lack "subprocess" module.
4747
Please check INSTALL document.'
4848
exit 1

t/t6021-merge-criss-cross.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
test_description='Test criss-cross merge'
1111
. ./test-lib.sh
1212

13+
if test "$no_python"; then
14+
echo "Skipping: no python => no recursive merge"
15+
test_done
16+
exit 0
17+
fi
18+
1319
test_expect_success 'prepare repository' \
1420
'echo "1
1521
2

t/t6022-merge-rename.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
test_description='Merge-recursive merging renames'
44
. ./test-lib.sh
55

6+
if test "$no_python"; then
7+
echo "Skipping: no python => no recursive merge"
8+
test_done
9+
exit 0
10+
fi
11+
612
test_expect_success setup \
713
'
814
cat >A <<\EOF &&

t/test-lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ do
6363
exit 0 ;;
6464
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
6565
verbose=t; shift ;;
66+
--no-python)
67+
no_python=t; shift ;;
6668
*)
6769
break ;;
6870
esac

0 commit comments

Comments
 (0)