Closed otherjoel closed 1 year ago
The output is fine but the error message popup is definitely not. Unfortunately I can't reproduce this issue. Can you try other extension versions? And I will try vscodium.
No errors in Vscodium too. I can't think of a reason why an error can popup on these file events.
JS is not one of my strengths, but here’s what it looks like to me. Here’s some commands I executed in a non-fossil-checkout folder:
❯ fossil status; echo $?
current directory is not within an open check-out
1
❯ fossil status 2>/dev/null
❯ fossil version; echo $?
This is fossil version 2.21 [7c71f00ac8] 2022-12-29 17:00:23 UTC
0
Output shows that running fossil status
in such a folder outputs to stderr and has a non-zero exit code.
The code in your _exec
seems like it will return 'NotAFossilRepository'
in this circumstance:
The logic in calling function exec
indicates that control flow will reach throw err;
in line 371:
…and getRepositoryRoot
is not catching that thrown exception:
The exception makes it up to tryOpenRepository
which looks like it should catch the error but does nothing with it?
Oh! I just noticed, the error message produced by my version of fossil says check-out
whereas your regex uses checkout
(without the hyphen):
So the regex does not match, and that function is actually (probably) returning 'unknown'
instead of 'NotAFossilRepository'
.
Edit: looks like this changed in this December 2022 commit on the fossil-scm repo: https://fossil-scm.org/home/info/bc36fdcf3acb3114
It must be it. I will be able to release fixed version in 32 hours.
I don’t use Fossil for all my projects, only some. This extension throws an error “Fossil: current directory not within an open checkout” when I open, close, or switch files when the folder I have open is not from a Fossil repo.
Contents of “Output” tab in bottom panel:
This happens even if I disable the Auto Refresh setting (User or Workspace or both, makes no difference). It happens when the current folder has actually been initialized as a git repo, and it happens when there is no version control in place for the folder.
If the current folder is not within an open Fossil checkout, no errors should be displayed unless the user has tried to do some Fossil action.
I'm using VS Codium on macOS 13.3.