NAME
Git::Code::Review::Utilities - Tools for performing code review using Git as the backend
VERSION
version 2.6
FUNCTIONS
gcr_dir()
Returns the audit directory
gcr_profile(exists => 1)
Return the user's requested profile based on: ~/.gitconfig --profile default
You can override the exists functionality by passing exists => 0;
gcr_profiles()
Returns a list of profiles with a selection file available
gcr_valid_profile($profile_name)
Returns 1 if a valid profile and undef if not
gcr_load_profile($profile_name)
Returns selection config for the profile
gcr_config()
Returns a copy of our configuration as a hash or hash ref.
gcr_is_initialized()
gcr_repo()
Returns the Git::Repository object for audit or source repos
gcr_mkdir(@path)
Takes a directory path as a list and creates the path inside the audit directory.
gcr_origin($type)
Lookup the remote 'origin' for 'audit' or 'source'
gcr_reset()
Reset the audit directory to origin:master, stash weirdness. Most operations call this first.
gcr_push()
Push any modifications upstream.
gcr_commit_exists($sha1 | $partial_sha1 | $path)
Returns 1 if the commit is in the audit already, or 0 otehrwise
gcr_commit_info($sha1 | $partial_sha1 | $path)
Retrieves all relevant Git::Code::Review details on the commit that matches the string passed in.
gcr_commit_profile(sha1)
Find and return the profile for the commit.
gcr_open_editor( mode => file )
Mode can be: readonly, modify
File is the file to be opened
gcr_view_commit($commit_info)
View the contents of the commit in the $commit_info, stores time spent in editor as review_time in the hash.
gcr_view_commit_files
Display a menu containing the files mentioned in the commit with the ability to view the contents of one of those files.
gcr_global_readme()
Get the global readme file.
gcr_profile_readme()
Get the readme file for a profile.
gcr_readme()
Get the readme file for the current profile if it exists or a global one.
gcr_view_readme()
View the README file for the current profile if it exists or the global README file.
gcr_change_profile($commit_info,$profile,$details)
$commit_info is a hash attained from gcr_commit_info() $profile is a string representing the desired profile $details can be either a string, the commit message, or a hash reference including a 'message' item to become the commit message. The rest of the keys will be added to the YAML generated.
gcr_get_states()
Get the valid states
gcr_change_state($commit_info,$state,$details)
$commit_info is a hash attained from gcr_commit_info() $state is a string representing the state $details can be either a string, the commit message, or a hash reference including a 'message' item to become the commit message. The rest of the keys will be added to the YAML generated.
gcr_commit_message($commit_info,\%details)
Creates the YAML commit message. If $details{message} exists it will be used as the YAML header text/comment.
gcr_audit_commit($AuditSHA1)
Returns the SHA1 from the source repository given the SHA1 from the the Audit Repository.
gcr_audit_files($AuditSHA1)
Returns the list of files modified by the Audit SHA1 the Audit Repository.
gcr_audit_record(@lines)
Converts a GCR Message into the structure: { message => 'FreeText', date => 'blah', author => 'blah', }
gcr_not_resigned($commit)
Returns true unless the author resigned from the commit.
gcr_not_authored($path)
Returns true unless the reviewer authored the commit.
gcr_state_color($state)
Make coloring consistent in this function.
gcr_lookup_profile($commit)
Review history to find the last profile this commit was a part of. Takes a sha1 or patch.
_get_review_path($path)
Figure out the review path from a file path.
_get_commit_date($path)
Figure out the commit date.
_get_commit_select_date($path)
Figure out the commit selection date.
_get_commit_profile($path)
Return the profile name
_get_author($path)
Figure out the commit author.
_get_sha1($path)
Extract the SHA1 from the file path
_get_state($path)
Figure out the state from the current path.
AUTHOR
Brad Lhotsky <brad@divisionbyzero.net>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2014 by Brad Lhotsky.
This is free software, licensed under:
The (three-clause) BSD License