summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: df9892f)
raw | patch | inline | side by side (parent: df9892f)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 6 Feb 2006 00:42:49 +0000 (16:42 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 6 Feb 2006 00:42:49 +0000 (16:42 -0800) |
This is essentially 'git whatchanged -n1 --always --cc "$@"'.
Just like whatchanged takes default flags from
whatchanged.difftree configuration, this uses show.difftree
configuration.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Just like whatchanged takes default flags from
whatchanged.difftree configuration, this uses show.difftree
configuration.
Signed-off-by: Junio C Hamano <junkio@cox.net>
.gitignore | patch | blob | history | |
Makefile | patch | blob | history | |
git-whatchanged.sh | patch | blob | history |
diff --git a/.gitignore b/.gitignore
index 5382e742719be2ca7285898d70d9bf0fd367c247..513f22eb1dda28392e7a463b98fa636937d02ea2 100644 (file)
--- a/.gitignore
+++ b/.gitignore
git-sh-setup
git-shell
git-shortlog
+git-show
git-show-branch
git-show-index
git-ssh-fetch
diff --git a/Makefile b/Makefile
index 2aa2385b6bed4733ba9f8f2d673596e386e7fe8e..dfd765115cdd194e0c86ecc2d0bc4414e6226226 100644 (file)
--- a/Makefile
+++ b/Makefile
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
$(patsubst %.py,%,$(SCRIPT_PYTHON)) \
- git-cherry-pick
+ git-cherry-pick git-show
# The ones that do not have to link with lcrypto nor lz.
SIMPLE_PROGRAMS = \
git-cherry-pick: git-revert
cp $< $@
+git-show: git-whatchanged
+ cp $< $@
+
# These can record GIT_VERSION
git$X git.spec \
$(patsubst %.sh,%,$(SCRIPT_SH)) \
diff --git a/git-whatchanged.sh b/git-whatchanged.sh
index d4f985b5eb2f64e597e820c04e510f0f81692a6a..574fc3558e15c0d1cbce95ef728ce99ac66e26fe 100755 (executable)
--- a/git-whatchanged.sh
+++ b/git-whatchanged.sh
. git-sh-setup
diff_tree_flags=$(git-rev-parse --sq --no-revs --flags "$@") || exit
+case "$0" in
+*whatchanged)
+ count=
+ test -z "$diff_tree_flags" &&
+ diff_tree_flags=$(git-repo-config --get whatchanged.difftree)
+ diff_tree_default_flags='-M --abbrev' ;;
+*show)
+ count=-n1
+ test -z "$diff_tree_flags" &&
+ diff_tree_flags=$(git-repo-config --get show.difftree)
+ diff_tree_default_flags='--cc --always' ;;
+esac
test -z "$diff_tree_flags" &&
- diff_tree_flags=$(git-repo-config --get whatchanged.difftree)
-test -z "$diff_tree_flags" &&
- diff_tree_flags='-M --abbrev'
+ diff_tree_flags="$diff_tree_default_flags"
rev_list_args=$(git-rev-parse --sq --default HEAD --revs-only "$@") &&
diff_tree_args=$(git-rev-parse --sq --no-revs --no-flags "$@") &&
-eval "git-rev-list $rev_list_args" |
+eval "git-rev-list $count $rev_list_args" |
eval "git-diff-tree --stdin --pretty -r $diff_tree_flags $diff_tree_args" |
LESS="$LESS -S" ${PAGER:-less}