rbtools.hooks.git¶
Git repository hook utilities.
Functions
|
Returns the branch name corresponding to the specified ref name. |
|
Returns a list of all branches containing the specified commit. |
|
Returns a list of abbreviated commit hashes from old_rev to new_rev. |
|
Returns the specified commit's commit message. |
|
Returns a list of all branches, excluding the specified branch. |
|
Returns a dictionary, mapping a review request ID to a list of commits. |
|
Returns a list of abbreviated commit hashes unique to ref_name. |
- rbtools.hooks.git.get_branch_name(ref_name)[source]¶
Returns the branch name corresponding to the specified ref name.
- rbtools.hooks.git.get_commit_hashes(old_rev, new_rev)[source]¶
Returns a list of abbreviated commit hashes from old_rev to new_rev.
- rbtools.hooks.git.get_unique_commit_hashes(ref_name, new_rev)[source]¶
Returns a list of abbreviated commit hashes unique to ref_name.
- rbtools.hooks.git.get_excluded_branches(ref_name)[source]¶
Returns a list of all branches, excluding the specified branch.
- rbtools.hooks.git.get_branches_containing_commit(commit_hash)[source]¶
Returns a list of all branches containing the specified commit.
- rbtools.hooks.git.get_commit_message(commit)[source]¶
Returns the specified commit’s commit message.
- rbtools.hooks.git.get_review_id_to_commits_map(lines, regex)[source]¶
Returns a dictionary, mapping a review request ID to a list of commits.
The commits must be in the form: oldrev newrev refname (separated by newlines), as given by a Git pre-receive or post-receive hook.
If a commit’s commit message does not contain a review request ID, we append the commit to the key 0.