Merge branch 'wk/doc-git-has-grown' into maint
[git/jrn.git] / t / t9604-cvsimport-timestamps.sh
blob1fd51423ee3d473a969180c29bfe05a6ac9b5b21
1 #!/bin/sh
3 test_description='git cvsimport timestamps'
4 . ./lib-cvs.sh
6 setup_cvs_test_repository t9604
8 test_expect_success 'check timestamps are UTC (TZ=CST6CDT)' '
10 TZ=CST6CDT git cvsimport -p"-x" -C module-1 module &&
11 git cvsimport -p"-x" -C module-1 module &&
13 cd module-1 &&
14 git log --format="%s %ai"
15 ) >actual-1 &&
16 cat >expect-1 <<-EOF &&
17 Rev 16 2006-10-29 07:00:01 +0000
18 Rev 15 2006-10-29 06:59:59 +0000
19 Rev 14 2006-04-02 08:00:01 +0000
20 Rev 13 2006-04-02 07:59:59 +0000
21 Rev 12 2005-12-01 00:00:00 +0000
22 Rev 11 2005-11-01 00:00:00 +0000
23 Rev 10 2005-10-01 00:00:00 +0000
24 Rev 9 2005-09-01 00:00:00 +0000
25 Rev 8 2005-08-01 00:00:00 +0000
26 Rev 7 2005-07-01 00:00:00 +0000
27 Rev 6 2005-06-01 00:00:00 +0000
28 Rev 5 2005-05-01 00:00:00 +0000
29 Rev 4 2005-04-01 00:00:00 +0000
30 Rev 3 2005-03-01 00:00:00 +0000
31 Rev 2 2005-02-01 00:00:00 +0000
32 Rev 1 2005-01-01 00:00:00 +0000
33 EOF
34 test_cmp actual-1 expect-1
37 test_expect_success 'check timestamps with author-specific timezones' '
39 cat >cvs-authors <<-EOF &&
40 user1=User One <user1@domain.org>
41 user2=User Two <user2@domain.org> CST6CDT
42 user3=User Three <user3@domain.org> EST5EDT
43 user4=User Four <user4@domain.org> MST7MDT
44 EOF
45 git cvsimport -p"-x" -A cvs-authors -C module-2 module &&
47 cd module-2 &&
48 git log --format="%s %ai %an"
49 ) >actual-2 &&
50 cat >expect-2 <<-EOF &&
51 Rev 16 2006-10-29 01:00:01 -0600 User Two
52 Rev 15 2006-10-29 01:59:59 -0500 User Two
53 Rev 14 2006-04-02 03:00:01 -0500 User Two
54 Rev 13 2006-04-02 01:59:59 -0600 User Two
55 Rev 12 2005-11-30 17:00:00 -0700 User Four
56 Rev 11 2005-10-31 19:00:00 -0500 User Three
57 Rev 10 2005-09-30 19:00:00 -0500 User Two
58 Rev 9 2005-09-01 00:00:00 +0000 User One
59 Rev 8 2005-07-31 18:00:00 -0600 User Four
60 Rev 7 2005-06-30 20:00:00 -0400 User Three
61 Rev 6 2005-05-31 19:00:00 -0500 User Two
62 Rev 5 2005-05-01 00:00:00 +0000 User One
63 Rev 4 2005-03-31 17:00:00 -0700 User Four
64 Rev 3 2005-02-28 19:00:00 -0500 User Three
65 Rev 2 2005-01-31 18:00:00 -0600 User Two
66 Rev 1 2005-01-01 00:00:00 +0000 User One
67 EOF
68 test_cmp actual-2 expect-2
71 test_done