From b37b8c339fab3c82ae3f139c2bb208676c7f1e4d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 13 Nov 2022 13:24:17 -0800 Subject: ref(elisp/gerrit): remove module related to gerrit I'm not using gerrit anymore, I don't need to keep this around. Change-Id: I764a1a54a3653582d8fd5539ad6db7a4b9697d82 --- emacs/elisp/my-gerrit.el | 76 ------------------------------------------------ emacs/init.el | 1 - 2 files changed, 77 deletions(-) delete mode 100644 emacs/elisp/my-gerrit.el (limited to 'emacs') diff --git a/emacs/elisp/my-gerrit.el b/emacs/elisp/my-gerrit.el deleted file mode 100644 index 4a9dc27..0000000 --- a/emacs/elisp/my-gerrit.el +++ /dev/null @@ -1,76 +0,0 @@ -;;; my-gerrit.el --- magit integration for Gerrit -*- lexical-binding: t -*- -;; Author: Franck Cuny - -;;; Commentary: - -;; interact with Gerrit from magit - -;;; Code: - -(require 'magit) -(require 's) - -(defgroup my/gerrit nil - "Customization options for Gerrit integration with magit." - :group 'magit) - -(defcustom my/gerrit-remote "origin" - "Name of the git remote for Gerrit." - :type '(string) - :group 'my/gerrit) - -(defun my/gerrit-ref (target-branch &optional flags) - "Target ref to push change based on TARGET-BRANCH, with optional FLAGS." - (let ((flag-suffix (if flags (format "%%%s" (s-join "," flags)) - ""))) - (format "HEAD:refs/for/%s%s" target-branch flag-suffix))) - -(transient-define-suffix my/magit-gerrit-push-for-review () - "Push to Gerrit for review." - (interactive) - (magit-push-refspecs my/gerrit-remote (my/gerrit-ref (magit-main-branch)) nil)) - -(transient-append-suffix 'magit-push "m" - '("R" "push to Gerrit for review" my/magit-gerrit-push-for-review)) - -;; By appending `%wip' to the ref, we mark the change as `work in progress'. -;; https://gerrit-review.googlesource.com/Documentation/intro-user.html#wip -(transient-define-suffix my/magit-gerrit-push-for-review-wip () - "Push to Gerrit as work in progress." - (interactive) - (magit-push-refspecs my/gerrit-remote (my/gerrit-ref (magit-main-branch) '("wip")) nil)) - -(transient-append-suffix 'magit-push "R" - '("W" "push to Gerrit for review (WIP)" my/magit-gerrit-push-for-review-wip)) - -;; By appending `%ready' to the ref, we mark the change as ready for -;; review. -;; https://gerrit-review.googlesource.com/Documentation/intro-user.html#wip -(transient-define-suffix my/magit-gerrit-push-for-review-ready () - "Push to Gerrit as ready." - (interactive) - (magit-push-refspecs my/gerrit-remote (my/gerrit-ref (magit-main-branch) '("ready")) nil)) - -(transient-append-suffix 'magit-push "W" - '("r" "push to Gerrit for review (ready)" my/magit-gerrit-push-for-review-ready)) - -;; For this to work, permissions need to be setup, as per -;; https://gerrit-review.googlesource.com/Documentation/user-upload.html#auto_merge -(transient-define-suffix my/magit-gerrit-submit () - (interactive) - (magit-push-refspecs my/gerrit-remote (my/gerrit-ref (magit-main-branch) '("submit")) nil)) - -(transient-append-suffix 'magit-push "r" - '("P" "push to Gerrit to submit change" my/magit-gerrit-submit)) - -(transient-define-suffix my/magit-gerrit-shipit () - "Ship it." - (interactive) - (magit-push-refspecs my/gerrit-remote (my/gerrit-ref (magit-main-branch)'("l=Code-Review+2" "publish-comments")) nil)) - -(transient-append-suffix 'magit-push "P" - '("S" "Approve the change in Gerrit" my/magit-gerrit-shipit)) - -(provide 'my-gerrit) - -;;; my-gerrit.el ends here diff --git a/emacs/init.el b/emacs/init.el index fcf2dbf..99b94a9 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -57,7 +57,6 @@ (require 'my-buffers) (require 'my-git-extra) -(require 'my-gerrit) (require 'my-strings) (require 'my-web) (require 'my-work) -- cgit 1.4.1