]> Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - bin/git-cv
.vimrc: Tweak listchars tab handling
[dotfiles.git] / bin / git-cv
1 #!/bin/sh
2 # Usage: git-cv <upstream> [<head> [<limit>]]
3 # Humane git-cherry view. Show commits not merged upstream
4 # like git-cherry with verbose output, short SHAs, and ANSI
5 # color.
6
7 for a in "$@" ; do
8 test "$a" = "--help" &&
9 exec git cherry --help
10 done
11
12 SHA=$(git config --get-color 'color.branch.local')
13 ADD=$(git config --get-color 'color.diff.new')
14 REM=$(git config --get-color 'color.diff.old')
15 RESET=$(git config --get-color '' 'reset')
16
17 git cherry -v "$@" |
18 cut -c1-9,43- |
19 sed -e "s/^\(.\) \(.......\)/\1 $SHA\2$RESET/" |
20 sed -e "s/^-/$REM-$RESET/" -e "s/^+/$ADD+$RESET/"