> # TL;DR
>
> **Added by @tarsius.**
>
> **We found and patched two bugs i…n Emacs that resulted in these symptoms.**
> **See https://github.com/magit/ghub/wiki/Known-Issues#emacs-bugs-resulting-in-bug-missing-headers.**
I used magithub for some time, and today it stopped working. After some investigation I found that it seems to be ghub-related.
For example, I get an error after doing this:
1. Remove access token in github settings
2. Removing ^magithub line from .authinfo.gpg
3. `M-x auth-source-forget-all-cached`
4. `M-x ghub-create-token`
After entering Host, Username, Package and not modifying Scopes, I get the following backtrace:
```
Debugger entered--Lisp error: (error "BUG: missing headers nil")
signal(error ("BUG: missing headers nil"))
error("BUG: missing headers %s" nil)
ghub--handle-response-headers(nil #s(ghub--req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/authorizations" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous nil) :forge nil :silent nil :method "POST" :headers #f(compiled-function () #<bytecode 0x29d0ab5>) :handler ghub--handle-response :unpaginate nil :noerror nil :reader nil :callback nil :errorback nil :value nil :extra nil))
ghub--handle-response(nil #s(ghub--req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/authorizations" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous nil) :forge nil :silent nil :method "POST" :headers #f(compiled-function () #<bytecode 0x29d0ab5>) :handler ghub--handle-response :unpaginate nil :noerror nil :reader nil :callback nil :errorback nil :value nil :extra nil))
ghub--retrieve("{\"scopes\":[\"repo\",\"user\",\"notifications\"],\"note\":\"Emacs package magithub @ fkhodkov-note\"}" #s(ghub--req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/authorizations" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous nil) :forge nil :silent nil :method "POST" :headers #f(compiled-function () #<bytecode 0x29d0ab5>) :handler ghub--handle-response :unpaginate nil :noerror nil :reader nil :callback nil :errorback nil :value nil :extra nil))
#f(compiled-function (arg1 arg2 &rest rest) "Make a request for RESOURCE and return the response body.\n\nAlso place the response headers in `ghub-response-headers'.\n\nMETHOD is the HTTP method, given as a string.\nRESOURCE is the resource to access, given as a string beginning\n with a slash.\n\nPARAMS, QUERY, PAYLOAD and HEADERS are alists used to specify\n data. The Github API documentation is vague on how data has\n to be transmitted and for a particular resource usually just\n talks about \"parameters\". Generally speaking when the METHOD\n is \"HEAD\" or \"GET\", then they have to be transmitted as a\n query, otherwise as a payload.\nUse PARAMS to automatically transmit like QUERY or PAYLOAD would\n depending on METHOD.\nUse QUERY to explicitly transmit data as a query.\nUse PAYLOAD to explicitly transmit data as a payload.\n Instead of an alist, PAYLOAD may also be a string, in which\n case it gets encoded as UTF-8 but is otherwise transmitted as-is.\nUse HEADERS for those rare resources that require that the data\n is transmitted as headers instead of as a query or payload.\n When that is the case, then the API documentation usually\n mentions it explicitly.\n\nIf SILENT is non-nil, then don't message progress reports and\n the like.\n\nIf UNPAGINATE is t, then make as many requests as necessary to\n get all values. If UNPAGINATE is a natural number, then get\n at most that many pages. For any other non-nil value raise\n an error.\nIf NOERROR is non-nil, then do not raise an error if the request\n fails and return nil instead. If NOERROR is `return', then\n return the error payload instead of nil.\nIf READER is non-nil, then it is used to read and return from the\n response buffer. The default is `ghub--read-json-payload'.\n For the very few resources that do not return JSON, you might\n want to use `ghub--decode-payload'.\n\nIf USERNAME is non-nil, then make a request on behalf of that\n user. It is better to specify the user using the Git variable\n `github.user' for \"api.github.com\", or `github.HOST.user' if\n connecting to a Github Enterprise instance.\n\nEach package that uses `ghub' should use its own token. If AUTH\n is nil, then the generic `ghub' token is used instead. This\n is only acceptable for personal utilities. A packages that\n is distributed to other users should always use this argument\n to identify itself, using a symbol matching its name.\n\n Package authors who find this inconvenient should write a\n wrapper around this function and possibly for the\n method-specific functions as well.\n\n Some symbols have a special meaning. `none' means to make an\n unauthorized request. `basic' means to make a password based\n request. If the value is a string, then it is assumed to be\n a valid token. `basic' and an explicit token string are only\n intended for internal and debugging uses.\n\n If AUTH is a package symbol, then the scopes are specified\n using the variable `AUTH-github-token-scopes'. It is an error\n if that is not specified. See `ghub-github-token-scopes' for\n an example.\n\nIf HOST is non-nil, then connect to that Github instance. This\n defaults to \"api.github.com\". When a repository is connected\n to a Github Enterprise instance, then it is better to specify\n that using the Git variable `github.host' instead of using this\n argument.\n\nIf FORGE is `gitlab', then connect to Gitlab.com or, depending\n on HOST, to another Gitlab instance. This is only intended for\n internal use. Instead of using this argument you should use\n function `glab-request' and other `glab-*' functions.\n\nIf CALLBACK and/or ERRORBACK is non-nil, then make one or more\n asynchronous requests and call CALLBACK or ERRORBACK when\n finished. If no error occurred, then call CALLBACK, unless\n that is nil.\n\n If an error occurred, then call ERRORBACK, or if that is nil,\n then CALLBACK. ERRORBACK can also be t, in which case an error\n is signaled instead. NOERROR is ignored for all asynchronous\n requests.\n\nBoth callbacks are called with four arguments.\n 1. For CALLBACK, the combined value of the retrieved pages.\n For ERRORBACK, the error that occured when retrieving the\n last page.\n 2. The headers of the last page as an alist.\n 3. Status information provided by `url-retrieve'. Its `:error'\n property holds the same information as ERRORBACK's first\n argument.\n 4. A `ghub--req' struct, which can be passed to `ghub-continue'\n (which see) to retrieve the next page, if any." #<bytecode 0x15ef2e5>)("POST" "/authorizations" ((scopes "repo" "user" "notifications") (note . "Emacs package magithub @ fkhodkov-note")) :query nil :payload nil :headers nil :silent nil :unpaginate nil :noerror nil :reader nil :username "fkhodkov" :auth basic :host "api.github.com" :callback nil :errorback nil :extra nil)
apply(#f(compiled-function (arg1 arg2 &rest rest) "Make a request for RESOURCE and return the response body.\n\nAlso place the response headers in `ghub-response-headers'.\n\nMETHOD is the HTTP method, given as a string.\nRESOURCE is the resource to access, given as a string beginning\n with a slash.\n\nPARAMS, QUERY, PAYLOAD and HEADERS are alists used to specify\n data. The Github API documentation is vague on how data has\n to be transmitted and for a particular resource usually just\n talks about \"parameters\". Generally speaking when the METHOD\n is \"HEAD\" or \"GET\", then they have to be transmitted as a\n query, otherwise as a payload.\nUse PARAMS to automatically transmit like QUERY or PAYLOAD would\n depending on METHOD.\nUse QUERY to explicitly transmit data as a query.\nUse PAYLOAD to explicitly transmit data as a payload.\n Instead of an alist, PAYLOAD may also be a string, in which\n case it gets encoded as UTF-8 but is otherwise transmitted as-is.\nUse HEADERS for those rare resources that require that the data\n is transmitted as headers instead of as a query or payload.\n When that is the case, then the API documentation usually\n mentions it explicitly.\n\nIf SILENT is non-nil, then don't message progress reports and\n the like.\n\nIf UNPAGINATE is t, then make as many requests as necessary to\n get all values. If UNPAGINATE is a natural number, then get\n at most that many pages. For any other non-nil value raise\n an error.\nIf NOERROR is non-nil, then do not raise an error if the request\n fails and return nil instead. If NOERROR is `return', then\n return the error payload instead of nil.\nIf READER is non-nil, then it is used to read and return from the\n response buffer. The default is `ghub--read-json-payload'.\n For the very few resources that do not return JSON, you might\n want to use `ghub--decode-payload'.\n\nIf USERNAME is non-nil, then make a request on behalf of that\n user. It is better to specify the user using the Git variable\n `github.user' for \"api.github.com\", or `github.HOST.user' if\n connecting to a Github Enterprise instance.\n\nEach package that uses `ghub' should use its own token. If AUTH\n is nil, then the generic `ghub' token is used instead. This\n is only acceptable for personal utilities. A packages that\n is distributed to other users should always use this argument\n to identify itself, using a symbol matching its name.\n\n Package authors who find this inconvenient should write a\n wrapper around this function and possibly for the\n method-specific functions as well.\n\n Some symbols have a special meaning. `none' means to make an\n unauthorized request. `basic' means to make a password based\n request. If the value is a string, then it is assumed to be\n a valid token. `basic' and an explicit token string are only\n intended for internal and debugging uses.\n\n If AUTH is a package symbol, then the scopes are specified\n using the variable `AUTH-github-token-scopes'. It is an error\n if that is not specified. See `ghub-github-token-scopes' for\n an example.\n\nIf HOST is non-nil, then connect to that Github instance. This\n defaults to \"api.github.com\". When a repository is connected\n to a Github Enterprise instance, then it is better to specify\n that using the Git variable `github.host' instead of using this\n argument.\n\nIf FORGE is `gitlab', then connect to Gitlab.com or, depending\n on HOST, to another Gitlab instance. This is only intended for\n internal use. Instead of using this argument you should use\n function `glab-request' and other `glab-*' functions.\n\nIf CALLBACK and/or ERRORBACK is non-nil, then make one or more\n asynchronous requests and call CALLBACK or ERRORBACK when\n finished. If no error occurred, then call CALLBACK, unless\n that is nil.\n\n If an error occurred, then call ERRORBACK, or if that is nil,\n then CALLBACK. ERRORBACK can also be t, in which case an error\n is signaled instead. NOERROR is ignored for all asynchronous\n requests.\n\nBoth callbacks are called with four arguments.\n 1. For CALLBACK, the combined value of the retrieved pages.\n For ERRORBACK, the error that occured when retrieving the\n last page.\n 2. The headers of the last page as an alist.\n 3. Status information provided by `url-retrieve'. Its `:error'\n property holds the same information as ERRORBACK's first\n argument.\n 4. A `ghub--req' struct, which can be passed to `ghub-continue'\n (which see) to retrieve the next page, if any." #<bytecode 0x15ef2e5>) ("POST" "/authorizations" ((scopes "repo" "user" "notifications") (note . "Emacs package magithub @ fkhodkov-note")) :query nil :payload nil :headers nil :silent nil :unpaginate nil :noerror nil :reader nil :username "fkhodkov" :auth basic :host "api.github.com" :callback nil :errorback nil :extra nil))
magithub-debug--ghub-request-wrapper(#f(compiled-function (arg1 arg2 &rest rest) "Make a request for RESOURCE and return the response body.\n\nAlso place the response headers in `ghub-response-headers'.\n\nMETHOD is the HTTP method, given as a string.\nRESOURCE is the resource to access, given as a string beginning\n with a slash.\n\nPARAMS, QUERY, PAYLOAD and HEADERS are alists used to specify\n data. The Github API documentation is vague on how data has\n to be transmitted and for a particular resource usually just\n talks about \"parameters\". Generally speaking when the METHOD\n is \"HEAD\" or \"GET\", then they have to be transmitted as a\n query, otherwise as a payload.\nUse PARAMS to automatically transmit like QUERY or PAYLOAD would\n depending on METHOD.\nUse QUERY to explicitly transmit data as a query.\nUse PAYLOAD to explicitly transmit data as a payload.\n Instead of an alist, PAYLOAD may also be a string, in which\n case it gets encoded as UTF-8 but is otherwise transmitted as-is.\nUse HEADERS for those rare resources that require that the data\n is transmitted as headers instead of as a query or payload.\n When that is the case, then the API documentation usually\n mentions it explicitly.\n\nIf SILENT is non-nil, then don't message progress reports and\n the like.\n\nIf UNPAGINATE is t, then make as many requests as necessary to\n get all values. If UNPAGINATE is a natural number, then get\n at most that many pages. For any other non-nil value raise\n an error.\nIf NOERROR is non-nil, then do not raise an error if the request\n fails and return nil instead. If NOERROR is `return', then\n return the error payload instead of nil.\nIf READER is non-nil, then it is used to read and return from the\n response buffer. The default is `ghub--read-json-payload'.\n For the very few resources that do not return JSON, you might\n want to use `ghub--decode-payload'.\n\nIf USERNAME is non-nil, then make a request on behalf of that\n user. It is better to specify the user using the Git variable\n `github.user' for \"api.github.com\", or `github.HOST.user' if\n connecting to a Github Enterprise instance.\n\nEach package that uses `ghub' should use its own token. If AUTH\n is nil, then the generic `ghub' token is used instead. This\n is only acceptable for personal utilities. A packages that\n is distributed to other users should always use this argument\n to identify itself, using a symbol matching its name.\n\n Package authors who find this inconvenient should write a\n wrapper around this function and possibly for the\n method-specific functions as well.\n\n Some symbols have a special meaning. `none' means to make an\n unauthorized request. `basic' means to make a password based\n request. If the value is a string, then it is assumed to be\n a valid token. `basic' and an explicit token string are only\n intended for internal and debugging uses.\n\n If AUTH is a package symbol, then the scopes are specified\n using the variable `AUTH-github-token-scopes'. It is an error\n if that is not specified. See `ghub-github-token-scopes' for\n an example.\n\nIf HOST is non-nil, then connect to that Github instance. This\n defaults to \"api.github.com\". When a repository is connected\n to a Github Enterprise instance, then it is better to specify\n that using the Git variable `github.host' instead of using this\n argument.\n\nIf FORGE is `gitlab', then connect to Gitlab.com or, depending\n on HOST, to another Gitlab instance. This is only intended for\n internal use. Instead of using this argument you should use\n function `glab-request' and other `glab-*' functions.\n\nIf CALLBACK and/or ERRORBACK is non-nil, then make one or more\n asynchronous requests and call CALLBACK or ERRORBACK when\n finished. If no error occurred, then call CALLBACK, unless\n that is nil.\n\n If an error occurred, then call ERRORBACK, or if that is nil,\n then CALLBACK. ERRORBACK can also be t, in which case an error\n is signaled instead. NOERROR is ignored for all asynchronous\n requests.\n\nBoth callbacks are called with four arguments.\n 1. For CALLBACK, the combined value of the retrieved pages.\n For ERRORBACK, the error that occured when retrieving the\n last page.\n 2. The headers of the last page as an alist.\n 3. Status information provided by `url-retrieve'. Its `:error'\n property holds the same information as ERRORBACK's first\n argument.\n 4. A `ghub--req' struct, which can be passed to `ghub-continue'\n (which see) to retrieve the next page, if any." #<bytecode 0x15ef2e5>) "POST" "/authorizations" ((scopes "repo" "user" "notifications") (note . "Emacs package magithub @ fkhodkov-note")) :query nil :payload nil :headers nil :silent nil :unpaginate nil :noerror nil :reader nil :username "fkhodkov" :auth basic :host "api.github.com" :callback nil :errorback nil :extra nil)
apply(magithub-debug--ghub-request-wrapper #f(compiled-function (arg1 arg2 &rest rest) "Make a request for RESOURCE and return the response body.\n\nAlso place the response headers in `ghub-response-headers'.\n\nMETHOD is the HTTP method, given as a string.\nRESOURCE is the resource to access, given as a string beginning\n with a slash.\n\nPARAMS, QUERY, PAYLOAD and HEADERS are alists used to specify\n data. The Github API documentation is vague on how data has\n to be transmitted and for a particular resource usually just\n talks about \"parameters\". Generally speaking when the METHOD\n is \"HEAD\" or \"GET\", then they have to be transmitted as a\n query, otherwise as a payload.\nUse PARAMS to automatically transmit like QUERY or PAYLOAD would\n depending on METHOD.\nUse QUERY to explicitly transmit data as a query.\nUse PAYLOAD to explicitly transmit data as a payload.\n Instead of an alist, PAYLOAD may also be a string, in which\n case it gets encoded as UTF-8 but is otherwise transmitted as-is.\nUse HEADERS for those rare resources that require that the data\n is transmitted as headers instead of as a query or payload.\n When that is the case, then the API documentation usually\n mentions it explicitly.\n\nIf SILENT is non-nil, then don't message progress reports and\n the like.\n\nIf UNPAGINATE is t, then make as many requests as necessary to\n get all values. If UNPAGINATE is a natural number, then get\n at most that many pages. For any other non-nil value raise\n an error.\nIf NOERROR is non-nil, then do not raise an error if the request\n fails and return nil instead. If NOERROR is `return', then\n return the error payload instead of nil.\nIf READER is non-nil, then it is used to read and return from the\n response buffer. The default is `ghub--read-json-payload'.\n For the very few resources that do not return JSON, you might\n want to use `ghub--decode-payload'.\n\nIf USERNAME is non-nil, then make a request on behalf of that\n user. It is better to specify the user using the Git variable\n `github.user' for \"api.github.com\", or `github.HOST.user' if\n connecting to a Github Enterprise instance.\n\nEach package that uses `ghub' should use its own token. If AUTH\n is nil, then the generic `ghub' token is used instead. This\n is only acceptable for personal utilities. A packages that\n is distributed to other users should always use this argument\n to identify itself, using a symbol matching its name.\n\n Package authors who find this inconvenient should write a\n wrapper around this function and possibly for the\n method-specific functions as well.\n\n Some symbols have a special meaning. `none' means to make an\n unauthorized request. `basic' means to make a password based\n request. If the value is a string, then it is assumed to be\n a valid token. `basic' and an explicit token string are only\n intended for internal and debugging uses.\n\n If AUTH is a package symbol, then the scopes are specified\n using the variable `AUTH-github-token-scopes'. It is an error\n if that is not specified. See `ghub-github-token-scopes' for\n an example.\n\nIf HOST is non-nil, then connect to that Github instance. This\n defaults to \"api.github.com\". When a repository is connected\n to a Github Enterprise instance, then it is better to specify\n that using the Git variable `github.host' instead of using this\n argument.\n\nIf FORGE is `gitlab', then connect to Gitlab.com or, depending\n on HOST, to another Gitlab instance. This is only intended for\n internal use. Instead of using this argument you should use\n function `glab-request' and other `glab-*' functions.\n\nIf CALLBACK and/or ERRORBACK is non-nil, then make one or more\n asynchronous requests and call CALLBACK or ERRORBACK when\n finished. If no error occurred, then call CALLBACK, unless\n that is nil.\n\n If an error occurred, then call ERRORBACK, or if that is nil,\n then CALLBACK. ERRORBACK can also be t, in which case an error\n is signaled instead. NOERROR is ignored for all asynchronous\n requests.\n\nBoth callbacks are called with four arguments.\n 1. For CALLBACK, the combined value of the retrieved pages.\n For ERRORBACK, the error that occured when retrieving the\n last page.\n 2. The headers of the last page as an alist.\n 3. Status information provided by `url-retrieve'. Its `:error'\n property holds the same information as ERRORBACK's first\n argument.\n 4. A `ghub--req' struct, which can be passed to `ghub-continue'\n (which see) to retrieve the next page, if any." #<bytecode 0x15ef2e5>) ("POST" "/authorizations" ((scopes "repo" "user" "notifications") (note . "Emacs package magithub @ fkhodkov-note")) :query nil :payload nil :headers nil :silent nil :unpaginate nil :noerror nil :reader nil :username "fkhodkov" :auth basic :host "api.github.com" :callback nil :errorback nil :extra nil))
ghub-request("POST" "/authorizations" ((scopes "repo" "user" "notifications") (note . "Emacs package magithub @ fkhodkov-note")) :query nil :payload nil :headers nil :silent nil :unpaginate nil :noerror nil :reader nil :username "fkhodkov" :auth basic :host "api.github.com" :callback nil :errorback nil :extra nil)
ghub-post("/authorizations" ((scopes "repo" "user" "notifications") (note . "Emacs package magithub @ fkhodkov-note")) :username "fkhodkov" :auth basic :host "api.github.com")
ghub-create-token("api.github.com" "fkhodkov" magithub ("repo" "user" "notifications"))
funcall-interactively(ghub-create-token "api.github.com" "fkhodkov" magithub ("repo" "user" "notifications"))
call-interactively(ghub-create-token record nil)
command-execute(ghub-create-token record)
execute-extended-command(nil "ghub-create-token" nil)
funcall-interactively(execute-extended-command nil "ghub-create-token" nil)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
```
, even though in github settings I see newly-created token. I can regenerate token and manually store it in `.authinfo.gpg`, but then I'll get similar error after every attempt to do anything magithub-related. For example, this I get after trying to `magithub-clone` the ghub's repo:
```
Debugger entered--Lisp error: (error "BUG: missing headers nil")
signal(error ("BUG: missing headers nil"))
error("BUG: missing headers %s" nil)
ghub--handle-response-headers(nil #s(ghub--req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/repos/magit/ghub" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous nil) :forge nil :silent nil :method "GET" :headers #f(compiled-function () #<bytecode 0x273b74d>) :handler ghub--handle-response :unpaginate nil :noerror nil :reader nil :callback nil :errorback nil :value nil :extra nil))
ghub--handle-response(nil #s(ghub--req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/repos/magit/ghub" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous nil) :forge nil :silent nil :method "GET" :headers #f(compiled-function () #<bytecode 0x273b74d>) :handler ghub--handle-response :unpaginate nil :noerror nil :reader nil :callback nil :errorback nil :value nil :extra nil))
ghub--retrieve(nil #s(ghub--req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/repos/magit/ghub" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous nil) :forge nil :silent nil :method "GET" :headers #f(compiled-function () #<bytecode 0x273b74d>) :handler ghub--handle-response :unpaginate nil :noerror nil :reader nil :callback nil :errorback nil :value nil :extra nil))
#f(compiled-function (arg1 arg2 &rest rest) "Make a request for RESOURCE and return the response body.\n\nAlso place the response headers in `ghub-response-headers'.\n\nMETHOD is the HTTP method, given as a string.\nRESOURCE is the resource to access, given as a string beginning\n with a slash.\n\nPARAMS, QUERY, PAYLOAD and HEADERS are alists used to specify\n data. The Github API documentation is vague on how data has\n to be transmitted and for a particular resource usually just\n talks about \"parameters\". Generally speaking when the METHOD\n is \"HEAD\" or \"GET\", then they have to be transmitted as a\n query, otherwise as a payload.\nUse PARAMS to automatically transmit like QUERY or PAYLOAD would\n depending on METHOD.\nUse QUERY to explicitly transmit data as a query.\nUse PAYLOAD to explicitly transmit data as a payload.\n Instead of an alist, PAYLOAD may also be a string, in which\n case it gets encoded as UTF-8 but is otherwise transmitted as-is.\nUse HEADERS for those rare resources that require that the data\n is transmitted as headers instead of as a query or payload.\n When that is the case, then the API documentation usually\n mentions it explicitly.\n\nIf SILENT is non-nil, then don't message progress reports and\n the like.\n\nIf UNPAGINATE is t, then make as many requests as necessary to\n get all values. If UNPAGINATE is a natural number, then get\n at most that many pages. For any other non-nil value raise\n an error.\nIf NOERROR is non-nil, then do not raise an error if the request\n fails and return nil instead. If NOERROR is `return', then\n return the error payload instead of nil.\nIf READER is non-nil, then it is used to read and return from the\n response buffer. The default is `ghub--read-json-payload'.\n For the very few resources that do not return JSON, you might\n want to use `ghub--decode-payload'.\n\nIf USERNAME is non-nil, then make a request on behalf of that\n user. It is better to specify the user using the Git variable\n `github.user' for \"api.github.com\", or `github.HOST.user' if\n connecting to a Github Enterprise instance.\n\nEach package that uses `ghub' should use its own token. If AUTH\n is nil, then the generic `ghub' token is used instead. This\n is only acceptable for personal utilities. A packages that\n is distributed to other users should always use this argument\n to identify itself, using a symbol matching its name.\n\n Package authors who find this inconvenient should write a\n wrapper around this function and possibly for the\n method-specific functions as well.\n\n Some symbols have a special meaning. `none' means to make an\n unauthorized request. `basic' means to make a password based\n request. If the value is a string, then it is assumed to be\n a valid token. `basic' and an explicit token string are only\n intended for internal and debugging uses.\n\n If AUTH is a package symbol, then the scopes are specified\n using the variable `AUTH-github-token-scopes'. It is an error\n if that is not specified. See `ghub-github-token-scopes' for\n an example.\n\nIf HOST is non-nil, then connect to that Github instance. This\n defaults to \"api.github.com\". When a repository is connected\n to a Github Enterprise instance, then it is better to specify\n that using the Git variable `github.host' instead of using this\n argument.\n\nIf FORGE is `gitlab', then connect to Gitlab.com or, depending\n on HOST, to another Gitlab instance. This is only intended for\n internal use. Instead of using this argument you should use\n function `glab-request' and other `glab-*' functions.\n\nIf CALLBACK and/or ERRORBACK is non-nil, then make one or more\n asynchronous requests and call CALLBACK or ERRORBACK when\n finished. If no error occurred, then call CALLBACK, unless\n that is nil.\n\n If an error occurred, then call ERRORBACK, or if that is nil,\n then CALLBACK. ERRORBACK can also be t, in which case an error\n is signaled instead. NOERROR is ignored for all asynchronous\n requests.\n\nBoth callbacks are called with four arguments.\n 1. For CALLBACK, the combined value of the retrieved pages.\n For ERRORBACK, the error that occured when retrieving the\n last page.\n 2. The headers of the last page as an alist.\n 3. Status information provided by `url-retrieve'. Its `:error'\n property holds the same information as ERRORBACK's first\n argument.\n 4. A `ghub--req' struct, which can be passed to `ghub-continue'\n (which see) to retrieve the next page, if any." #<bytecode 0x15ef2e5>)("GET" "/repos/magit/ghub" nil :query nil :payload nil :unpaginate nil :headers nil :username nil :auth magithub :host nil)
apply(#f(compiled-function (arg1 arg2 &rest rest) "Make a request for RESOURCE and return the response body.\n\nAlso place the response headers in `ghub-response-headers'.\n\nMETHOD is the HTTP method, given as a string.\nRESOURCE is the resource to access, given as a string beginning\n with a slash.\n\nPARAMS, QUERY, PAYLOAD and HEADERS are alists used to specify\n data. The Github API documentation is vague on how data has\n to be transmitted and for a particular resource usually just\n talks about \"parameters\". Generally speaking when the METHOD\n is \"HEAD\" or \"GET\", then they have to be transmitted as a\n query, otherwise as a payload.\nUse PARAMS to automatically transmit like QUERY or PAYLOAD would\n depending on METHOD.\nUse QUERY to explicitly transmit data as a query.\nUse PAYLOAD to explicitly transmit data as a payload.\n Instead of an alist, PAYLOAD may also be a string, in which\n case it gets encoded as UTF-8 but is otherwise transmitted as-is.\nUse HEADERS for those rare resources that require that the data\n is transmitted as headers instead of as a query or payload.\n When that is the case, then the API documentation usually\n mentions it explicitly.\n\nIf SILENT is non-nil, then don't message progress reports and\n the like.\n\nIf UNPAGINATE is t, then make as many requests as necessary to\n get all values. If UNPAGINATE is a natural number, then get\n at most that many pages. For any other non-nil value raise\n an error.\nIf NOERROR is non-nil, then do not raise an error if the request\n fails and return nil instead. If NOERROR is `return', then\n return the error payload instead of nil.\nIf READER is non-nil, then it is used to read and return from the\n response buffer. The default is `ghub--read-json-payload'.\n For the very few resources that do not return JSON, you might\n want to use `ghub--decode-payload'.\n\nIf USERNAME is non-nil, then make a request on behalf of that\n user. It is better to specify the user using the Git variable\n `github.user' for \"api.github.com\", or `github.HOST.user' if\n connecting to a Github Enterprise instance.\n\nEach package that uses `ghub' should use its own token. If AUTH\n is nil, then the generic `ghub' token is used instead. This\n is only acceptable for personal utilities. A packages that\n is distributed to other users should always use this argument\n to identify itself, using a symbol matching its name.\n\n Package authors who find this inconvenient should write a\n wrapper around this function and possibly for the\n method-specific functions as well.\n\n Some symbols have a special meaning. `none' means to make an\n unauthorized request. `basic' means to make a password based\n request. If the value is a string, then it is assumed to be\n a valid token. `basic' and an explicit token string are only\n intended for internal and debugging uses.\n\n If AUTH is a package symbol, then the scopes are specified\n using the variable `AUTH-github-token-scopes'. It is an error\n if that is not specified. See `ghub-github-token-scopes' for\n an example.\n\nIf HOST is non-nil, then connect to that Github instance. This\n defaults to \"api.github.com\". When a repository is connected\n to a Github Enterprise instance, then it is better to specify\n that using the Git variable `github.host' instead of using this\n argument.\n\nIf FORGE is `gitlab', then connect to Gitlab.com or, depending\n on HOST, to another Gitlab instance. This is only intended for\n internal use. Instead of using this argument you should use\n function `glab-request' and other `glab-*' functions.\n\nIf CALLBACK and/or ERRORBACK is non-nil, then make one or more\n asynchronous requests and call CALLBACK or ERRORBACK when\n finished. If no error occurred, then call CALLBACK, unless\n that is nil.\n\n If an error occurred, then call ERRORBACK, or if that is nil,\n then CALLBACK. ERRORBACK can also be t, in which case an error\n is signaled instead. NOERROR is ignored for all asynchronous\n requests.\n\nBoth callbacks are called with four arguments.\n 1. For CALLBACK, the combined value of the retrieved pages.\n For ERRORBACK, the error that occured when retrieving the\n last page.\n 2. The headers of the last page as an alist.\n 3. Status information provided by `url-retrieve'. Its `:error'\n property holds the same information as ERRORBACK's first\n argument.\n 4. A `ghub--req' struct, which can be passed to `ghub-continue'\n (which see) to retrieve the next page, if any." #<bytecode 0x15ef2e5>) ("GET" "/repos/magit/ghub" nil :query nil :payload nil :unpaginate nil :headers nil :username nil :auth magithub :host nil))
magithub-debug--ghub-request-wrapper(#f(compiled-function (arg1 arg2 &rest rest) "Make a request for RESOURCE and return the response body.\n\nAlso place the response headers in `ghub-response-headers'.\n\nMETHOD is the HTTP method, given as a string.\nRESOURCE is the resource to access, given as a string beginning\n with a slash.\n\nPARAMS, QUERY, PAYLOAD and HEADERS are alists used to specify\n data. The Github API documentation is vague on how data has\n to be transmitted and for a particular resource usually just\n talks about \"parameters\". Generally speaking when the METHOD\n is \"HEAD\" or \"GET\", then they have to be transmitted as a\n query, otherwise as a payload.\nUse PARAMS to automatically transmit like QUERY or PAYLOAD would\n depending on METHOD.\nUse QUERY to explicitly transmit data as a query.\nUse PAYLOAD to explicitly transmit data as a payload.\n Instead of an alist, PAYLOAD may also be a string, in which\n case it gets encoded as UTF-8 but is otherwise transmitted as-is.\nUse HEADERS for those rare resources that require that the data\n is transmitted as headers instead of as a query or payload.\n When that is the case, then the API documentation usually\n mentions it explicitly.\n\nIf SILENT is non-nil, then don't message progress reports and\n the like.\n\nIf UNPAGINATE is t, then make as many requests as necessary to\n get all values. If UNPAGINATE is a natural number, then get\n at most that many pages. For any other non-nil value raise\n an error.\nIf NOERROR is non-nil, then do not raise an error if the request\n fails and return nil instead. If NOERROR is `return', then\n return the error payload instead of nil.\nIf READER is non-nil, then it is used to read and return from the\n response buffer. The default is `ghub--read-json-payload'.\n For the very few resources that do not return JSON, you might\n want to use `ghub--decode-payload'.\n\nIf USERNAME is non-nil, then make a request on behalf of that\n user. It is better to specify the user using the Git variable\n `github.user' for \"api.github.com\", or `github.HOST.user' if\n connecting to a Github Enterprise instance.\n\nEach package that uses `ghub' should use its own token. If AUTH\n is nil, then the generic `ghub' token is used instead. This\n is only acceptable for personal utilities. A packages that\n is distributed to other users should always use this argument\n to identify itself, using a symbol matching its name.\n\n Package authors who find this inconvenient should write a\n wrapper around this function and possibly for the\n method-specific functions as well.\n\n Some symbols have a special meaning. `none' means to make an\n unauthorized request. `basic' means to make a password based\n request. If the value is a string, then it is assumed to be\n a valid token. `basic' and an explicit token string are only\n intended for internal and debugging uses.\n\n If AUTH is a package symbol, then the scopes are specified\n using the variable `AUTH-github-token-scopes'. It is an error\n if that is not specified. See `ghub-github-token-scopes' for\n an example.\n\nIf HOST is non-nil, then connect to that Github instance. This\n defaults to \"api.github.com\". When a repository is connected\n to a Github Enterprise instance, then it is better to specify\n that using the Git variable `github.host' instead of using this\n argument.\n\nIf FORGE is `gitlab', then connect to Gitlab.com or, depending\n on HOST, to another Gitlab instance. This is only intended for\n internal use. Instead of using this argument you should use\n function `glab-request' and other `glab-*' functions.\n\nIf CALLBACK and/or ERRORBACK is non-nil, then make one or more\n asynchronous requests and call CALLBACK or ERRORBACK when\n finished. If no error occurred, then call CALLBACK, unless\n that is nil.\n\n If an error occurred, then call ERRORBACK, or if that is nil,\n then CALLBACK. ERRORBACK can also be t, in which case an error\n is signaled instead. NOERROR is ignored for all asynchronous\n requests.\n\nBoth callbacks are called with four arguments.\n 1. For CALLBACK, the combined value of the retrieved pages.\n For ERRORBACK, the error that occured when retrieving the\n last page.\n 2. The headers of the last page as an alist.\n 3. Status information provided by `url-retrieve'. Its `:error'\n property holds the same information as ERRORBACK's first\n argument.\n 4. A `ghub--req' struct, which can be passed to `ghub-continue'\n (which see) to retrieve the next page, if any." #<bytecode 0x15ef2e5>) "GET" "/repos/magit/ghub" nil :query nil :payload nil :unpaginate nil :headers nil :username nil :auth magithub :host nil)
apply(magithub-debug--ghub-request-wrapper #f(compiled-function (arg1 arg2 &rest rest) "Make a request for RESOURCE and return the response body.\n\nAlso place the response headers in `ghub-response-headers'.\n\nMETHOD is the HTTP method, given as a string.\nRESOURCE is the resource to access, given as a string beginning\n with a slash.\n\nPARAMS, QUERY, PAYLOAD and HEADERS are alists used to specify\n data. The Github API documentation is vague on how data has\n to be transmitted and for a particular resource usually just\n talks about \"parameters\". Generally speaking when the METHOD\n is \"HEAD\" or \"GET\", then they have to be transmitted as a\n query, otherwise as a payload.\nUse PARAMS to automatically transmit like QUERY or PAYLOAD would\n depending on METHOD.\nUse QUERY to explicitly transmit data as a query.\nUse PAYLOAD to explicitly transmit data as a payload.\n Instead of an alist, PAYLOAD may also be a string, in which\n case it gets encoded as UTF-8 but is otherwise transmitted as-is.\nUse HEADERS for those rare resources that require that the data\n is transmitted as headers instead of as a query or payload.\n When that is the case, then the API documentation usually\n mentions it explicitly.\n\nIf SILENT is non-nil, then don't message progress reports and\n the like.\n\nIf UNPAGINATE is t, then make as many requests as necessary to\n get all values. If UNPAGINATE is a natural number, then get\n at most that many pages. For any other non-nil value raise\n an error.\nIf NOERROR is non-nil, then do not raise an error if the request\n fails and return nil instead. If NOERROR is `return', then\n return the error payload instead of nil.\nIf READER is non-nil, then it is used to read and return from the\n response buffer. The default is `ghub--read-json-payload'.\n For the very few resources that do not return JSON, you might\n want to use `ghub--decode-payload'.\n\nIf USERNAME is non-nil, then make a request on behalf of that\n user. It is better to specify the user using the Git variable\n `github.user' for \"api.github.com\", or `github.HOST.user' if\n connecting to a Github Enterprise instance.\n\nEach package that uses `ghub' should use its own token. If AUTH\n is nil, then the generic `ghub' token is used instead. This\n is only acceptable for personal utilities. A packages that\n is distributed to other users should always use this argument\n to identify itself, using a symbol matching its name.\n\n Package authors who find this inconvenient should write a\n wrapper around this function and possibly for the\n method-specific functions as well.\n\n Some symbols have a special meaning. `none' means to make an\n unauthorized request. `basic' means to make a password based\n request. If the value is a string, then it is assumed to be\n a valid token. `basic' and an explicit token string are only\n intended for internal and debugging uses.\n\n If AUTH is a package symbol, then the scopes are specified\n using the variable `AUTH-github-token-scopes'. It is an error\n if that is not specified. See `ghub-github-token-scopes' for\n an example.\n\nIf HOST is non-nil, then connect to that Github instance. This\n defaults to \"api.github.com\". When a repository is connected\n to a Github Enterprise instance, then it is better to specify\n that using the Git variable `github.host' instead of using this\n argument.\n\nIf FORGE is `gitlab', then connect to Gitlab.com or, depending\n on HOST, to another Gitlab instance. This is only intended for\n internal use. Instead of using this argument you should use\n function `glab-request' and other `glab-*' functions.\n\nIf CALLBACK and/or ERRORBACK is non-nil, then make one or more\n asynchronous requests and call CALLBACK or ERRORBACK when\n finished. If no error occurred, then call CALLBACK, unless\n that is nil.\n\n If an error occurred, then call ERRORBACK, or if that is nil,\n then CALLBACK. ERRORBACK can also be t, in which case an error\n is signaled instead. NOERROR is ignored for all asynchronous\n requests.\n\nBoth callbacks are called with four arguments.\n 1. For CALLBACK, the combined value of the retrieved pages.\n For ERRORBACK, the error that occured when retrieving the\n last page.\n 2. The headers of the last page as an alist.\n 3. Status information provided by `url-retrieve'. Its `:error'\n property holds the same information as ERRORBACK's first\n argument.\n 4. A `ghub--req' struct, which can be passed to `ghub-continue'\n (which see) to retrieve the next page, if any." #<bytecode 0x15ef2e5>) ("GET" "/repos/magit/ghub" nil :query nil :payload nil :unpaginate nil :headers nil :username nil :auth magithub :host nil))
ghub-request("GET" "/repos/magit/ghub" nil :query nil :payload nil :unpaginate nil :headers nil :username nil :auth magithub :host nil)
ghubp-request(get "/repos/magit/ghub" nil nil)
apply(ghubp-request get "/repos/magit/ghub" (nil nil))
ghubp-get-repos-owner-repo(((owner (login . "magit")) (name . "ghub")))
byte-code("\302 \303 C\304\030\211\305\306B\002\242B\240\210\307\310\311\312\313\005!\314\"\315$\020\316\002!)\262\001\206:\0\211\317\320\002\236A\236A\321\002\236A\322\323\003\003#\266\202\262\001\324\321\002\"\325\326\011\003\304\005%\002\001D\207" [ghubp-contextualize-function magithub-clone-default-directory magithub-clone--get-repo ghubp-get-context nil auth magithub make-byte-code 0 "\300\242\207" vconcat vector [] 1 ghubp-get-repos-owner-repo login owner name user-error "Repository %s/%s does not exist" alist-get read-directory-name "Destination: "] 9)
call-interactively(magithub-clone record nil)
command-execute(magithub-clone record)
execute-extended-command(nil "magithub-clone" nil)
funcall-interactively(execute-extended-command nil "magithub-clone" nil)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
```