quizzes/git: Add 'git add / commit' question
authorW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 01:56:06 +0000 (20:56 -0500)
committerW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 02:25:16 +0000 (21:25 -0500)
Remove the default timeout, to give users who spawn `$EDITOR` via `git
commit` time to write and save their message.

quizzes/git.json

index 3d5607225de2d32e033666a98a03fcaa4cc48207..5d547902d36d97d77c341404cba5fdece3ac3aaa 100644 (file)
                                "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"
                }
        ]
 }