Class GitReview::Local
In: lib/git-review/local.rb
Parent: Object

The local repository is where the git-review command is being called by default. It is (supposedly) able to handle systems other than Github. TODO: remove Github-dependency

Methods

Included Modules

::GitReview::Helpers

Attributes

config  [RW] 

Public Class methods

acts like a singleton class but it‘s actually not use ::GitReview::Local.instance everywhere except in tests

Public Instance methods

@return [Array<String>] all existing branches

@param location [Symbol] location of the branch, `:remote` or `:local` @param branch_name [String] name of the branch @return [Boolean] whether a branch exists in a specified location

clean all obsolete branches

Remove obsolete remotes with review prefix.

clean a single request‘s obsolete branch

@return [Array(String, String)] the title and the body of pull request

delete local and remote branches that match a given name @param branch_name [String] name of the branch to delete

delete local branch if it exists. @param (see delete_branch)

delete remote branch if it exists. @param (see delete_branch)

@return [String] the head string used for pull requests

@return [Boolean] whether a specified commit has already been merged.

@return [Boolean] whether there are commits not in target branch yet

@return [Boolean] whether already on a feature branch

@return [Array<String>] all open requests’ branches shouldn‘t be deleted

Prune all configured remotes.

Determine whether a remote with a given name exists?

Finds the correct remote for a given branch name.

Find or create the correct remote for a fork with a given owner name.

List all available remotes.

Find all remotes which are currently referenced by local branches.

Collect all remotes for a given url.

Create a Hash with all remotes as keys and their urls as values.

@return [Array<String>] all review branches with ‘review_’ prefix

Remove all non word characters and turn them into underscores.

@return [String] combine source repo and branch

@return [String] the current source branch

@return [String] the source repo

@return [String] combine target repo and branch

@return [String] the name of the target branch

if to send a pull request to upstream repo, get the parent as target @return [String] the name of the target repo

@return [Boolean] whether there are local changes not committed

@param branch_name [String] name of the branch @param verbose [Boolean] if verbose output @return [Boolean] whether there are unmerged commits on the local or

  remote branch.

[Validate]