From ee4c068561c23191c6aa186d99d5dc9309a3c200 Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Mon, 4 Aug 2014 11:03:26 -0400 Subject: [PATCH] adding a reset button :) --- plugins/gerrit/gerrit.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/gerrit/gerrit.plugin.zsh b/plugins/gerrit/gerrit.plugin.zsh index 623f25151..d72278d29 100644 --- a/plugins/gerrit/gerrit.plugin.zsh +++ b/plugins/gerrit/gerrit.plugin.zsh @@ -6,6 +6,7 @@ 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 " reset Reset hard to origin/master"; 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"; @@ -40,6 +41,10 @@ function gerrit_draft () { git push origin HEAD:refs/drafts/$1; } +function gerrit_reset { + git reset --hard origin/master; +} + function gerrit_pull () { #git pull --rebase origin $1; git fetch; @@ -93,6 +98,7 @@ function gerrit () { [ "$1" = "patch" ] && gerrit_patch "$2" [ "$1" = "push" ] && gerrit_push "$branch"; [ "$1" = "review" ] && gerrit_review "$branch"; + [ "$1" = "reset" ] && gerrit_reset; [ "$1" = "draft" ] && gerrit_draft "$branch"; [ "$1" = "pull" ] && gerrit_pull "$branch"; [ "$1" = "clone" ] && gerrit_clone "$2";