git_helpers

Description

Diff Fancy

The output is very similar to diff-fancy.rb. With the following differences: - diff-fancy.rb implement a parser of git diff. It is then very easy to tweak the output afterwards. The original diff-fancy relies on regexp, which makes it harder to customize. - support for submodules change in the diff - support for octopus merge - clean up 'No new line at end of file' for symlinks (which never have a new line)

TODO: - support 'git log -p –graph' - support git config to activate features on a repo basis

Examples

Here is my .gitconfig using diff-fancy.rb:

<s>~ highlight = “!f() { [ "$GIT_PREFIX" != "" ] && cd "$GIT_PREFIX"; GIT_PAGER="diff-fancy.rb" git $@; }; f” di = “!f() { [ "$GIT_PREFIX" != "" ] && cd "$GIT_PREFIX"; GIT_PAGER="diff-fancy.rb" git diff -B $@; }; f” dc = “!f() { [ "$GIT_PREFIX" != "" ] && cd "$GIT_PREFIX"; GIT_PAGER="diff-fancy.rb" git diff -B –staged $@; }; f” dw = “!f() { [ "$GIT_PREFIX" != "" ] && cd "$GIT_PREFIX"; GIT_PAGER="diff-fancy.rb –no-highlight" git diff -B –color-words $@; }; f” dcw = “!f() { [ "$GIT_PREFIX" != "" ] && cd "$GIT_PREFIX"; GIT_PAGER="diff-fancy.rb –no-highlight" git diff -B –staged –color-words $@; }; f” </s>~

Install

#TODO: release the gem
$ gem install git_helpers

Copyright © 2016–2017 Damien Robert

MIT License. See LICENSE.txt for details.