Permalink
Browse files

final version

  • Loading branch information...
1 parent c052176 commit d110dc966e4b166dbc166a4e89164fcf475bd6ff @schacon committed Apr 1, 2011
View
@@ -110,6 +110,15 @@ table.rdata {
font-size: 1.5em;
}
+.rvc h2 {
+ font-size: 60px;
+ font-weight: bold;
+}
+.rvc h3 {
+ font-size: 40px;
+ color: #0b98b4;
+}
+
table.rdata tr.level {
color: #0b98b4;
background: #def;
@@ -155,3 +164,12 @@ table.rdata tr td.no-wd {
.backup pre code {
font-size: 25px;
}
+
+.tiny {
+ line-height: 19px;
+}
+
+.tiny pre code {
+ font-size: 25px;
+ color: #000;
+}
View
@@ -1,5 +1,18 @@
!SLIDE title
+# CODA #
+## Let's Review ##
+
+!SLIDE bullets list incremental
+
+# Tree Roles #
+
+* **HEAD** last commit, next parent
+* **Index** proposed next commit
+* **Work Dir** sandbox
+
+!SLIDE title
+
### Hi, you've reached Jimmy ###
## If you can dream it, you can do it! ##
@@ -16,3 +29,6 @@
# questions? #
### threetrees.heroku.com ###
+### schacon.github.com/resetvcheckout.html ###
+### github.com/schacon/tale_of_three_trees ###
+### gist.github.com/582888 ###
View
@@ -0,0 +1,70 @@
+var timerSetUp = false;
+var timerRunning = false;
+var intervalRunning = false;
+var seconds = 0;
+var totalMinutes = 35;
+
+function setUpTimer()
+{
+ if (timerSetUp) { return; }
+
+ timerSetUp = true;
+
+ $("#slideInfo").after(' <span id="timerInfo"></span> &nbsp; <img id="progressIcon"/>');
+
+ $(document).keydown(function(event) {
+ var key = event.keyCode;
+ if (event.ctrlKey || event.altKey || event.metaKey) { return; }
+
+ if (key == 89) // y for timer
+ {
+ toggleTimer();
+ }
+ });
+}
+
+function toggleTimer()
+{
+ if (!timerRunning) {
+ timerRunning = true
+ $("#timerInfo").text(timerStatus(0));
+ seconds = 0
+ if (!intervalRunning) {
+ intervalRunning = true
+ setInterval(function() {
+ if (!timerRunning) { return; }
+ seconds++;
+ $("#timerInfo").text(timerStatus(seconds));
+ }, 1000); // fire every minute
+ }
+ } else {
+ seconds = 0
+ timerRunning = false
+ $("#timerInfo").text('')
+ }
+}
+
+function timerStatus(seconds) {
+ var minutes = Math.round(seconds / 60);
+ var left = (totalMinutes - minutes);
+ var percent = Math.round((minutes / totalMinutes) * 100);
+ var progress = getSlidePercent() - percent;
+ setProgressIcon(progress);
+ return ' - (' + minutes + '/' + left + ':' + percent + '%)';
+}
+
+function setProgressIcon(progress) {
+ if(progress > 10) {
+ $('#progressIcon').attr('src', '/image/timer/flag_blue.png')
+ } else if (progress > 0) {
+ $('#progressIcon').attr('src', '/image/timer/flag_green.png')
+ } else if (progress > -10) {
+ $('#progressIcon').attr('src', '/image/timer/flag_yellow.png')
+ } else {
+ $('#progressIcon').attr('src', '/image/timer/flag_red.png')
+ }
+}
+
+$(function(){
+ setUpTimer();
+});
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -12,6 +12,40 @@
* git reset --patch (commit) [file]
* git checkout --patch (commit) [file]
+!SLIDE code
+
+# git read-tree #
+
+!SLIDE code
+
+# git write-tree #
+
+!SLIDE commandline incremental
+
+ $ ls
+ README Rakefile lib
+
+ $ git init
+ Initialized empty Git repository in /private/tmp/gt/.git/
+ nothing added to commit but untracked files present (use "git add" to track)
+
+ $ git log
+ fatal: bad default revision 'HEAD'
+
+ $ git add --all
+
+ $ git write-tree
+ 4b8ad0172510761cb0e07d2c4220932bf41bbd07
+
+ $ git ls-tree 4b8ad0172510761cb0e07d2c4220932bf41bbd07
+ 100644 blob 45dc653de6860... README
+ 100644 blob ea3fe2ac46e92... Rakefile
+ 040000 tree 99f1a6d12cb4b... lib
+
+!SLIDE code
+
+# git commit-tree #
+
!SLIDE
# Environment Variables #
@@ -181,3 +215,39 @@
Date: Thu Mar 31 13:45:56 2011 -0700
back
+
+!SLIDE
+
+# Freeze Submodules Before Push #
+
+!SLIDE tiny
+
+ @@@ ruby
+ current_commit = `git rev-parse HEAD`
+ current_tree = `git rev-parse HEAD^{tree}`
+
+ # get a list of submodules
+ status = `git submodule status`.chomp
+ subdata = status.split("\n")
+ subdata.each do |subline|
+ sharaw, path = subline.split(" ")
+ sha = sharaw[1, sharaw.size - 1]
+ remote = path.gsub('/', '-')
+ `git remote add #{remote} #{path} 2>/dev/null` # fetch each submodule into a remote
+ `git fetch #{remote}`
+ `git read-tree --prefix=#{path} #{sha}` # for each submodule/sha, read-tree the sha into the path
+ end
+
+ # find heroku parent
+ prev_commit = `git rev-parse heroku 2>/dev/null`.chomp
+ pcommit = (prev_commit != "heroku") ? "-p #{prev_commit}" : ''
+
+ # write-tree/commit-tree with message of what commit sha it's based on
+ tree_sha = `git write-tree`.chomp
+ commit_sha = `echo "deploy at #{current_commit}" | git commit-tree #{tree_sha} #{pcommit}`
+
+ # update-ref
+ `git update-ref refs/heads/heroku #{commit_sha}`
+
+ # reset
+ `git reset HEAD`
View
@@ -256,7 +256,13 @@
!SLIDE code
-## git reset HEAD -- file ##
+## git reset ##
+
+!SLIDE code
+
+# OR #
+
+## git reset [file] ##
!SLIDE
@@ -283,6 +289,29 @@
!SLIDE
+# undo last commit #
+## but keep the stage ##
+
+!SLIDE smaller
+
+# `git reset --soft HEAD~` #
+
+## moves HEAD back but keeps index ##
+
+!SLIDE
+
+![](reset1.png)
+
+!SLIDE
+
+![](reset-soft.png)
+
+!SLIDE
+
+![](reset-mixed.png)
+
+!SLIDE
+
# squash the last 2 commits into one #
!SLIDE small
@@ -337,9 +366,10 @@
![](reset-checkout.png)
-!SLIDE center
+!SLIDE center rvc
-# Reset v. Checkout #
+## Reset v. Checkout ##
+### schacon.github.com/resetvcheckout.html ###
<table class="rdata">
<tr>

0 comments on commit d110dc9

Please sign in to comment.