summaryrefslogtreecommitdiffstats
path: root/git-follow/git-follow.in
blob: 7d8d4b6a06f89101a6d66ab47ce8ff11a3b89e05 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

unset CDPATH
SED="${SED-sed}"

self=`basename "$0"`
selfdir=`dirname "$0"`
selfdir=`cd "$selfdir" && pwd`
. "$selfdir/git-ndim-sh"

SUBDIRECTORY_OK="yes"
USAGE="<command> [params...]"

LONG_USAGE="\
Let a local subtree of branches follow a remote origin without too much merging.
For more details, see the ${self}(1) man page."
. git-sh-setup

require_work_tree

# Abort on error
set -e

gf_init() {
    git config follow.tree | while read from to restofline; do
	if test "x#" = "x$(echo "$from" | sed -n '1s/^\(.\).*/\1/p')"; then continue; fi
	echo "ITEM"
	echo "  From: $from"
	echo "    To: $to"
    done
}

# The great command case
command="$1"
if shift; then
    case "$command" in	*)
	    die "Invalid command line parameter: \"$command\""
	    ;;
    esac
else
    die "Command required"
fi

# End of file.