All Projects → robertgzr → porcelain

robertgzr / porcelain

Licence: MIT license
a git status parser

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to porcelain

ls-git
A happy union of `ls` and `git status`.
Stars: ✭ 15 (-51.61%)
Mutual labels:  git-status

porcelain

Parses git status --porcelain=v2 --branch and outputs nicely formatted strings for your shell.

screen_shot

The minimum git version for porcelain v2 with --branch is v2.13.2. Otherwise you can use the old porcelain v1 based parser on the legacy branch.

With a working Go environment do: go get -u github.com/robertgzr/porcelain

Binaries can be found here.

Installation

make install

On Gentoo there is an ebuild in my personal overlay.

Output explained:

 <branch>@<commit> [↑/↓ <ahead/behind count>][untracked][unmerged][modified][dirty/clean]

  • ? : untracked files
  • : unmerged : merge in process
  • Δ : modified : unstaged changes

Definitions taken from: https://www.kernel.org/pub/software/scm/git/docs/gitglossary.html#def_dirty

  • : dirty : working tree contains uncommited but staged changes
  • : clean : working tree corresponds to the revision referenced by HEAD

Notice

In some fonts individual characters may look different, so it is important to use a powerline font. They are available:

  • From Source
  • via apt package: apt install fonts-powerline
  • via dnf package: dnf install powerline-fonts

Usage

Run porcelain without any options to get the colorful output :) For all supported options see porcelain -h.

I run this in ZSH to fill my RPROMPT, for this the terminal color codes need to be escaped. Use the -bash and -zsh flags to do that.

To use it in your tmux statusline you can turn off colors with no-colors or switch to tmux color formatting -tmux.

If you're using tpm you can install it as a plugin:

set -g @plugin 'robertgzr/porcelain'

And then add #{porcelain} to your statusline configuration.

This installs the latest version into the tpm plugin directory.


The screenshots use:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].