# Octogit This program is what I use to display git status in my shell prompt. The way you use it is by putting the binary somewhere in your shell prompt, so it's executed. In fish, that would be something like this: ```fish function fish_prompt printf (pwd)' ' octogit end ``` By default, octogit will print this output to stdout (if you had every single type of change in your current git directory), with a space but not a newline at the end: `octogit --test` ![](img/octogit-default-nerd.png) The meanings of every element in order: 1. Stashes 1. Commits you fetched but haven't pulled 1. Commits you haven't yet pushed to the remote 1. Staged renamed files 1. Staged modifications 1. Staged new files 1. Staged deletions 1. Unstaged modifications 1. Unstaged new files 1. Unstaged deletions It uses nerd font symbols for some of the elements. If you don't want to use a nerd font, use the `--ascii-symbols` flag: `octogit --test --ascii-symbols` ![](img/octogit-default-ascii.png) Only the elements that are at least one are printed, making testing how octogit fully looks kinda annoying. That's why the `--test` flag exists – you get to see the entire output of octogit regardless of how many changes your current git directory actually has. By default, commits (stashes, unpulled, unpushed) are shown in yellow, staged changes in green, and unstaged changes in cyan, following your terminal's color scheme. You can change each category's default to any one of these 8 colors: black, red, green, yellow, blue, purple, cyan, white `octogit --color-all-staged purple` ![](img/staged-purple-word.png) Or by providing a hex color: `octogit --color-all-staged AF87FF` ![](img/staged-purple-hex.png) The cAsE of colors doesn't matter. You can then override the default for specific elements, if you want to: `octogit --color-all-unstaged blue --color-deleted red` ![](img/unstaged-blue-deleted-red.png) Same thing applies to the [glyphs used](https://www.nerdfonts.com/cheat-sheet): `octogit --symbol-unpushed 󰤇 --symbol-deleted 󱇪` ![](img/symbol-rabbit-unpushed-spider-deleted.png) Interestingly, you're not restricted to a single character. So it could be a whole word, if you want to!: `octogit --symbol-unpushed meow` ![](img/unpushed-custom-word.png) A similar thing happens for colors: `octogit --color-staged-deleted '87FF5F this is my brigher green that I want to use for this element'` ![](img/sentence.png) Despite putting an entire sentence into the flag, only the hex color is used, ignoring all other text. You can use this behavior as a comment. Doesn't work with word colors (like `green`, `red`, etc). Since this program is something you're going to use in your shell prompt, it doesn't print error messages by default. If something isn't working correctly, use the `-v`/`--verbose` flag interactively to check what's wrong: `octogit -v --test --color-unstaged 'non-existent-color'` ![](img/incorrect-hex-color.png) In other words, your prompt will still continue to work via using defaults, if there are any errors. This prevents you from having a broken shell prompt because you specified an incorrect argument, for example. If there's any element that you don't want to see, you can remove it: `octogit --remove-unpulled --remove-deleted` ![](img/remove.png) Keep in mind that all the git commands required to get the elements still get executed, so you won't get a speed boost by removing some elements. The information of a deleted element will also **not** get transferred to another element. In some more known shell prompt vcs, all staged changes are displayed in a single element. In octogit, however, if you remove an element, you will then just lack that information. Useful if you hate seeing stashes, for example. ## Usage ``` A simple executable git status for your shell prompt. Usage: octogit [OPTIONS] Options: -v, --verbose octogit doesn't print errors by default, because it's supposed to be in your shell prompt constantly. When you do want to see the errors, use this flag --ascii-symbols octogit uses nerd font symbols for some elements by default. Use this flag if you don't use a nerd font. You can see both the nerd and ascii defaults for every category later down in this help --test Will print every single element. Helpful for testing the output without having to be in a git directory with certain changes --color-all-commits [default: yellow] For every color, you can either specify one of the main 8 colors from your terminal color scheme: black, red, green, yellow, blue, purple, cyan, white Or a hex code, without the # symbol like: FFAFD7 For both hex codes and color names, the cAsE doesn't matter --color-all-staged [default: green] --color-all-unstaged [default: cyan] --color-stashed [default: --color-all-commits] --color-unpulled [default: --color-all-commits] --color-unpushed [default: --color-all-commits] --color-renamed [default: --color-all-staged] --color-staged [default: --color-all-staged] --color-added [default: --color-all-staged] --color-staged-deleted [default: --color-all-staged] --color-modified [default: --color-all-unstaged] --color-unstaged [default: --color-all-unstaged] --color-deleted [default: --color-all-unstaged] --symbol-stashed [default: 󰟫 or *] --symbol-unpulled [default:  or <] --symbol-unpushed [default:  or >] --symbol-renamed [default: 󰕍 or &] --symbol-staged [default: 󰄬 or !] --symbol-added [default: 󰐕 or +] --symbol-staged-deleted [default: 󰍴 or -] --symbol-modified [default:  or !] --symbol-unstaged [default: 󰐕 or +] --symbol-deleted [default: 󰍴 or -] --remove-stashed Remove an element from outputting to stdout using the following flags. Keep in mind, everything still gets processed, so you won't get a speed boost. If you remove something, you will then just lack that information, instead of it getting transferred to another element, like you may expect. Helpful if you really hate staged deletions specifically. /s --remove-unpulled --remove-unpushed --remove-renamed --remove-staged --remove-added --remove-staged-deleted --remove-modified --remove-unstaged --remove-deleted -h, --help Print help -V, --version Print version ``` ## Install ``` cargo install octogit ``` `cargo-binstall` and `cargo-quickinstall` are also supported ## Uninstall ``` cargo uninstall octogit ```