Giter Site home page Giter Site logo

porcelain's Introduction

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.

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:

porcelain's People

Contributors

lukasjue avatar robertgzr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.