Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-22 09:25:00 +0300
committerJunio C Hamano <junkio@cox.net>2005-12-22 10:48:45 +0300
commit9b15770220aab37302cda115d257eeb4e6e72959 (patch)
tree424d76554685baa038ecdcaab66a8c0d8f547e9f /git-whatchanged.sh
parentebc12ce5bfcf6401c8fcc7e4935bc50142a65db4 (diff)
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>
Diffstat (limited to 'git-whatchanged.sh')
-rwxr-xr-xgit-whatchanged.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-whatchanged.sh b/git-whatchanged.sh
index b170f74a94..80e2500e0e 100755
--- a/git-whatchanged.sh
+++ b/git-whatchanged.sh
@@ -4,9 +4,15 @@ USAGE='[-p] [--max-count=<n>] [<since>..<limit>] [--pretty=<format>] [-m] [git-d
SUBDIRECTORY_OK='Yes'
. git-sh-setup
+diff_tree_flags=$(git-rev-parse --sq --no-revs --flags "$@")
+test -z "$diff_tree_flags" &&
+ diff_tree_flags=$(git-repo-config --get whatchanged.difftree)
+test -z "$diff_tree_flags" &&
+ diff_tree_flags='-M --abbrev'
+
rev_list_args=$(git-rev-parse --sq --default HEAD --revs-only "$@") &&
-diff_tree_args=$(git-rev-parse --sq --no-revs "$@") &&
+diff_tree_args=$(git-rev-parse --sq --no-revs --no-flags "$@") &&
eval "git-rev-list $rev_list_args" |
-eval "git-diff-tree --stdin --pretty -r $diff_tree_args" |
+eval "git-diff-tree --stdin --pretty -r $diff_tree_flags $diff_tree_args" |
LESS="$LESS -S" ${PAGER:-less}