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

GitError: fatal: not a git repository (or any of the parent directories): .git #166

Closed
1 task
Adammatthiesen opened this issue Nov 26, 2024 · 4 comments
Closed
1 task

Comments

@Adammatthiesen
Copy link

What package manager are you using?

pnpm

What operating system are you using?

Linux (nixpacks deployment container)

Describe the bug

I am attempting to deploy to my Coolify server which uses nixpacks and handles the cloning process itself to account for being able to do PR deployments and am getting the following error:

#14 1.888 GitError: fatal: not a git repository (or any of the parent directories): .git
#14 1.888 
#14 1.888     at Object.action (file:///app/node_modules/.pnpm/[email protected]/node_modules/simple-git/dist/esm/index.js:4462:25)
#14 1.888     at PluginStore.exec (file:///app/node_modules/.pnpm/[email protected]/node_modules/simple-git/dist/esm/index.js:4501:25)
#14 1.888     at file:///app/node_modules/.pnpm/[email protected]/node_modules/simple-git/dist/esm/index.js:1369:43
#14 1.888     at new Promise (<anonymous>)
#14 1.888     at GitExecutorChain.handleTaskData (file:///app/node_modules/.pnpm/[email protected]/node_modules/simple-git/dist/esm/index.js:1367:16)
#14 1.888     at GitExecutorChain.<anonymous> (file:///app/node_modules/.pnpm/[email protected]/node_modules/simple-git/dist/esm/index.js:1351:44)
#14 1.888     at Generator.next (<anonymous>)
#14 1.888     at fulfilled (file:///app/node_modules/.pnpm/[email protected]/node_modules/simple-git/dist/esm/index.js:45:24) {
#14 1.888   task: {
#14 1.888     commands: [ 'rev-parse', '--is-shallow-repository' ],
#14 1.888     format: 'utf-8',
#14 1.888     parser: [Function: parser]
#14 1.888   }
#14 1.888 }

This is for trying to build Lunaria for our docs from our deployment pipeline on StudioCMS while trying to build and output only the Lunaria files.

The following PR to our docs contains the config files currently being used withstudiocms/studiocms#386

I have also used the PR link for the minimal reproduction since this is a deployment bug, and works locally without an issue, so i would assume/hope there would be a way to work around this through a update?

Link to minimal reproducible example

withstudiocms/studiocms#386

Participation

  • I am willing to submit a pull request for this issue.
@yanthomasdev
Copy link
Member

Thanks for the report @Adammatthiesen, could you try upgrading to the Lunaria v1 prerelease?

pnpm add https://pkg.pr.new/@lunariajs/core@4c8b9b0

The specific part of the code in the stack trace doesn't exist anymore in the prerelease and that might solve it, from your PR I can also see you're using root locale in Starlight which wasn't supported in v0.1 but is in v1, so I guess there's no escaping the upgrade in this case.

There's no docs for it yet, but you can see how we migrated in Docs here:
https://github.com/withastro/docs/pull/9978/files#diff-38c1b1d0c97b72231f9803e9c2653bb5d78e367b1968250d549b5846a66689d2

That would mean bringing all the dashboard code to the repo for the time being, as it is still WIP for the v1 version, but what we did in the Astro Docs repo is all you need.

In the v1 branch there's also an example of how to set up for root locale in Starlight:
https://github.com/lunariajs/lunaria/pull/155/files#diff-365dc679711fba481dbd2d7eab51cce2fb4934bb8be72c2e4bad578e4cdd585aR19-R27

@Adammatthiesen
Copy link
Author

Adammatthiesen commented Nov 27, 2024

Well, i've managed to get things migrated over to your v1 package...

getting the following error when running the build script

#14 1.406 > [email protected] lunaria:build /app/www/docs
#14 1.406 > tsm ./scripts/lunaria.mts
#14 1.406 
#14 1.551 (node:44) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
#14 1.551 --import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///app/node_modules/.pnpm/tsm%402.3.0/node_modules/tsm/loader.mjs", pathToFileURL("./"));'
#14 1.551 (Use `node --trace-warnings ...` to show where the warning was created)
#14 2.096 /app/node_modules/.pnpm/[email protected]/node_modules/simple-git/src/lib/plugins/error-detection.plugin.ts:42
#14 2.096             return { error: new GitError(undefined, error.toString('utf-8')) };
#14 2.096                             ^
#14 2.096 
#14 2.096 
#14 2.096 GitError: fatal: not a git repository (or any of the parent directories): .git
#14 2.096 
#14 2.096     at Object.action (/app/node_modules/.pnpm/[email protected]/node_modules/simple-git/src/lib/plugins/error-detection.plugin.ts:42:29)
#14 2.096     at PluginStore.exec (/app/node_modules/.pnpm/[email protected]/node_modules/simple-git/src/lib/plugins/plugin-store.ts:54:29)
#14 2.096     at <anonymous> (/app/node_modules/.pnpm/[email protected]/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:124:42)
#14 2.096     at new Promise (<anonymous>)
#14 2.096     at GitExecutorChain.handleTaskData (/app/node_modules/.pnpm/[email protected]/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:121:14)
#14 2.096     at GitExecutorChain.<anonymous> (/app/node_modules/.pnpm/[email protected]/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:97:40)
#14 2.096     at Generator.next (<anonymous>)
#14 2.096     at fulfilled (file:///app/node_modules/.pnpm/[email protected]/node_modules/simple-git/dist/esm/index.js:45:24) {
#14 2.096   task: {
#14 2.096     commands: [
#14 2.096       'log',
#14 2.096       '--pretty=format:òòòòòò %H ò %aI ò %s ò %D ò %b ò %aN ò %aE òò',
#14 2.096       '--follow',
#14 2.096       [String: 'src/content/i18n/en.json'],
#14 2.096       'bdd769c0a41ba8d22dcddeb3f55628fb770309af^...'
#14 2.096     ],
#14 2.096     format: 'utf-8',
#14 2.096     parser: [Function (anonymous)]
#14 2.096   }
#14 2.096 }

Also during local testing, it only seems to be able to read the content/i18n/ folder contents and is not reading any of the content with the default root locale, where the other version did indeed read all my content files correctly.
image

These updates are available on the branch (PR)

@Adammatthiesen
Copy link
Author

Adammatthiesen commented Nov 28, 2024

was able to use Github actions and pages to create a Lunaria deployment pipeline... but still having the weirdness of it not detecting the primary content, see https://i18n.docs.studiocms.dev/ (Commented out all the extra langs, so it gives a simpler test now)

@Adammatthiesen
Copy link
Author

nvm i forgot about the tracking system 😅

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

No branches or pull requests

2 participants