Skip to content

Commit

Permalink
(WIP) Improve support for selecting and downloading changes
Browse files Browse the repository at this point in the history
This change adds support for selecting and downloading changes that
match a custom gerrit query (e.g. "is:open").

A new interactive function called gerrit-download-and-open-overview' was
added which downloads the change and opens an magit-commit buffer using
magit-show-commit'. (It the downloaded change is at the top of a
relation chain, the other commits are currently not displayed by this
`gerrit-download-and-open-overview' function.

Closes: #19
Change-Id: Ie3ed04a8f212cb8c0a98745d1dca4f680f420642
  • Loading branch information
twmr committed Oct 2, 2021
1 parent 2661841 commit f47c38e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions gerrit.el
Original file line number Diff line number Diff line change
Expand Up @@ -1362,5 +1362,24 @@ workspace of the project."

(call-interactively #'gerrit-upload-transient)))

;; DONE split this up into two parts (one that downloads the change and one that opens the overview page sing magit-show-commit
(defun gerrit-download-and-open-overview (changenr)
;; since a simple "is:open" query might return a lot of gerrit-changes, it
;; is possible to filter the returned results by setting an variable
;; called `gerrit-interesting-open-changes-filter'.
(interactive (list
(let
((gerrit-change-singleline-columns '(number branch project subject)))
(gerrit--select-change-from-matching-changes
gerrit-interesting-open-changes-filter))))

(gerrit--init-accounts)
(gerrit-download:--in-known-repo changenr)
;; TODO run magit-show-commit
;; only when the above change is downloaded to avoid window-flickering
(magit-show-commit "HEAD"))



(provide 'gerrit)
;;; gerrit.el ends here

0 comments on commit f47c38e

Please sign in to comment.