summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fbe0b24)
raw | patch | inline | side by side (parent: fbe0b24)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 12 Dec 2006 23:01:41 +0000 (00:01 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 13 Dec 2006 05:47:29 +0000 (21:47 -0800) |
Now that we have git-merge-file, an RCS merge lookalike, we no longer
need it. So long, merge, and thanks for all the fish!
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
need it. So long, merge, and thanks for all the fish!
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
.gitignore | patch | blob | history | |
Documentation/git-merge-index.txt | patch | blob | history | |
INSTALL | patch | blob | history | |
git-cvsserver.perl | patch | blob | history | |
git-rerere.perl | patch | blob | history | |
git.spec.in | patch | blob | history | |
merge-file.c | patch | blob | history | |
t/t0000-basic.sh | patch | blob | history |
diff --git a/.gitignore b/.gitignore
index 7f2cd55088de2bdd109dbcd6b50b7dfd0c593115..d706dd92c6a63474616c09388fc9744ff055cedc 100644 (file)
--- a/.gitignore
+++ b/.gitignore
git-merge
git-merge-base
git-merge-index
+git-merge-file
git-merge-tree
git-merge-octopus
git-merge-one-file
index 6cd060108292733725aca28cc8f0b83aa7d0f56e..0cf505ea84d231e4e4997676d4169c5c5c7dd9f9 100644 (file)
processes them in turn only stopping if merge returns a non-zero exit
code.
-Typically this is run with the a script calling the merge command from
-the RCS package.
+Typically this is run with the a script calling git's imitation of
+the merge command from the RCS package.
A sample script called "git-merge-one-file" is included in the
distribution.
index 8f69039fb90100f8fba5c908455660b9bcaf552d..b5dd9f0abb2483ad986950785fa95b8d373b60b6 100644 (file)
--- a/INSTALL
+++ b/INSTALL
do that even if it wasn't for git. There's no point in living
in the dark ages any more.
- - "merge", the standard UNIX three-way merge program. It usually
- comes with the "rcs" package on most Linux distributions, so if
- you have a developer install you probably have it already, but a
- "graphical user desktop" install might have left it out.
-
- You'll only need the merge program if you do development using
- git, and if you only use git to track other peoples work you'll
- never notice the lack of it.
-
- "wish", the Tcl/Tk windowing shell is used in gitk to show the
history graphically
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index ca519b7e49a0b2cc5104f71459fe621041382f19..55ff83b1a3fd90d030129aa83135889296476d27 100755 (executable)
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
$log->debug("Temporary directory for merge is $dir");
- my $return = system("merge", $file_local, $file_old, $file_new);
+ my $return = system("git merge-file", $file_local, $file_old, $file_new);
$return >>= 8;
if ( $return == 0 )
diff --git a/git-rerere.perl b/git-rerere.perl
index d3664ff491fe73d8a6acf6e2c4da5806c5753ce1..2e8dbbd4ea0adcf8aee1e87acfc439e41a7289cf 100755 (executable)
--- a/git-rerere.perl
+++ b/git-rerere.perl
sub merge {
my ($name, $path) = @_;
record_preimage($path, "$rr_dir/$name/thisimage");
- unless (system('merge', map { "$rr_dir/$name/${_}image" }
+ unless (system('git merge-file', map { "$rr_dir/$name/${_}image" }
qw(this pre post))) {
my $in;
open $in, "<$rr_dir/$name/thisimage" or
diff --git a/git.spec.in b/git.spec.in
index f2374b7331cfe49792e7a76145fdb1cea8f6795c..fb95e375948ed84abd9c433294692b12e2ff1b8d 100644 (file)
--- a/git.spec.in
+++ b/git.spec.in
%package core
Summary: Core git tools
Group: Development/Tools
-Requires: zlib >= 1.2, rsync, rcs, curl, less, openssh-clients, expat
+Requires: zlib >= 1.2, rsync, curl, less, openssh-clients, expat
%description core
This is a stupid (but extremely fast) directory content manager. It
doesn't do a whole lot, but what it _does_ do is track directory
diff --git a/merge-file.c b/merge-file.c
index fc9b148993027d4064257d4df8e63a12e1afc5d4..69dc1ebbf7685f3dd30dcca64974eabba8ee137b 100644 (file)
--- a/merge-file.c
+++ b/merge-file.c
#include "xdiff-interface.h"
#include "blob.h"
-static void rm_temp_file(const char *filename)
-{
- unlink(filename);
- free((void *)filename);
-}
-
-static const char *write_temp_file(mmfile_t *f)
-{
- int fd;
- const char *tmp = getenv("TMPDIR");
- char *filename;
-
- if (!tmp)
- tmp = "/tmp";
- filename = mkpath("%s/%s", tmp, "git-tmp-XXXXXX");
- fd = mkstemp(filename);
- if (fd < 0)
- return NULL;
- filename = xstrdup(filename);
- if (f->size != xwrite(fd, f->ptr, f->size)) {
- rm_temp_file(filename);
- return NULL;
- }
- close(fd);
- return filename;
-}
-
-static void *read_temp_file(const char *filename, unsigned long *size)
-{
- struct stat st;
- char *buf = NULL;
- int fd = open(filename, O_RDONLY);
- if (fd < 0)
- return NULL;
- if (!fstat(fd, &st)) {
- *size = st.st_size;
- buf = xmalloc(st.st_size);
- if (st.st_size != xread(fd, buf, st.st_size)) {
- free(buf);
- buf = NULL;
- }
- }
- close(fd);
- return buf;
-}
-
static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
{
void *buf;
static void *three_way_filemerge(mmfile_t *base, mmfile_t *our, mmfile_t *their, unsigned long *size)
{
- void *res;
- const char *t1, *t2, *t3;
-
- t1 = write_temp_file(base);
- t2 = write_temp_file(our);
- t3 = write_temp_file(their);
- res = NULL;
- if (t1 && t2 && t3) {
- int code = run_command("merge", t2, t1, t3, NULL);
- if (!code || code == -1)
- res = read_temp_file(t2, size);
- }
- rm_temp_file(t1);
- rm_temp_file(t2);
- rm_temp_file(t3);
- return res;
+ mmbuffer_t res;
+ xpparam_t xpp;
+ int merge_status;
+
+ memset(&xpp, 0, sizeof(xpp));
+ merge_status = xdl_merge(base, our, ".our", their, ".their",
+ &xpp, XDL_MERGE_ZEALOUS, &res);
+
+ if (merge_status < 0)
+ return NULL;
+
+ *size = res.size;
+ return res.ptr;
}
static int common_outf(void *priv_, mmbuffer_t *mb, int nbuf)
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 81f3bedc90f4ead3f12f344641d7c3bff44f6ab8..3260d1d7a746f6968aab0d3f374bd7e76bf33bd0 100755 (executable)
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
'
################################################################
-# It appears that people are getting bitten by not installing
-# 'merge' (usually part of RCS package in binary distributions).
-# Check this and error out before running any tests. Also catch
-# the bogosity of trying to run tests without building while we
-# are at it.
+# It appears that people try to run tests without building...
../git >/dev/null
if test $? != 1
exit 1
fi
-merge >/dev/null 2>/dev/null
-if test $? = 127
-then
- echo >&2 'You do not seem to have "merge" installed.
-Please check INSTALL document.'
- exit 1
-fi
-
. ./test-lib.sh
################################################################