diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-07-19 13:54:15 +0100 |
---|---|---|
committer | Martin Peres <martin.peres@linux.intel.com> | 2015-07-20 11:34:59 +0300 |
commit | c993c4a4445bddce57aaf2a3c6eec5e917405e9a (patch) | |
tree | 279fbe23d802e148044b94461eca0d86a7dd0d16 /ezbench.sh | |
parent | 790b0113e4eead3fb81c6daa755128c25d3eec76 (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-x | ezbench.sh | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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 |