vermiculus / magithub

**DEPRECATED - please use Forge instead!** -- Magit-based interfaces to GitHub
GNU General Public License v3.0
579 stars 63 forks source link

problems creating new issue #139

Closed anquegi closed 7 years ago

anquegi commented 7 years ago

I have configured and connected ghub magit is fully functional but usingmagithub I get the following error:

ELISP> (ghub-get "/user")
((login . "anquegi")
 (id . 2518346)
 (avatar_url . "https://avatars3.githubusercontent.com/u/2518346?v=4")
 (gravatar_id . "")
 (url . "https://api.github.com/users/anquegi")
 (html_url . "https://github.com/anquegi")
 (followers_url . "https://api.github.com/users/anquegi/followers")
 (following_url . "https://api.github.com/users/anquegi/following{/other_user}")
 (gists_url . "https://api.github.com/users/anquegi/gists{/gist_id}")
 (starred_url . "https://api.github.com/users/anquegi/starred{/owner}{/repo}")
 (subscriptions_url . "https://api.github.com/users/anquegi/subscriptions")
 (organizations_url . "https://api.github.com/users/anquegi/orgs")
 (repos_url . "https://api.github.com/users/anquegi/repos")
 (events_url . "https://api.github.com/users/anquegi/events{/privacy}")
 (received_events_url . "https://api.github.com/users/anquegi/received_events")
 (type . "User")
 (site_admin)
 (name . "Antonio Juan Querol")
 (company . "@ElevenPaths Telefónica")
 (blog . "")
 (location . "Valencia")
 (email . "antoniojuan.querolginer@telefonica.com")
 (hireable)
 (bio)
 (public_repos . 28)
 (public_gists . 2)
 (followers . 5)
 (following . 7)
 (created_at . "2012-10-09T08:13:26Z")
 (updated_at . "2017-09-01T12:10:04Z")
 (private_gists . 0)
 (total_private_repos . 17)
 (owned_private_repos . 16)
 (disk_usage . 1050266)
 (collaborators . 6)
 (two_factor_authentication . t)
 (plan
  (name . "developer")
  (space . 976562499)
  (collaborators . 0)
  (private_repos . 9999)))

but when submitting a new use I always get the following error:

Not Found: "POST", "/repos/////issues", nil, "{\"title\":\"separate repositories clip and clap into submodules\",\"body\":\"I think that clip and clap should go in separate submodules\"}", ((message . "Not Found") (documentation_url . "https://developer.github.com/v3"))
Saving file /Users/toni/.emacs.d/magithub/cache...
Wrote /Users/toni/.emacs.d/magithub/cache
*CLING*CLING*

and in the cache: `

s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ((nil condition-case e (or (ghubp-get-repos-owner-repo (quote nil)) (and (not magithub--api-available-p) sparse-repo)) (ghub-404 nil)) ((22958 19819 624998 0))))`

vermiculus commented 7 years ago

what does (magithub-repo) return in the repository you're trying to submit an issue to?

vermiculus commented 7 years ago

we might have to update one of the regexps in magithub-core.el -- can you debug that function and see what the value of url is? (You can also get this value with git config remote.REMOTE.url.)

anquegi commented 7 years ago

Executing the function after regreshing github data with on magit buffer press H and then on magithub dispatch g (Refresh all Github data) on ielm executing (magithub-repo) return nil. and a capture in the debugger

with debug-on-entry for magithub-repo I get this:

 Debugger entered--returning value: [-flatten]
  vconcat([-flatten] [])
* -mapcat(-flatten ("config" "-z" "--get-all" "magithub.proxy"))
* -flatten(("config" "-z" "--get-all" "magithub.proxy"))
* (append magit-git-global-arguments (-flatten args))
* magit-process-git-arguments(("config" "-z" "--get-all" "magithub.proxy"))
* (setq args (magit-process-git-arguments args))
* magit-git-insert("config" "-z" "--get-all" "magithub.proxy")
* apply(magit-git-insert ("config" "-z" "--get-all" "magithub.proxy"))
* (progn (apply (function magit-git-insert) args) (split-string (buffer-string) "�" t))
* (unwind-protect (progn (apply (function magit-git-insert) args) (split-string (buffer-string) "�" t)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
* (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (apply (function magit-git-insert) args) (split-string (buffer-string) "�" t)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
* (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (apply (function magit-git-insert) args) (split-string (buffer-string) "�" t)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
* magit-git-items("config" "-z" "--get-all" "magithub.proxy")
* (if magit--refresh-cache (magit-config-get-from-cached-list key) (magit-git-items "config" "-z" "--get-all" key))
* (let ((magit-git-debug nil) (key (mapconcat (quote identity) keys "."))) (if magit--refresh-cache (magit-config-get-from-cached-list key) (magit-git-items "config" "-z" "--get-all" key)))
* magit-get-all("magithub" "proxy")
* apply(magit-get-all ("magithub" "proxy"))
* (last (apply (quote magit-get-all) keys))
* (car (last (apply (quote magit-get-all) keys)))
* magit-get("magithub" "proxy")
* magithub-source--remote()
* magithub-source--sparse-repo()
* #[256 "\211\206�\300 \301\302\303\304\305\306\307DD\310BB\311BBB\312\313\312%\207" [magithub-source--sparse-repo magithub-cache :repo-demographics condition-case e or ghubp-get-repos-owner-repo quote ((and (not magithub--api-available-p) sparse-repo)) ((ghub-404 nil)) nil :context] 10 ("/Users/toni/.emacs.d/.cask/25.2/elpa/magithub-20170829.1509/magithub-core.elc" . 21468)]()
* apply(#[256 "\211\206�\300 \301\302\303\304\305\306\307DD\310BB\311BBB\312\313\312%\207" [magithub-source--sparse-repo magithub-cache :repo-demographics condition-case e or ghubp-get-repos-owner-repo quote ((and (not magithub--api-available-p) sparse-repo)) ((ghub-404 nil)) nil :context] 10 ("/Users/toni/.emacs.d/.cask/25.2/elpa/magithub-20170829.1509/magithub-core.elc" . 21468)] nil)
* magithub-repo()
  (setq repo (magithub-repo))
  (let ((alist (setq repo (magithub-repo)))) (let ((\.full_name (cdr (assq (quote full_name) alist))) (\.permissions\.push (cdr (assq (quote push) (cdr (assq ... alist)))))) (list repo (read-string (format "Issue title (%s): " \.full_name)) (if \.permissions\.push (progn (magithub-label-read-labels "Labels: "))))))
  call-interactively(magithub-issue-new)
  (let* ((magit-current-popup magit-this-popup) (magit-current-popup-args (magit-popup-get-args)) (command (progn nil (or (progn nil (and (vectorp ...) (>= ... 7) (memq ... cl-struct-magit-popup-event-tags) t)) (signal (quote wrong-type-argument) (list (quote magit-popup-event) (or action variable)))) (aref (or action variable) 4))) (magit-current-popup-action command)) (if action (progn (magit-popup-quit))) (call-interactively command) (setq this-command command) (if action nil (magit-refresh-popup-buffer)))
  (cond ((or action variable) (let* ((magit-current-popup magit-this-popup) (magit-current-popup-args (magit-popup-get-args)) (command (progn nil (or (progn nil ...) (signal ... ...)) (aref (or action variable) 4))) (magit-current-popup-action command)) (if action (progn (magit-popup-quit))) (call-interactively command) (setq this-command command) (if action nil (magit-refresh-popup-buffer)))) ((eq event 113) (magit-popup-quit) (if magit-previous-popup (progn (magit-popup-mode-setup magit-previous-popup nil)))) (t (user-error "%c isn't bound to any action" event)))
  (let ((action (magit-popup-lookup event :actions)) (variable (magit-popup-lookup event :variables))) (if (and variable (not (progn nil (or (progn nil (and ... ... ... t)) (signal (quote wrong-type-argument) (list ... variable))) (aref variable 3)))) (progn (setq action variable) (setq variable nil))) (cond ((or action variable) (let* ((magit-current-popup magit-this-popup) (magit-current-popup-args (magit-popup-get-args)) (command (progn nil (or ... ...) (aref ... 4))) (magit-current-popup-action command)) (if action (progn (magit-popup-quit))) (call-interactively command) (setq this-command command) (if action nil (magit-refresh-popup-buffer)))) ((eq event 113) (magit-popup-quit) (if magit-previous-popup (progn (magit-popup-mode-setup magit-previous-popup nil)))) (t (user-error "%c isn't bound to any action" event))))
  magit-invoke-popup-action(105)
  funcall-interactively(magit-invoke-popup-action 105)
  call-interactively(magit-invoke-popup-action nil nil)
  command-execute(magit-invoke-popup-action)
captura de pantalla 2017-09-05 a las 18 07 46

I hope this info help

Sorry I closed and reopen the issue

vermiculus commented 7 years ago

Can you execute these commands?

git config magithub.proxy
git config remote.REMOTE-THAT-POINTS-TO-GITHUB.url
anquegi commented 7 years ago

Thanks for you help @vermiculus

on eshell I get no response

on magit with (!!) I get

GitError! Git failed [Type `$' for details]

1 git config magithub.proxy 1 git config remote.REMOTE-THAT-POINTS-TO-GITHUB.url

from both commands

and executing directy a shell command I get (shell command failed with code 1 and no output)

captura de pantalla 2017-09-08 a las 13 29 53

So I need to configure this variable, I do not see anything in the readme

vermiculus commented 7 years ago

If there's nothing in the proxy, then you're probably using origin. This is an entirely optional configuration setting – it just accommodates non-standard workflows.

REMOTE-THAT-POINTS-TO-GITHUB isn't actually the remote name you want.... I meant for you to say

git config remote.origin.url

assuming that origin is the remote that points to GitHub.

anquegi commented 7 years ago

Sorry, thanks for the correction

0 git config remote.github.url git@github.com:anquegi/cl-clasp.git

vermiculus commented 7 years ago

So github is the name of the remote that points to GitHub? Looks like you should then be using a proxy.

What does evaluating (let ((default-directory "/path/to/your/repo")) (magit-get "magithub" "proxy")) get you? If that's nothing, try doing git config magithub.proxy github in your repo directory and try again.

anquegi commented 7 years ago

So the problem was that my origin was called github instead of origin. Thanks for your help. Using this instruction, on a magit buffer I execute what you said !! git config magithub.proxy github and all worked well, thanks for your help

vermiculus commented 7 years ago

Glad it worked out for ya :-)