Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added commit_all #1

Merged
merged 1 commit into from

2 participants

@mschae
Collaborator

Quick'n'easy way to add all untracked files and commit them using B/R's convention for naming commits.

Michael Schaefermeyer Added commit_all a4ed4b7
@winton winton merged commit 7d310e8 into from
@winton
Owner

New gem version pushed, muchas gracias mi amigo.

@mschae
Collaborator

De nada muchacho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 4, 2012
  1. Added commit_all

    Michael Schaefermeyer authored
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.