{"id":14965453,"url":"https://github.com/68publishers/tracy-git-version","last_synced_at":"2025-10-25T11:31:48.932Z","repository":{"id":40651016,"uuid":"442934722","full_name":"68publishers/tracy-git-version","owner":"68publishers","description":":twisted_rightwards_arrows: Git version panel for Tracy","archived":false,"fork":false,"pushed_at":"2025-01-11T02:01:48.000Z","size":277,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-31T07:04:43.481Z","etag":null,"topics":["build","git","nette","tracy","tracy-debugger","tracy-panel","vcs","version"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/68publishers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-12-30T01:33:42.000Z","updated_at":"2025-01-11T02:01:00.000Z","dependencies_parsed_at":"2024-09-02T17:41:55.515Z","dependency_job_id":"de26e874-1d17-4961-9a1c-ddf982a735e5","html_url":"https://github.com/68publishers/tracy-git-version","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.052631578947368474","last_synced_commit":"d661168ca0b08283c39236e815b2c9cdba120b91"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftracy-git-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftracy-git-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftracy-git-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftracy-git-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/68publishers","download_url":"https://codeload.github.com/68publishers/tracy-git-version/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238128573,"owners_count":19421057,"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":["build","git","nette","tracy","tracy-debugger","tracy-panel","vcs","version"],"created_at":"2024-09-24T13:34:46.660Z","updated_at":"2025-10-25T11:31:43.659Z","avatar_url":"https://github.com/68publishers.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1 align=\"center\"\u003eTracy Git version\u003c/h1\u003e\n\nSimple and extensible panel for [Tracy](https://github.com/nette/tracy) that shows information from Git.\n\n\u003cimg src=\"docs/images/tracy-panel-header.png\" alt=\"Tracy Git version panel\" align=\"center\" width=\"500\"\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/68publishers/tracy-git-version/actions\"\u003e\u003cimg alt=\"Checks\" src=\"https://badgen.net/github/checks/68publishers/tracy-git-version/main\"\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/68publishers/tracy-git-version?branch=main\"\u003e\u003cimg alt=\"Coverage Status\" src=\"https://coveralls.io/repos/github/68publishers/tracy-git-version/badge.svg?branch=main\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/68publishers/tracy-git-version\"\u003e\u003cimg alt=\"Total Downloads\" src=\"https://badgen.net/packagist/dt/68publishers/tracy-git-version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/68publishers/tracy-git-version\"\u003e\u003cimg alt=\"Latest Version\" src=\"https://badgen.net/packagist/v/68publishers/tracy-git-version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/68publishers/tracy-git-version\"\u003e\u003cimg alt=\"PHP Version\" src=\"https://badgen.net/packagist/php/68publishers/tracy-git-version\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Table of contents\n\n* [Installation](#installation)\n* [Basic integration](#basic-integration)\n* [Solution for application builds without Git](#solution-for-application-builds-without-git)\n* [Advanced guide](#advanced-guide)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Installation\n\nThe best way to install `68publishers/tracy-git-version` is using Composer:\n\n```bash\n$ composer require 68publishers/tracy-git-version\n```\n\n## Basic integration\n\n### Standalone Tracy integration\n\nThe simplest way how to register the panel into Tracy is by creating a default instance and providing it directly into a Bar.\n\n```php\nuse Tracy\\Debugger;\nuse SixtyEightPublishers\\TracyGitVersion\\Bridge\\Tracy\\GitVersionPanel;\n\nDebugger::getBar()-\u003eaddPanel(GitVersionPanel::createDefault());\n```\n\n### Integration into Nette Framework\n\nBasic integration into Nette is really simple. Just register an extension.\n\n```neon\nextensions:\n    68publishers.tracy_git_version: SixtyEightPublishers\\TracyGitVersion\\Bridge\\Nette\\DI\\TracyGitVersionExtension\n```\n\nAnd everything works 😉\n\n## Solution for application builds without Git\n\nOften when we deploy an application to a production environment, neither Git nor the `.git` directory is available due to trying to have a build as small as possible.\nHowever, at this moment we have no source of information about the current version. The solution is to export a file that contains all important information at the time when the Git is still accessible.\n\n### Setup for standalone Tracy\n\nYou must create repositories and the panel manually but there is not much work to do.\n\n```php\nuse Tracy\\Debugger;\nuse SixtyEightPublishers\\TracyGitVersion\\Bridge\\Tracy\\GitVersionPanel;\nuse SixtyEightPublishers\\TracyGitVersion\\Repository\\LocalGitRepository;\nuse SixtyEightPublishers\\TracyGitVersion\\Repository\\ExportedGitRepository;\nuse SixtyEightPublishers\\TracyGitVersion\\Repository\\ResolvableGitRepository;\nuse SixtyEightPublishers\\TracyGitVersion\\Repository\\RuntimeCachedGitRepository;\nuse SixtyEightPublishers\\TracyGitVersion\\Bridge\\Tracy\\Block\\CurrentStateBlock;\n\n# create a repository that reads from the .git directory:\n$localGitRepository = LocalGitRepository::createDefault();\n\n# create a repository that reads from a JSON export:\n$exportedGitRepository = ExportedGitRepository::createDefault('/var/git-version/repository.json');\n\n# combine there two repositories, if the .git directory is not accessible then try to read from the export file:\n$resolvableGitRepository = new ResolvableGitRepository([$localGitRepository, $exportedGitRepository]);\n\n# add runtime cache, commands results are stored so there are no duplicated calls to the real repository:\n$cachedGitRepository = new RuntimeCachedGitRepository($resolvableGitRepository);\n\n# add the panel into Tracy\nDebugger::getBar()-\u003eaddPanel(new GitVersionPanel($cachedGitRepository, [new CurrentStateBlock()]));\n```\n\n### Setup for Nette Framework\n\nThe setup for Nette is more simple. Just add another extension into your neon configuration.\n\n```neon\nextensions:\n    68publishers.tracy_git_version: SixtyEightPublishers\\TracyGitVersion\\Bridge\\Nette\\DI\\TracyGitVersionExtension\n    68publishers.tracy_git_version.export: SixtyEightPublishers\\TracyGitVersion\\Bridge\\Nette\\DI\\TracyGitVersionExportExtension\n```\n\nThe default name for the exported file is `%tempDir%/git-version/repository.json` but you can change it.\n\n```neon\n68publishers.tracy_git_version.export:\n    export_filename: %tempDir%/my/custom/path.json\n```\n\n### Creating the export file\n\nThe export file should be created by executing a script that is located in the composer's `bin` directory.\nThe script is independent of the application so you must provide the filename of the exported file as an option.\n\n```bash\n$ vendor/bin/tracy-git-version export-repository --output-file \u003cyour_temp\u003e/git-version/repository.json -vv\n```\n\n## Advanced guide\n\nIf you want to read more about repositories, how to extend them or how to add custom data into the panel, please see the [Advanced guide](docs/advanced-guide.md).\n\n## Contributing\n\nBefore opening a pull request, please check your changes using the following commands\n\n```bash\n$ make init # to pull and start all docker images\n\n$ make cs.check\n$ make stan\n$ make tests.all\n```\n\n## License\n\nThe package is distributed under the MIT License. See [LICENSE](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F68publishers%2Ftracy-git-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F68publishers%2Ftracy-git-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F68publishers%2Ftracy-git-version/lists"}