2ac0d6273f
The am-backend drops information and thus limits what we can do: * lack of full tree information from the original commits means we cannot do directory rename detection and warn users that they might want to move some of their new files that they placed in old directories to prevent their becoming orphaned.[1] * reduction in context from only having a few lines beyond those changed means that when context lines are non-unique we can apply patches incorrectly.[2] * lack of access to original commits means that conflict marker annotation has less information available. * the am backend has safety problems with an ill-timed interrupt. Also, the merge/interactive backend have far more abilities, appear to currently have a slight performance advantage[3] and have room for more optimizations than the am backend[4] (and work is underway to take advantage of some of those possibilities). [1] https://lore.kernel.org/git/xmqqh8jeh1id.fsf@gitster-ct.c.googlers.com/ [2] https://lore.kernel.org/git/CABPp-BGiu2nVMQY_t-rnFR5GQUz_ipyEE8oDocKeO+h+t4Mn4A@mail.gmail.com/ [3] https://public-inbox.org/git/CABPp-BF=ev03WgODk6TMQmuNoatg2kiEe5DR__gJ0OTVqHSnfQ@mail.gmail.com/ [4] https://lore.kernel.org/git/CABPp-BGh7yW69QwxQb13K0HM38NKmQif3A6C6UULEKYnkEJ5vA@mail.gmail.com/ Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
107 lines
2.6 KiB
Bash
Executable File
107 lines
2.6 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (c) 2006 Eric Wong
|
|
test_description='git svn commit-diff clobber'
|
|
. ./lib-git-svn.sh
|
|
|
|
test_expect_success 'initialize repo' '
|
|
mkdir import &&
|
|
(
|
|
cd import &&
|
|
echo initial >file &&
|
|
svn_cmd import -m "initial" . "$svnrepo"
|
|
) &&
|
|
echo initial > file &&
|
|
git update-index --add file &&
|
|
git commit -a -m "initial"
|
|
'
|
|
test_expect_success 'commit change from svn side' '
|
|
svn_cmd co "$svnrepo" t.svn &&
|
|
(
|
|
cd t.svn &&
|
|
echo second line from svn >>file &&
|
|
poke file &&
|
|
svn_cmd commit -m "second line from svn"
|
|
) &&
|
|
rm -rf t.svn
|
|
'
|
|
|
|
test_expect_success 'commit conflicting change from git' '
|
|
echo second line from git >> file &&
|
|
git commit -a -m "second line from git" &&
|
|
test_must_fail git svn commit-diff -r1 HEAD~1 HEAD "$svnrepo"
|
|
'
|
|
|
|
test_expect_success 'commit complementing change from git' '
|
|
git reset --hard HEAD~1 &&
|
|
echo second line from svn >> file &&
|
|
git commit -a -m "second line from svn" &&
|
|
echo third line from git >> file &&
|
|
git commit -a -m "third line from git" &&
|
|
git svn commit-diff -r2 HEAD~1 HEAD "$svnrepo"
|
|
'
|
|
|
|
test_expect_success 'dcommit fails to commit because of conflict' '
|
|
git svn init "$svnrepo" &&
|
|
git svn fetch &&
|
|
git reset --hard refs/remotes/git-svn &&
|
|
svn_cmd co "$svnrepo" t.svn &&
|
|
(
|
|
cd t.svn &&
|
|
echo fourth line from svn >>file &&
|
|
poke file &&
|
|
svn_cmd commit -m "fourth line from svn"
|
|
) &&
|
|
rm -rf t.svn &&
|
|
echo "fourth line from git" >> file &&
|
|
git commit -a -m "fourth line from git" &&
|
|
test_must_fail git svn dcommit
|
|
'
|
|
|
|
test_expect_success 'dcommit does the svn equivalent of an index merge' "
|
|
git reset --hard refs/remotes/git-svn &&
|
|
echo 'index merge' > file2 &&
|
|
git update-index --add file2 &&
|
|
git commit -a -m 'index merge' &&
|
|
echo 'more changes' >> file2 &&
|
|
git update-index file2 &&
|
|
git commit -a -m 'more changes' &&
|
|
git svn dcommit
|
|
"
|
|
|
|
test_expect_success 'commit another change from svn side' '
|
|
svn_cmd co "$svnrepo" t.svn &&
|
|
(
|
|
cd t.svn &&
|
|
echo third line from svn >>file &&
|
|
poke file &&
|
|
svn_cmd commit -m "third line from svn"
|
|
) &&
|
|
rm -rf t.svn
|
|
'
|
|
|
|
test_expect_success 'multiple dcommit from git svn will not clobber svn' "
|
|
git reset --hard refs/remotes/git-svn &&
|
|
echo new file >> new-file &&
|
|
git update-index --add new-file &&
|
|
git commit -a -m 'new file' &&
|
|
echo clobber > file &&
|
|
git commit -a -m 'clobber' &&
|
|
test_must_fail git svn dcommit
|
|
"
|
|
|
|
|
|
test_expect_success 'check that rebase really failed' '
|
|
git status >output &&
|
|
grep currently.rebasing output
|
|
'
|
|
|
|
test_expect_success 'resolve, continue the rebase and dcommit' "
|
|
echo clobber and I really mean it > file &&
|
|
git update-index file &&
|
|
git rebase --continue &&
|
|
git svn dcommit
|
|
"
|
|
|
|
test_done
|