quizzes/git: Add 'git commit -a' question
authorW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 22:03:05 +0000 (17:03 -0500)
committerW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 22:03:05 +0000 (17:03 -0500)
quizzes/git.json

index 17f25e728604deb7a4d8b375f3695676db2c1649..1ecdc1f415736664d69dcbe4cfad7fe72e3b3dcd 100644 (file)
                                "query"
                                ]
                },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git commit -a",
+                       "prompt": [
+                               "You've edited a few files since the last commit.",
+                               "Make a new commit including all of these changes.",
+                               "The commit message should be `Reformat widgets`."
+                               ],
+                       "timeout": null,
+                       "answer": "git commit -am 'Reformat widgets'",
+                       "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",
+                               "echo 'Lots of widgets' > widgets",
+                               "git add README widgets",
+                               "git commit -m 'Add some widgets'",
+                               "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
+                               "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
+                               "echo 'Take a look in the widgets file.' >> README",
+                               "echo 'Widget-1 should be blue' >> widgets"
+                               ],
+                       "teardown": [
+                               "git log -p"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
+                       "tags": [
+                               "commit"
+                               ]
+               },
                {
                        "class": "ScriptQuestion",
                        "interpreter": "sh",