summaryrefslogtreecommitdiff
path: root/ezbench.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-07-19 13:54:15 +0100
committerMartin Peres <martin.peres@linux.intel.com>2015-07-20 11:34:59 +0300
commitc993c4a4445bddce57aaf2a3c6eec5e917405e9a (patch)
tree279fbe23d802e148044b94461eca0d86a7dd0d16 /ezbench.sh
parent790b0113e4eead3fb81c6daa755128c25d3eec76 (diff)
Replace git log parsing with git plumbing
Instead of piping 'git log' output through a text pipeline, just use the git plumbing commands directly to generate the commit lists.
Diffstat (limited to 'ezbench.sh')
-rwxr-xr-xezbench.sh11
1 files changed, 4 insertions, 7 deletions
diff --git a/ezbench.sh b/ezbench.sh
index e3f60f9..faadff2 100755
--- a/ezbench.sh
+++ b/ezbench.sh
@@ -115,17 +115,14 @@ function finish {
trap finish EXIT
trap finish INT # Needed for zsh
-# Check the git repo
+# Check the git repo, saving then displaying the HEAD commit
cd $gitRepoDir
-tmp=$(git log HEAD...HEAD~ 2> /dev/null > /dev/null)
+commit_head=$(git rev-parse HEAD 2>/dev/null)
if [ $? -ne 0 ]
then
- printf "ERROR: The path '$gitRepoDir' does not contain a valid git repository. Aborting...\n"
+ echo "ERROR: The path '$gitRepoDir' does not contain a valid git repository. Aborting..."
exit 1
fi
-
-# Save and display the HEAD commit
-commit_head=$(git show HEAD | grep commit | cut -d ' ' -f 2)
echo "Original commit = $commit_head"
# Preserve any local modifications
@@ -180,7 +177,7 @@ function callIfDefined() {
callIfDefined ezbench_pre_hook
# Iterate through the commits
-for commit in $(git log --oneline --reverse -$lastNCommits | cut -d ' ' -f1) $stash
+for commit in $(git rev-list --abbrev-commit --reverse -n ${lastNCommits} HEAD) $stash
do
# Make sure we are in the right folder
cd $gitRepoDir