@matheusbsbs / matheus-bagliano / commits / 9b15770220
Fork 0

whatchanged: customize diff-tree output

This allows the configuration item whatchanged.difftree to control the output from git-whatchanged command. For example: [whatchanged] difftree = --pretty=fuller --name-status -M does rename detection, shows the commit header in "fuller" format and lists affected pathnames and the kind of changes to them. When no such configuration item exists, the output format defaults to "--pretty -M --abbrev". Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 21, 2005 at 22:25 UTC 9b15770220aab37302cda115d257eeb4e6e72959
1 file changed +8 -2
git-whatchanged.sh
+8 -2
@@ -4,9 +4,15 @@ USAGE='[-p] [--max-count=<n>] [<since>..<limit>] [--pretty=<format>] [-m] [git-d
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 "$@") &&
8 -diff_tree_args=$(git-rev-parse --sq --no-revs "$@") &&
14 +diff_tree_args=$(git-rev-parse --sq --no-revs --no-flags "$@") &&
15
16 eval "git-rev-list $rev_list_args" |
11 -eval "git-diff-tree --stdin --pretty -r $diff_tree_args" |
17 +eval "git-diff-tree --stdin --pretty -r $diff_tree_flags $diff_tree_args" |
18 LESS="$LESS -S" ${PAGER:-less}