{"id":15010267,"url":"https://github.com/clojure/tools.gitlibs","last_synced_at":"2025-05-16T01:04:59.018Z","repository":{"id":54351697,"uuid":"116035055","full_name":"clojure/tools.gitlibs","owner":"clojure","description":"API for retrieving, caching, and programatically accessing git libraries","archived":false,"fork":false,"pushed_at":"2024-12-05T17:41:14.000Z","size":191,"stargazers_count":63,"open_issues_count":0,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-08T11:15:06.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clojure.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-01-02T16:31:21.000Z","updated_at":"2024-12-05T17:33:11.000Z","dependencies_parsed_at":"2024-02-19T20:27:41.039Z","dependency_job_id":"1b742ba0-d139-47c8-bf2f-9e9c8e84a38e","html_url":"https://github.com/clojure/tools.gitlibs","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojure%2Ftools.gitlibs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojure%2Ftools.gitlibs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojure%2Ftools.gitlibs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojure%2Ftools.gitlibs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clojure","download_url":"https://codeload.github.com/clojure/tools.gitlibs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-09-24T19:33:15.915Z","updated_at":"2025-05-16T01:04:58.934Z","avatar_url":"https://github.com/clojure.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"tools.gitlibs\n========================================\n\nAn API for retrieving, caching, and programatically accessing git libraries.\n\n## Rationale\n\nTo access git dependencies (for example, via tools.deps), one must download git directories\nand working trees as indicated by git shas. This library provides this functionality and also\nkeeps a cache of git dirs and working trees that can be reused.\n\n## API\n\nThe following API is provided in `clojure.tools.gitlibs`:\n\n* `(resolve git-url rev) ;; returns full sha of rev in git-url`\n* `(procure git-url lib rev) ;; returns working tree directory for git-url identified as lib at rev`\n* `(descendant git-url revs) ;; returns rev which is a descedant of all revs, or nil if none`\n* `(tags git-url) ;; returns a collection of tags in this git-url (fetches to refresh)`\n* `(cache-dir) ;; returns path to root of gitlibs cache dir`\n\n### Git urls\n\nThe following git url types are supported:\n\n* `https` - for public anonymous clone and fetch of public or private repos with credentials via git credential sources\n* `ssh` - for authenticated clone and fetch of private repos (uses ssh)\n* `http` and `git` protocols are plain-text and NOT supported or recommended\n\n### Revs\n\nThe API functions all take revs, which can be any git rev that resolves to a commit, such as:\n\n* Full sha (40 chars)\n* Prefix sha (sufficiently unique in the repo, often 7 chars)\n* Tag name\n* Branch name\n\nProcured working trees are always cached on the basis of the rev's full sha, so using `procure` \nrepeatedly on a rev that does not resolve to a fixed sha may result in new checkouts in the cache.\n\n### Configuration\n\nDownloaded git dirs and working trees are stored in the gitlibs cache dir, ~/.gitlibs by default. This directory is just a cache and can be safely removed if needed.\n\ntools.gitlibs can be configured by either environment variable or Java system property. If both are provided, the Java system property takes precedence.\n\n| Env var | Java system property | default | description\n| ------- | -------------------- | ------- | -----------\n| GITLIBS | clojure.gitlibs.dir | ~/.gitlibs | Local directory cache for git repos and working trees |\n| GITLIBS_COMMAND | clojure.gitlibs.command | git | git command to run when shelling out (supply full path if needed) |\n| GITLIBS_DEBUG | clojure.gitlibs.debug | false | If true, print git commands and output to stderr |\n| GITLIBS_TERMINAL | clojure.gitlibs.terminal | false | If true, interactively prompt if needed |\n\n## Example Usage\n\n```clojure\n(require '[clojure.tools.gitlibs :as gl])\n\n;; Given a git repo url and a rev, resolve to a full sha.\n(gl/resolve \"https://github.com/clojure/spec.alpha.git\" \"739c1af\")\n;; =\u003e \"739c1af56dae621aedf1bb282025a0d676eff713\"\n\n;; Given a git repo url, library identifier, and a rev, return a path to the working tree\n(gl/procure \"https://github.com/clojure/spec.alpha.git\" 'org.clojure/spec.alpha \"739c1af\")\n;; =\u003e \"/Users/me/.gitlibs/libs/org.clojure/spec.alpha/739c1af56dae621aedf1bb282025a0d676eff713\"\n\n;; Given git repo url, and a collection of revs, return the full sha of the one commit that is\n;; a descendant of all other revs or nil if no such rev exists in the collection.\n(gl/descendant \"https://github.com/clojure/spec.alpha.git\" [\"607aef0\" \"739c1af\"])\n;; =\u003e \"739c1af56dae621aedf1bb282025a0d676eff713\"\n```\n\n## Release Information\n\nThis project follows the version scheme MAJOR.MINOR.COMMITS where MAJOR and MINOR provide some relative indication of the size of the change, but do not follow semantic versioning. In general, all changes endeavor to be non-breaking (by moving to new names rather than by breaking existing names). COMMITS is an ever-increasing counter of commits since the beginning of this repository.\n\nLatest release: 2.6.206\n\n* [All released versions](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22tools.gitlibs%22)\n* Coordinates: `org.clojure/tools.gitlibs {:mvn/version \"2.6.206\"}`\n\n# Developer Information\n\n* [GitHub project](https://github.com/clojure/tools.gitlibs)\n* [Bug Tracker](https://dev.clojure.org/jira/browse/TDEPS) - if you don't have an acct there, please ask at [Ask Clojure](https://ask.clojure.org)\n* [How to contribute](https://clojure.org/dev/dev)\n* [Continuous Integration](https://github.com/clojure/tools.gitlibs/actions/workflows/test.yml)\n\n# Copyright and License\n\nCopyright © Rich Hickey, Alex Miller, and contributors\n\nAll rights reserved. The use and\ndistribution terms for this software are covered by the\n[Eclipse Public License 1.0] which can be found in the file\nepl-v10.html at the root of this distribution. By using this software\nin any fashion, you are agreeing to be bound by the terms of this\nlicense. You must not remove this notice, or any other, from this\nsoftware.\n\n[Eclipse Public License 1.0]: https://opensource.org/license/epl-1-0/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclojure%2Ftools.gitlibs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclojure%2Ftools.gitlibs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclojure%2Ftools.gitlibs/lists"}