summaryrefslogtreecommitdiff
path: root/contrib/subtree
diff options
context:
space:
mode:
authorRoger Strain <rstrain@swri.org>2018-10-12 13:52:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-12 14:28:32 (GMT)
commit19ad68d95d6f8104eca1e86f8d1dfae50c7fb268 (patch)
tree90fba2d54c3c51ec58d7c4eddf09dc0d2af79ce0 /contrib/subtree
parent68f8ff81513fb3599ef3dfc3dd11da36d868e91b (diff)
downloadgit-19ad68d95d6f8104eca1e86f8d1dfae50c7fb268.zip
git-19ad68d95d6f8104eca1e86f8d1dfae50c7fb268.tar.gz
git-19ad68d95d6f8104eca1e86f8d1dfae50c7fb268.tar.bz2
subtree: performance improvement for finding unexpected parent commits
After testing a previous patch at larger scale, a performance issue was detected when using git show to locate parent revisions, with a single run of the git show command taking 2 seconds or longer in a complex repo. When the command is required tens or hundreds of times in a run of the script, the additional wait time is unaccepatable. Replacing the command with git rev-parse resulted in significantly increased performance, with the command in question returning instantly. Signed-off-by: Roger Strain <rstrain@swri.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/subtree')
-rwxr-xr-xcontrib/subtree/git-subtree.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 1c157db..147201d 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -633,7 +633,7 @@ process_split_commit () {
else
# processing commit without normal parent information;
# fetch from repo
- parents=$(git show -s --pretty=%P "$rev")
+ parents=$(git rev-parse "$rev^@")
extracount=$(($extracount + 1))
fi