{"id":23963664,"url":"https://github.com/Spitfire1900/xontrib-pygitstatus","last_synced_at":"2025-09-12T20:32:06.238Z","repository":{"id":270617270,"uuid":"775783047","full_name":"Spitfire1900/xontrib-pygitstatus","owner":"Spitfire1900","description":"PyGit2 implementation of the gitstatus prompt for Xonsh shell","archived":false,"fork":false,"pushed_at":"2025-01-03T19:17:11.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T18:15:34.306Z","etag":null,"topics":["git","gitstatus","pygit2","xonsh","xonsh-prompt","xontrib"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Spitfire1900.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":"2024-03-22T03:05:29.000Z","updated_at":"2025-01-03T19:17:15.000Z","dependencies_parsed_at":"2025-01-01T21:32:14.171Z","dependency_job_id":"b52adf66-ec4e-4c18-a557-c67782b29d40","html_url":"https://github.com/Spitfire1900/xontrib-pygitstatus","commit_stats":null,"previous_names":["spitfire1900/xontrib-pygitstatus"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Spitfire1900/xontrib-pygitstatus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spitfire1900%2Fxontrib-pygitstatus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spitfire1900%2Fxontrib-pygitstatus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spitfire1900%2Fxontrib-pygitstatus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spitfire1900%2Fxontrib-pygitstatus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Spitfire1900","download_url":"https://codeload.github.com/Spitfire1900/xontrib-pygitstatus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spitfire1900%2Fxontrib-pygitstatus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274873276,"owners_count":25365823,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["git","gitstatus","pygit2","xonsh","xonsh-prompt","xontrib"],"created_at":"2025-01-06T21:01:32.571Z","updated_at":"2025-09-12T20:32:06.230Z","avatar_url":"https://github.com/Spitfire1900.png","language":"Python","funding_links":[],"categories":["Prompts"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\nPyGit2 implementation of the builtin gitstatus PROMPT fields.\n\u003c/p\u003e\n\nxontrib-pygitstatus provides a set of PROMPT fields that mimic the behavior of the builtin gitstatus prompt fields with [minor differences](#differences-from-gitstatus).\n\nUnlike the builtin prompt, xontrib-pygitstatus does not invoke the git cli, so may be more performant in the following cases:\n\n-   You're on a Windows workstations, where process spawning is slower than Linux\n-   You have an on-access virtus scanner installed, which will slow down git cli invocations\n-   Git is not installed on your system\n\n## Installation\n\nTo install use pip:\n\n```xsh\nxpip install xontrib-pygitstatus\n# or: xpip install -U git+https://github.com//xontrib-pygitstatus\n```\n\n## Usage\n\nThis xontrib will get loaded automatically for interactive sessions.\nTo stop this, set\n\n```xsh\n$XONTRIBS_AUTOLOAD_DISABLED = [\"pygitstatus\", ]\n# if you have set this for other xontribs, you should append the vale\n```\n\nthen use pygitstatus's prompts in your .xonshrc file:\n\n```xsh\nPROMPT = '{pygitstatus}'\n```\n\nExample modified default prompt:\n\n```xsh\n$PROMPT = '{YELLOW}{env_name}{RESET}{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {cwd}{pygitstatus.branch_color}{pygitstatus_curr_branch: {}}{RESET} {RED}{last_return_code_if_nonzero:[{BOLD_INTENSE_RED}{}{RED}] }{RESET}{BOLD_BLUE}{prompt_end}{RESET}'\n```\n\n## Differences from gitstatus\n\nPyGitStatus is a reimplementation of the [gitstatus](https://github.com/xonsh/xonsh/blob/0.12.5/xonsh/prompt/gitstatus.py) that nearly follows the same logic as the original gitstatus prompt, but with a few differences:\n\n-   Conflict files are intentionally excluded from pygitstatus.staged.\n-   Merge conflicts on files that are both added to the index and the working tree are counted as conflicts.\n-   Untracked files is calculated recursively, this has the same macro-performance as only counting untracked files and directories in the current directory.\n\ngitstatus uses `git status --porcelain`, which is unable to distinguish between a conflict file and one that was added to both the index and working tree.\n\n## Fields\n\n```xsh\n{pygitstatus}\n{pygitstatus_curr_branch}\n{pygitstatus.ahead}\n{pygitstatus.behind}\n{pygitstatus.branch}\n{pygitstatus.branch_bg_color}\n{pygitstatus.branch_color}\n{pygitstatus.changed}\n{pygitstatus.clean}\n{pygitstatus.conflicts}\n{pygitstatus.deleted}\n{pygitstatus.lines_added}\n{pygitstatus.lines_deleted}\n{pygitstatus.numstat}\n{pygitstatus.operations}\n{pygitstatus.repo_path}\n{pygitstatus.short_head}\n{pygitstatus.staged}\n{pygitstatus.stash_count}\n{pygitstatus.tag}\n{pygitstatus.tag_or_hash}\n{pygitstatus.untracked}\n```\n\n## Known issues\n\nWhile this xontrib works on Windows, the tests do not pass on Windows.\n\n## Credits\n\nThis package was created with [xontrib template](https://github.com/xonsh/xontrib-template).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSpitfire1900%2Fxontrib-pygitstatus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSpitfire1900%2Fxontrib-pygitstatus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSpitfire1900%2Fxontrib-pygitstatus/lists"}