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

Nimble commands fail after git init #1180

Open
narimiran opened this issue Jan 29, 2024 · 0 comments · May be fixed by #1224
Open

Nimble commands fail after git init #1180

narimiran opened this issue Jan 29, 2024 · 0 comments · May be fixed by #1224

Comments

@narimiran
Copy link
Member

I've tried to run nimble lock on a directory which wasn't under version control, and I got this message:

    Error:  Sync file require current working directory to be under some supported type of version control.
     Hint:  Put package's working directory under version control.

(and this still created nimble.lock file, btw)


After that, I've run git init, and now nimble lock produces:

$ nimble lock
       Tip: 2 messages have been suppressed, use --verbose to show them.
tools.nim(62)            tryDoCmdEx

    Error:  Execution of 'git -C /home/miran/code/nim-lang/tests/myPackage rev-parse HEAD' failed with an exit code 128.
        ... Details: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
        ... Use '--' to separate paths from revisions, like this:
        ... 'git <command> [<revision>...] -- [<file>...]'
        ... HEAD

The same error appears on some other commands (e.g. nimble check, nimble test, or non-existing commands such as nimble foobar), but not on others (e.g. nimble tasks or nimble list -i).


The issue is resolved after one makes a first commit. But then the original hint ("Put package's working directory under version control.") should be changed to reflect that just initializing git isn't enough.

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

Successfully merging a pull request may close this issue.

2 participants