Skip to content

Commit 720d150

Browse files
author
Junio C Hamano
committed
Add a new merge strategy by Fredrik Kuivinen.
I really wanted to try this out, instead of asking for an adjustment to the 'git merge' driver and waiting. For now the new strategy is called 'fredrik' and not in the list of default strategies to be tried. The script wants Python 2.4 so this commit also adjusts Debian and RPM build procecure files. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 0f69be5 commit 720d150

File tree

9 files changed

+741
-7
lines changed

9 files changed

+741
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ git-mailinfo
4343
git-mailsplit
4444
git-merge
4545
git-merge-base
46+
git-merge-fredrik
4647
git-merge-index
4748
git-merge-octopus
4849
git-merge-one-file

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ ALL_CFLAGS = $(CFLAGS) $(PLATFORM_DEFINES) $(DEFINES)
4848
prefix = $(HOME)
4949
bindir = $(prefix)/bin
5050
template_dir = $(prefix)/share/git-core/templates/
51+
GIT_PYTHON_DIR = $(prefix)/share/git-core/python
5152
# DESTDIR=
5253

5354
CC = gcc
@@ -81,6 +82,9 @@ SCRIPT_PERL = \
8182
git-archimport.perl git-cvsimport.perl git-relink.perl \
8283
git-rename.perl git-shortlog.perl
8384

85+
SCRIPT_PYTHON = \
86+
git-merge-fredrik.py
87+
8488
# The ones that do not have to link with lcrypto nor lz.
8589
SIMPLE_PROGRAMS = \
8690
git-get-tar-commit-id git-mailinfo git-mailsplit git-stripspace \
@@ -105,6 +109,9 @@ PROGRAMS = \
105109
git-upload-pack git-verify-pack git-write-tree \
106110
$(SIMPLE_PROGRAMS)
107111

112+
PYMODULES = \
113+
gitMergeCommon.py
114+
108115
ifdef WITH_SEND_EMAIL
109116
SCRIPT_PERL += git-send-email.perl
110117
endif
@@ -150,6 +157,9 @@ endif
150157
ifndef PERL_PATH
151158
PERL_PATH = /usr/bin/perl
152159
endif
160+
ifndef PYTHON_PATH
161+
PYTHON_PATH = /usr/bin/python
162+
endif
153163

154164
ifndef NO_OPENSSL
155165
LIB_OBJS += epoch.o
@@ -189,7 +199,9 @@ endif
189199
DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'
190200

191201
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
192-
$(patsubst %.perl,%,$(SCRIPT_PERL)) gitk
202+
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
203+
$(patsubst %.py,%,$(SCRIPT_PYTHON)) \
204+
gitk
193205

194206
### Build rules
195207

@@ -214,6 +226,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) : % : %.perl
214226
sed -e '1s|#!.*perl|#!$(PERL_PATH)|' $@.perl >$@
215227
chmod +x $@
216228

229+
$(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
230+
rm -f $@
231+
sed -e '1s|#!.*python|#!$(PYTHON_PATH)|' \
232+
-e 's|@@GIT_PYTHON_PATH@@|$(GIT_PYTHON_DIR)|g' \
233+
$@.py >$@
234+
chmod +x $@
235+
217236
%.o: %.c
218237
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
219238
%.o: %.S
@@ -274,6 +293,8 @@ install: $(PROGRAMS) $(SCRIPTS)
274293
$(INSTALL) git-revert $(DESTDIR)$(bindir)/git-cherry-pick
275294
sh ./cmd-rename.sh $(DESTDIR)$(bindir)
276295
$(MAKE) -C templates install
296+
$(INSTALL) -m755 -d $(DESTDIR)$(GIT_PYTHON_DIR)
297+
$(INSTALL) $(PYMODULES) $(DESTDIR)$(GIT_PYTHON_DIR)
277298

278299
install-doc:
279300
$(MAKE) -C Documentation install

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Standards-Version: 3.6.1
88
Package: git-core
99
Architecture: any
1010
Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, patch, rcs
11-
Recommends: rsync, curl, ssh, libmail-sendmail-perl, libemail-valid-perl
11+
Recommends: rsync, curl, ssh, libmail-sendmail-perl, libemail-valid-perl, python (>= 2.4.0)
1212
Suggests: cogito
1313
Conflicts: git, cogito (<< 0.13)
1414
Description: The git content addressable filesystem

debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ MAN_DESTDIR := $(DESTDIR)/$(MANDIR)
4141
build: debian/build-stamp
4242
debian/build-stamp:
4343
dh_testdir
44-
$(MAKE) prefix=$(PREFIX) all doc
44+
$(MAKE) prefix=$(PREFIX) PYTHON_PATH=/usr/bin/python2.4 all doc
4545
touch debian/build-stamp
4646

4747
debian-clean:

git-core.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ URL: http://kernel.org/pub/software/scm/git/
1010
Source: http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.gz
1111
BuildRequires: zlib-devel, openssl-devel, curl-devel %{!?_without_docs:, xmlto, asciidoc > 6.0.3}
1212
BuildRoot: %{_tmppath}/%{name}-%{version}-root
13-
Requires: sh-utils, diffutils, rsync, rcs, mktemp >= 1.5
13+
Requires: sh-utils, diffutils, rsync, rcs, python >= 2.4
1414

1515
%description
1616
This is a stupid (but extremely fast) directory content manager. It

0 commit comments

Comments
 (0)