Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forge-create-issue produces a confusing error when repo has no clone #722

Open
bcc32 opened this issue Oct 29, 2024 · 2 comments
Open

forge-create-issue produces a confusing error when repo has no clone #722

bcc32 opened this issue Oct 29, 2024 · 2 comments

Comments

@bcc32
Copy link

bcc32 commented Oct 29, 2024

When attempting to create an issue for a repo that has been added to
forge but which has no local clone, the error produced is confusing:

Creating directory: Permission denied, /magit

It seems to be attempting to create a directory to store the draft
issue text, which makes sense, but the error itself is a little
unclear and it would probably be a nicer experience to handle this
case specifically and produce a user-error.

Steps to reproduce are just:

  1. M-x forge-add-repository and specify some GitHub repo you don't
    have a clone for. I used djcb/mu.
  2. M-x forge-list-repositories and go to the topics page for that
    newly-added repo.
  3. M-x forge-create-issue, which errors with the message mentioned
    above.

Backtrace follows:

Debugger entered--Lisp error: (permission-denied "Creating directory" "Permission denied" "/magit")
  transient--exit-and-debug(error (permission-denied "Creating directory" "Permission denied" "/magit"))
  signal(permission-denied ("Creating directory" "Permission denied" "/magit"))
  files--ensure-directory(make-directory-internal "/magit")
  make-directory("/magit/posts/" t)
  forge--prepare-post-buffer("new-issue" "Create new issue on djcb/mu")
  #<subr forge-create-issue>()
  apply(#<subr forge-create-issue> nil)
  #f(compiled-function (fn &rest args) #<bytecode 0x10411af0915d810c>)(#<subr forge-create-issue>)
  apply(#f(compiled-function (fn &rest args) #<bytecode 0x10411af0915d810c>) #<subr forge-create-issue> nil)
  (lambda (fn &rest args) (interactive #f(compiled-function (spec) #<bytecode 0x43d85eb2db5920d>)) (apply '#f(compiled-function (fn &rest args) #<bytecode 0x10411af0915d810c>) fn args))(#<subr forge-create-issue>)
  apply((lambda (fn &rest args) (interactive #f(compiled-function (spec) #<bytecode 0x43d85eb2db5920d>)) (apply '#f(compiled-function (fn &rest args) #<bytecode 0x10411af0915d810c>) fn args)) #<subr forge-create-issue> nil)
  forge-create-issue()
  funcall-interactively(forge-create-issue)
  command-execute(forge-create-issue)

FYI version info:

M-x magit-version RET

Magit 20241020.1608 [>= 20241020.1608], Transient 20241018.1740, Forge 20241018.1648, Git 2.44.1, Emacs 29.4, gnu/linux

@tarsius
Copy link
Member

tarsius commented Oct 31, 2024

Yes, the errors could be improved and it is also worth looking into instead making it possible to create issues in such situations (and pull-requests, but that is both harder and stranger (where does the branch come from if there is no clone?)).

Additional work is arriving at a very high frequency right now, so I won't get to this soon.

@bcc32
Copy link
Author

bcc32 commented Nov 1, 2024

No problem, thanks for the ack and all your amazing work on magit and forge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants