summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 99a19b4)
raw | patch | inline | side by side (parent: 99a19b4)
author | Fredrik Kuivinen <freku045@student.liu.se> | |
Mon, 3 Oct 2005 06:13:09 +0000 (08:13 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 3 Oct 2005 07:25:42 +0000 (00:25 -0700) |
Let the merge strategies handle the base less case if they are able to
do it. It also fixes git-resolve.sh to die if no common ancestors
exists, instead of doing the wrong thing. Furthermore, it contains a
small independent fix for git-merge.sh and a fix for a base less code
path in gitMergeCommon.py.
With this it's possible to use
git merge -s recursive 'merge message' A B
to do a base less merge of A and B.
[jc: Thanks Fredrik for fixing the brown-paper-bag in git-merge.
I fixed a small typo in git-merge-resolve fix; 'test' equality
check is spelled with single equal sign -- C-style double equal
sign is bashism.]
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
do it. It also fixes git-resolve.sh to die if no common ancestors
exists, instead of doing the wrong thing. Furthermore, it contains a
small independent fix for git-merge.sh and a fix for a base less code
path in gitMergeCommon.py.
With this it's possible to use
git merge -s recursive 'merge message' A B
to do a base less merge of A and B.
[jc: Thanks Fredrik for fixing the brown-paper-bag in git-merge.
I fixed a small typo in git-merge-resolve fix; 'test' equality
check is spelled with single equal sign -- C-style double equal
sign is bashism.]
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-merge-resolve.sh | patch | blob | history | |
git-merge.sh | patch | blob | history | |
gitMergeCommon.py | patch | blob | history |
diff --git a/git-merge-resolve.sh b/git-merge-resolve.sh
index e3b04a0e959676e513a7b7e902ea51927d76e2be..966e81ff7d353beb15ac2c9ed9a50a1ea45c876c 100755 (executable)
--- a/git-merge-resolve.sh
+++ b/git-merge-resolve.sh
exit 2 ;;
esac
+# Give up if this is a baseless merge.
+if test '' = "$bases"
+then
+ exit 2
+fi
+
git-update-index --refresh 2>/dev/null
git-read-tree -u -m $bases $head $remotes || exit 2
echo "Trying simple merge."
diff --git a/git-merge.sh b/git-merge.sh
index d12a2a93b1408e7be6e9947737b4b09c5f0927fe..3465041bc4c9b2512623ee6c06317ecb7689e528 100755 (executable)
--- a/git-merge.sh
+++ b/git-merge.sh
savestate() {
# Stash away any local modifications.
git-diff-index -r -z --name-only $head |
- cpio -0 -o >"$GIR_DIR/MERGE_SAVE"
+ cpio -0 -o >"$GIT_DIR/MERGE_SAVE"
}
restorestate() {
case "$#,$common" in
*,'')
- die "Unable to find common commit between $head_arg and $*"
+ # No common ancestors found. We need a real merge.
;;
1,"$1")
# If head can reach all the merge then we are up to date.
diff --git a/gitMergeCommon.py b/gitMergeCommon.py
index 7e8855c617ac3391a698e61023d9ca465b4b295e..1b5bddd467c3d2265e8204bb90c80a2c53742b4a 100644 (file)
--- a/gitMergeCommon.py
+++ b/gitMergeCommon.py
# Write the empty tree to the object database and return its SHA1
def writeEmptyTree():
- tmpIndex = os.environ['GIT_DIR'] + '/merge-tmp-index'
+ tmpIndex = os.environ.get('GIT_DIR', '.git') + '/merge-tmp-index'
def delTmpIndex():
try:
os.unlink(tmpIndex)