From e063d3763f536d7943354c62f030dee0278c29dc Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 00:20:10 -0700 Subject: [PATCH 01/18] Updated main readme file to give Toughtbot original attribution and say they are modified by us. Commented out Trello PM link. --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a3205a84..8c0f7197 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Guides Guides for getting things done, programming well, and programming in style. -* Product Management with [Trello](/product-management/trello) +<---* Product Management with [Trello](/product-management/trello)--> * [Protocol](/protocol) * [Code Review](/code-review) * [Best Practices](/best-practices) @@ -25,12 +25,14 @@ A note on the language: Credits ------- +This is a branch of the original [Thoughtbot, inc](http://thoughtbot.com/community) [Guides](https://github.com/thoughtbot/guides) + +The original guides have been modified for use internally by [DigitalAugment Inc.](http://digitalaugment.com) + Thank you, [contributors](https://github.com/thoughtbot/guides/graphs/contributors)! ![thoughtbot](http://thoughtbot.com/images/tm/logo.png) -Guides is maintained by [thoughtbot, inc](http://thoughtbot.com/community). - License ------- From a64991a591c078af8fe4afa43528a7b35a77235a Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 00:28:12 -0700 Subject: [PATCH 02/18] Fixed commented out line. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c0f7197..e1079080 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Guides Guides for getting things done, programming well, and programming in style. -<---* Product Management with [Trello](/product-management/trello)--> + * [Protocol](/protocol) * [Code Review](/code-review) * [Best Practices](/best-practices) From 8a0581a2c98bd8ca734e0d66ec10a0f8674a3117 Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 00:56:04 -0700 Subject: [PATCH 03/18] Updated protocal guide to remove the items not being used right now. Updated to use git alias'. Changed names of tools used. --- code-review/README.md | 2 +- protocol/README.md | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/code-review/README.md b/code-review/README.md index b06a479c..4608089f 100644 --- a/code-review/README.md +++ b/code-review/README.md @@ -40,7 +40,7 @@ Having your code reviewed * Seek to understand the reviewer's perspective. * Try to respond to every comment. * Wait to merge the branch until another person signs off. -* Wait to merge the branch until Continuous Integration (TDDium, TravisCI, etc.) +* Wait to merge the branch until Continuous Integration ([CodeClimate](https://codeclimate.com), [TravisCI](https://travis-ci.org), etc.) tells you the test suite is green in the branch. Reviewing code diff --git a/protocol/README.md b/protocol/README.md index f71a7c48..94a667de 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -3,6 +3,8 @@ Protocol A guide for getting things done. + + +Add Git Alias' +------------- + +Added the following to the ``~/.gitconfig`` file. + + [alias] + pr = !hub pull-request -h master + create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' - + merge-branch = !git checkout master && git merge @{-1} + rebase-origin = !git fetch origin && git rebase origin/master + irebase-origin = !git fetch origin && git rebase -i origin/master + Write a feature --------------- Create a local feature branch based off master. - git checkout master - git pull - git checkout -b + git create-branch Prefix the branch name with your initials. Rebase frequently to incorporate upstream changes. - git fetch origin - git rebase origin/master + git rebase-origin Resolve conflicts. When feature is complete and tests pass, stage the changes. @@ -120,7 +133,13 @@ Share your branch. Submit a [GitHub pull request](http://goo.gl/Kmdee). -Ask for a code review in [Campfire](http://campfirenow.com). + git pr + +Link to the code review in JIRA ticket comment. + + "Ready for review: http://github.com/organization/project/pull/1" + +Ask for a code review in [Hipchat](http://hipchat.com). Review code ----------- @@ -130,7 +149,7 @@ A team member other than the author reviews the pull request. They follow miscommunication. They make comments and ask questions directly on lines of code in the Github -web interface or in Campfire. +web interface or in Hipchat. For changes which they can make themselves, they check out the branch. @@ -150,8 +169,7 @@ Merge Rebase interactively. Squash commits like "Fix whitespace" into one or a small number of valuable commit(s). Edit commit messages to reveal intent. - git fetch origin - git rebase -i origin/master + git irebase-origin rake View a list of new commits. View changed files. Merge branch into master. @@ -170,6 +188,8 @@ Delete your local feature branch. git branch --delete + \ No newline at end of file From e3bda7bc16e1a90378e87dc671c9678a700fa620 Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 01:01:29 -0700 Subject: [PATCH 04/18] Updated branch name specification --- protocol/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/README.md b/protocol/README.md index 94a667de..e7dc5af6 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -100,7 +100,7 @@ Write a feature Create a local feature branch based off master. - git create-branch + git create-branch _ Prefix the branch name with your initials. From f37ec5131e2a5ee95b6d7f65df43b689a1df33d5 Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 01:21:57 -0700 Subject: [PATCH 05/18] Added note to install hub. --- protocol/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/protocol/README.md b/protocol/README.md index e7dc5af6..5c13c675 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -83,6 +83,11 @@ Maintain a Rails app --> +Install Hub +----------- + + brew install hub + Add Git Alias' ------------- @@ -137,7 +142,7 @@ Submit a [GitHub pull request](http://goo.gl/Kmdee). Link to the code review in JIRA ticket comment. - "Ready for review: http://github.com/organization/project/pull/1" + @ Ready for review: http://github.com/organization/project/pull/1 Ask for a code review in [Hipchat](http://hipchat.com). From 396435c48c9e767446022fa8fa9dfee29e77e8cc Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 01:28:51 -0700 Subject: [PATCH 06/18] Removed options on pr alias --- protocol/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/README.md b/protocol/README.md index 5c13c675..7bf96763 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -94,7 +94,7 @@ Add Git Alias' Added the following to the ``~/.gitconfig`` file. [alias] - pr = !hub pull-request -h master + pr = !hub pull-request create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' - merge-branch = !git checkout master && git merge @{-1} rebase-origin = !git fetch origin && git rebase origin/master From 8774de5ca7087fe505de9350dbba10910ea21726 Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 01:32:05 -0700 Subject: [PATCH 07/18] Updated commands Now use rake reports:all for tests and commit -av for commits. --- protocol/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/protocol/README.md b/protocol/README.md index 7bf96763..3bf6cbdf 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -94,6 +94,7 @@ Add Git Alias' Added the following to the ``~/.gitconfig`` file. [alias] + st = status pr = !hub pull-request create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' - merge-branch = !git checkout master && git merge @{-1} @@ -113,15 +114,14 @@ Rebase frequently to incorporate upstream changes. git rebase-origin -Resolve conflicts. When feature is complete and tests pass, stage the changes. +Resolve conflicts. When feature is complete and tests pass. - rake - git add --all + rake reports:all When you've staged the changes, commit them. - git status - git commit --verbose + git st + git commit -av Write a [good commit message](http://goo.gl/w11us). Example format: From a4c12eacd65a5a76d7aa9e226134749c6ddbed18 Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 01:37:55 -0700 Subject: [PATCH 08/18] Updated how to create branch Description for ticket number Added initials to format --- protocol/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/protocol/README.md b/protocol/README.md index 3bf6cbdf..5a17a59c 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -106,9 +106,9 @@ Write a feature Create a local feature branch based off master. - git create-branch _ + git create-branch __ -Prefix the branch name with your initials. +Prefix the branch name with your initials and postfix with JIRA ticket number. Rebase frequently to incorporate upstream changes. @@ -132,9 +132,9 @@ Write a [good commit message](http://goo.gl/w11us). Example format: http://project.management-system.com/ticket/123 -Share your branch. +Push your branch. - git push origin + git push Submit a [GitHub pull request](http://goo.gl/Kmdee). From f5623724ebfc2402ba631e71e6bcf8afbcfc6e22 Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 01:59:03 -0700 Subject: [PATCH 09/18] Fix pr command Added notes to create alias for git to hub Updated .gitconfig directions --- protocol/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/protocol/README.md b/protocol/README.md index 5a17a59c..a1f4f870 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -83,11 +83,16 @@ Maintain a Rails app --> -Install Hub +Setup Hub ----------- +Install [hub](https://github.com/defunkt/hub) brew install hub +Alias git to hub by adding this line to you ``.bash_profile`` or ``.profile`` + + alias git='hub' + Add Git Alias' ------------- @@ -95,9 +100,10 @@ Added the following to the ``~/.gitconfig`` file. [alias] st = status - pr = !hub pull-request + pr = pull-request create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' - merge-branch = !git checkout master && git merge @{-1} + delete-branch = !sh -c 'git push origin :refs/heads/$1 && git remote prune origin && git branch -D $1' - rebase-origin = !git fetch origin && git rebase origin/master irebase-origin = !git fetch origin && git rebase -i origin/master From c4075de79793569d4d5fffdd5d3db50b1c4414b5 Mon Sep 17 00:00:00 2001 From: Mike O'Toole Date: Sun, 5 May 2013 02:22:10 -0700 Subject: [PATCH 10/18] Updated protocol code review and merge sections. --- protocol/README.md | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/protocol/README.md b/protocol/README.md index a1f4f870..ca1d5314 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -116,15 +116,11 @@ Create a local feature branch based off master. Prefix the branch name with your initials and postfix with JIRA ticket number. -Rebase frequently to incorporate upstream changes. +Rebase frequently to incorporate upstream changes and resolve conflicts as needed. git rebase-origin -Resolve conflicts. When feature is complete and tests pass. - - rake reports:all - -When you've staged the changes, commit them. +Commit changes regularly. git st git commit -av @@ -138,6 +134,10 @@ Write a [good commit message](http://goo.gl/w11us). Example format: http://project.management-system.com/ticket/123 +When feature is complete make sure all tests and reports pass. + + rake reports:all + Push your branch. git push @@ -160,19 +160,14 @@ A team member other than the author reviews the pull request. They follow miscommunication. They make comments and ask questions directly on lines of code in the Github -web interface or in Hipchat. - -For changes which they can make themselves, they check out the branch. +web interface or in [Hipchat](http://hipchat.com). - git checkout - rake db:migrate - rake - git diff staging/master..HEAD +When satisfied, they comment on the pull request `Ready to merge.` -They make small changes right in the branch, test the feature in browser, -run tests, commit, and push. +The merge master for the project should then be asked to merge the branch. +This can be done on Hipchat or by mentioning them in a JIRA comment. -When satisfied, they comment on the pull request `Ready to merge.` + `@ Ready to merge.` Merge ----- @@ -181,23 +176,21 @@ Rebase interactively. Squash commits like "Fix whitespace" into one or a small number of valuable commit(s). Edit commit messages to reveal intent. git irebase-origin - rake + +Run all tests and validate code quality. + + rake reports:all View a list of new commits. View changed files. Merge branch into master. git log origin/master.. git diff --stat origin/master - git checkout master - git merge --ff-only + git merge-branch git push -Delete your remote feature branch. - - git push origin --delete - -Delete your local feature branch. +Delete your local and remote feature branch. - git branch --delete + git delete-branch