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
Cannot commit - The directory '~/.emacs.d/server' is unsafe #41
Comments
Could you post the result of evaluating the following please: (list :attrs (file-attributes "~/.emacs.d/server" 'integer)
:uid (user-uid)
:modes (file-modes "~/.emacs.d/server")) |
Also see magit/magit#3148. |
@tarsius that one is about macOS, this one is Windows. Probably not actually related. |
Okay! Already reopened. |
I do not see anything when I evaluate:
Should i be looking in a specific place? |
I meant you should paste that in But actually, maybe this is just another case of magit/magit#1587? So try the solution in https://stackoverflow.com/questions/885793/emacs-error-when-calling-server-start |
Yes i posted that in scratch and did M-x eval-buffer. Nothing happened. OK I will check out your suggestion. |
All expressions in the buffer (in this case likely just that one expression) were evaluated. However that command does not print the output of all evaluated expressions because there could be thousands of them. Instead use |
OK so I tried following the instructions at the stack overflow link. That seems to be on the right track. I created the folder at C:\Users[username].emacs.d\server. By default it had administrator as owner. The problem is that I am unable to change the owner to [computer name][username] as I am on my workplace network. If I look under my computer name when I try to change the owner my username simply doesn't exist in the list and is rejected. The only thing I can change it to is [username]@[worknetwork]. I tried doing this, restarting emacs and then comitting again and I get the same error. |
Hmm, could you post the output of that command again, now that you've changed the ownership? You can copy the text from the Does the takeown solution work any better? |
Here is the output: Unfortunately, the takeown solution results in the same error. It successfully changes the ownership of that folder to [myworkdomain] / [username] as opposed to [mycomputername] / [username]. |
Looks like the ownership didn't change at all from Emacs point of view (it's in position 2 (counting from 0) in the return from I guess you're stuck with suppressing the error, as suggested in https://stackoverflow.com/a/17069276 |
Adding this to my .emacs worked like a charm! (defadvice server-ensure-safe-dir (around Thanks! |
I think it means anyone with write access to
So ignoring the errors is probably not completely crazy. |
Ahhhh. I actually just discovered that there is a .emacs.d folder at C:\Users \ [username] as well as another .emacs.d folder at C:\Users\ [username] \ AppData\Roaming\ I had previously been changing the owner of the first one (at C:\Users \ [username] \ .emacs.d\server) |
Aha, that would explain why Emacs showed the ownership not being changed. Note to self: when troubleshooting this next time, include the full w32 filename as one of the things to check. |
Hello,
As stated in the title I cannot commit my staged changes. I get the message:
The directory '~/.emacs.d/server' is unsafe
Output of magit-version:
Magit 2.11.0, Git 2.14.2.windows.3, Emacs 25.3.1, windows-nt
Output of with-editor-debug:
Any help is greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: