magit / forge

Work with Git forges from the comfort of Magit
GNU General Public License v3.0
1.3k stars 113 forks source link

Wrong-number-of-arguments error when using magit-status #642

Closed LemonBreezes closed 6 months ago

LemonBreezes commented 6 months ago
Debugger entered--Lisp error: (wrong-number-of-arguments nil 0)
  signal(wrong-number-of-arguments (nil 0))
  (if (= (length --cl-rest--) 3) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal 'wrong-number-of-arguments (list nil (length --cl-rest--))))
  (let* ((--cl-rest-- (if --cl-rest-- (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal 'wrong-number-of-arguments (list nil (length --cl-rest--))))) (host (if (= (length --cl-rest--) 3) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal 'wrong-number-of-arguments (list nil (length --cl-rest--))))) (owner (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (name (car-safe --cl-rest--)) (remote (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (demand (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))))) (progn (if --cl-rest-- (signal 'wrong-number-of-arguments (list nil (+ 3 (length --cl-rest--))))) (let* ((spec (and t (forge--get-forge-host host t)))) (if spec (progn (ignore (consp spec)) (let* ((x982 ...) (x983 ...)) (progn (ignore ...) (let* ... ...)))) (if (memq demand forge--signal-no-entry) (progn (error "Cannot determine forge repository.  No entry for %S in %s" host 'forge-alist)))))))
  (progn (let* ((--cl-rest-- (if --cl-rest-- (car-safe (prog1 --cl-rest-- (setq --cl-rest-- ...))) (signal 'wrong-number-of-arguments (list nil (length --cl-rest--))))) (host (if (= (length --cl-rest--) 3) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- ...))) (signal 'wrong-number-of-arguments (list nil (length --cl-rest--))))) (owner (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (name (car-safe --cl-rest--)) (remote (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (demand (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))))) (progn (if --cl-rest-- (signal 'wrong-number-of-arguments (list nil (+ 3 (length --cl-rest--))))) (let* ((spec (and t (forge--get-forge-host host t)))) (if spec (progn (ignore (consp spec)) (let* (... ...) (progn ... ...))) (if (memq demand forge--signal-no-entry) (progn (error "Cannot determine forge repository.  No entry for %S in %s" host ...))))))))
  (closure (t) (&rest --cl-rest--) "((HOST OWNER NAME) &optional REMOTE DEMAND)\n\nReturn the repository identified by HOST, OWNER and NAME.\nSee `forge-alist' for valid Git hosts.\n\n(fn (HOST OWNER NAME) &optional REMOTE DEMAND)" (progn (let* ((--cl-rest-- (if --cl-rest-- (car-safe ...) (signal ... ...))) (host (if (= ... 3) (car-safe ...) (signal ... ...))) (owner (car-safe (prog1 --cl-rest-- ...))) (name (car-safe --cl-rest--)) (remote (car-safe (prog1 --cl-rest-- ...))) (demand (car-safe (prog1 --cl-rest-- ...)))) (progn (if --cl-rest-- (signal 'wrong-number-of-arguments (list nil ...))) (let* ((spec ...)) (if spec (progn ... ...) (if ... ...)))))))(nil)
  apply((closure (t) (&rest --cl-rest--) "((HOST OWNER NAME) &optional REMOTE DEMAND)\n\nReturn the repository identified by HOST, OWNER and NAME.\nSee `forge-alist' for valid Git hosts.\n\n(fn (HOST OWNER NAME) &optional REMOTE DEMAND)" (progn (let* ((--cl-rest-- (if --cl-rest-- (car-safe ...) (signal ... ...))) (host (if (= ... 3) (car-safe ...) (signal ... ...))) (owner (car-safe (prog1 --cl-rest-- ...))) (name (car-safe --cl-rest--)) (remote (car-safe (prog1 --cl-rest-- ...))) (demand (car-safe (prog1 --cl-rest-- ...)))) (progn (if --cl-rest-- (signal 'wrong-number-of-arguments (list nil ...))) (let* ((spec ...)) (if spec (progn ... ...) (if ... ...))))))) nil nil)
  forge-get-repository(nil)
  (and t (forge-get-repository nil))
  (let* ((repo (and t (forge-get-repository nil)))) (if repo (progn (and (not (eieio-oref repo 'sparse-p)) (or (not issues-p) (eieio-oref repo 'issues-p)) repo))))
  (and (forge-db t) (or forge-display-in-status-buffer (not (eq major-mode 'magit-status-mode))) (let* ((repo (and t (forge-get-repository nil)))) (if repo (progn (and (not (eieio-oref repo 'sparse-p)) (or (not issues-p) (eieio-oref repo 'issues-p)) repo)))))
  forge--assert-insert-topics-get-repository()
  (and t (forge--assert-insert-topics-get-repository))
  (let* ((repo (and t (forge--assert-insert-topics-get-repository)))) (if repo (forge--insert-topics 'pullreqs heading (funcall getter repo)) nil))
  forge--insert-pullreqs("Pull requests" forge--ls-recent-pullreqs)
  forge-insert-pullreqs()
  apply(forge-insert-pullreqs nil)
  (if (and (boundp 'magit-refresh-verbose) magit-refresh-verbose) (let ((time (let ((t1 (current-time))) (apply entry args) (float-time (time-since t1))))) (message "  %-50s %f %s" entry time (cond ((> time 0.03) "!!") ((> time 0.01) "!") (t "")))) (apply entry args))
  (if (memq entry magit-disabled-section-inserters) nil (if (and (boundp 'magit-refresh-verbose) magit-refresh-verbose) (let ((time (let ((t1 ...)) (apply entry args) (float-time (time-since t1))))) (message "  %-50s %f %s" entry time (cond ((> time 0.03) "!!") ((> time 0.01) "!") (t "")))) (apply entry args)))
  (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) (if (memq entry magit-disabled-section-inserters) nil (if (and (boundp 'magit-refresh-verbose) magit-refresh-verbose) (let ((time (let (...) (apply entry args) (float-time ...)))) (message "  %-50s %f %s" entry time (cond ((> time 0.03) "!!") ((> time 0.01) "!") (t "")))) (apply entry args))))
  (let ((entry (car tail))) (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) (if (memq entry magit-disabled-section-inserters) nil (if (and (boundp 'magit-refresh-verbose) magit-refresh-verbose) (let ((time (let ... ... ...))) (message "  %-50s %f %s" entry time (cond (... "!!") (... "!") (t "")))) (apply entry args)))) (setq tail (cdr tail)))
  (while tail (let ((entry (car tail))) (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) (if (memq entry magit-disabled-section-inserters) nil (if (and (boundp 'magit-refresh-verbose) magit-refresh-verbose) (let ((time ...)) (message "  %-50s %f %s" entry time (cond ... ... ...))) (apply entry args)))) (setq tail (cdr tail))))
  (let ((tail entries)) (while tail (let ((entry (car tail))) (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) (if (memq entry magit-disabled-section-inserters) nil (if (and (boundp ...) magit-refresh-verbose) (let (...) (message "  %-50s %f %s" entry time ...)) (apply entry args)))) (setq tail (cdr tail)))))
  (let ((entries (symbol-value hook))) (if (listp entries) nil (setq entries (list entries))) (let* ((invalid (and t (seq-remove #'functionp entries)))) (if invalid (progn (message "`%s' contains entries that are no longer valid.\n%s\nUsing standard value instead.  Please re-configure hook variable." hook (mapconcat #'(lambda ... ...) invalid "\n")) (sit-for 5) (setq entries (eval (car (get hook ...))))) nil)) (let ((tail entries)) (while tail (let ((entry (car tail))) (let ((magit--current-section-hook (cons ... magit--current-section-hook))) (if (memq entry magit-disabled-section-inserters) nil (if (and ... magit-refresh-verbose) (let ... ...) (apply entry args)))) (setq tail (cdr tail))))))
  magit-run-section-hook(magit-status-sections-hook)
  (catch 'cancel-section (magit-run-section-hook 'magit-status-sections-hook) (run-hooks 'magit-insert-section-hook) (magit-insert-child-count section350) (if magit-section-inhibit-markers nil (set-marker-insertion-type (eieio-oref section350 'start) t)) (let* ((end (eieio-oset section350 'end (if magit-section-inhibit-markers (point) (point-marker)))) (class-map (eieio-oref section350 'keymap)) (magit-map (intern (format "magit-%s-section-map" (eieio-oref section350 'type)))) (forge-map (intern (format "forge-%s-section-map" (eieio-oref section350 'type)))) (map (and class-map (symbol-value class-map)))) (if map nil (setq map (or (and (boundp magit-map) (symbol-value magit-map)) (and (boundp forge-map) (symbol-value forge-map)))) (eieio-oset section350 'keymap map)) (save-excursion (goto-char (eieio-oref section350 'start)) (while (< (point) end) (let ((next (or ... end))) (if (magit-section-at) nil (put-text-property (point) next 'magit-section section350) (if map (progn ...))) (magit-section-maybe-add-heading-map section350) (goto-char next))))) (cond ((eq section350 magit-root-section) (if (eq magit-section-inhibit-markers 'delay) (progn (setq magit-section-inhibit-markers nil) (magit-map-sections #'(lambda ... ... ...)))) (let ((magit-section-cache-visibility nil)) (magit-section-show section350))) (magit-section-insert-in-reverse (let* ((v (eieio-oref section350 'parent))) (eieio-oset v 'children (cons section350 (eieio-oref v 'children))))) ((let ((parent (eieio-oref section350 'parent))) (eieio-oset parent 'children (nconc (eieio-oref parent 'children) (list section350)))))))
  (let ((magit-insert-section--current section350) (magit-insert-section--parent section350) (magit-insert-section--oldroot (or magit-insert-section--oldroot (and (not magit-insert-section--parent) (prog1 magit-root-section (setq magit-root-section section350)))))) (catch 'cancel-section (magit-run-section-hook 'magit-status-sections-hook) (run-hooks 'magit-insert-section-hook) (magit-insert-child-count section350) (if magit-section-inhibit-markers nil (set-marker-insertion-type (eieio-oref section350 'start) t)) (let* ((end (eieio-oset section350 'end (if magit-section-inhibit-markers (point) (point-marker)))) (class-map (eieio-oref section350 'keymap)) (magit-map (intern (format "magit-%s-section-map" (eieio-oref section350 ...)))) (forge-map (intern (format "forge-%s-section-map" (eieio-oref section350 ...)))) (map (and class-map (symbol-value class-map)))) (if map nil (setq map (or (and (boundp magit-map) (symbol-value magit-map)) (and (boundp forge-map) (symbol-value forge-map)))) (eieio-oset section350 'keymap map)) (save-excursion (goto-char (eieio-oref section350 'start)) (while (< (point) end) (let ((next ...)) (if (magit-section-at) nil (put-text-property ... next ... section350) (if map ...)) (magit-section-maybe-add-heading-map section350) (goto-char next))))) (cond ((eq section350 magit-root-section) (if (eq magit-section-inhibit-markers 'delay) (progn (setq magit-section-inhibit-markers nil) (magit-map-sections #'...))) (let ((magit-section-cache-visibility nil)) (magit-section-show section350))) (magit-section-insert-in-reverse (let* ((v (eieio-oref section350 ...))) (eieio-oset v 'children (cons section350 (eieio-oref v ...))))) ((let ((parent (eieio-oref section350 ...))) (eieio-oset parent 'children (nconc (eieio-oref parent ...) (list section350))))))) (if magit-section-insert-in-reverse (progn (setq magit-section-insert-in-reverse nil) (eieio-oset section350 'children (nreverse (eieio-oref section350 'children))))) section350)
  (let* ((type349 'status) (section350 (funcall (if (class-p type349) type349 (or (cdr (assq type349 magit--section-type-alist)) 'magit-section)) :type (or (and (class-p type349) (car (rassq type349 magit--section-type-alist))) type349) :value nil :start (if magit-section-inhibit-markers (point) (point-marker)) :parent magit-insert-section--parent))) (eieio-oset section350 'hidden (let* ((value (and t (run-hook-with-args-until-success 'magit-section-set-visibility-hook section350)))) (if value (eq value 'hide) (let* ((incarnation (and t ...))) (if incarnation (eieio-oref incarnation 'hidden) (let* (...) (if value ... nil))))))) (let ((magit-insert-section--current section350) (magit-insert-section--parent section350) (magit-insert-section--oldroot (or magit-insert-section--oldroot (and (not magit-insert-section--parent) (prog1 magit-root-section (setq magit-root-section section350)))))) (catch 'cancel-section (magit-run-section-hook 'magit-status-sections-hook) (run-hooks 'magit-insert-section-hook) (magit-insert-child-count section350) (if magit-section-inhibit-markers nil (set-marker-insertion-type (eieio-oref section350 'start) t)) (let* ((end (eieio-oset section350 'end (if magit-section-inhibit-markers ... ...))) (class-map (eieio-oref section350 'keymap)) (magit-map (intern (format "magit-%s-section-map" ...))) (forge-map (intern (format "forge-%s-section-map" ...))) (map (and class-map (symbol-value class-map)))) (if map nil (setq map (or (and ... ...) (and ... ...))) (eieio-oset section350 'keymap map)) (save-excursion (goto-char (eieio-oref section350 'start)) (while (< (point) end) (let (...) (if ... nil ... ...) (magit-section-maybe-add-heading-map section350) (goto-char next))))) (cond ((eq section350 magit-root-section) (if (eq magit-section-inhibit-markers 'delay) (progn (setq magit-section-inhibit-markers nil) (magit-map-sections ...))) (let ((magit-section-cache-visibility nil)) (magit-section-show section350))) (magit-section-insert-in-reverse (let* ((v ...)) (eieio-oset v 'children (cons section350 ...)))) ((let ((parent ...)) (eieio-oset parent 'children (nconc ... ...)))))) (if magit-section-insert-in-reverse (progn (setq magit-section-insert-in-reverse nil) (eieio-oset section350 'children (nreverse (eieio-oref section350 'children))))) section350))
  magit-status-refresh-buffer()
  magit-refresh-buffer()
  magit-setup-buffer-internal(magit-status-mode nil ((magit-buffer-diff-args ("--no-ext-diff")) (magit-buffer-diff-files nil) (magit-buffer-log-args ("-n256" "--decorate")) (magit-buffer-log-files nil)))
  (let* ((default-directory directory) (d (magit-diff--get-value 'magit-status-mode magit-status-use-buffer-arguments)) (l (magit-log--get-value 'magit-status-mode magit-status-use-buffer-arguments)) (file (and magit-status-goto-file-position (magit-file-relative-name))) (line (and file (save-restriction (widen) (line-number-at-pos)))) (col (and file (save-restriction (widen) (current-column)))) (buf (magit-setup-buffer-internal #'magit-status-mode nil (list (list 'magit-buffer-diff-args (nth 0 d)) (list 'magit-buffer-diff-files (nth 1 d)) (list 'magit-buffer-log-args (nth 0 l)) (list 'magit-buffer-log-files (nth 1 l)))))) (if file (progn (save-current-buffer (set-buffer buf) (let ((staged (magit-get-section ...))) (if (and staged (car ...)) (magit-diff--goto-position file line col staged) (let (...) (if ... nil ...))))))) buf)
  magit-status-setup-buffer("/home/st/src/atlas/")
  (if directory (let ((toplevel (magit-toplevel directory))) (setq directory (file-name-as-directory (expand-file-name directory))) (if (and toplevel (file-equal-p directory toplevel)) (magit-status-setup-buffer directory) (if (y-or-n-p (if toplevel (format "%s is a repository.  Create another in %s? " toplevel directory) (format "Create repository in %s? " directory))) (progn (setq magit--refresh-cache nil) (magit-init directory))))) (magit-status-setup-buffer default-directory))
  (let ((magit--refresh-cache (or cache (list (cons 0 0))))) (if directory (let ((toplevel (magit-toplevel directory))) (setq directory (file-name-as-directory (expand-file-name directory))) (if (and toplevel (file-equal-p directory toplevel)) (magit-status-setup-buffer directory) (if (y-or-n-p (if toplevel (format "%s is a repository.  Create another in %s? " toplevel directory) (format "Create repository in %s? " directory))) (progn (setq magit--refresh-cache nil) (magit-init directory))))) (magit-status-setup-buffer default-directory)))
  magit-status(nil ((75 . 29) (("/home/st/src/atlas/" magit-get-push-branch #("PSP-4678-fix-linux-compilation-1" 0 32 (face magit-branch-local font-lock-face magit-branch-local)) nil) . #("origin/PSP-4678-fix-linux-compilation-1" 0 39 (font-lock-face magit-branch-remote face magit-branch-remote))) (("/home/st/src/atlas/" "symbolic-ref" #("refs/remotes/origin/HEAD" 13 19 (face magit-branch-remote font-lock-face magit-branch-remote))) . "refs/remotes/origin/master") (("/home/st/src/atlas/" "rev-parse" "--verify" "HEAD~10") . "d7df5987962c5c0dd9270091c6ed29fdecc090da") (("/home/st/src/atlas/" . magit--insert-pushremote-log-p)) (("/home/st/src/atlas/" magit-get-upstream-branch nil) . #("origin/master" 0 13 (face magit-branch-remote font-lock-face magit-branch-remote))) (("/home/st/src/atlas/" magit-get-push-branch nil nil) . #("origin/master" 0 13 (font-lock-face magit-branch-remote face magit-branch-remote))) (("/home/st/src/atlas/" "rev-parse" "--short" "HEAD~") . "c33e7741d") (("/home/st/src/atlas/" "rev-parse" "--short" "HEAD") . "dc83fc68b") (("/home/st/src/atlas/" "rev-parse" "--verify" "refs/stash") . "940fcadb6a8877c38843a6078e222536136fdb98") (("/home/st/src/atlas/" "rev-parse" "--is-bare-repository") . "false\n") ("/home/st/src/atlas/" . "2.44.0") (("/home/st/src/atlas/" "describe" "--contains" "HEAD")) (("/home/st/src/atlas/" "describe" "--long" "--tags")) (("/home/st/src/atlas/" "rev-parse" "--verify" #("origin/master" 0 13 (font-lock-face magit-branch-remote face magit-branch-remote))) . "dc83fc68bd5fc1305876cc86dab5a3d9715f173f") (("/home/st/src/atlas/" magit-get-push-branch "master" nil) . #("origin/master" 0 13 (font-lock-face magit-branch-remote face magit-branch-remote))) (("/home/st/src/atlas/" "log" "--no-walk" "--format=%s" #("origin/master^{commit}" 0 13 (font-lock-face magit-branch-remote face magit-branch-remote)) "--") . "Merge branch 'PSP-4678-fix-linux-compilation-1' into 'master'") (("/home/st/src/atlas/" magit-get-upstream-branch "master") . #("origin/master" 0 13 (face magit-branch-remote font-lock-face magit-branch-remote))) (("/home/st/src/atlas/" "rev-parse" "--verify" "--abbrev-ref" "master@{upstream}") . "origin/master") (("/home/st/src/atlas/" "log" "--no-walk" "--format=%h %s" "HEAD^{commit}" "--") . "dc83fc68b Merge branch 'PSP-4678-fix-linux-compilation-1' into 'master'") (("/home/st/src/atlas/" "symbolic-ref" "--short" "HEAD") . "master") (("/home/st/src/atlas/" "rev-parse" "--verify" "HEAD") . "dc83fc68bd5fc1305876cc86dab5a3d9715f173f") (("/home/st/src/atlas/" "symbolic-ref" "--short" "refs/remotes/origin/HEAD") . "origin/master") (("/home/st/src/atlas/" forge-get-repository full)) (("/home/st/src/atlas/" "remote" "get-url" "origin") . "git@gitNew.domain.farelogix.com:farelogix/atlas.git") (("/home/st/src/atlas/" . config) . #<hash-table equal 42/96 0x1e16cb3987dc ...>) (("/home/st/src/atlas/" magit-gitdir) . "/home/st/src/atlas/.git/") (("/home/st/src/atlas/" "rev-parse" "--git-dir") . ".git") (("/home/st/src/atlas/" . magit-toplevel) . "/home/st/src/atlas/") (("/home/st/src/atlas/" "rev-parse" "--show-toplevel") . "/home/st/src/atlas")))
  funcall-interactively(magit-status nil ((75 . 29) (("/home/st/src/atlas/" magit-get-push-branch #("PSP-4678-fix-linux-compilation-1" 0 32 (face magit-branch-local font-lock-face magit-branch-local)) nil) . #("origin/PSP-4678-fix-linux-compilation-1" 0 39 (font-lock-face magit-branch-remote face magit-branch-remote))) (("/home/st/src/atlas/" "symbolic-ref" #("refs/remotes/origin/HEAD" 13 19 (face magit-branch-remote font-lock-face magit-branch-remote))) . "refs/remotes/origin/master") (("/home/st/src/atlas/" "rev-parse" "--verify" "HEAD~10") . "d7df5987962c5c0dd9270091c6ed29fdecc090da") (("/home/st/src/atlas/" . magit--insert-pushremote-log-p)) (("/home/st/src/atlas/" magit-get-upstream-branch nil) . #("origin/master" 0 13 (face magit-branch-remote font-lock-face magit-branch-remote))) (("/home/st/src/atlas/" magit-get-push-branch nil nil) . #("origin/master" 0 13 (font-lock-face magit-branch-remote face magit-branch-remote))) (("/home/st/src/atlas/" "rev-parse" "--short" "HEAD~") . "c33e7741d") (("/home/st/src/atlas/" "rev-parse" "--short" "HEAD") . "dc83fc68b") (("/home/st/src/atlas/" "rev-parse" "--verify" "refs/stash") . "940fcadb6a8877c38843a6078e222536136fdb98") (("/home/st/src/atlas/" "rev-parse" "--is-bare-repository") . "false\n") ("/home/st/src/atlas/" . "2.44.0") (("/home/st/src/atlas/" "describe" "--contains" "HEAD")) (("/home/st/src/atlas/" "describe" "--long" "--tags")) (("/home/st/src/atlas/" "rev-parse" "--verify" #("origin/master" 0 13 (font-lock-face magit-branch-remote face magit-branch-remote))) . "dc83fc68bd5fc1305876cc86dab5a3d9715f173f") (("/home/st/src/atlas/" magit-get-push-branch "master" nil) . #("origin/master" 0 13 (font-lock-face magit-branch-remote face magit-branch-remote))) (("/home/st/src/atlas/" "log" "--no-walk" "--format=%s" #("origin/master^{commit}" 0 13 (font-lock-face magit-branch-remote face magit-branch-remote)) "--") . "Merge branch 'PSP-4678-fix-linux-compilation-1' into 'master'") (("/home/st/src/atlas/" magit-get-upstream-branch "master") . #("origin/master" 0 13 (face magit-branch-remote font-lock-face magit-branch-remote))) (("/home/st/src/atlas/" "rev-parse" "--verify" "--abbrev-ref" "master@{upstream}") . "origin/master") (("/home/st/src/atlas/" "log" "--no-walk" "--format=%h %s" "HEAD^{commit}" "--") . "dc83fc68b Merge branch 'PSP-4678-fix-linux-compilation-1' into 'master'") (("/home/st/src/atlas/" "symbolic-ref" "--short" "HEAD") . "master") (("/home/st/src/atlas/" "rev-parse" "--verify" "HEAD") . "dc83fc68bd5fc1305876cc86dab5a3d9715f173f") (("/home/st/src/atlas/" "symbolic-ref" "--short" "refs/remotes/origin/HEAD") . "origin/master") (("/home/st/src/atlas/" forge-get-repository full)) (("/home/st/src/atlas/" "remote" "get-url" "origin") . "git@gitNew.domain.farelogix.com:farelogix/atlas.git") (("/home/st/src/atlas/" . config) . #<hash-table equal 42/96 0x1e16cb3987dc ...>) (("/home/st/src/atlas/" magit-gitdir) . "/home/st/src/atlas/.git/") (("/home/st/src/atlas/" "rev-parse" "--git-dir") . ".git") (("/home/st/src/atlas/" . magit-toplevel) . "/home/st/src/atlas/") (("/home/st/src/atlas/" "rev-parse" "--show-toplevel") . "/home/st/src/atlas")))
  call-interactively(magit-status)
  (let* ((buffer-file-path (if buffer-file-name (progn (file-relative-name buffer-file-name (locate-dominating-file buffer-file-name ".git"))))) (default-directory (project-root (project-current))) (section-ident (cons (cons 'file buffer-file-path) '((unstaged) (status))))) (call-interactively #'magit-status) (let ((ignore-window-parameters t)) (delete-other-windows)) (if buffer-file-path (progn (goto-char (point-min)) (catch '--cl-block-nil-- (while (not (if (equal section-ident ...) (progn ... t))) (condition-case nil (magit-section-forward) (error (throw ... ...)))) nil))) (recenter))
  (closure (t) nil "Open a `magit-status' buffer and close the other window so only Magit is visible.\nIf a file was visited in the buffer that was active when this\ncommand was called, go to its unstaged changes section." (interactive) (let* ((buffer-file-path (if buffer-file-name (progn (file-relative-name buffer-file-name (locate-dominating-file buffer-file-name ".git"))))) (default-directory (project-root (project-current))) (section-ident (cons (cons 'file buffer-file-path) '((unstaged) (status))))) (call-interactively #'magit-status) (let ((ignore-window-parameters t)) (delete-other-windows)) (if buffer-file-path (progn (goto-char (point-min)) (catch '--cl-block-nil-- (while (not (if ... ...)) (condition-case nil (magit-section-forward) (error ...))) nil))) (recenter)))()
  apply((closure (t) nil "Open a `magit-status' buffer and close the other window so only Magit is visible.\nIf a file was visited in the buffer that was active when this\ncommand was called, go to its unstaged changes section." (interactive) (let* ((buffer-file-path (if buffer-file-name (progn (file-relative-name buffer-file-name ...)))) (default-directory (project-root (project-current))) (section-ident (cons (cons 'file buffer-file-path) '(... ...)))) (call-interactively #'magit-status) (let ((ignore-window-parameters t)) (delete-other-windows)) (if buffer-file-path (progn (goto-char (point-min)) (catch '--cl-block-nil-- (while (not ...) (condition-case nil ... ...)) nil))) (recenter))) nil)
  cae-unpackaged-magit-status()
  cae-unpackaged-magit-save-buffer-show-status()
  funcall-interactively(cae-unpackaged-magit-save-buffer-show-status)
  command-execute(cae-unpackaged-magit-save-buffer-show-status))

This is the version of forge-get-repository that is being run:

(cl-defmethod forge-get-repository (((host owner name) list)
                                    &optional remote demand)
  "((HOST OWNER NAME) &optional REMOTE DEMAND)

Return the repository identified by HOST, OWNER and NAME.
See `forge-alist' for valid Git hosts."
  (if-let ((spec (forge--get-forge-host host t)))
      (pcase-let ((`(,githost ,apihost ,webhost ,class) spec))
        ;; The `webhost' is used to identify the corresponding forge.
        ;; For that reason it is stored in the `forge' slot.  The id
        ;; stored in the `id' slot also derives from that value.
        (let* ((row (car (forge-sql [:select * :from repository
                                     :where (and (= forge $s1)
                                                 (= owner $s2)
                                                 (= name  $s3))]
                                    webhost owner name)))
               (obj (and row (closql--remake-instance class (forge-db) row))))
          (when obj
            (oset obj apihost apihost)
            (oset obj githost githost)
            (oset obj remote  remote))
          (cond ((and (eq demand t)
                      (or (not obj)
                          (oref obj sparse-p)))
                 (error "Cannot use `%s' in %S yet.\n%s"
                        this-command (magit-toplevel)
                        "Use `M-x forge-add-repository' before trying again."))
                ((and obj
                      (oref obj sparse-p)
                      (eq demand 'full))
                 (setq obj nil)))
          (when (and (memq demand '(create stub maybe))
                     (not obj))
            (pcase-let ((`(,id . ,forge-id)
                         (forge--repository-ids
                          class webhost owner name
                          (memq demand '(stub maybe)))))
              ;; The repo might have been renamed on the forge.  #188
              (unless (setq obj (forge-get-repository :id id))
                (setq obj (funcall class
                                   :id       id
                                   :forge-id forge-id
                                   :forge    webhost
                                   :owner    owner
                                   :name     name
                                   :apihost  apihost
                                   :githost  githost
                                   :remote   remote))
                (when (eq demand 'create)
                  (closql-insert (forge-db) obj)))))
          obj))
    (when (memq demand forge--signal-no-entry)
      (error "Cannot determine forge repository.  No entry for %S in %s"
             host 'forge-alist))))

I've been debugging this for a few hours and I'm stumped.

I'm using the latest Emacs.

LemonBreezes commented 6 months ago

I feel like some new Emacs commit broke Forge.

yasuhirokimura commented 6 months ago

Same here.

According to the result of bisect with master branch of Emacs git repository, the problem starts with following commit.

commit c55694785e93212d1da5f96123288e596cb24f53
Merge: 4dd4f145b85 4372a056fef
Author:     Andrea Corallo <acorallo@gnu.org>
AuthorDate: Fri Mar 1 09:30:44 2024 +0100
Commit:     Andrea Corallo <acorallo@gnu.org>
CommitDate: Fri Mar 1 09:30:44 2024 +0100

    Merge branch 'feature/type-hierarchy' into 'master'
StillerHarpo commented 6 months ago

I think the problem is that the call (forge-get-repository nil) should match

(cl-defmethod forge-get-repository ((demand symbol) &optional remote) ..

instead of

(cl-defmethod forge-get-repository (((host owner name) list)
                                    &optional remote demand) ...

Maybe this is a upstream bug

tarsius commented 6 months ago

Thanks for having this all ready to go, by the time I have made it out of bed. :zzz: :grinning:

I've pushed a fix.

Funny enough, I am working to replace the valid values for the demand argument with a more descriptive set (not including nil). Had I merged that already, we might not have noticed this at all. Or maybe it would just have become harder to debug. We might still have to handle the (forge-get-repository (thought-this-never-returns-nil)) case, if only to make debugging that easier.

leungbk commented 6 months ago

I've pushed a fix.

Before you pushed your fix, I submitted a bug report to Emacs upstream thinking it was an upstream bug; is there anything that needs to be done upstream? If not, I will close that ticket.

tarsius commented 6 months ago

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69520

Leave it open. It's good to have a place to discuss it.

tarsius commented 6 months ago

Seems to work, indeed. Test-case:

(cl-defmethod xxx ((a symbol))
  (message "symbol: %s" a))

(cl-defmethod xxx (((a b) list))
  (message "list: (%s %s)" a b))

(xxx 'foo)
(xxx '(1 2))
(xxx nil)

I'll leave the kludge in forge in place for a few days.