3 #=======================================================================
5 # File ID: 149ce758-8aca-11e0-afed-37ea9f2067e0
7 # "git what's new", show descendants of a specific commit
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #=======================================================================
29 " -n "$progname" -- "$@
")"
30 test "$?" = "0" ||
exit 1
40 -h|
--help) opt_help
=1; shift ;;
41 -p|
--patch) opt_patch
=1; shift ;;
42 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
43 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
44 -w|
--word-diff) opt_word_diff
=1; shift ;;
45 --version) echo $progname $VERSION; exit 0 ;;
47 *) echo $progname: Internal error
>&2; exit 1 ;;
50 opt_verbose
=$
(($opt_verbose - $opt_quiet))
52 if test "$opt_help" = "1"; then
53 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
56 "git what's new", show descendants of a specific commit. For example,
57 after "git fetch", list all new commits.
59 Usage: $progname [options] [commit] [git_log_args]
66 Use extended format with patch.
68 Be more quiet. Can be repeated to increase silence.
70 Increase level of verbosity. Can be repeated.
72 Same as -p, but use word diff instead
74 Print version information.
76 If commit is not specified, use HEAD. To use git_log_args, a
77 commit/branch/tag/whatever has to be specified as \$1.
84 test "$opt_word_diff" = "1" && { opt_patch
=1; word_diff_str
="--word-diff"; }
89 test -z "$from" && from
=HEAD
90 git log
-1 $from &>/dev
/null ||
{ echo $from: Invalid ref
>&2; exit 1; }
93 for f
in $
(git lc
$from); do
94 branches
="$branches $from..$f"
97 if test "$opt_patch" = "1"; then
98 git log
--date-order --date=iso
--decorate=short
--format=fuller
--graph \
99 $word_diff_str -c -p $log_args $branches
101 git log
--abbrev-commit --date-order --decorate=short
--graph \
102 --pretty=format
:'%Cred%h %Cblue%p%Creset -%Creset %s %Cgreen(%cd %Cblue%an%Cgreen)%Creset%C(yellow)%d%Creset' \