Skip to content

Commit b0e621a

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 635530a commit b0e621a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

git-stash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ create_stash () {
5757
# state of the base commit
5858
if b_commit=$(git rev-parse --verify HEAD)
5959
then
60-
head=$(git log --no-color --abbrev-commit --pretty=oneline -n 1 HEAD --)
60+
head=$(git rev-list --oneline -n 1 HEAD --)
6161
else
6262
die "You do not have the initial commit yet"
6363
fi

git-submodule.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ cmd_summary() {
643643
range=$sha1_dst
644644
fi
645645
GIT_DIR="$name/.git" \
646-
git log --pretty=oneline --first-parent $range | wc -l
646+
git rev-list --first-parent $range -- | wc -l
647647
)
648648
total_commits=" ($(($total_commits + 0)))"
649649
;;

0 commit comments

Comments
 (0)