quizzes/git: Add 'git log *' questions
authorW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 22:39:26 +0000 (17:39 -0500)
committerW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 22:42:49 +0000 (17:42 -0500)
New questions:
* git log
* git log -p
* git log --stat
* git log --all
* git log --oneline
* git log --oneline --graph
* git log --oneline --decorate

quizzes/git.json

index ed4876962e29914608f59261f676489c787cc498..2acff0ccf609ba05afcb601b3c80b6bd2b3ed785 100644 (file)
                                "query"
                                ]
                },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git log",
+                       "prompt": "Print the commits leading up to your current state.",
+                       "answer": "git log",
+                       "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",
+                               "git commit -am 'More widgets'"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
+                       "tags": [
+                               "query"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git log -p",
+                       "prompt": [
+                               "Print the commits leading up to your current state,",
+                               "showing a patch for each commit."
+                               ],
+                       "answer": "git log -p",
+                       "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",
+                               "git commit -am 'More widgets'"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
+                       "tags": [
+                               "query"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git log --stat",
+                       "prompt": [
+                               "Print the commits leading up to your current state,",
+                               "showing the files changed by each commit."
+                               ],
+                       "answer": "git log --stat",
+                       "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",
+                               "git commit -am 'More widgets'"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
+                       "tags": [
+                               "query"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git log --all",
+                       "prompt": [
+                               "Print every commit in your repository reachable from a reference",
+                               "(e.g from any tag or branch)"
+                               ],
+                       "answer": "git log --all",
+                       "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\"",
+                               "git checkout -b more-widgets",
+                               "echo 'Take a look in the widgets file.' >> README",
+                               "echo 'Widget-1 should be blue' >> widgets",
+                               "git commit -am 'More widgets'",
+                               "git checkout master"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
+                       "tags": [
+                               "query",
+                               "branch"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git log --oneline",
+                       "prompt": [
+                               "Print the commits leading up to your current state,",
+                               "with each commit only using a single line."
+                               ],
+                       "answer": "git log --oneline",
+                       "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",
+                               "git commit -am 'More widgets'"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
+                       "tags": [
+                               "query"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git log --oneline --graph",
+                       "prompt": [
+                               "Print the commits leading up to your current state,",
+                               "with each commit only using a single line",
+                               "and an ASCII-art inheritence graph."
+                               ],
+                       "answer": "git log --oneline --graph",
+                       "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",
+                               "git commit -am 'More widgets'"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
+                       "tags": [
+                               "query"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "id": "git log --oneline --decorate",
+                       "prompt": [
+                               "Print the commits leading up to your current state,",
+                               "with each commit only using a single line",
+                               "and reference (e.g. tag and branch) names before the summary"
+                               ],
+                       "answer": "git log --oneline --decorate",
+                       "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",
+                               "git commit -am 'More widgets'"
+                               ],
+                       "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
+                       "tags": [
+                               "query",
+                               "branch"
+                               ]
+               },
                {
                        "class": "ScriptQuestion",
                        "interpreter": "sh",