summaryrefslogtreecommitdiffstats
path: root/supercherry
blob: 68eac966f3ca525584c2bb49054126ed03465a52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

base="master"

RED="\e[1;31m"
GREEN="\e[0;32m"
YELLOW="\e[0;33m"
BLUE="\e[1;34m"
PURPLE="\e[0;35m"
GRAY="\e[0;37m"
NONE="\e[0;0m"


for ref in $(git for-each-ref --format='%(refname)' refs/remotes); do
        sha1="$(git rev-parse --verify $ref)"
        if [ "$(git merge-base $ref $base)" = "$sha1" ]; then
                continue
        fi
        echo -e "$sha1: ${RED}${ref}${NONE}"
        git cherry -v $base $ref | while read line; do
                case $line in
                        +*)
                                echo -e $BLUE$line$NONE
                                ;;
                        -*)
                                echo -e $GRAY$line$NONE
                                ;;
                esac
        done
        echo
done