quizzes/git: Convert multi-line prompts to lists
[quizzer.git] / quizzes / git.json
1 {
2         "version": "0.1",
3         "questions": [
4                 {
5                         "class": "ScriptQuestion",
6                         "interpreter": "sh",
7                         "id": "git config --global user.name",
8                         "prompt": "Configure your user-wide name to be `A U Thor`.",
9                         "answer": "git config --global user.name 'A U Thor'",
10                         "setup": [
11                                         "export HOME=."
12                                         ],
13                         "teardown": [
14                                 "cat .gitconfig"
15                                 ],
16                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
17                         "tags": [
18                                 "config"
19                                 ]
20                 },
21                 {
22                         "class": "ScriptQuestion",
23                         "interpreter": "sh",
24                         "id": "git config --global user.email",
25                         "prompt": "Configure your user-wide email to be `author@example.com`.",
26                         "answer": "git config --global user.email 'author@example.com'",
27                         "setup": [
28                                         "export HOME=."
29                                         ],
30                         "teardown": [
31                                 "cat .gitconfig"
32                                 ],
33                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
34                         "tags": [
35                                 "config"
36                                 ]
37                 },
38                 {
39                         "class": "ScriptQuestion",
40                         "interpreter": "sh",
41                         "id": "git init",
42                         "prompt": "Initialize a Git repository in a new `my-project` directory.",
43                         "multiline": true,
44                         "answer": [
45                                         "mkdir my-project",
46                                         "cd my-project",
47                                         "git init"
48                                         ],
49                         "teardown": [
50                                 "git status"
51                                 ],
52                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-init.html",
53                         "tags": [
54                                 "init"
55                                 ]
56                 },
57                 {
58                         "class": "ScriptQuestion",
59                         "interpreter": "sh",
60                         "id": "git clone",
61                         "prompt": "Clone git://github.com/wking/quizzer.git into a new `quizzer` directory.",
62                         "answer": "git clone git://github.com/wking/quizzer.git",
63                         "teardown": [
64                                 "cd quizzer",
65                                 "git status"
66                                 ],
67                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html",
68                         "tags": [
69                                 "init"
70                                 ]
71                 },
72                 {
73                         "class": "ScriptQuestion",
74                         "interpreter": "sh",
75                         "id": "git add / commit",
76                         "prompt": [
77                                 "There is a new README file in your repository.",
78                                 "Make a new commit including this README.",
79                                 "The commit message should be `Add a README`."
80                                 ],
81                         "multiline": true,
82                         "timeout": null,
83                         "answer": [
84                                 "git add README",
85                                 "git commit -m \"Add a README\""
86                                 ],
87                         "setup": [
88                                 "export GIT_AUTHOR_NAME='A U Thor'",
89                                 "export GIT_AUTHOR_EMAIL=author@example.com",
90                                 "export GIT_COMMITTER_NAME='C O Mitter'",
91                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
92                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
93                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
94                                 "git init",
95                                 "echo 'This project is wonderful' > README"
96                                 ],
97                         "teardown": [
98                                 "git ls-files",
99                                 "git status"
100                                 ],
101                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-add.html\nhttp://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
102                         "tags": [
103                                 "add",
104                                 "commit"
105                                 ]
106                 },
107                 {
108                         "class": "ScriptQuestion",
109                         "interpreter": "sh",
110                         "id": "git checkout HEAD -- FILE",
111                         "prompt": [
112                                 "You've messed up your README file.",
113                                 "Restore it to the last committed version."
114                                 ],
115                         "answer": "git checkout HEAD -- README",
116                         "setup": [
117                                 "export GIT_AUTHOR_NAME='A U Thor'",
118                                 "export GIT_AUTHOR_EMAIL=author@example.com",
119                                 "export GIT_COMMITTER_NAME='C O Mitter'",
120                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
121                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
122                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
123                                 "git init",
124                                 "echo 'This project is wonderful' > README",
125                                 "git add README",
126                                 "git commit -am 'Add a README'",
127                                 "echo 'This project is terrible' > README"
128                                 ],
129                         "teardown": [
130                                 "git status",
131                                 "cat README"
132                                 ],
133                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
134                         "tags": [
135                                 "checkout"
136                                 ]
137                 },
138                 {
139                         "class": "ScriptQuestion",
140                         "interpreter": "sh",
141                         "id": "git commit --amend",
142                         "prompt": [
143                                 "You messed up your README file in your last commit.",
144                                 "You just fixed the contents of `README`, but haven't added it to the index.",
145                                 "Commit the new version so it also fixes the last commit.",
146                                 "The fixed commit message should be `Add a README`."
147                                 ],
148                         "multiline": true,
149                         "timeout": null,
150                         "answer": [
151                                 "git commit --amend -am 'Add a README'"
152                                 ],
153                         "setup": [
154                                 "export GIT_AUTHOR_NAME='A U Thor'",
155                                 "export GIT_AUTHOR_EMAIL=author@example.com",
156                                 "export GIT_COMMITTER_NAME='C O Mitter'",
157                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
158                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
159                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
160                                 "git init",
161                                 "echo 'This project is terrible' > README",
162                                 "git add README",
163                                 "git commit -am 'Add a README'",
164                                 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
165                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
166                                 "echo 'This project is wonderful' > README"
167                                 ],
168                         "teardown": [
169                                 "git log -p",
170                                 "git status"
171                                 ],
172                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
173                         "tags": [
174                                 "commit",
175                                 "rewrite"
176                                 ]
177                 }
178         ]
179 }