{"id":40717507,"url":"https://github.com/cantabular/git-prep-directory","last_synced_at":"2026-01-21T13:30:57.194Z","repository":{"id":41870738,"uuid":"44819999","full_name":"cantabular/git-prep-directory","owner":"cantabular","description":"Build tools friendly way of repeatedly cloning a git repository using a submodule cache and keeping timestamps to commit times","archived":false,"fork":false,"pushed_at":"2025-12-12T12:01:02.000Z","size":122,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-14T01:59:54.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cantabular.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-10-23T15:00:19.000Z","updated_at":"2025-12-12T12:01:05.000Z","dependencies_parsed_at":"2025-12-12T17:00:58.439Z","dependency_job_id":null,"html_url":"https://github.com/cantabular/git-prep-directory","commit_stats":null,"previous_names":["scraperwiki/git-prep-directory","cantabular/git-prep-directory","sensiblecodeio/git-prep-directory"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/cantabular/git-prep-directory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantabular%2Fgit-prep-directory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantabular%2Fgit-prep-directory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantabular%2Fgit-prep-directory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantabular%2Fgit-prep-directory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cantabular","download_url":"https://codeload.github.com/cantabular/git-prep-directory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantabular%2Fgit-prep-directory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28633760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-21T13:30:57.102Z","updated_at":"2026-01-21T13:30:57.158Z","avatar_url":"https://github.com/cantabular.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-prep-directory\n\nBuild tools friendly way of repeatedly cloning a git repository using a\nsubmodule cache and keeping timestamps to commit times.\n\n## Concept\n\nExecuting the tool/library repeatedly on the same repository with different\ncommit refs results in two optimizations:\n\n- Faster clone times due to less network traffic as most submodules change so\n  infrequently that they are likely already exist in the submodule cache.\n- Faster build times for tools like Make and Docker as unchanged files keep\n  their timestamp this are cached by the build tools.\n\nFor each execution of a given commit ref the tool/library does the follow steps:\n\n1. Clone the given repository\n2. Checkout the given revision\n3. Find all submodules and check if they are already cached\n  - If cached, assert the required commit is checked out and initialize them\n  - If not cached, checkout the submodule and store it in the cache.\n4. Set the timestamp of all files and directories to their respective commit time.\n\nThis results in the following path hierarchy:\n\n    .\n    └── src\n        ├── HEAD\n        ├── c                       \u003c-- repository commits\n        │   ├── 39529a7ed3\n        │   ├── 5e90e55e6b\n        │   ├── 607f0489ec\n        │   └── :\n        ├── config\n        ├── index\n        ├── modules                 \u003c-- submodules cache\n        │   ├── path/to/submodule/1\n        │   ├── path/to/submodule/2\n        │   ├── path/to/submodule/3\n        │   └── :\n        ├── objects\n        ├── packed-refs\n        └── refs\n\n\n## Command line tool\n\n### Installation\n\n    $ go get github.com/sensiblecodeio/git-prep-directory/cmd/git-prep-directory\n\n\n### Usage\n\n    $ git-prep-directory --help\n    NAME:\n       git-prep-directory - Build tools friendly way of repeatedly cloning a git\n       repository using a submodule cache and setting file timestamps to commit times.\n\n    USAGE:\n       git-prep-directory [global options] command [command options] [arguments...]\n\n    VERSION:\n       1.0.0\n\n    COMMANDS:\n       help, h      Shows a list of commands or help for one command\n\n    GLOBAL OPTIONS:\n       --url, -u                    URL to clone\n       --ref, -r                    ref to checkout\n       --destination, -d \"./src\"    destination dir\n       --help, -h                   show help\n       --version, -v                print the version\n\n\n## Go Library\n\n```go\nimport \"github.com/sensiblecodeio/git-prep-directory\"\n\nbuildDirectory, err := git.PrepBuildDirectory(\u003cOUT_PATH\u003e, \u003cREPO_URL\u003e, \u003cGIT_REF\u003e)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcantabular%2Fgit-prep-directory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcantabular%2Fgit-prep-directory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcantabular%2Fgit-prep-directory/lists"}