{"id":16964946,"url":"https://github.com/propensive/octogenarian","last_synced_at":"2025-04-05T15:45:57.022Z","repository":{"id":185777380,"uuid":"673948447","full_name":"propensive/octogenarian","owner":"propensive","description":"Common Git operations for Scala","archived":false,"fork":false,"pushed_at":"2025-02-11T23:38:28.000Z","size":1348,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T20:49:19.604Z","etag":null,"topics":["git","git-api","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/propensive.png","metadata":{"files":{"readme":".github/readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":null,"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":"2023-08-02T19:40:19.000Z","updated_at":"2025-02-11T23:38:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a88a8a1-63fe-4b87-85c4-bf89fdaf15bc","html_url":"https://github.com/propensive/octogenarian","commit_stats":null,"previous_names":["propensive/nonagenarian","propensive/octogenarian"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Foctogenarian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Foctogenarian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Foctogenarian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Foctogenarian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/propensive","download_url":"https://codeload.github.com/propensive/octogenarian/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361598,"owners_count":20926642,"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":["git","git-api","scala"],"created_at":"2024-10-13T23:44:39.747Z","updated_at":"2025-04-05T15:45:57.015Z","avatar_url":"https://github.com/propensive.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg alt=\"GitHub Workflow\" src=\"https://img.shields.io/github/actions/workflow/status/propensive/octogenarian/main.yml?style=for-the-badge\" height=\"24\"\u003e](https://github.com/propensive/octogenarian/actions)\n[\u003cimg src=\"https://img.shields.io/discord/633198088311537684?color=8899f7\u0026label=DISCORD\u0026style=for-the-badge\" height=\"24\"\u003e](https://discord.com/invite/MBUrkTgMnA)\n\u003cimg src=\"/doc/images/github.png\" valign=\"middle\"\u003e\n\n# Octogenarian\n\n__Common Git operations for Scala__\n\nGit has become the _de facto_ version control system for programmers, but its\ncore API is its command line interface, designed with a shell user foremost in\nmind, yet with many operations designed for batch operation, or programmatic\nusage. _Octogenarian_ is an attempt to provide a Git API in Scala, with all of\nthe capabilities available on the command-line, but presented through an\nidiomatic API.\n\n## Features\n\n- implements core Git commands\n- entitities like commits, branches and tags are represented as immutable values\n- Git's API is reorganized to be more idiomatic\n- long-running operations run asynchronously, and track progress\n\n\n## Availability\n\n\n\n\n\n\n\n## Getting Started\n\nAll terms and types are provided in the `octogenarian` package:\n```scala\nimport octogenarian.*\n```\n\n### Types\n\nOctogenarian introduces various types representing entities relevant to Git.\n\nA `GitRepo` is an immutable value representing a Git repository, defined only by its filesystem location: its\nGit directory, and optionally, its working tree. The contents of the repository are not represented by a\n`GitRepo`, and the API presumes that the repository may be changed by other processes.\n\nThe opaque types, `Tag`, `Branch` and `CommitHash` represent tags, branches and commit hashes within a Git\nrepository, and all are subtypes of `Refspec`. Instances of these types may be returned by various Git\noperations, and may be used as parameters to some operations.\n\n`Commit` describes the details of a commit, including its hash, tree, parent(s), author, committer, signature\nand message.\n\n`SshUrl` is used to specify a SSH URL pointing to a remote Git repository.\n\nErrors are represented by `GitError`s, for operational problems, and `GitRefErrors`, for reference validation\nfailures.\n\nFinally, `GitProcess` is a mutable type representing a long-running Git process, and can be used to capture\nprogress updates as well as the final result of an operation.\n\n### Getting a `GitRepo`\n\nA `GitRepo` can be created from an existing repository on the filesystem, initializing a new one, or by cloning\na remote URL.\n\nIf the repository is already on disk, constructing it is as simple as invoking the factory, `GitRepo(path)`,\nwhere `path` is some representation of the path on the filesystem, as long as an appropriate\n[Anticipation](https://github.com/propensive/anticipation/) `GenericPath` typeclass is available. If using\n[Galilei](https://github.com/propensive/galilei/) `Path`s, then it is.\n\nA new, empty repository can be created with `Git.init(path)`, specifying a nonexistent path on the filesystem\nto create it. The optional `bare` parameter, defaulting to `false`, makes it possible to create a bare Git\nrepository, i.e. without a working tree.\n\nA repository can also be cloned from an existing repository, either remotely or locally. The `Git.clone` method\nwill clone a repository from a URL, a local path or a `SshUrl`, using any Anticipation-aware types, for example:\n```scala\nimport nettlesome.*\nimport galilei.*\n\nval repo = Git.clone(\n  url\"https://github.com/propensive/octogenarian\",\n  % / p\"home\" / p\"work\" / p\"octogenarian\",\n  branch = Branch(t\"main\")\n)\n```\n\nA further variant of `clone` exists which allows a single `Commit` value to be specified, `cloneCommit`.\n\n### Operations on a `GitRepo`\n\nVarious operations are available on an instance of a `GitRepo`. These generally follow the naming of the Git\ncommand-line subcommands, but a single `git` subcommand is sometimes split into more than one method:\n - `checkout`, checks out a `Tag`, `Branch` or `CommitHash`\n - `pull`, pulls from the default remote\n - `switch`, changes the current branch\n - `fetch`, fetches from the specified remote\n - `commit`, commits the currently-staged changes with the specified message\n - `branches`, lists the branches\n - `makeBranch`, creates a new branch\n - `tags`, lists the repository tags\n - `log`, reads changes to the repository as a stream of `Commit`s\n - `pushTags`, pushes tags to the remote\n\nImplementations of other commands remain incomplete, and should be added in due course.\n\n### Asynchronous operations\n\nCertain operations, notably those involving fetching, will run asynchronously, and their progress can be\ntracked. Asynchronous operations will return a `GitProcess` instance. Calling its `complete` method will return\nits result synchronously, as soon as it finishes. But updates on its progress can be obtained as a\n`LazyList[Progress]` with its `progress` member.\n\n\n\n## Status\n\nOctogenarian is classified as __embryotic__. For reference, Soundness projects are\ncategorized into one of the following five stability levels:\n\n- _embryonic_: for experimental or demonstrative purposes only, without any guarantees of longevity\n- _fledgling_: of proven utility, seeking contributions, but liable to significant redesigns\n- _maturescent_: major design decisions broady settled, seeking probatory adoption and refinement\n- _dependable_: production-ready, subject to controlled ongoing maintenance and enhancement; tagged as version `1.0.0` or later\n- _adamantine_: proven, reliable and production-ready, with no further breaking changes ever anticipated\n\nProjects at any stability level, even _embryonic_ projects, can still be used,\nas long as caution is taken to avoid a mismatch between the project's stability\nlevel and the required stability and maintainability of your own project.\n\nOctogenarian is designed to be _small_. Its entire source code currently consists\nof 509 lines of code.\n\n## Building\n\nOctogenarian will ultimately be built by Fury, when it is published. In the\nmeantime, two possibilities are offered, however they are acknowledged to be\nfragile, inadequately tested, and unsuitable for anything more than\nexperimentation. They are provided only for the necessity of providing _some_\nanswer to the question, \"how can I try Octogenarian?\".\n\n1. *Copy the sources into your own project*\n   \n   Read the `fury` file in the repository root to understand Octogenarian's build\n   structure, dependencies and source location; the file format should be short\n   and quite intuitive. Copy the sources into a source directory in your own\n   project, then repeat (recursively) for each of the dependencies.\n\n   The sources are compiled against the latest nightly release of Scala 3.\n   There should be no problem to compile the project together with all of its\n   dependencies in a single compilation.\n\n2. *Build with [Wrath](https://github.com/propensive/wrath/)*\n\n   Wrath is a bootstrapping script for building Octogenarian and other projects in\n   the absence of a fully-featured build tool. It is designed to read the `fury`\n   file in the project directory, and produce a collection of JAR files which can\n   be added to a classpath, by compiling the project and all of its dependencies,\n   including the Scala compiler itself.\n   \n   Download the latest version of\n   [`wrath`](https://github.com/propensive/wrath/releases/latest), make it\n   executable, and add it to your path, for example by copying it to\n   `/usr/local/bin/`.\n\n   Clone this repository inside an empty directory, so that the build can\n   safely make clones of repositories it depends on as _peers_ of `octogenarian`.\n   Run `wrath -F` in the repository root. This will download and compile the\n   latest version of Scala, as well as all of Octogenarian's dependencies.\n\n   If the build was successful, the compiled JAR files can be found in the\n   `.wrath/dist` directory.\n\n## Contributing\n\nContributors to Octogenarian are welcome and encouraged. New contributors may like\nto look for issues marked\n[beginner](https://github.com/propensive/octogenarian/labels/beginner).\n\nWe suggest that all contributors read the [Contributing\nGuide](/contributing.md) to make the process of contributing to Octogenarian\neasier.\n\nPlease __do not__ contact project maintainers privately with questions unless\nthere is a good reason to keep them private. While it can be tempting to\nrepsond to such questions, private answers cannot be shared with a wider\naudience, and it can result in duplication of effort.\n\n## Author\n\nOctogenarian was designed and developed by Jon Pretty, and commercial support and\ntraining on all aspects of Scala 3 is available from [Propensive\nO\u0026Uuml;](https://propensive.com/).\n\n\n\n## Name\n\nIn British English, a \"git\" is a derogatory term for a cantankerous old man,\nquite possibly in his eighties, and thus an octogenarian.\n\nIn general, Soundness project names are always chosen with some rationale,\nhowever it is usually frivolous. Each name is chosen for more for its\n_uniqueness_ and _intrigue_ than its concision or catchiness, and there is no\nbias towards names with positive or \"nice\" meanings—since many of the libraries\nperform some quite unpleasant tasks.\n\nNames should be English words, though many are obscure or archaic, and it\nshould be noted how willingly English adopts foreign words. Names are generally\nof Greek or Latin origin, and have often arrived in English via a romance\nlanguage.\n\n## Logo\n\nThe logo shows a stylized version of the Git logo.\n\n## License\n\nOctogenarian is copyright \u0026copy; 2025 Jon Pretty \u0026 Propensive O\u0026Uuml;, and\nis made available under the [Apache 2.0 License](/license.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Foctogenarian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpropensive%2Foctogenarian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Foctogenarian/lists"}