{"id":13487303,"url":"https://github.com/jaspernbrouwer/powerline-gitstatus","last_synced_at":"2025-05-16T13:04:08.743Z","repository":{"id":26582061,"uuid":"30036539","full_name":"jaspernbrouwer/powerline-gitstatus","owner":"jaspernbrouwer","description":"A Powerline segment for showing the status of a Git working copy","archived":false,"fork":false,"pushed_at":"2024-09-08T01:18:13.000Z","size":66,"stargazers_count":386,"open_issues_count":13,"forks_count":53,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-03T08:11:09.678Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/jaspernbrouwer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2015-01-29T19:14:31.000Z","updated_at":"2025-03-18T19:45:59.000Z","dependencies_parsed_at":"2024-06-19T00:13:50.908Z","dependency_job_id":"f164f5a7-02c2-4a97-bb1a-e0052a86f694","html_url":"https://github.com/jaspernbrouwer/powerline-gitstatus","commit_stats":{"total_commits":53,"total_committers":11,"mean_commits":4.818181818181818,"dds":0.5471698113207547,"last_synced_commit":"fe8e963b3489e4cceaa2c1f26f2bcc2ef405364c"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaspernbrouwer%2Fpowerline-gitstatus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaspernbrouwer%2Fpowerline-gitstatus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaspernbrouwer%2Fpowerline-gitstatus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaspernbrouwer%2Fpowerline-gitstatus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaspernbrouwer","download_url":"https://codeload.github.com/jaspernbrouwer/powerline-gitstatus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525624,"owners_count":21118714,"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-07-31T18:00:57.536Z","updated_at":"2025-04-12T06:20:29.165Z","avatar_url":"https://github.com/jaspernbrouwer.png","language":"Python","funding_links":[],"categories":["Python","Segments","Shell"],"sub_categories":["PCAP"],"readme":"Powerline Gitstatus\n===================\n\nA [Powerline][1] segment for showing the status of a Git working copy.\n\nBy [Jasper N. Brouwer][2].\n\nIt will show the branch-name, or the commit hash if in detached head state.\n\nIt will also show the number of commits behind, commits ahead, staged files,\nunmerged files (conflicts), changed files, untracked files and stashed files\nif that number is greater than zero.\n\n![screenshot][4]\n\nGlossary\n--------\n- ``: branch name or commit hash\n- `★`: most recent tag (if enabled)\n- `↓`: n commits behind\n- `↑`: n commits ahead\n- `●`: n staged files\n- `✖`: n unmerged files (conflicts)\n- `✚`: n changed files\n- `…`: n untracked files\n- `⚑`: n stashed files\n\nRequirements\n------------\n\nThe Gitstatus segment requires [git][5]! Preferably, but not limited to, version 1.8.5 or higher.\n\nVersion 1.8.5 will enable the usage of the `-C` parameter, which is more performant and accurate.\n\nInstallation\n------------\n\n### On Debian/Ubuntu\n\nOn a recent enough Debian (at least Stretch with backports enabled) or Ubuntu (at least 18.10) there is an official package available. \n\n```txt\napt install powerline-gitstatus\n```\n\nThis command will also instruct your package manager to install Powerline, if it's not already available.\n\nPowerline will be automatically configured to use the Gitstatus highlight groups and add the segment to the default\nshell theme.\n\n### Using pip\n\n```txt\npip install powerline-gitstatus\n```\n\nConfiguration\n-------------\n\nThe Gitstatus segment uses a couple of custom highlight groups. You'll need to define those groups in your colorscheme,\nfor example in `.config/powerline/colorschemes/default.json`:\n\n```json\n{\n  \"groups\": {\n    \"gitstatus\":                 { \"fg\": \"gray8\",           \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_branch\":          { \"fg\": \"gray8\",           \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_branch_clean\":    { \"fg\": \"green\",           \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_branch_dirty\":    { \"fg\": \"gray8\",           \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_branch_detached\": { \"fg\": \"mediumpurple\",    \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_tag\":             { \"fg\": \"darkcyan\",        \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_behind\":          { \"fg\": \"gray10\",          \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_ahead\":           { \"fg\": \"gray10\",          \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_staged\":          { \"fg\": \"green\",           \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_unmerged\":        { \"fg\": \"brightred\",       \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_changed\":         { \"fg\": \"mediumorange\",    \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_untracked\":       { \"fg\": \"brightestorange\", \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus_stashed\":         { \"fg\": \"darkblue\",        \"bg\": \"gray2\", \"attrs\": [] },\n    \"gitstatus:divider\":         { \"fg\": \"gray8\",           \"bg\": \"gray2\", \"attrs\": [] }\n  }\n}\n```\n\nThen you can activate the Gitstatus segment by adding it to your segment configuration,\nfor example in `.config/powerline/themes/shell/default.json`:\n\n```json\n{\n    \"function\": \"powerline_gitstatus.gitstatus\",\n    \"priority\": 40\n}\n```\n\nThe Gitstatus segment will use the `-C` argument by default, but this requires git 1.8.5 or higher.\n\nIf you cannot meet that requirement, you'll have to disable the usage of `-C`.\nDo this by passing `false` to the `use_dash_c` argument, for example in `.config/powerline/themes/shell/__main__.json`:\n\n```json\n\"gitstatus\": {\n    \"args\": {\n        \"use_dash_c\": false\n    }\n}\n```\n\nIt's strongly recommended to define the `trusted_paths` argument. This will\nrestrict the locations where git commands will be invoked, limiting the\nexposure to remote code execution via malicious repositories. Navigating the\nshell to repositories outside these trusted paths will not display the segment.\n\n```json\n\"gitstatus\": {\n    \"args\": {\n        \"trusted_paths\": [\n            \"/home/foo/code\",\n            \"/home/foo/projects\"\n        ]\n    }\n}\n```\n\nOptionally, a tag description for the current branch may be displayed using the `show_tag` option. Valid values for this\nargument are:\n\n * `last` : shows the most recent tag\n * `annotated` : shows the most recent annotated tag\n * `contains` : shows the closest tag that comes after the current commit\n * `exact` : shows a tag only if it matches the current commit\n\nYou can enable this by passing one of these to the `show_tag` argument, for example in `.config/powerline/themes/shell/__main__.json`:\n\n```json\n\"gitstatus\": {\n    \"args\": {\n        \"show_tag\": \"exact\"\n    }\n}\n```\nGit is executed an additional time to find this tag, so it is disabled by default.\n\nNote: before v1.3.0, the behavior when the value is `True` was `last`. As of v1.3.0 onwards, `True` behaves as `exact`.\n\nOptionally the format in which Gitstatus shows information can be customized.\nThis allows to use a different symbol or remove a fragment if desired. You can\ncustomize string formats for _branch_, _tag_, _behind_, _ahead_, _staged_, _unmerged_,\n_changed_, _untracked_ and _stash_ fragments with the following arguments in a\ntheme configuration file, for example `.config/powerline/themes/shell/__main__.json`:\n\n```json\n\"gitstatus\": {\n    \"args\": { \n        \"formats\": {\n            \"branch\": \"\\ue0a0 {}\",\n            \"tag\": \" ★ {}\",\n            \"behind\": \" ↓ {}\",\n            \"ahead\": \" ↑ {}\",\n            \"staged\": \" ● {}\",\n            \"unmerged\": \" ✖ {}\",\n            \"changed\": \" ✚ {}\",\n            \"untracked\": \" … {}\",\n            \"stashed\": \" ⚑ {}\"\n        }\n    }\n}\n```\n\nBy default, when in detached head state (current revision is not a branch tip), Gitstatus shows a short commit hash in\nplace of the branch name. This can be replaced with a description of the closest reachable ref using the\n`detached_head_style` argument, for example in `.config/powerline/themes/shell/__main__.json`:\n\n```json\n\"gitstatus\": {\n    \"args\": { \n        \"detached_head_style\": \"ref\"\n    }\n}\n```\n\nBy default, if your local branch has untracked files but no other changes, the branch status will be highlighted as dirty in the segment. You can disable this behavior by setting the `untracked_not_dirty` argument to `true`, for example in `.config/powerline/themes/shell/__main__.json`:\n\n```json\n\"gitstatus\": {\n    \"args\": {\n        \"untracked_not_dirty\": true\n    }\n}\n```\n \nLicense\n-------\n\nLicensed under [the MIT License][3].\n\n[1]: https://powerline.readthedocs.org/en/master/\n[2]: https://github.com/jaspernbrouwer\n[3]: https://github.com/jaspernbrouwer/powerline-gitstatus/blob/master/LICENSE\n[4]: https://github.com/jaspernbrouwer/powerline-gitstatus/blob/master/screenshot.png\n[5]: https://git-scm.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaspernbrouwer%2Fpowerline-gitstatus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaspernbrouwer%2Fpowerline-gitstatus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaspernbrouwer%2Fpowerline-gitstatus/lists"}