magit / forge

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

Trying to add a new repo from the *forge-notifications* buffer fails #650

Closed benthamite closed 5 months ago

benthamite commented 8 months ago
  1. M-x forge-list-notifications.
  2. With point on a notification for a repo not in the database, press n (forge-dispatch).
  3. In the "Not inside a Git repository" prompt, press a (“add repository to database").

Error: "Cannot determine Forge repository outside of Git repository"

Here’s the backtrace:

Debugger entered--Lisp error: (error "Cannot determine Forge repository outside of Git repository")
transient--exit-and-debug(error (error "Cannot determine Forge repository outside of Git repository"))
error("Cannot determine Forge repository outside of Git repository")
#f(compiled-function (demand &optional remote) "Return the current forge repository.\n\nFirst check if `forge-buffer-repository', or if that is nil, then\nthe repository for `forge-buffer-topic', satisfies DEMAND.  If so,\nthen return that repository.\n\nOtherwise return the repository for `default-directory', if that\nexists and satisfies DEMAND.  If that fails too, then return nil\nor signal an error, depending on DEMAND." #<bytecode 0xfb47dc9b69c6289>)(:stub)
apply(#f(compiled-function (demand &optional remote) "Return the current forge repository.\n\nFirst check if `forge-buffer-repository', or if that is nil, then\nthe repository for `forge-buffer-topic', satisfies DEMAND.  If so,\nthen return that repository.\n\nOtherwise return the repository for `default-directory', if that\nexists and satisfies DEMAND.  If that fails too, then return nil\nor signal an error, depending on DEMAND." #<bytecode 0xfb47dc9b69c6289>) :stub nil)
forge-get-repository(:stub)
byte-code("\300\301\302\303!\211\205\15\0\304\1\305\"\211\205\26\0\306\307\310\3#\266\202\"\311\1\312\313\3\3\3\314$\266\203\203)\0C\207\315\1!C\207" [magit-read-string-ns "Add repository to database (url or name)" forge-get-repository :stub eieio-oref remote magit-git-string "remote" "get-url" "\\(://\\|@\\)" nil string-match t magit-clone--name-to-url] 9)
advice-eval-interactive-spec((byte-code "\300\301\302\303!\211\205\15\0\304\1\305\"\211\205\26\0\306\307\310\3#\266\202\"\311\1\312\313\3\3\3\314$\266\203\203)\0C\207\315\1!C\207" [magit-read-string-ns "Add repository to database (url or name)" forge-get-repository :stub eieio-oref remote magit-git-string "remote" "get-url" "\\(://\\|@\\)" nil string-match t magit-clone--name-to-url] 9))
#f(compiled-function (spec) #<bytecode 0x1b2732228d3ff7f2>)((byte-code "\300\301\302\303!\211\205\15\0\304\1\305\"\211\205\26\0\306\307\310\3#\266\202\"\311\1\312\313\3\3\3\314$\266\203\203)\0C\207\315\1!C\207" [magit-read-string-ns "Add repository to database (url or name)" forge-get-repository :stub eieio-oref remote magit-git-string "remote" "get-url" "\\(://\\|@\\)" nil string-match t magit-clone--name-to-url] 9))
funcall(#f(compiled-function (spec) #<bytecode 0x1b2732228d3ff7f2>) (byte-code "\300\301\302\303!\211\205\15\0\304\1\305\"\211\205\26\0\306\307\310\3#\266\202\"\311\1\312\313\3\3\3\314$\266\203\203)\0C\207\315\1!C\207" [magit-read-string-ns "Add repository to database (url or name)" forge-get-repository :stub eieio-oref remote magit-git-string "remote" "get-url" "\\(://\\|@\\)" nil string-match t magit-clone--name-to-url] 9))
command-execute(forge-add-repository)
tarsius commented 8 months ago

Thanks for letting me now. It's already on my radar. I've already done some work to fix adding a repository, but it's not quite ready yet.

tarsius commented 5 months ago

This works now.