Title: Add Git support for containers · Issue #5 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Add Git support for containers · Issue #5 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Add Git support for containers · Issue #5 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary Enable containers to function as Git repositories, allowing users to: git clone a container git push changes back Track version history of resources Motivation Familiar workflow - Developers know Git; versioning pods becomes intu...
Open Graph Description: Summary Enable containers to function as Git repositories, allowing users to: git clone a container git push changes back Track version history of resources Motivation Familiar workflow - Developer...
X Description: Summary Enable containers to function as Git repositories, allowing users to: git clone a container git push changes back Track version history of resources Motivation Familiar workflow - Developer...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/5
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add Git support for containers","articleBody":"## Summary\n\nEnable containers to function as Git repositories, allowing users to:\n- `git clone` a container\n- `git push` changes back\n- Track version history of resources\n\n## Motivation\n\n1. **Familiar workflow** - Developers know Git; versioning pods becomes intuitive\n2. **Offline editing** - Clone pod locally, edit, push when ready\n3. **Collaboration** - Multiple users can branch/merge pod content\n4. **Backup** - Clone provides automatic backup\n5. **Version history** - Built-in audit trail for all changes\n\n## Prior Art\n\n### nosdav/server\nAlready implemented in nosdav using `git http-backend`:\n- https://github.com/nosdav/server/commit/e97e255 - Initial git support\n- https://github.com/nosdav/server/commit/4d96539 - Normal and bare repos\n- https://github.com/nosdav/server/commit/c47b404 - allowTipSHA1InWant\n- https://github.com/nosdav/server/commit/35e1e6e - CORS headers before git\n\n### QuitStore\n[QuitStore](https://github.com/AKSW/QuitStore) - \"Quads in Git\" - combines Git with RDF/SPARQL for versioned linked data.\n\n### Git HTTP Protocol\n- [Smart HTTP](https://git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP)\n- [git-http-backend](https://git-scm.com/docs/git-http-backend)\n\n## Implementation Approach\n\n### Simple: Shell out to `git http-backend`\n\nFollowing nosdav's approach - no npm packages, just use Git's built-in CGI:\n\n```javascript\nimport { spawn } from 'child_process';\n\nfunction handleGitRequest(request, reply) {\n const git = spawn('git', ['http-backend'], {\n env: {\n GIT_PROJECT_ROOT: '/path/to/pods',\n GIT_HTTP_EXPORT_ALL: '1',\n GIT_HTTP_RECEIVE_PACK: 'true',\n PATH_INFO: request.url,\n QUERY_STRING: request.query,\n REQUEST_METHOD: request.method,\n // ... other CGI env vars\n }\n });\n \n request.raw.pipe(git.stdin);\n git.stdout.pipe(reply.raw);\n}\n```\n\n### Detection\n\nGit requests identified by:\n- `*/info/refs?service=git-upload-pack`\n- `*/git-upload-pack`\n- `*/git-receive-pack`\n- URLs ending in `.git`\n\n### Authorization\n\nUse existing WAC - check `acl:Read` for clone, `acl:Write` for push.\n\n## Questions\n\n1. **Auto-init**: Create `.git` when container is created, or on first clone attempt?\n2. **Bare vs regular**: Bare repos are more efficient for servers\n3. **RDF awareness**: Should commits trigger any RDF-specific logic?\n4. **Submodules**: Support `.git` suffix on any container path?\n\n## Files to Modify\n\n| File | Change |\n|------|--------|\n| `src/handlers/git.js` | **NEW** - Git HTTP backend handler |\n| `src/index.js` | Add git route detection |\n| `src/handlers/container.js` | Optional: init git on container creation |\n\n## Effort Estimate\n\n~3-4 hours - mostly porting nosdav's working implementation.\n\n## References\n\n- [nosdav git implementation](https://github.com/nosdav/server)\n- [git-http-backend docs](https://git-scm.com/docs/git-http-backend)\n- [QuitStore](https://github.com/AKSW/QuitStore)\n- [express-git](https://www.npmjs.com/package/express-git)","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2025-12-27T15:19:55Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/5"}
| 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:4492d3d2-b603-ae8d-5607-153484dcc492 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 909E:1D68C9:7368A1:97E30C:6B0390DD |
| html-safe-nonce | 27c8f3887ef86d0becb48fc1b8c656b64530b18a7f21a62b64cbe89c51837e62 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDlFOjFENjhDOTo3MzY4QTE6OTdFMzBDOjZCMDM5MEREIiwidmlzaXRvcl9pZCI6Ijc2MTAyNzU1MzU5NDc3OTY3MDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 234266494c367deb851a57228e8bc3202880d18e4e2b1fa5ad749fa1c1f30851 |
| hovercard-subject-tag | issue:3764850764 |
| 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/5/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b19a1314d6f6709e6818ae8513f614c67298e437de58bf7dcbede170c3451709/JavaScriptSolidServer/JavaScriptSolidServer/issues/5 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b19a1314d6f6709e6818ae8513f614c67298e437de58bf7dcbede170c3451709/JavaScriptSolidServer/JavaScriptSolidServer/issues/5 |
| og:image:alt | Summary Enable containers to function as Git repositories, allowing users to: git clone a container git push changes back Track version history of resources Motivation Familiar workflow - Developer... |
| 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