PyGit implementation of xonsh's builtin gitstatus PROMPT
Project description
PyGit2 implementation of the builtin gitstatus PROMPT fields.
xontrib-pygitstatus provides a set of PROMPT fields that mimic the behavior of the builtin gitstatus prompt fields with minor differences.
Unlike the builtin prompt, xontrib-pygitstatus does not invoke the git cli, so may be more performant in the following cases:
- You're on a Windows workstations, where process spawning is slower than Linux
- You have an on-access virtus scanner installed, which will slow down git cli invocations
- Git is not installed on your system
Installation
To install use pip:
xpip install xontrib-pygitstatus
# or: xpip install -U git+https://github.com//xontrib-pygitstatus
Usage
This xontrib will get loaded automatically for interactive sessions. To stop this, set
$XONTRIBS_AUTOLOAD_DISABLED = ["pygitstatus", ]
# if you have set this for other xontribs, you should append the vale
then use pygitstatus's prompts in your .xonshrc file:
PROMPT = '{pygitstatus}'
Example modified default prompt:
$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}'
Differences from gitstatus
PyGitStatus is a fork of gitstatus that nearly follows the same logic as the original gitstatus prompt, but with a few differences:
- Conflict files are intentionally excluded from pygitstatus.staged.
- The pygitstatus prompt will include conflicted files when both are added to the index and the working tree.
Fields
{pygitstatus}
{pygitstatus_curr_branch}
{pygitstatus.ahead}
{pygitstatus.behind}
{pygitstatus.branch}
{pygitstatus.branch_bg_color}
{pygitstatus.branch_color}
{pygitstatus.changed}
{pygitstatus.clean}
{pygitstatus.conflicts}
{pygitstatus.deleted}
{pygitstatus.lines_added}
{pygitstatus.lines_deleted}
{pygitstatus.numstat}
{pygitstatus.operations}
{pygitstatus.repo_path}
{pygitstatus.short_head}
{pygitstatus.staged}
{pygitstatus.stash_count}
{pygitstatus.tag}
{pygitstatus.tag_or_hash}
{pygitstatus.untracked}
Known issues
While this xontrib works on Windows, the tests do not pass on Windows.
Credits
This package was created with xontrib template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xontrib_pygitstatus-0.1.0.tar.gz.
File metadata
- Download URL: xontrib_pygitstatus-0.1.0.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dce4a1ca90e76e97ef45e81f75747eb441b54cfb73963754d2865a3fcc5a4555
|
|
| MD5 |
83105a5ef3e3bcc9df1deb3b2074b898
|
|
| BLAKE2b-256 |
9c1d5d3c325794d2cdbb88b615df400c005bd0974e17a170acc43275d1b6f5d5
|
Provenance
The following attestation bundles were made for xontrib_pygitstatus-0.1.0.tar.gz:
Publisher:
release.yml on Spitfire1900/xontrib-pygitstatus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xontrib_pygitstatus-0.1.0.tar.gz -
Subject digest:
dce4a1ca90e76e97ef45e81f75747eb441b54cfb73963754d2865a3fcc5a4555 - Sigstore transparency entry: 158765200
- Sigstore integration time:
-
Permalink:
Spitfire1900/xontrib-pygitstatus@2042ed56bce57d0f231bc0d1e81285081f260f27 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Spitfire1900
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2042ed56bce57d0f231bc0d1e81285081f260f27 -
Trigger Event:
release
-
Statement type:
File details
Details for the file xontrib_pygitstatus-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xontrib_pygitstatus-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aa82a9fdeb962153dfb802356113d82a4604ee936d006e5421e1974964b72be
|
|
| MD5 |
b55d68ec0dac01ab69abd9abd028793d
|
|
| BLAKE2b-256 |
844783b5862f15ac86bca5f5175c7d83c8714b27dd3242bcb9e30a02f4b4758e
|
Provenance
The following attestation bundles were made for xontrib_pygitstatus-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Spitfire1900/xontrib-pygitstatus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xontrib_pygitstatus-0.1.0-py3-none-any.whl -
Subject digest:
2aa82a9fdeb962153dfb802356113d82a4604ee936d006e5421e1974964b72be - Sigstore transparency entry: 158765201
- Sigstore integration time:
-
Permalink:
Spitfire1900/xontrib-pygitstatus@2042ed56bce57d0f231bc0d1e81285081f260f27 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Spitfire1900
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2042ed56bce57d0f231bc0d1e81285081f260f27 -
Trigger Event:
release
-
Statement type: