Title: Git auto-init: use regular (non-bare) repo so pushed files are served as static resources · Issue #468 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Git auto-init: use regular (non-bare) repo so pushed files are served as static resources · Issue #468 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Git auto-init: use regular (non-bare) repo so pushed files are served as static resources · Issue #468 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Context #466 shipped auto-init on first push, choosing git init --bare. That's correct for the "pod is a git remote" use case (clone / fetch / push all work), but breaks the symmetrical "install an app via git push" use case that motivat...
Open Graph Description: Context #466 shipped auto-init on first push, choosing git init --bare. That's correct for the "pod is a git remote" use case (clone / fetch / push all work), but breaks the symmetrical "install an...
X Description: Context #466 shipped auto-init on first push, choosing git init --bare. That's correct for the "pod is a git remote" use case (clone / fetch / push all work), but breaks the symmetric...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/468
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Git auto-init: use regular (non-bare) repo so pushed files are served as static resources","articleBody":"## Context\n\n[#466](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/pull/466) shipped auto-init on first push, choosing `git init --bare`. That's correct for the \"pod is a git remote\" use case (clone / fetch / push all work), but **breaks the symmetrical \"install an app via git push\" use case** that motivated the feature in the first place ([jspod#25](https://github.com/JavaScriptSolidServer/jspod/issues/25), [#464](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/464)).\n\n## Repro\n\n```bash\ngit clone https://github.com/solid-apps/hub.git\ncd hub\ngit remote add pod http://localhost:5444/public/apps/hub\ngit push pod HEAD:main\n# Push succeeds: * [new branch] HEAD -> main\n\ncurl http://localhost:5444/public/apps/hub/index.html\n# 404 — there is no index.html file. The contents live inside the\n# bare repo's pack objects, not as files in the directory.\n\nls pod-data/public/apps/hub/\n# HEAD branches config description hooks info objects refs\n# (bare-repo internals, no working tree)\n```\n\n## Root cause\n\n`tryAutoInitBareRepo` runs `spawnSync('git', ['init', '--bare', repoAbs])`. Bare repos by definition have no working tree.\n\n## Proposed fix\n\nAuto-init regular (non-bare) repos. The existing handler in `handleGit` already does the right thing for non-bare repos on every push:\n\n```js\n// For non-bare repos, auto-update working directory after push\nif (gitInfo.isRegular) {\n execSync('git config receive.denyCurrentBranch updateInstead', {\n cwd: repoAbs,\n env: { ...process.env, GIT_DIR: gitInfo.gitDir }\n });\n}\n```\n\nSo switching auto-init to non-bare automatically composes with the existing receive-pack flow. Files land in the working tree on each push, JSS's static-file serving picks them up at the corresponding URL, the data browser renders them — apps \"install\" by `git push`.\n\n## Diff size\n\n- `src/handlers/git.js`: drop `--bare` from one spawnSync arg list. ~1 LoC.\n- `test/git-auto-init.test.js`: update assertions to look for `.git/HEAD` (regular) instead of root-level `HEAD` (bare). ~5 LoC.\n\n## Trade-offs\n\n- **Storage**: a regular repo has both `.git/` history AND the checked-out working tree. Roughly 2× the disk footprint of a bare repo for the same content. Acceptable: most Solid pods are content-light and this matches what users expect from \"files served by my pod.\"\n- **Semantics**: cloning / fetching / pushing still works identically. The only observable difference is that the directory contents are now visible to HTTP GET (which is the whole point).\n- **Existing behaviour preserved**: this only changes the *auto-init* path. Operators who manually pre-create a bare repo at a pod path (the workflow that existed before #466) still get bare semantics — `findGitDir` already handles both shapes.\n\n## Recommendation\n\nSwitch auto-init to regular repos. The bare-repo flavor of \"pod as git remote\" remains available for anyone who explicitly creates bare repos manually; the auto-init path now serves the \"install\" use case it was originally motivated by.\n\n## Cross-references\n\n- [#466](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/pull/466) — the PR that introduced auto-init (this is a follow-up)\n- [#465](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/465) — the original init-primitive issue\n- [#464](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/464) — apps-in-pods at the protocol level\n- [jspod#25](https://github.com/JavaScriptSolidServer/jspod/issues/25) — wrapper-side `jspod install` (the consumer)","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-16T16:14:37Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/468"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:65893556-b2a2-34bd-ec7c-88f57a9caf9a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E9A:28DAC6:12C746B:17C08D9:6B03A2B6 |
| html-safe-nonce | 59bddecad3eec9fe614aae5a0397aa1b9f6a72595c63e8383aeb75c5a61c1d8b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTlBOjI4REFDNjoxMkM3NDZCOjE3QzA4RDk6NkIwM0EyQjYiLCJ2aXNpdG9yX2lkIjoiNDc1OTIxMTI0OTEyMjkxMDkwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fb39def6627e4f223e50ec32863f01d0a64a3705e39c78b7917d770eb4ef4a77 |
| hovercard-subject-tag | issue:4460517173 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/468/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68a50d4c95e960cf550184098da33ede4cb8ef57cfe345c8a61683ec5cc1e7af/JavaScriptSolidServer/JavaScriptSolidServer/issues/468 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68a50d4c95e960cf550184098da33ede4cb8ef57cfe345c8a61683ec5cc1e7af/JavaScriptSolidServer/JavaScriptSolidServer/issues/468 |
| og:image:alt | Context #466 shipped auto-init on first push, choosing git init --bare. That's correct for the "pod is a git remote" use case (clone / fetch / push all work), but breaks the symmetrical "install an... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width