mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Gerrit plugin to support drafts
This commit is contained in:
parent
a2877a2b05
commit
af39ef9d23
1 changed files with 11 additions and 3 deletions
|
|
@ -6,7 +6,8 @@ function gerrit_usage {
|
|||
echo " push Push changes without going through a review. ";
|
||||
echo " pull Pull latest changes and rebase ... or something. ";
|
||||
echo " patch Work with gerrit patchset";
|
||||
echo " review Push changes and submit changes for review";
|
||||
echo " review Submit changes for review";
|
||||
echo " draft Submit changes for review as draft";
|
||||
echo " setup-reviewers Set current repo to automatically have reviewers from your team";
|
||||
echo " add-reviewer Add a reviewer to the repo";
|
||||
echo " clone Clone a repo from gerrit, requires repo name";
|
||||
|
|
@ -20,8 +21,9 @@ function gerrit_patch_usage () {
|
|||
echo
|
||||
echo " try these :";
|
||||
echo
|
||||
echo " commit amend the patchset commit";
|
||||
echo " review push the patchset back to the gerrit review";
|
||||
echo " commit Amend the patchset commit";
|
||||
echo " review Submit patchset back to the gerrit for review";
|
||||
echo " draft Submit patchset back to the gerrit for review as draft";
|
||||
echo
|
||||
}
|
||||
|
||||
|
|
@ -33,6 +35,10 @@ function gerrit_review () {
|
|||
git push origin HEAD:refs/for/$1;
|
||||
}
|
||||
|
||||
function gerrit_draft () {
|
||||
git push origin HEAD:refs/drafts/$1;
|
||||
}
|
||||
|
||||
function gerrit_pull () {
|
||||
#git pull --rebase origin $1;
|
||||
git fetch;
|
||||
|
|
@ -45,6 +51,7 @@ function gerrit_patch () {
|
|||
else
|
||||
[ $1 = "commit" ] && git commit --amend;
|
||||
[ $1 = "review" ] && gerrit_review "master";
|
||||
[ $1 = "draft" ] && gerrit_draft "master";
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -101,6 +108,7 @@ function gerrit () {
|
|||
[ $1 = "patch" ] && gerrit_patch $2
|
||||
[ $1 = "push" ] && gerrit_push $branch;
|
||||
[ $1 = "review" ] && gerrit_review $branch;
|
||||
[ $1 = "draft" ] && gerrit_draft $branch;
|
||||
[ $1 = "pull" ] && gerrit_pull $branch;
|
||||
[ $1 = "setup-reviewers" ] && gerrit_set_team_reviewers;
|
||||
[ $1 = "add-reviewer" ] && gerrit_add_reviewer $2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue