Permalink
Browse files

Removing --track, adding error on gitc ready if nothing committed, gi…

…tc track
  • Loading branch information...
1 parent ea62515 commit cf3f89915badd7a469d263d433d281721dabb72b @winton committed Jan 28, 2012
Showing with 41 additions and 24 deletions.
  1. +25 −22 README.md
  2. +16 −2 lib/gitcycle.rb
View
@@ -19,18 +19,6 @@ Type `gitc` + your ticket URL to create a new branch:
gitc https://xxx.lighthouseapp.com/projects/0000/tickets/0000-my-ticket
-Reset Branch
-------------
-
-If you associate the wrong branch with a ticket, use `gitc reset` to fix it.
-
-Checkout the branch that you will eventually merge your feature into:
-
- git checkout master
-
-Type `gitc reset` + your ticket URL to reset the branch:
-
- gitc reset https://xxx.lighthouseapp.com/projects/0000/tickets/0000-my-ticket
Pull Changes from Upstream
--------------------------
@@ -62,9 +50,7 @@ Managers will periodically check for "Pending Review" issues on GitHub.
Once reviewed, they will mark the issue as reviewed:
- gitc reviewed 0000
-
-Where 0000 is the Github issue number.
+ gitc reviewed [GITHUB ISSUE #] [...]
Quality Assurance
-----------------
@@ -73,7 +59,7 @@ QA engineers will periodically check for "Pending QA" issues on Github.
To create a new QA branch:
- gitc qa 0000 0001
+ gitc qa [GITHUB ISSUE #] [...]
This will create a new QA branch containing the commits from the related Github issue numbers.
@@ -84,9 +70,7 @@ QA Fail
If a feature does not pass QA:
- gitc qa fail 0000
-
-Where 0000 is the Github issue number.
+ gitc qa fail [GITHUB ISSUE #] [...]
To fail all issues:
@@ -99,16 +83,35 @@ QA Pass
If a feature passes QA:
- gitc qa pass 0000
-
-Where 0000 is the Github issue number.
+ gitc qa pass [GITHUB ISSUE #] [...]
To pass all issues:
gitc qa pass
This will add a "pass" label to the issue and will complete the pull request by merging the feature branch into the target branch.
+More
+----
+
+=== Reset Branch
+
+If you associate the wrong branch with a ticket, use `gitc reset` to fix it.
+
+Checkout the branch that you will eventually merge your feature into:
+
+ git checkout master
+
+Type `gitc reset` + your ticket URL to reset the branch:
+
+ gitc reset https://xxx.lighthouseapp.com/projects/0000/tickets/0000-my-ticket
+
+=== Track Upstream Branch
+
+If you are working in a fork, it is easy to track upstream branches:
+
+ gitc track [BRANCH] [...]
+
Todo
----
View
@@ -274,6 +274,8 @@ def ready(*issues)
puts "Opening issue: #{branch['issue_url']}\n".green
Launchy.open(branch['issue_url'])
+ else
+ puts "You have not pushed any commits to '#{branch['name']}'.\n".red
end
else
puts "\nLabeling issues as 'Pending Review'.\n".green
@@ -336,6 +338,18 @@ def start(args=[])
end
end
+ def track(*branches)
+ puts "\nRetrieving repo information from gitcycle.\n".green
+ repo = get('repo')
+
+ branches.each do |branch|
+ add_remote_and_fetch(:owner => repo['owner'], :repo => repo['name'])
+
+ puts "Creating branch '#{branch}' from '#{repo['owner']}/#{branch}'.\n".green
+ run("git branch --no-track #{branch} #{repo['owner']}/#{branch}")
+ end
+ end
+
private
def add_remote_and_fetch(options={})
@@ -376,7 +390,7 @@ def checkout_or_track(options={})
else
puts "Tracking branch '#{remote}/#{name}'.\n".green
run("git fetch -q #{remote}")
- run("git checkout --track -b #{name} #{remote}/#{name}")
+ run("git checkout -b #{name} #{remote}/#{name}")
end
run("git pull #{remote} #{name}")
@@ -402,7 +416,7 @@ def checkout_remote_branch(options={})
add_remote_and_fetch(options)
puts "Checking out remote branch '#{target}' from '#{owner}/#{repo}/#{branch}'.\n".green
- run("git checkout --track -b #{target} #{owner}/#{branch}")
+ run("git checkout -b #{target} #{owner}/#{branch}")
puts "Pulling 'origin/#{target}'.\n".green
run("git pull origin #{target}")

0 comments on commit cf3f899

Please sign in to comment.