Home Home > GIT Browse > vanilla
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Poirier <bpoirier@suse.com>2018-12-07 15:30:59 +0900
committerBenjamin Poirier <bpoirier@suse.com>2018-12-21 16:50:37 +0900
commit0f98ccc51ed33ee1e75310f6add3fab64e5cf802 (patch)
tree413ffeec3c5d1afa8dfe1c6a7756b28a056d1844
parent7178c2c070e54be00d4eb832720fd7676cb2cf9d (diff)
scripts: Run pre-commit checks only once when splitting changes into multiple commits
Instead of repeating the series_sort check for each patch, we can do the check once at the beginning, which saves time. Same goes for the other checks part of the pre-commit hook.
-rwxr-xr-xscripts/log25
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/log2 b/scripts/log2
index 6ac84d890c..8e159d72ea 100755
--- a/scripts/log2
+++ b/scripts/log2
@@ -341,7 +341,7 @@ commit_single_patches()
# Patches are being committed one by one for better bisectability.
# There are $# more patches to commit.
EOF
- if ! do_commit $no_edit; then
+ if ! do_commit $no_edit --no-verify; then
# restore the index so that the user does not need to git add
# the patches again
git read-tree "$saved_index"
@@ -357,7 +357,7 @@ EOF
if test -n "${modified[*]}"; then
no_edit=
fi
- if ! do_commit $no_edit -a; then
+ if ! do_commit $no_edit --no-verify -a; then
git read-tree "$saved_index"
return 1
fi
@@ -402,6 +402,7 @@ deleted=($(git diff --name-only --diff-filter=D HEAD))
scripts/check-patch-dirs "${added[@]}" "${modified[@]}" || exit 1
if only_patches; then
+ "$_libdir"/git-pre-commit || exit
commit_single_patches || exit
else
# FIXME: -a should not be the default