quizzer/git: Add 'git merge' question
authorW. Trevor King <wking@tremily.us>
Thu, 7 Feb 2013 00:43:45 +0000 (19:43 -0500)
committerW. Trevor King <wking@tremily.us>
Thu, 7 Feb 2013 01:14:47 +0000 (20:14 -0500)
quizzes/git.json

index 8607339b30efc5f01f1d596b13864e0c8f3b95bf..99978bfd6b2343055287f0c94e506da4c58feae9 100644 (file)
                        "tags": [
                                "branch"
                                ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git merge",
+                       "prompt": "Merge the `widget-x` branch into the current branch",
+                       "answer": "git merge widget-x",
+                       "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",
+                               "git commit --allow-empty -m 'Dummy commit'",
+                               "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
+                               "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
+                               "git checkout -b widget-x",
+                               "echo 'Widget X will be wonderful' > README",
+                               "git add README",
+                               "git commit -am 'Add widget-x documentation'",
+                               "export GIT_AUTHOR_DATE=1970-01-01T00:02:00Z",
+                               "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
+                               "git checkout master"
+                               ],
+                       "teardown": [
+                               "git log --all --oneline --graph --decorate"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-merge.html",
+                       "tags": [
+                               "branch",
+                               "merge"
+                               ]
                }
        ]
 }