quizzes/git: Add 'git branch *' questions
authorW. Trevor King <wking@tremily.us>
Thu, 7 Feb 2013 00:22:58 +0000 (19:22 -0500)
committerW. Trevor King <wking@tremily.us>
Thu, 7 Feb 2013 00:37:46 +0000 (19:37 -0500)
New questions:
* git branch
* git branch -a
* git branch -r
* git branch -d

quizzes/git.json

index a3a3e12848e25d6aa938dd71c5b41fd1c66553f1..e9bc336616f7106aa154430581db078adab8fd30 100644 (file)
                                ],
                        "setup": [
                                "export GIT_AUTHOR_NAME='A U Thor'",
-                               "export GIT_AUTHOR_EMAIL=author@example.com",
+                                       "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",
                        "tags": [
                                "config"
                                ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git branch",
+                       "prompt": "List all the local branches in your repository.",
+                       "answer": "git branch",
+                       "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'",
+                               " git branch feature-x",
+                               " git branch feature-y",
+                               ")",
+                               "git clone origin test",
+                               "cd test",
+                               "git branch feature-z"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-branch.html",
+                       "tags": [
+                               "branch"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git branch -a",
+                       "prompt": "List all the branches (local and remote-tracking) in your repository.",
+                       "answer": "git branch -a",
+                       "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'",
+                               " git branch feature-x",
+                               " git branch feature-y",
+                               ")",
+                               "git clone origin test",
+                               "cd test",
+                               "git branch feature-z"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-branch.html",
+                       "tags": [
+                               "branch"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git branch -r",
+                       "prompt": "List the remote-tracking branches in your repository.",
+                       "answer": "git branch -r",
+                       "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'",
+                               " git branch feature-x",
+                               " git branch feature-y",
+                               ")",
+                               "git clone origin test",
+                               "cd test",
+                               "git branch feature-z"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-branch.html",
+                       "tags": [
+                               "branch"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git branch -d",
+                       "prompt": "Delete the local `widget-x` branch",
+                       "answer": "git branch -d 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'",
+                               "git branch widget-x"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-branch.html",
+                       "tags": [
+                               "branch"
+                               ]
                }
        ]
 }