From f47c38e2619f5c4df2965938abec66b808f74326 Mon Sep 17 00:00:00 2001 From: Thomas Hisch Date: Sat, 2 Oct 2021 22:51:08 +0200 Subject: [PATCH] (WIP) Improve support for selecting and downloading changes 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 --- gerrit.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gerrit.el b/gerrit.el index 58fabd6..b2e493e 100644 --- a/gerrit.el +++ b/gerrit.el @@ -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