Permalink
Browse files

Comments: Fix spelling mistakes and formatting

  • Loading branch information...
1 parent ca90186 commit f8ec0c27ec731fbb630c7545febccce0b5951000 @timothyasp timothyasp committed Mar 22, 2013
Showing with 30 additions and 13 deletions.
  1. +1 −1 bin/feature
  2. +21 −6 lib/git.rb
  3. +3 −3 lib/github.rb
  4. +5 −3 lib/helpers.rb
View
@@ -141,7 +141,7 @@ when 'switch'
when 'clean'
args = ''
- # Remove all untracked .gitignored files as well
+ # Remove all untracked .gitignore'd files as well
args += 'x' if ARGV.include?('--all')
# -fd alone will NOT remove submodule directories, -ffd is required for this
View
@@ -4,6 +4,8 @@ def self.has_uncommitted_changes()
return !clean
end
+ # Return the development branch specified by the
+ # feature.development-branch git config value
def self.development_branch
dev_branch = `git config feature.development-branch`.strip
if !dev_branch || $? != 0
@@ -14,7 +16,7 @@ def self.development_branch
dev_branch
end
- # Returns an array of branches that aren't merged into the specifeid branch
+ # Returns an array of branches that aren't merged into the specified branch
def self.branches_not_merged_into(branch)
self::all_branches - self::merged_branches(branch)
end
@@ -56,20 +58,22 @@ def self.all_branches()
map {|branch| branch.sub(/refs\/\w+\//, '') }.uniq
end
- # returns the name of th currently checked out brnach, or nil if detached.
+ # Returns the name of the currently checked out branch, or nil if detached.
def self.current_branch()
ref = `git symbolic-ref -q HEAD`.strip
ref.split('/').last
end
- # returns the SHA1 hash that the specified branch or symbol points to
+ # Returns the SHA1 hash that the specified branch or symbol points to
def self.branch_hash(branch)
`git rev-parse --verify --quiet "#{branch}" 2>/dev/null`.strip
end
- # Return formatted string containing:
- # commit_hash Authoe Name (relative date)
- # for the specifeid branch or commit
+ # Returns formatted string containing:
+ #
+ # commit_hash Author Name (relative date)
+ #
+ # for the specified branch or commit
def self.branch_info(branch)
# branch info format: hash author (relative date)
format = "%h %an %Cgreen(%ar)%Creset"
@@ -146,6 +150,14 @@ def self.stashes
end
end
+ ##
+ # Switch to the specified branch.
+ # Because we use submodules, we have to check for updates to those
+ # submodules when we checkout a branch
+ #
+ # args: --clean - remove every unstaged file, including non-existant
+ # submodules
+ #
def self.switch_branch(branch)
self.run_safe("git checkout \"#{branch}\"")
self.submodules_update
@@ -154,6 +166,9 @@ def self.switch_branch(branch)
self.show_stashes_saved_on(branch)
end
+ ##
+ # Update / initialize submodules from the TLD
+ #
def self.submodules_update
# capture only the path, not the newline
basedir = `git rev-parse --show-toplevel`.split("\n").first
View
@@ -54,7 +54,7 @@ def self.get_authentication(authorization_info)
end
##
- # Returns a hash containing username and github oauth token
+ # Returns a hash containing the username and github oauth token
#
# Prompts the user for credentials if the token isn't stored in git config
##
@@ -73,7 +73,7 @@ def self.request_authorization(authorization_info)
auth = auth || octokit.create_authorization(authorization_info)
- success =
+ success =
system("git config --global github.user #{username}") &&
system("git config --global github.token #{auth[:token]}")
@@ -154,7 +154,7 @@ def self.get_pull_request_description(branch_name = nil)
def self.get_pull_request_description_from_api(branch_name, into_branch)
octokit = Github::api
- # Should succeed if authentication is setup.
+ # Should succeed if authentication is set up.
pulls = octokit.pulls(Github::get_github_repo)
pull = pulls.find {|pull| branch_name == pull[:head][:ref] }
View
@@ -80,9 +80,10 @@ def display_help(args)
HELP
end
-
-# prints out an error and the approprite help if there is not exactly one
-# commandline argument
+##
+# Prints out an error and the appropriate help if there is not exactly one
+# command-line argument
+##
def require_argument(program, command = nil, min = 2, max = 2)
help = lambda do |msg|
if program == :hotfix
@@ -107,6 +108,7 @@ def require_argument(program, command = nil, min = 2, max = 2)
##
# Repeatedly prints out a y/n question until a y or n is input
+##
def confirm(question)
loop do
print(question)

0 comments on commit f8ec0c2

Please sign in to comment.