From: W. Trevor King Date: Wed, 6 Feb 2013 01:56:06 +0000 (-0500) Subject: quizzes/git: Add 'git add / commit' question X-Git-Tag: v0.1~39 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=de7873b217c430dc307e6a3ec6a4440cffc24842;p=quizzer.git quizzes/git: Add 'git add / commit' question Remove the default timeout, to give users who spawn `$EDITOR` via `git commit` time to write and save their message. --- diff --git a/quizzes/git.json b/quizzes/git.json index 3d56072..5d54790 100644 --- a/quizzes/git.json +++ b/quizzes/git.json @@ -28,6 +28,33 @@ "git status" ], "help": "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html" + }, + { + "class": "ScriptQuestion", + "interpreter": "sh", + "id": "git add / commit", + "prompt": "there is a new README file in your repository.\nmake a new commit including this README.\nthe commit message should be `Add a README`", + "multiline": true, + "timeout": null, + "answer": [ + "git add README", + "git commit -m \"Add a README\"" + ], + "setup": [ + "export GIT_AUTHOR_NAME='A U Thor'", + "export GIT_AUTHOR_EMAIL=author@example.com", + "export GIT_COMMITTER_NAME='C O Mitter'", + "export GIT_COMMITTER_EMAIL=committer@example.com", + "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z", + "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"", + "git init", + "echo 'This project is wonderful' > README" + ], + "teardown": [ + "git ls-files", + "git status" + ], + "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" } ] }