tg-info.sh: show dependents with --verbose
[topgit/pro.git] / tg-files.sh
blobd674316990accbce7d6b45a1a6cf34e6381a0031
1 #!/bin/sh
2 # TopGit - A different patch queue manager
3 # (c) Petr Baudis <pasky@suse.cz> 2008
4 # GPLv2
6 name=
7 head_from=
10 ## Parse options
12 while [ -n "$1" ]; do
13 arg="$1"; shift
14 case "$arg" in
15 -i|-w)
16 [ -z "$head_from" ] || die "-i and -w are mutually exclusive"
17 head_from="$arg";;
18 -*)
19 echo "Usage: ${tgname:-tg} [...] files [-i | -w] [<name>]" >&2
20 exit 1;;
22 [ -z "$name" ] || die "name already specified ($name)"
23 name="$arg";;
24 esac
25 done
28 head="$(git symbolic-ref -q HEAD)" || :
29 head="${head#refs/heads/}"
31 [ -n "$name" ] ||
32 name="${head:-HEAD}"
33 name="$(verify_topgit_branch "$name")"
34 base_rev="$(git rev-parse --short --verify "refs/$topbases/$name" -- 2>/dev/null)" ||
35 die "not a TopGit-controlled branch"
37 if [ -n "$head_from" ] && [ "$name" != "$head" ]; then
38 die "$head_from makes only sense for the current branch"
41 b_tree=$(pretty_tree "$name" -b)
42 t_tree=$(pretty_tree "$name" $head_from)
44 git diff-tree --name-only -r $b_tree $t_tree
46 # vim:noet