Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:winton/gitcycle

  • Loading branch information...
commit 7272ad78e0ebd5f4f102c88544f6c75676e9e5ff 2 parents 81a5644 + 7d310e8
@winton authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 lib/gitcycle.rb
View
17 lib/gitcycle.rb
@@ -75,6 +75,20 @@ def checkout(remote, branch=nil)
end
alias :co :checkout
+ def commit_all
+ branch_info = get('branch',
+ 'branch[name]' => branches(:current => true),
+ 'create' => 0
+ )
+
+ if branch_info && (title = branch_info["title"]) && id = branch_info["body"].match(/#\d+/)
+ commit_msg = "[#{id}] #{title}"
+ end
+
+ run "git add . && git commit -am" + (commit_msg ? " \"#{commit_msg}\"" : "")
+ end
+ alias :ca :commit_all
+
def create_branch(url_or_title, reset=false)
require_git && require_config
@@ -634,7 +648,8 @@ def get(path, hash={})
exit
end
- error = json.match(/Gitcycle error reference code (\d+)/)[1]
+ match = json.match(/Gitcycle error reference code (\d+)/)
+ error = match && match[1]
if error
puts "\nSomething went wrong :(".red
Please sign in to comment.
Something went wrong with that request. Please try again.