3 test_description
='git svn authorship'
6 test_expect_success
'setup svn repository' '
7 svn_cmd checkout "$svnrepo" work.svn &&
12 svn_cmd commit -m "first commit" file
16 test_expect_success
'interact with it via git svn' '
20 git svn init "$svnrepo"
23 echo modification >file &&
25 git commit -a -m second &&
30 echo "further modification" >file &&
32 git commit -a -m third &&
35 git svn --add-author-from dcommit &&
37 echo "yet further modification" >file &&
39 git commit -a -m fourth &&
42 git svn --add-author-from --use-log-author dcommit &&
46 git show -s HEAD^^ >../actual.2 &&
47 git show -s HEAD^ >../actual.3 &&
48 git show -s HEAD >../actual.4
52 # Make sure that --add-author-from without --use-log-author
53 # did not affect the authorship information
54 myself=$(grep "^Author: " actual.2) &&
55 unaffected=$(grep "^Author: " actual.3) &&
56 test "z$myself" = "z$unaffected" &&
58 # Make sure lack of --add-author-from did not add cruft
59 ! grep "^ From: A U Thor " actual.2 &&
61 # Make sure --add-author-from added cruft
62 grep "^ From: A U Thor " actual.3 &&
63 grep "^ From: A U Thor " actual.4 &&
65 # Make sure --add-author-from with --use-log-author affected
66 # the authorship information
67 grep "^Author: A U Thor " actual.4 &&
69 # Make sure there are no commit messages with excess blank lines
70 test $(grep "^ " actual.2 | wc -l) = 3 &&
71 test $(grep "^ " actual.3 | wc -l) = 5 &&
72 test $(grep "^ " actual.4 | wc -l) = 5 &&
74 # Make sure there are no svn commit messages with excess blank lines
79 test $(svn_cmd log -r2:2 | wc -l) = 5 &&
80 test $(svn_cmd log -r4:4 | wc -l) = 7