feat: add ghpr-list-prs

This commit is contained in:
Lucas Sta Maria 2025-08-22 22:48:35 +08:00
parent 28e18f7ecb
commit 30cfe3b7f3
Signed by: lucas
GPG key ID: F07FB16A826E3B47
4 changed files with 122 additions and 1 deletions

View file

@ -31,6 +31,16 @@
;;; Code:
(require 'magit)
(defun ghpr--get-repo-name ()
"Get the GitHub repository name in owner/repo format from origin remote.
Returns nil if origin remote doesn't exist or is not a GitHub repository."
(when (magit-remote-p "origin")
(let ((origin-url (magit-get "remote.origin.url")))
(when (string-match "github\\.com[:/]\\([^/]+/[^/.]+\\)" origin-url)
(match-string 1 origin-url)))))
(provide 'ghpr-repo)
;;; ghpr-repo.el ends here