nix icon indicating copy to clipboard operation
nix copied to clipboard

File does not exist error improvement

Open gytis-ivaskevicius opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. When importing untracked nix file error such as is shown: error: path '/nix/store/xxx-source/something.nix' does not exist I noticed some newbies struggling with it and I think better error message should be shown

Describe the solution you'd like If it is a git repository it should show something like this:

  • error: path '/nix/store/xxx-source/something.nix' exists but is not tracked by git (Might be annoying to implement)
  • error: path '/nix/store/xxx-source/something.nix' does not exist or is not tracked by git

Describe alternatives you've considered None, this is more of a nice to have improvement to make onboarding process easier

Priorities

Add :+1: to issues you find important.

gytis-ivaskevicius avatar May 31 '24 10:05 gytis-ivaskevicius

Maybe it could be possible to retrieve the fullpath and stat the file (or maybe using libgit), to help distinguish the error into 2 separate ones. I think this would be very nice as nix beginners often get confused with this error

Sigmanificient avatar May 31 '24 10:05 Sigmanificient

IIRC we have a solution that will land as we diligently port changes from lazy trees to master.

Duplicate of #7107

roberth avatar May 31 '24 13:05 roberth