rev-parse: --show-cdup
[git.git] / git-whatchanged.sh
1 #!/bin/sh
2
3 USAGE='[-p] [--max-count=<n>] [<since>..<limit>] [--pretty=<format>] [-m] [git-diff-tree options] [git-rev-list options]'
4 SUBDIRECTORY_OK='Yes'
5 . git-sh-setup
6
7 diff_tree_flags=$(git-rev-parse --sq --no-revs --flags "$@")
8 test -z "$diff_tree_flags" &&
9         diff_tree_flags=$(git-repo-config --get whatchanged.difftree)
10 test -z "$diff_tree_flags" &&
11         diff_tree_flags='-M --abbrev'
12
13 rev_list_args=$(git-rev-parse --sq --default HEAD --revs-only "$@") &&
14 diff_tree_args=$(git-rev-parse --sq --no-revs --no-flags "$@") &&
15
16 eval "git-rev-list $rev_list_args" |
17 eval "git-diff-tree --stdin --pretty -r $diff_tree_flags $diff_tree_args" |
18 LESS="$LESS -S" ${PAGER:-less}