feat(tvl.el): Make target branch configurable
I'm using gerrit at work now, and would like to use tvl.el to interact with it via Emacs, but we use a different default branch than "canon". This makes it configurable, and also marks it as safe so I can configure it in .dir-locals.el Change-Id: I66d4c7ce94351f2df863ec49dbc3e1d1d6d1547a Reviewed-on: https://cl.tvl.fyi/c/depot/+/3369 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
206f96fbed
commit
db3fdd5ee8
1 changed files with 9 additions and 4 deletions
|
@ -29,6 +29,11 @@
|
|||
"Location at which the TVL depot is checked out."
|
||||
:group 'tvl)
|
||||
|
||||
(defcustom tvl-target-branch "canon"
|
||||
"Branch to use to target CLs"
|
||||
:group 'tvl
|
||||
:safe (lambda (_) t))
|
||||
|
||||
(defun tvl--gerrit-ref (target-branch &optional flags)
|
||||
(let ((flag-suffix (if flags (format "%%l=%s" (s-join "," flags))
|
||||
"")))
|
||||
|
@ -38,7 +43,7 @@
|
|||
"Push to Gerrit for review."
|
||||
(interactive)
|
||||
(magit-push-refspecs tvl-gerrit-remote
|
||||
(tvl--gerrit-ref "canon")
|
||||
(tvl--gerrit-ref tvl-target-branch)
|
||||
nil))
|
||||
|
||||
(transient-append-suffix
|
||||
|
@ -49,7 +54,7 @@
|
|||
"Push to Gerrit as a work-in-progress."
|
||||
(interactive)
|
||||
(magit-push-refspecs tvl-gerrit-remote
|
||||
(concat (tvl--gerrit-ref "canon") "%wip")
|
||||
(concat (tvl--gerrit-ref tvl-target-branch) "%wip")
|
||||
nil))
|
||||
|
||||
(transient-append-suffix
|
||||
|
@ -60,7 +65,7 @@
|
|||
"Push to Gerrit for review."
|
||||
(interactive)
|
||||
(magit-push-refspecs tvl-gerrit-remote
|
||||
(tvl--gerrit-ref "canon" '("submit"))
|
||||
(tvl--gerrit-ref tvl-target-branch '("submit"))
|
||||
nil))
|
||||
|
||||
(transient-append-suffix
|
||||
|
@ -74,7 +79,7 @@ rubberstamp operation is dangerous and should only be used in
|
|||
`//users'."
|
||||
(interactive)
|
||||
(magit-push-refspecs tvl-gerrit-remote
|
||||
(tvl--gerrit-ref "canon"
|
||||
(tvl--gerrit-ref tvl-target-branch
|
||||
'("Code-Review+2" "publish-comments"))
|
||||
nil))
|
||||
|
||||
|
|
Loading…
Reference in a new issue