rkotze / git-mob-vs-code

Co-author commits. A quick way to add co-author metadata to a Git commit via VS Code source control panel.
https://marketplace.visualstudio.com/items?itemName=RichardKotze.git-mob
MIT License
33 stars 9 forks source link

error message: `EACCES: permission denied, open '../.gitmessage'` #302

Closed haakon-e closed 1 month ago

haakon-e commented 4 months ago

Prerequisites

Description

Whenever I open VSCode, I get error messages like:

EACCES: permission denied, open '../.gitmessage'

EROFS: read-only file system, open '../../../../.gitmessage'

Expected behaviour: [What you expect to happen]

no message -- everything is fine!

Actual behaviour: [What actually happens]

Not sure what it actual implies about the extension?

Reproduces how often: [What percentage of the time does it reproduce?]

Every time I open VScode

Versions

Additional Information

rkotze commented 3 months ago

Hi @haakon-e

It is strange to see this error.

It looks like the file does not have the correct file permissions for git-mob to modify it.

Make sure the file has write permissions.

File permissions

silopolis commented 3 months ago

I get the same error here. The .gitmessage file is present in the user's home dir and has 644 perms.

rkotze commented 2 months ago

Very strange, I can't reproduce.

I wonder if anyone else is having this issue.

Have you tried to delete the .gitmessage file then reload the git mob extension?

davideluque commented 2 months ago

Very strange, I can't reproduce.

I wonder if anyone else is having this issue.

Have you tried to delete the .gitmessage file then reload the git mob extension?

Captura de pantalla 2024-06-26 a las 21 32 48

I am not sure how .gitmessage works but is it always a file in ~/ ? I don't have that file there and the error appeared out of nowhere. Intel Mac user here.

rkotze commented 2 months ago

Do you use git mob cli and do you see the same issue?

davideluque commented 2 months ago

Do you use git mob cli and do you see the same issue?

I have no issues with the CLI, although I only use the VSCode Extension.

dylanspyer commented 2 months ago

Same issue

shajz commented 2 months ago

tl;dr

Workaround for v1.20.0

  1. Run this in your terminal
    git config --global commit.template ~/.gitmessage
  2. Reload vscode

Got it working by downgrading the extension to the previous release (v1.19.0).

Something must have changed regarding the handling of .gitmessage in the v1.20.0 release.

After inspecting changes in diffs for the vscode extension (https://github.com/rkotze/git-mob-vs-code/compare/v1.19.0...v1.20.0) and the core dependency (https://github.com/rkotze/git-mob/compare/v2.4.1...v3.2.2), I tried to set the git config commit.template to ~/.gitmessage and it worked!

Not sure what the problem is but that could point @rkotze in the right direction to reproduce, maybe you already had that in your .gitconfig file?

EDIT: Weird thing is now I can remove the commit.template config and everything still works 🤔 Not sure why.

rkotze commented 1 month ago

I was able to reproduce the error and hopefully this issue is now fixed with the release of v1.20.1

Thank you all for capturing this issue and patience.