quiz: Add Quiz.introduction for an optional intro message
[quizzer.git] / quizzes / git.json
index 8607339b30efc5f01f1d596b13864e0c8f3b95bf..20c7aafcd2f32e3ee41d94e54311841017367ca2 100644 (file)
@@ -1,5 +1,6 @@
 {
        "version": "0.1",
+       "introduction": "Test your knowledge of the Git version control system.",
        "questions": [
                {
                        "class": "ScriptQuestion",
                        "interpreter": "sh",
                        "id": "gitignore",
                        "prompt": "Tell git to ignore files ending with `~`.",
+                       "timeout": null,
                        "answer": "echo '*~' > .gitignore",
                        "setup": [
                                        "git init"
                        "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"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git remote add",
+                       "prompt": [
+                               "Add a remote repository at `git://example.com/widgets.git`.",
+                               "Call the new repository `widgets`."
+                               ],
+                       "answer": "git remote add widgets git://example.com/widgets.git",
+                       "setup": [
+                               "git init"
+                               ],
+                       "teardown": [
+                               "cat .git/config"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-remote.html",
+                       "tags": [
+                               "remote"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git remote -v",
+                       "prompt": "List your configured remotes and their associated URLs.",
+                       "answer": "git remote -v",
+                       "setup": [
+                               "git init",
+                               "git remote add alice git://alice.au/widgets.git",
+                               "git remote add bob https://bob.br/bobs-widgets.git",
+                               "git remote add charlie charlie@charlie.ca:wgts/"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-remote.html",
+                       "tags": [
+                               "query",
+                               "remote"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git fetch REPOSITORY",
+                       "prompt": [
+                               "Update remote-tracking branches following the `widgets` remote.",
+                               "Don't merge any changes into your current branch."
+                               ],
+                       "answer": "git fetch 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\"",
+                               "(mkdir origin",
+                               " cd origin",
+                               " git init",
+                               " git commit --allow-empty -m 'Dummy commit'",
+                               ")",
+                               "mkdir test",
+                               "cd test",
+                               "git init",
+                               "git remote add widgets ../origin"
+                               ],
+                       "teardown": [
+                               "cat .git/config"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html",
+                       "tags": [
+                               "fetch",
+                               "remote"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git push REPOSITORY BRANCH",
+                       "prompt": [
+                               "Update the `master` branch on the `widgets` remote with",
+                               "the current contents of your `master` branch."
+                               ],
+                       "answer": "git push widgets master",
+                       "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\"",
+                               "(mkdir test",
+                               " cd test",
+                               " 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 clone --bare test origin",
+                               "cd test  # subshell closed in teardown",
+                               "git remote add widgets ../origin",
+                               "echo 'Widget X will be wonderful' > README",
+                               "git add README",
+                               "git commit -am 'Add widget-x documentation'"
+                               ],
+                       "teardown": [
+                               "cd ../origin",
+                               "git log --oneline"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-push.html",
+                       "tags": [
+                               "push",
+                               "remote"
+                               ]
                }
        ]
 }