Import upstream version 3.5.3+git20210727.1.00a77b7
Debian Janitor
2 years ago
116 | 116 | (comments [(:edges t)] |
117 | 117 | databaseId |
118 | 118 | (author login) |
119 | createdAt | |
120 | updatedAt | |
119 | createdAt | |
120 | updatedAt | |
121 | 121 | body) |
122 | 122 | (labels [(:edges t)] |
123 | 123 | id)) |
168 | 168 | databaseId |
169 | 169 | (author login) |
170 | 170 | createdAt |
171 | updatedAt | |
172 | body) | |
171 | updatedAt | |
172 | body) | |
173 | 173 | (labels [(:edges t)] |
174 | 174 | id))))) |
175 | 175 | |
476 | 476 | `(,(car single) |
477 | 477 | ,(vector (list (cadr single) (cdr (car lineage)))) |
478 | 478 | ,@(if (cdr lineage) |
479 | (ghub--graphql-narrow-query child (cdr lineage) cursor) | |
479 | (ghub--graphql-narrow-query child (cdr lineage) cursor) | |
480 | 480 | child))) |
481 | 481 | (let* ((child (or (assq (car lineage) (cdr query)) |
482 | 482 | ;; Alias |
411 | 411 | (setq-default ghub-response-headers headers)) |
412 | 412 | page) |
413 | 413 | (cdr (assq 'link-alist ghub-response-headers))) |
414 | (when-let ((rels (cdr (assoc "Link" (or headers ghub-response-headers))))) | |
415 | (mapcar (lambda (elt) | |
416 | (pcase-let ((`(,url ,rel) (split-string elt "; "))) | |
417 | (cons (intern (substring rel 5 -1)) | |
418 | (substring url 1 -1)))) | |
419 | (split-string rels ", "))))) | |
414 | (when-let ((rels (cdr (assoc "Link" (or headers ghub-response-headers))))) | |
415 | (mapcar (lambda (elt) | |
416 | (pcase-let ((`(,url ,rel) (split-string elt "; "))) | |
417 | (cons (intern (substring rel 5 -1)) | |
418 | (substring url 1 -1)))) | |
419 | (split-string rels ", "))))) | |
420 | 420 | |
421 | 421 | (cl-defun ghub-repository-id (owner name &key username auth host forge noerror) |
422 | 422 | "Return the id of the specified repository. |
470 | 470 | - For any other non-nil value use the kludge, if and only if we |
471 | 471 | believe that doing so is the correct thing to do. |
472 | 472 | |
473 | The default value of this variable is either nil or `forge'. It | |
474 | is `forge' if using libgnutls >=3.6.3 (the version introducing | |
473 | The default value of this variable is either nil or `force'. It | |
474 | is `force' if using libgnutls >=3.6.3 (the version introducing | |
475 | 475 | TLS1.3); AND also using Emacs < 26.3 and/or macOS (any version). |
476 | 476 | |
477 | 477 | If the value is any other non-nil value, then `ghub--retrieve' |
7 | 7 | #+TEXINFO_DIR_CATEGORY: Emacs |
8 | 8 | #+TEXINFO_DIR_TITLE: Ghub: (ghub). |
9 | 9 | #+TEXINFO_DIR_DESC: Minuscule client library for the Github API. |
10 | #+SUBTITLE: for version 3.5.3 | |
10 | #+SUBTITLE: for version 3.5.3 (v3.5.3-4-g39f9a5b+1) | |
11 | 11 | |
12 | 12 | #+TEXINFO_DEFFN: t |
13 | 13 | #+OPTIONS: H:4 num:4 toc:2 |
19 | 19 | the APIs of various instances of various Git forge implementations. |
20 | 20 | |
21 | 21 | #+TEXINFO: @noindent |
22 | This manual is for Ghub version 3.5.3. | |
22 | This manual is for Ghub version 3.5.3 (v3.5.3-4-g39f9a5b+1). | |
23 | 23 | |
24 | 24 | #+BEGIN_QUOTE |
25 | 25 | Copyright (C) 2017-2021 Jonas Bernoulli <jonas@bernoul.li> |
150 | 150 | - ~gitea.HOST.user~ specifies the user for the HOST ~gitea~ instance. |
151 | 151 | - ~gitea.host~ specifies the ~gitea~ host, unless the HOST argument is |
152 | 152 | non-nil |
153 | - ~gogs.user~ is *not* used because no canonical ~gitea~ instance exists. | |
153 | - ~gogs.user~ is *not* used because no canonical ~gogs~ instance exists. | |
154 | 154 | - ~gogs.HOST.user~ specifies the user for the HOST ~gogs~ instance. |
155 | 155 | - ~gogs.host~ specifies the ~gogs~ host, unless the HOST argument is |
156 | 156 | non-nil |
166 | 166 | |
167 | 167 | *** Setting your Github.com Username |
168 | 168 | :PROPERTIES: |
169 | :NONODE: t | |
169 | :UNNUMBERED: notoc | |
170 | 170 | :END: |
171 | 171 | |
172 | 172 | To inform Ghub about your "github.com" username do this: |
185 | 185 | |
186 | 186 | *** Setting your Gitlab.com Username |
187 | 187 | :PROPERTIES: |
188 | :NONODE: t | |
188 | :UNNUMBERED: notoc | |
189 | 189 | :END: |
190 | 190 | |
191 | 191 | To inform Ghub about your "gitlab.com" username do this: |
207 | 207 | |
208 | 208 | *** Setting your Github Enterprise Username |
209 | 209 | :PROPERTIES: |
210 | :NONODE: t | |
210 | :UNNUMBERED: notoc | |
211 | 211 | :END: |
212 | 212 | |
213 | 213 | For Github Enterprise instances you have to specify where the API |
235 | 235 | |
236 | 236 | *** Setting your Username for Other Hosts and/or Forges |
237 | 237 | :PROPERTIES: |
238 | :NONODE: t | |
238 | :UNNUMBERED: notoc | |
239 | 239 | :END: |
240 | 240 | |
241 | 241 | To inform Ghub about your username on HOST (a FORGE instance) do this: |
268 | 268 | hosts: |
269 | 269 | |
270 | 270 | - https://github.com/settings/tokens |
271 | - https://gitlab.com/profile/personal_access_tokens | |
271 | - https://gitlab.com/-/profile/personal_access_tokens | |
272 | 272 | |
273 | 273 | For other forges we cannot provide a functioning URL because they |
274 | 274 | contain unknown values such as your name. Just go to the general |
30 | 30 | @finalout |
31 | 31 | @titlepage |
32 | 32 | @title Ghub User and Developer Manual |
33 | @subtitle for version 3.5.3 | |
33 | @subtitle for version 3.5.3 (v3.5.3-4-g39f9a5b+1) | |
34 | 34 | @author Jonas Bernoulli |
35 | 35 | @page |
36 | 36 | @vskip 0pt plus 1filll |
47 | 47 | the APIs of various instances of various Git forge implementations. |
48 | 48 | |
49 | 49 | @noindent |
50 | This manual is for Ghub version 3.5.3. | |
50 | This manual is for Ghub version 3.5.3 (v3.5.3-4-g39f9a5b+1). | |
51 | 51 | |
52 | 52 | @quotation |
53 | 53 | Copyright (C) 2017-2021 Jonas Bernoulli <jonas@@bernoul.li> |
267 | 267 | non-nil |
268 | 268 | |
269 | 269 | @item |
270 | @code{gogs.user} is @strong{not} used because no canonical @code{gitea} instance exists. | |
270 | @code{gogs.user} is @strong{not} used because no canonical @code{gogs} instance exists. | |
271 | 271 | |
272 | 272 | @item |
273 | 273 | @code{gogs.HOST.user} specifies the user for the HOST @code{gogs} instance. |
286 | 286 | is needed because you might use different usernames on different |
287 | 287 | hosts. |
288 | 288 | |
289 | @subsection Setting your Github.com Username | |
289 | @anchor{Setting your Githubcom Username} | |
290 | @subheading Setting your Github.com Username | |
290 | 291 | |
291 | 292 | To inform Ghub about your "github.com" username do this: |
292 | 293 | |
302 | 303 | git config --local github.user USERNAME |
303 | 304 | @end example |
304 | 305 | |
305 | @subsection Setting your Gitlab.com Username | |
306 | @anchor{Setting your Gitlabcom Username} | |
307 | @subheading Setting your Gitlab.com Username | |
306 | 308 | |
307 | 309 | To inform Ghub about your "gitlab.com" username do this: |
308 | 310 | |
321 | 323 | Make sure you use the correct USERNAME for this forge/host. It might |
322 | 324 | not be the same as on "github.com"! |
323 | 325 | |
324 | @subsection Setting your Github Enterprise Username | |
326 | @anchor{Setting your Github Enterprise Username} | |
327 | @subheading Setting your Github Enterprise Username | |
325 | 328 | |
326 | 329 | For Github Enterprise instances you have to specify where the API |
327 | 330 | can be accessed and a different variable has to be used to set the |
346 | 349 | git config --local github.host example.com/api/v3 |
347 | 350 | @end example |
348 | 351 | |
349 | @subsection Setting your Username for Other Hosts and/or Forges | |
352 | @anchor{Setting your Username for Other Hosts and/or Forges} | |
353 | @subheading Setting your Username for Other Hosts and/or Forges | |
350 | 354 | |
351 | 355 | To inform Ghub about your username on HOST (a FORGE instance) do this: |
352 | 356 | |
390 | 394 | @uref{https://github.com/settings/tokens} |
391 | 395 | |
392 | 396 | @item |
393 | @uref{https://gitlab.com/profile/personal_access_tokens} | |
397 | @uref{https://gitlab.com/-/profile/personal_access_tokens} | |
394 | 398 | @end itemize |
395 | 399 | |
396 | 400 | For other forges we cannot provide a functioning URL because they |