2017-02-09 22:59:49 +00:00
|
|
|
|
;;; funcs.el --- GitHub layer functions File
|
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2017-02-09 22:59:49 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
|
|
|
|
;;; License: GPLv3
|
2019-03-31 16:14:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Forge
|
|
|
|
|
|
|
|
|
|
(defun spacemacs/forge-get-info-from-fetched-notification-error (err)
|
|
|
|
|
"Return info for given s-exp error return by `forge-pull-notifications'.
|
|
|
|
|
|
|
|
|
|
Call this function interactively and paste the s-exp from the error returned by
|
|
|
|
|
the `forge-pull-notifications' function.
|
|
|
|
|
|
|
|
|
|
Example of error:
|
|
|
|
|
|
|
|
|
|
error in process filter: ghub--signal-error: peculiar error:
|
|
|
|
|
((path \"query\" \"_Z2l0aHViLmNvbTowMTA6UmVwb3NpdG9yeTI5MDM3NDE6NTI0NzY1\")
|
|
|
|
|
(extensions (code . \"undefinedField\")
|
|
|
|
|
(typeName . \"Query\")
|
|
|
|
|
(fieldName . \"nil\"))
|
|
|
|
|
(locations ((line . 2) (column . 1)))
|
|
|
|
|
(message . \"Field 'nil' doesn't exist on type 'Query'\"))
|
|
|
|
|
|
|
|
|
|
Function adapted from issue:
|
|
|
|
|
https://github.com/magit/forge/issues/80#issuecomment-456103195
|
|
|
|
|
"
|
|
|
|
|
(interactive "xs-exp: ")
|
|
|
|
|
(message "%s" err)
|
|
|
|
|
(let* ((query_value (third (car err)))
|
|
|
|
|
(result (car (forge-sql
|
|
|
|
|
[:select [owner name]
|
|
|
|
|
:from repository
|
|
|
|
|
:where (= id $s1)]
|
|
|
|
|
(base64-encode-string
|
|
|
|
|
(mapconcat
|
|
|
|
|
#'identity
|
|
|
|
|
(butlast
|
|
|
|
|
(split-string
|
|
|
|
|
(base64-decode-string (substring query_value 1))
|
|
|
|
|
":"))
|
|
|
|
|
":")
|
|
|
|
|
t)))))
|
|
|
|
|
(message "repository: %s/%s" (car result) (cadr result))))
|