script with rev-list instead of log
Because log.decorate now shows decorations for --pretty=oneline, we must explicitly turn it off when scripting. Otherwise, users with log.decorate set will get cruft like: $ git stash Saved working directory and index state WIP on master: 2c1f7f5 (HEAD, master) commit subject Instead of adding --no-decorate to the log command line, let's just use the rev-list plumbing interface instead, which does the right thing. git-submodule has a similar call. Since it just counts the commit lines, nothing is broken, but let's switch it, too, for the sake of consistency and cleanliness. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
635530a2fc
commit
b0e621adfd
@ -643,7 +643,7 @@ cmd_summary() {
|
||||
range=$sha1_dst
|
||||
fi
|
||||
GIT_DIR="$name/.git" \
|
||||
git log --pretty=oneline --first-parent $range | wc -l
|
||||
git rev-list --first-parent $range -- | wc -l
|
||||
)
|
||||
total_commits=" ($(($total_commits + 0)))"
|
||||
;;
|
||||
|
Reference in New Issue
Block a user