3 test_description
='git svn authorship'
7 test_expect_success
'setup svn repository' '
8 svn_cmd checkout "$svnrepo" work.svn &&
13 svn_cmd commit -m "first commit" file
17 test_expect_success
'interact with it via git svn' '
21 git svn init "$svnrepo" &&
24 echo modification >file &&
26 git commit -a -m second &&
31 echo "further modification" >file &&
33 git commit -a -m third &&
36 git svn --add-author-from dcommit &&
38 echo "yet further modification" >file &&
40 git commit -a -m fourth &&
43 git svn --add-author-from --use-log-author dcommit &&
47 git show -s HEAD^^ >../actual.2 &&
48 git show -s HEAD^ >../actual.3 &&
49 git show -s HEAD >../actual.4
53 # Make sure that --add-author-from without --use-log-author
54 # did not affect the authorship information
55 myself=$(grep "^Author: " actual.2) &&
56 unaffected=$(grep "^Author: " actual.3) &&
57 test "z$myself" = "z$unaffected" &&
59 # Make sure lack of --add-author-from did not add cruft
60 ! grep "^ From: A U Thor " actual.2 &&
62 # Make sure --add-author-from added cruft
63 grep "^ From: A U Thor " actual.3 &&
64 grep "^ From: A U Thor " actual.4 &&
66 # Make sure --add-author-from with --use-log-author affected
67 # the authorship information
68 grep "^Author: A U Thor " actual.4 &&
70 # Make sure there are no commit messages with excess blank lines
71 test $(grep "^ " actual.2 | wc -l) = 3 &&
72 test $(grep "^ " actual.3 | wc -l) = 5 &&
73 test $(grep "^ " actual.4 | wc -l) = 5 &&
75 # Make sure there are no svn commit messages with excess blank lines
80 test $(svn_cmd log -r2:2 | wc -l) = 5 &&
81 test $(svn_cmd log -r4:4 | wc -l) = 7