From 80eaa74e55a2e7e24b365dc3d8a432f1397c78cd Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 22 Jan 2019 15:15:49 +0100 Subject: [PATCH] Update ghub. Signed-off-by: Andreas Gerler --- .../buck.el | 2 +- .../dir | 0 .../ghub-autoloads.el | 0 .../ghub-graphql.el | 63 ++++++++----- .../ghub-pkg.el | 4 +- .../ghub.el | 90 +++++++++++++------ .../ghub.info | 88 +++++++++--------- .../glab.el | 6 +- .../gogs.el | 4 +- .../gtea.el | 4 +- elpa/ghub-readme.txt | 16 ---- 11 files changed, 163 insertions(+), 114 deletions(-) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/buck.el (99%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/dir (100%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/ghub-autoloads.el (100%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/ghub-graphql.el (89%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/ghub-pkg.el (64%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/ghub.el (93%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/ghub.info (95%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/glab.el (96%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/gogs.el (98%) rename elpa/{ghub-20181110.1845 => ghub-20190121.2116}/gtea.el (98%) delete mode 100644 elpa/ghub-readme.txt diff --git a/elpa/ghub-20181110.1845/buck.el b/elpa/ghub-20190121.2116/buck.el similarity index 99% rename from elpa/ghub-20181110.1845/buck.el rename to elpa/ghub-20190121.2116/buck.el index 141ea900..94e7d81a 100644 --- a/elpa/ghub-20181110.1845/buck.el +++ b/elpa/ghub-20190121.2116/buck.el @@ -1,6 +1,6 @@ ;;; buck.el --- minuscule client library for the Bitbucket API -*- lexical-binding: t -*- -;; Copyright (C) 2016-2018 Jonas Bernoulli +;; Copyright (C) 2016-2019 Jonas Bernoulli ;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/ghub diff --git a/elpa/ghub-20181110.1845/dir b/elpa/ghub-20190121.2116/dir similarity index 100% rename from elpa/ghub-20181110.1845/dir rename to elpa/ghub-20190121.2116/dir diff --git a/elpa/ghub-20181110.1845/ghub-autoloads.el b/elpa/ghub-20190121.2116/ghub-autoloads.el similarity index 100% rename from elpa/ghub-20181110.1845/ghub-autoloads.el rename to elpa/ghub-20190121.2116/ghub-autoloads.el diff --git a/elpa/ghub-20181110.1845/ghub-graphql.el b/elpa/ghub-20190121.2116/ghub-graphql.el similarity index 89% rename from elpa/ghub-20181110.1845/ghub-graphql.el rename to elpa/ghub-20190121.2116/ghub-graphql.el index 0f907cb0..53133e75 100644 --- a/elpa/ghub-20181110.1845/ghub-graphql.el +++ b/elpa/ghub-20190121.2116/ghub-graphql.el @@ -1,6 +1,6 @@ ;;; ghub-graphql.el --- access Github API using GrapthQL -*- lexical-binding: t -*- -;; Copyright (C) 2016-2018 Jonas Bernoulli +;; Copyright (C) 2016-2019 Jonas Bernoulli ;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/ghub @@ -80,7 +80,9 @@ behave as for `ghub-request' (which see)." createdAt updatedAt nameWithOwner + (parent nameWithOwner) description + homepageUrl (defaultBranchRef name) isArchived isFork @@ -218,6 +220,7 @@ data as the only argument." (query nil :read-only t) (variables nil :read-only t) (until nil :read-only t) + (buffer nil :read-only t) (pages 0 :read-only nil)) (cl-defun ghub--graphql-vacuum (query variables callback @@ -238,18 +241,23 @@ See Info node `(ghub)GraphQL Support'." :query query :variables variables :until until - :callback (if narrow + :buffer (current-buffer) + :callback (let ((buf (current-buffer))) + (if narrow + (lambda (data) + (let ((path narrow) key) + (while (setq key (pop path)) + (setq data (cdr (assq key data))))) + (ghub--graphql-set-mode-line buf nil) + (funcall callback data)) (lambda (data) - (let ((path narrow) key) - (while (setq key (pop path)) - (setq data (cdr (assq key data))))) - (funcall callback data)) - callback)))) + (ghub--graphql-set-mode-line buf nil) + (funcall callback data))))))) (cl-defun ghub--graphql-retrieve (req &optional lineage cursor) (let ((p (cl-incf (ghub--graphql-req-pages req)))) (when (> p 1) - (message "Fetching page %s..." p))) + (ghub--graphql-set-mode-line req "Fetching page %s" p))) (ghub--retrieve (let ((json-false nil)) (ghub--encode-payload @@ -283,7 +291,9 @@ See Info node `(ghub)GraphQL Support'." (setq loc (treepy-down loc)) (setq loc (treepy-next loc))) (dolist (elt alist) - (cond ((keywordp (car elt))) + (cond ((eq (car elt) :alias) + (push elt vars)) + ((keywordp (car elt))) ((= (length elt) 3) (push (list (nth 0 elt) (nth 1 elt)) vars) @@ -417,26 +427,37 @@ See Info node `(ghub)GraphQL Support'." (defun ghub--graphql-encode (g) (if (symbolp g) (symbol-name g) - (let* ((object (car g)) + (let* ((object (graphql--encode-object (car g))) (args (and (vectorp (cadr g)) (cl-coerce (cadr g) 'list))) - (fields (if args (cddr g) (cdr g)))) - (concat - (graphql--encode-object object) - (and args - (format " (\n%s)" - (mapconcat (pcase-lambda (`(,key ,val)) - (graphql--encode-argument key val)) - args ",\n"))) - (and fields - (format " {\n%s\n}" - (mapconcat #'ghub--graphql-encode fields "\n"))))))) + (aliasp (cadr (assq :alias args))) + (fields (if args (cddr g) (cdr g))) + (fields (and fields + (mapconcat #'ghub--graphql-encode fields "\n"))) + (args (and args + (mapconcat (pcase-lambda (`(,key ,val)) + (graphql--encode-argument key val)) + args ",\n")))) + (if aliasp + (concat object ": " fields) + (concat object + (and args (format " (\n%s)" args)) + (and fields (format " {\n%s\n}" fields))))))) (defun ghub--alist-zip (root) (let ((branchp (lambda (elt) (and (listp elt) (listp (cdr elt))))) (make-node (lambda (_ children) children))) (treepy-zipper branchp #'identity make-node root))) +(defun ghub--graphql-set-mode-line (buf string &rest args) + (when (ghub--graphql-req-p buf) + (setq buf (ghub--graphql-req-buffer buf))) + (when (buffer-live-p buf) + (with-current-buffer buf + (setq mode-line-process + (and string (concat " " (apply #'format string args)))) + (force-mode-line-update t)))) + ;;; _ (provide 'ghub-graphql) ;;; ghub-graphql.el ends here diff --git a/elpa/ghub-20181110.1845/ghub-pkg.el b/elpa/ghub-20190121.2116/ghub-pkg.el similarity index 64% rename from elpa/ghub-20181110.1845/ghub-pkg.el rename to elpa/ghub-20190121.2116/ghub-pkg.el index 69c8a922..64348b9c 100644 --- a/elpa/ghub-20181110.1845/ghub-pkg.el +++ b/elpa/ghub-20190121.2116/ghub-pkg.el @@ -1,9 +1,9 @@ -(define-package "ghub" "20181110.1845" "Minuscule client libraries for Git forge APIs." +(define-package "ghub" "20190121.2116" "Minuscule client libraries for Git forge APIs." '((emacs "25.1") (dash "2.14.1") (graphql "0.1.1") (let-alist "1.0.5") - (treepy "1.0.0"))) + (treepy "0.1.1"))) ;; Local Variables: ;; no-byte-compile: t ;; End: diff --git a/elpa/ghub-20181110.1845/ghub.el b/elpa/ghub-20190121.2116/ghub.el similarity index 93% rename from elpa/ghub-20181110.1845/ghub.el rename to elpa/ghub-20190121.2116/ghub.el index cde8c87c..bdf4ae8b 100644 --- a/elpa/ghub-20181110.1845/ghub.el +++ b/elpa/ghub-20190121.2116/ghub.el @@ -1,6 +1,6 @@ ;;; ghub.el --- minuscule client libraries for Git forge APIs -*- lexical-binding: t -*- -;; Copyright (C) 2016-2018 Jonas Bernoulli +;; Copyright (C) 2016-2019 Jonas Bernoulli ;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/ghub @@ -218,7 +218,7 @@ Like calling `ghub-request' (which see) with \"DELETE\" as METHOD." callback errorback value extra) "Make a request for RESOURCE and return the response body. -Also place the response header in `ghub-response-headers'. +Also place the response headers in `ghub-response-headers'. METHOD is the HTTP method, given as a string. RESOURCE is the resource to access, given as a string beginning @@ -295,10 +295,13 @@ If FORGE is `gitlab', then connect to Gitlab.com or, depending If CALLBACK and/or ERRORBACK is non-nil, then make one or more asynchronous requests and call CALLBACK or ERRORBACK when - finished. If an error occurred, then call ERRORBACK, or if - that is nil, then CALLBACK. When no error occurred then call - CALLBACK. When making asynchronous requests, then no errors - are signaled, regardless of the value of NOERROR. + finished. If no error occurred, then call CALLBACK, unless + that is nil. + + If an error occurred, then call ERRORBACK, or if that is nil, + then CALLBACK. ERRORBACK can also be t, in which case an error + is signaled instead. NOERROR is ignored for all asynchronous + requests. Both callbacks are called with four arguments. 1. For CALLBACK, the combined value of the retrieved pages. @@ -425,11 +428,18 @@ this function is called with nil for PAYLOAD." (substring url 1 -1)))) (split-string rels ", "))))) -(cl-defun ghub-repository-id (owner name &key username auth host forge) - "Return the id of the specified repository." +(cl-defun ghub-repository-id (owner name &key username auth host forge noerror) + "Return the id of the specified repository. +Signal an error if the id cannot be determined." (let ((fn (intern (format "%s-repository-id" (or forge 'ghub))))) - (funcall (if (eq fn 'ghub-repository-id) 'ghub--repository-id fn) - owner name :username username :auth auth :host host))) + (or (funcall (if (eq fn 'ghub-repository-id) 'ghub--repository-id fn) + owner name :username username :auth auth :host host) + (and (not noerror) + (error "Repository %S does not exist on %S.\n%s%S?" + (concat owner "/" name) + (or host (ghub--host host)) + "Maybe it was renamed and you have to update " + "remote..url"))))) ;;;; Internal @@ -469,6 +479,7 @@ this function is called with nil for PAYLOAD." (payload (ghub--handle-response-payload req)) (payload (ghub--handle-response-error status payload req)) (value (ghub--handle-response-value payload req)) + (prev (ghub--req-url req)) (next (cdr (assq 'next (ghub-response-link-relations req headers payload))))) (when (numberp unpaginate) @@ -485,7 +496,11 @@ this function is called with nil for PAYLOAD." (errorback (ghub--req-errorback req)) (err (plist-get status :error))) (cond ((and err errorback) - (funcall errorback err headers status req)) + (setf (ghub--req-url req) prev) + (funcall (if (eq errorback t) + 'ghub--errorback + errorback) + err headers status req)) (callback (funcall callback value headers status req)) (t value)))))) @@ -496,14 +511,28 @@ this function is called with nil for PAYLOAD." (goto-char (point-min)) (forward-line 1) (let (headers) + (when (memq url-http-end-of-headers '(nil 0)) + (setq url-debug t) + (let ((print-escape-newlines nil)) + (error "BUG: missing headers + See https://github.com/magit/ghub/issues/81. + headers: %S + status: %S + buffer: %S + buffer-string: + %S + --- end of buffer-string ---" + url-http-end-of-headers + status + (current-buffer) + (buffer-substring-no-properties + (point-min) (point-max))))) (while (re-search-forward "^\\([^:]*\\): \\(.+\\)" url-http-end-of-headers t) (push (cons (match-string 1) (match-string 2)) headers)) (setq headers (nreverse headers)) - (unless url-http-end-of-headers - (error "BUG: missing headers %s" (plist-get status :error))) (goto-char (1+ url-http-end-of-headers)) (if (and req (or (ghub--req-callback req) (ghub--req-errorback req))) @@ -520,10 +549,10 @@ this function is called with nil for PAYLOAD." payload (setcdr (last err) (list payload)) nil) - (ghub--signal-error err payload)) + (ghub--signal-error err payload req)) payload))) -(defun ghub--signal-error (err &optional payload) +(defun ghub--signal-error (err &optional payload req) (pcase-let ((`(,symb . ,data) err)) (if (eq symb 'error) (if (eq (car-safe data) 'http) @@ -531,10 +560,14 @@ this function is called with nil for PAYLOAD." (let ((code (car (cdr-safe data)))) (list code (nth 2 (assq code url-http-codes)) + (and req (url-filename (ghub--req-url req))) payload))) (signal 'ghub-error data)) (signal symb data)))) +(defun ghub--errorback (err _headers _status req) + (ghub--signal-error err (nth 3 err) req)) + (defun ghub--handle-response-value (payload req) (setf (ghub--req-value req) (nconc (ghub--req-value req) @@ -633,7 +666,9 @@ SCOPES are the scopes the token is given access to." ;; If the Auth-Source cache contains the information that there ;; is no value, then setting the value does not invalidate that ;; now incorrect information. - (auth-source-forget (list :host host :user user)) + ;; The (:max 1) is needed and has to be placed at the + ;; end for Emacs releases before 26.1. #24 #64 #72 + (auth-source-forget (list :host host :user user :max 1)) token))) ;;;###autoload @@ -717,7 +752,8 @@ and call `auth-source-forget+'." (if (assoc "X-GitHub-OTP" (ghub--handle-response-headers nil nil)) (progn (setq url-http-extra-headers - `(("Content-Type" . "application/json") + `(("Pragma" . "no-cache") + ("Content-Type" . "application/json") ("X-GitHub-OTP" . ,(ghub--read-2fa-code)) ;; Without "Content-Type" and "Authorization". ;; The latter gets re-added from the return value. @@ -743,7 +779,7 @@ and call `auth-source-forget+'." ;; fixing so we want to keep trying by invalidating that ;; information. ;; The (:max 1) is needed and has to be placed at the - ;; end for Emacs releases before 26.1. See #24, #64. + ;; end for Emacs releases before 26.1. #24 #64 #72 (auth-source-forget (list :host host :user user :max 1)) (and (not nocreate) (cl-ecase forge @@ -838,8 +874,9 @@ See https://magit.vc/manual/ghub/Support-for-Other-Forges.html for instructions. Store on Github as:\n %S Store locally according to option `auth-sources':\n %S %s -If in doubt, then abort and first view the section of the Ghub -documentation called \"Manually Creating and Storing a Token\". +If in doubt, then abort and first view the section of +the Ghub documentation called \"Interactively Creating +and Storing a Token\". Otherwise confirm and then provide your Github username and password at the next two prompts. Depending on the backend @@ -857,7 +894,7 @@ WARNING: The token will be stored unencrypted in %S. If you don't want that, you have to abort and customize the `auth-sources' option.\n" (car auth-sources)) "")))) - (condition-case ghub--create-token-error + (condition-case err ;; Naively attempt to create the token since the user told us to (ghub-create-token host username package scopes) ;; The API _may_ respond with the fact that a token of the name @@ -881,12 +918,11 @@ WARNING: The token will be stored unencrypted in %S. ;; simplicity it's better to error out here and ask the user to ;; take action. This situation should almost never arise anyway. (ghub-http-error - (if (string-equal (let-alist (nth 3 ghub--create-token-error) - (car .errors.code)) - "already_exists") - (error "\ -A token named %S already exists on Github. \ -Please visit https://github.com/settings/tokens and delete it." ident)))) + (if (equal (alist-get 'code (car (alist-get 'errors (nth 4 err)))) + "already_exists") + (error "A token named %S already exists on Github. +Please visit https://github.com/settings/tokens and delete it." ident) + (signal (car err) (cdr err))))) (user-error "Abort")))) (defun ghub--get-token-id (host username package) diff --git a/elpa/ghub-20181110.1845/ghub.info b/elpa/ghub-20190121.2116/ghub.info similarity index 95% rename from elpa/ghub-20181110.1845/ghub.info rename to elpa/ghub-20190121.2116/ghub.info index d1e1d05b..a54177bb 100644 --- a/elpa/ghub-20181110.1845/ghub.info +++ b/elpa/ghub-20190121.2116/ghub.info @@ -1,6 +1,6 @@ This is ghub.info, produced by makeinfo version 6.5 from ghub.texi. - Copyright (C) 2017-2018 Jonas Bernoulli + Copyright (C) 2017-2019 Jonas Bernoulli You can redistribute this document and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -46,9 +46,9 @@ adoption would make life easier for users and maintainers alike, because then all packages that talk to forge APIs could be configured the same way. -This manual is for Ghub version 3.0.0 (v3.0.0-2-g8dbf6b2+1). +This manual is for Ghub version 3.2.0 (v3.2.0-1-gae7acf4+1). - Copyright (C) 2017-2018 Jonas Bernoulli + Copyright (C) 2017-2019 Jonas Bernoulli You can redistribute this document and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -179,17 +179,19 @@ this should be true even when configuring the very first token. and Storing a Token::. Also see *note Support for Other Forges::. • If you want to access a Github Enterprise instance, then you have - to tell Ghub about it before the wizard makes its appearance by - setting the Git variable ‘github.host’. For example, if your - company’s GitHub Enterprise instance is hosted at - ‘git.example.com’, then you should set ‘github.host’ to - ‘git.example.com/api/v3’ to use the JSON API. You also have to - tell Ghub your username for that instance using the variable - ‘github.HOST.user’ (e.g. ‘github.git.example.com/api/v3.user’) - even if it is the same as on Github.com. While ‘github.host’ - should be set per-repository to allow Ghub to interface with both a - GitHub Enterprise instance and GitHub.com, setting GitHub - Enterprise users globally is recommended. + to tell Ghub about that before the wizard makes its appearance by + setting the Git variable ‘github.host’. You also have to tell Ghub + your username for that instance using the variable + ‘github.HOST.user’ even if it is the same as on Github.com. + + These variables are documented in *note Configuration Variables::. + Also see *note Setting the Username::. TL;DR: If your Github + Enterprise instance is hosted at ‘git.example.com’ and your + username on that instance is ‘jtribbiani’, then set ‘github.host’ + to ‘git.example.com/api/v3’ in every repository cloned from that + instance (i.e. _do not_ set it globally) and _globally_ set + ‘github.git.example.com/api/v3.user’ to ‘jtribbiani’. The latter + is necessary even if your username on Github.com is the same. • If the variable ‘github.user’ (or ‘github.HOST.user’ for an Enterprise instance) is unset when the wizard is first summoned, @@ -294,8 +296,9 @@ then the setup wizard will first ask you something like this: Store locally according to option `auth-sources': ("~/.authinfo" "~/.authinfo.gpg" "~/.netrc") - If in doubt, then abort and first view the section of the Ghub - documentation called "Manually Creating and Storing a Token". + If in doubt, then abort and first view the section of + the Ghub documentation called "Interactively Creating + and Storing a Token". Create and store such a token? (yes or no) @@ -378,7 +381,7 @@ of the doubts that you might have: ‘ghub-override-system-name’. See *note Configuration Variables:: for details. - After the above prompt you are also asked for you username and + After the above prompt you are also asked for your username and password. If you have enabled two-factor authentication, then you also have to provide the authentication code at least twice. If you make sure the code is still good for a while when asked for it first, then @@ -395,8 +398,8 @@ figure out what scopes a package wants, (2) create such a token using the web interface and (3) store the token where Ghub expects to find it. A package named ‘PACKAGE’ has to specify the scopes that it wants in -the variable named ‘PACKAGE-ghub-token-scopes’. The doc-string of such -variables should document what the various scopes are needed for. +the variable named ‘PACKAGE-github-token-scopes’. The doc-string of +such variables should document what the various scopes are needed for. To create or edit a token go to . For Gitlab.com use . @@ -585,7 +588,8 @@ File: ghub.info, Node: Making Requests, Next: Authentication, Up: API This function makes a request for ‘RESOURCE’ using ‘METHOD’. ‘PARAMS’, ‘QUERY’, ‘PAYLOAD’ and/or ‘HEADERS’ are alists holding additional request data. The response body is returned and the - response header is stored in the variable ‘ghub-response-headers’. + response headers are stored in the variable + ‘ghub-response-headers’. • ‘METHOD’ is the HTTP method, given as a string. @@ -680,11 +684,13 @@ File: ghub.info, Node: Making Requests, Next: Authentication, Up: API • If ‘CALLBACK’ and/or ‘ERRORBACK’ is non-nil, then this function makes one or more asynchronous requests and calls - ‘CALLBACK’ or ‘ERRORBACK’ when finished. If an error - occurred, then it calls ‘ERRORBACK’, or if that is ‘nil’, then - ‘CALLBACK’. When no error occurred then it calls ‘CALLBACK’. - When making asynchronous requests, then no errors are - signaled, regardless of the value of ‘NOERROR’. + ‘CALLBACK’ or ‘ERRORBACK’ when finished. If no error + occurred, then it calls ‘CALLBACK’, unless that is ‘nil’. + + If an error occurred, then it calls ‘ERRORBACK’, or if that is + nil, then ‘CALLBACK’. ‘ERRORBACK’ can also be ‘t’, in which + case it signals instead. ‘NOERROR’ is ignored for all + asynchronous requests. Both callbacks are called with four arguments. @@ -707,8 +713,8 @@ File: ghub.info, Node: Making Requests, Next: Authentication, Up: API If there is a next page, then this function retrieves that. This function is only intended to be called from callbacks. If - there is a next page, then that is retrieve and the buffer that the - result will be loaded into is returned, or t if the process has + there is a next page, then that is retrieved and the buffer that + the result will be loaded into is returned, or t if the process has already completed. If there is no next page, then return nil. Callbacks are called with four arguments (see ‘ghub-request’). The @@ -1286,20 +1292,20 @@ Tag Table: Node: Top764 Node: Introduction3279 Node: Getting Started6321 -Node: Setting the Username9944 -Node: Interactively Creating and Storing a Token11369 -Node: Manually Creating and Storing a Token17009 -Node: How Ghub uses Auth-Source18232 -Node: Using Ghub in Personal Scripts20165 -Node: Using Ghub in a Package21621 -Node: API24239 -Node: Making Requests25036 -Node: Authentication39075 -Node: Configuration Variables40920 -Node: GraphQL Support44640 -Node: Support for Other Forges51305 -Node: Forge Functions and Variables51522 -Node: Forge Limitations and Notes56041 +Node: Setting the Username10055 +Node: Interactively Creating and Storing a Token11480 +Node: Manually Creating and Storing a Token17131 +Node: How Ghub uses Auth-Source18356 +Node: Using Ghub in Personal Scripts20289 +Node: Using Ghub in a Package21745 +Node: API24363 +Node: Making Requests25160 +Node: Authentication39259 +Node: Configuration Variables41104 +Node: GraphQL Support44824 +Node: Support for Other Forges51489 +Node: Forge Functions and Variables51706 +Node: Forge Limitations and Notes56225  End Tag Table diff --git a/elpa/ghub-20181110.1845/glab.el b/elpa/ghub-20190121.2116/glab.el similarity index 96% rename from elpa/ghub-20181110.1845/glab.el rename to elpa/ghub-20190121.2116/glab.el index fa35b351..8aec40e4 100644 --- a/elpa/ghub-20181110.1845/glab.el +++ b/elpa/ghub-20190121.2116/glab.el @@ -1,6 +1,6 @@ ;;; glab.el --- minuscule client library for the Gitlab API -*- lexical-binding: t -*- -;; Copyright (C) 2016-2018 Jonas Bernoulli +;; Copyright (C) 2016-2019 Jonas Bernoulli ;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/ghub @@ -145,7 +145,9 @@ Like calling `ghub-request' (which see) with `gitlab' as FORGE." (cl-defun glab-repository-id (owner name &key username auth host) "Return the id of the repository specified by OWNER, NAME and HOST." (number-to-string - (cdr (assq 'id (glab-get (format "/projects/%s%%2F%s" owner name) + (cdr (assq 'id (glab-get (format "/projects/%s%%2F%s" + (replace-regexp-in-string "/" "%2F" owner) + name) nil :username username :auth auth :host host))))) ;;; _ diff --git a/elpa/ghub-20181110.1845/gogs.el b/elpa/ghub-20190121.2116/gogs.el similarity index 98% rename from elpa/ghub-20181110.1845/gogs.el rename to elpa/ghub-20190121.2116/gogs.el index 0fbac46e..7ce7fcdc 100644 --- a/elpa/ghub-20181110.1845/gogs.el +++ b/elpa/ghub-20190121.2116/gogs.el @@ -1,6 +1,6 @@ ;;; gogs.el --- minuscule client library for the Gogs API -*- lexical-binding: t -*- -;; Copyright (C) 2016-2018 Jonas Bernoulli +;; Copyright (C) 2016-2019 Jonas Bernoulli ;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/ghub @@ -36,7 +36,7 @@ (require 'ghub) (defconst gogs-default-host "localhost:3000/api/v1" - "The default host that is used if `gogs.host' is not set.") + "The default Gogs host.") ;; HEAD does not appear to be supported. diff --git a/elpa/ghub-20181110.1845/gtea.el b/elpa/ghub-20190121.2116/gtea.el similarity index 98% rename from elpa/ghub-20181110.1845/gtea.el rename to elpa/ghub-20190121.2116/gtea.el index 07ca2909..81223bd4 100644 --- a/elpa/ghub-20181110.1845/gtea.el +++ b/elpa/ghub-20190121.2116/gtea.el @@ -1,6 +1,6 @@ ;;; gtea.el --- minuscule client library for the Gitea API -*- lexical-binding: t -*- -;; Copyright (C) 2016-2018 Jonas Bernoulli +;; Copyright (C) 2016-2019 Jonas Bernoulli ;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/ghub @@ -36,7 +36,7 @@ (require 'ghub) (defconst gtea-default-host "localhost:3000/api/v1" - "The default host that is used if `gtea.host' is not set.") + "The default Gitea host.") ;; HEAD does not appear to be supported. diff --git a/elpa/ghub-readme.txt b/elpa/ghub-readme.txt deleted file mode 100644 index 2e6c5237..00000000 --- a/elpa/ghub-readme.txt +++ /dev/null @@ -1,16 +0,0 @@ -Ghub is a library that provides basic support for using the Github API -from Emacs packages. It abstracts access to API resources using only -a handful of functions that are not resource-specific. - -Ghub handles the creation, storage and use of access tokens using a -setup wizard to make it easier for users to get started and to reduce -the support burden imposed on package maintainers. It also comes with -a comprehensive manual to address the cases when things don't just -work as expected or in case you don't want to use the wizard. - -Ghub is intentionally limited to only provide these two essential -features — basic request functions and guided setup — to avoid being -too opinionated, which would hinder wide adoption. It is assumed that -wide adoption would make life easier for users and maintainers alike, -because then all packages that talk to the Github API could be -configured the same way. -- 2.47.3