@matheusbsbs / matheus-bagliano / commits / 0bed5eaa0e
Fork 0

git-svn: enable follow-parent functionality by default

--no-follow-parent disables and reverts it back to the old default behavior of not following parents (if you don't care for full history). Signed-off-by: Eric Wong <normalperson@yhbt.net>

Eric Wong committed Feb 9, 2007 at 02:45 UTC 0bed5eaa0edc3a2dfa0d5910ff1fb280539b242d
3 files changed +17 -16
Documentation/git-svn.txt
+2 -1
@@ -311,7 +311,8 @@ for more information on using GIT_SVN_ID.
311 This is especially helpful when we're tracking a directory
312 that has been moved around within the repository, or if we
313 started tracking a branch and never tracked the trunk it was
314 - descended from.
314 + descended from. This feature is enabled by default, use
315 + --no-follow-parent to disable it.
316
317 config key: svn.followparent
318
git-svn.perl
+2 -2
@@ -57,11 +57,11 @@ my ($_stdin, $_help, $_edit,
57 $_version,
58 $_merge, $_strategy, $_dry_run,
59 $_prefix);
60 -
60 +$Git::SVN::_follow_parent = 1;
61 my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
62 'config-dir=s' => \$Git::SVN::Ra::config_dir,
63 'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache );
64 -my %fc_opts = ( 'follow-parent|follow' => \$Git::SVN::_follow_parent,
64 +my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
65 'authors-file|A=s' => \$_authors,
66 'repack:i' => \$Git::SVN::_repack,
67 'no-metadata' => \$Git::SVN::_no_metadata,
t/t9104-git-svn-follow-parent.sh
+13 -13
@@ -3,7 +3,7 @@
3 # Copyright (c) 2006 Eric Wong
4 #
5
6 -test_description='git-svn --follow-parent fetching'
6 +test_description='git-svn fetching'
7 . ./lib-git-svn.sh
8
9 test_expect_success 'initialize repo' "
@@ -27,9 +27,9 @@ test_expect_success 'initialize repo' "
27 cd ..
28 "
29
30 -test_expect_success 'init and fetch --follow-parent a moved directory' "
30 +test_expect_success 'init and fetch a moved directory' "
31 git-svn init -i thunk $svnrepo/thunk &&
32 - git-svn fetch --follow-parent -i thunk &&
32 + git-svn fetch -i thunk &&
33 test \"\`git-rev-parse --verify refs/remotes/thunk@2\`\" \
34 = \"\`git-rev-parse --verify refs/remotes/thunk~1\`\" &&
35 test \"\`git-cat-file blob refs/remotes/thunk:readme |\
@@ -44,7 +44,7 @@ test_expect_success 'init and fetch from one svn-remote' "
44 trunk:refs/remotes/svn/trunk &&
45 git-repo-config --add svn-remote.svn.fetch \
46 thunk:refs/remotes/svn/thunk &&
47 - git-svn fetch --follow-parent -i svn/thunk &&
47 + git-svn fetch -i svn/thunk &&
48 test \"\`git-rev-parse --verify refs/remotes/svn/trunk\`\" \
49 = \"\`git-rev-parse --verify refs/remotes/svn/thunk~1\`\" &&
50 test \"\`git-cat-file blob refs/remotes/svn/thunk:readme |\
@@ -56,8 +56,8 @@ test_expect_success 'follow deleted parent' "
56 -r2 $svnrepo/trunk $svnrepo/junk &&
57 git-repo-config --add svn-remote.svn.fetch \
58 junk:refs/remotes/svn/junk &&
59 - git-svn fetch --follow-parent -i svn/thunk &&
60 - git-svn fetch -i svn/junk --follow-parent &&
59 + git-svn fetch -i svn/thunk &&
60 + git-svn fetch -i svn/junk &&
61 test -z \"\`git diff svn/junk svn/trunk\`\" &&
62 test \"\`git merge-base svn/junk svn/trunk\`\" \
63 = \"\`git rev-parse svn/trunk\`\"
@@ -69,7 +69,7 @@ test_expect_success 'follow larger parent' "
69 svn import -m 'import a larger parent' import $svnrepo/larger-parent &&
70 svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger &&
71 git-svn init -i larger $svnrepo/another-larger/trunk/thunk/bump/thud &&
72 - git-svn fetch -i larger --follow-parent &&
72 + git-svn fetch -i larger &&
73 git-rev-parse --verify refs/remotes/larger &&
74 git-rev-parse --verify \
75 refs/remotes/larger-parent/trunk/thunk/bump/thud &&
@@ -91,7 +91,7 @@ test_expect_success 'follow higher-level parent' "
91 svn mkdir -m 'new glob at top level' $svnrepo/glob &&
92 svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&
93 git-svn init -i blob $svnrepo/glob/blob &&
94 - git-svn fetch -i blob --follow-parent
94 + git-svn fetch -i blob
95 "
96
97 test_expect_success 'follow deleted directory' "
@@ -128,7 +128,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
128 cd .. &&
129 git-svn init -i r9270-t \
130 $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&
131 - git-svn fetch -i r9270-t --follow-parent &&
131 + git-svn fetch -i r9270-t &&
132 test \`git rev-list r9270-t | wc -l\` -eq 2 &&
133 test \"\`git ls-tree --name-only r9270-t~1\`\" = \
134 \"\`git ls-tree --name-only r9270-t\`\"
@@ -138,7 +138,7 @@ test_expect_success "track initial change if it was only made to parent" "
138 svn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk &&
139 git-svn init -i r9270-d \
140 $svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t &&
141 - git-svn fetch -i r9270-d --follow-parent &&
141 + git-svn fetch -i r9270-d &&
142 test \`git rev-list r9270-d | wc -l\` -eq 3 &&
143 test \"\`git ls-tree --name-only r9270-t\`\" = \
144 \"\`git ls-tree --name-only r9270-d\`\" &&
@@ -148,19 +148,19 @@ test_expect_success "track initial change if it was only made to parent" "
148
149 test_expect_success "track multi-parent paths" "
150 svn cp -m 'resurrect /glob' $svnrepo/r9270 $svnrepo/glob &&
151 - git-svn multi-fetch --follow-parent &&
151 + git-svn multi-fetch &&
152 test \`git cat-file commit refs/remotes/glob | \
153 grep '^parent ' | wc -l\` -eq 2
154 "
155
156 test_expect_success "multi-fetch continues to work" "
157 - git-svn multi-fetch --follow-parent
157 + git-svn multi-fetch
158 "
159
160 test_expect_success "multi-fetch works off a 'clean' repository" "
161 rm -r $GIT_DIR/svn $GIT_DIR/refs/remotes $GIT_DIR/logs &&
162 mkdir $GIT_DIR/svn &&
163 - git-svn multi-fetch --follow-parent
163 + git-svn multi-fetch
164 "
165
166 test_debug 'gitk --all &'