quizzes/git: Add 'git status' question
[quizzer.git] / quizzes / git.json
1 {
2         "version": "0.1",
3         "questions": [
4                 {
5                         "class": "ScriptQuestion",
6                         "intepreter": "sh",
7                         "id": "git help config",
8                         "prompt": "Get help for Git's `config` command",
9                         "answer": "git help config",
10                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-help.html",
11                         "tags": [
12                                 "help"
13                                 ]
14                 },
15                 {
16                         "class": "ScriptQuestion",
17                         "interpreter": "sh",
18                         "id": "git config --global user.name",
19                         "prompt": "Configure your user-wide name to be `A U Thor`.",
20                         "answer": "git config --global user.name 'A U Thor'",
21                         "setup": [
22                                         "export HOME=."
23                                         ],
24                         "teardown": [
25                                 "cat .gitconfig"
26                                 ],
27                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
28                         "tags": [
29                                 "config"
30                                 ]
31                 },
32                 {
33                         "class": "ScriptQuestion",
34                         "interpreter": "sh",
35                         "id": "git config --global user.email",
36                         "prompt": "Configure your user-wide email to be `author@example.com`.",
37                         "answer": "git config --global user.email 'author@example.com'",
38                         "setup": [
39                                         "export HOME=."
40                                         ],
41                         "teardown": [
42                                 "cat .gitconfig"
43                                 ],
44                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
45                         "tags": [
46                                 "config"
47                                 ]
48                 },
49                 {
50                         "class": "ScriptQuestion",
51                         "interpreter": "sh",
52                         "id": "git init",
53                         "prompt": "Initialize a Git repository in a new `my-project` directory.",
54                         "multiline": true,
55                         "answer": [
56                                         "mkdir my-project",
57                                         "cd my-project",
58                                         "git init"
59                                         ],
60                         "teardown": [
61                                 "git status"
62                                 ],
63                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-init.html",
64                         "tags": [
65                                 "init"
66                                 ]
67                 },
68                 {
69                         "class": "ScriptQuestion",
70                         "interpreter": "sh",
71                         "id": "git clone",
72                         "prompt": "Clone git://github.com/wking/quizzer.git into a new `quizzer` directory.",
73                         "answer": "git clone git://github.com/wking/quizzer.git",
74                         "teardown": [
75                                 "cd quizzer",
76                                 "git status"
77                                 ],
78                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html",
79                         "tags": [
80                                 "init"
81                                 ]
82                 },
83                 {
84                         "class": "ScriptQuestion",
85                         "interpreter": "sh",
86                         "id": "git add / commit",
87                         "prompt": [
88                                 "There is a new README file in your repository.",
89                                 "Make a new commit including this README.",
90                                 "The commit message should be `Add a README`."
91                                 ],
92                         "multiline": true,
93                         "timeout": null,
94                         "answer": [
95                                 "git add README",
96                                 "git commit -m \"Add a README\""
97                                 ],
98                         "setup": [
99                                 "export GIT_AUTHOR_NAME='A U Thor'",
100                                 "export GIT_AUTHOR_EMAIL=author@example.com",
101                                 "export GIT_COMMITTER_NAME='C O Mitter'",
102                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
103                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
104                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
105                                 "git init",
106                                 "echo 'This project is wonderful' > README"
107                                 ],
108                         "teardown": [
109                                 "git ls-files",
110                                 "git status"
111                                 ],
112                         "help": [
113                                 "http://www.kernel.org/pub/software/scm/git/docs/git-add.html",
114                                 "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html"
115                                 ],
116                         "tags": [
117                                 "add",
118                                 "commit"
119                                 ]
120                 },
121                 {
122                         "class": "ScriptQuestion",
123                         "interpreter": "sh",
124                         "id": "git status",
125                         "prompt": [
126                                 "You don't remember if you've staged README to be committed.",
127                                 "How would you check?"
128                                 ],
129                         "answer": "git status",
130                         "setup": [
131                                 "git init",
132                                 "echo 'This project is wonderful' > README",
133                                 "git add README"
134                                 ],
135                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-status.html",
136                         "tags": [
137                                 "add",
138                                 "query"
139                                 ]
140                 },
141                 {
142                         "class": "ScriptQuestion",
143                         "interpreter": "sh",
144                         "id": "git checkout HEAD -- FILE",
145                         "prompt": [
146                                 "You've messed up your README file.",
147                                 "Restore it to the last committed version."
148                                 ],
149                         "answer": "git checkout HEAD -- README",
150                         "setup": [
151                                 "export GIT_AUTHOR_NAME='A U Thor'",
152                                 "export GIT_AUTHOR_EMAIL=author@example.com",
153                                 "export GIT_COMMITTER_NAME='C O Mitter'",
154                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
155                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
156                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
157                                 "git init",
158                                 "echo 'This project is wonderful' > README",
159                                 "git add README",
160                                 "git commit -am 'Add a README'",
161                                 "echo 'This project is terrible' > README"
162                                 ],
163                         "teardown": [
164                                 "git status",
165                                 "cat README"
166                                 ],
167                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
168                         "tags": [
169                                 "checkout"
170                                 ]
171                 },
172                 {
173                         "class": "ScriptQuestion",
174                         "interpreter": "sh",
175                         "id": "git commit --amend",
176                         "prompt": [
177                                 "You messed up your README file in your last commit.",
178                                 "You just fixed the contents of `README`, but haven't added it to the index.",
179                                 "Commit the new version so it also fixes the last commit.",
180                                 "The fixed commit message should be `Add a README`."
181                                 ],
182                         "multiline": true,
183                         "timeout": null,
184                         "answer": [
185                                 "git commit --amend -am 'Add a README'"
186                                 ],
187                         "setup": [
188                                 "export GIT_AUTHOR_NAME='A U Thor'",
189                                 "export GIT_AUTHOR_EMAIL=author@example.com",
190                                 "export GIT_COMMITTER_NAME='C O Mitter'",
191                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
192                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
193                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
194                                 "git init",
195                                 "echo 'This project is terrible' > README",
196                                 "git add README",
197                                 "git commit -am 'Add a README'",
198                                 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
199                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
200                                 "echo 'This project is wonderful' > README"
201                                 ],
202                         "teardown": [
203                                 "git log -p",
204                                 "git status"
205                                 ],
206                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
207                         "tags": [
208                                 "commit",
209                                 "rewrite"
210                                 ]
211                 },
212                 {
213                         "class": "ScriptQuestion",
214                         "interpreter": "sh",
215                         "id": "gitignore",
216                         "prompt": "Tell git to ignore files ending with `~`.",
217                         "answer": "echo '*~' > .gitignore",
218                         "setup": [
219                                         "git init"
220                                         ],
221                         "teardown": [
222                                 "touch some-file~",
223                                 "git status | grep some-file"
224                                 ],
225                         "help": "http://www.kernel.org/pub/software/scm/git/docs/gitignore.html",
226                         "tags": [
227                                 "config"
228                                 ]
229                 }
230         ]
231 }