summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rwxr-xr-xextra/git-post-commit.sh4
-rwxr-xr-xextra/git-pre-push.sh9
-rwxr-xr-xextra/make-changelog.py34
3 files changed, 29 insertions, 18 deletions
diff --git a/extra/git-post-commit.sh b/extra/git-post-commit.sh
index 18238585..e74c2948 100755
--- a/extra/git-post-commit.sh
+++ b/extra/git-post-commit.sh
@@ -12,8 +12,8 @@ url=$(git config bash-completion.docker-hub-trigger-url)
test "$(git symbolic-ref --short HEAD 2>/dev/null)" = master
-git diff-tree -r --name-only --no-commit-id HEAD | \
- grep -qxE 'completions/Makefile\.am|test/requirements\.txt'
+git diff-tree -r --name-only --no-commit-id HEAD |
+ grep -qxE 'test/test-cmd-list\.txt'
curl \
--silent --show-error \
diff --git a/extra/git-pre-push.sh b/extra/git-pre-push.sh
index 27de6013..52d990eb 100755
--- a/extra/git-pre-push.sh
+++ b/extra/git-pre-push.sh
@@ -11,20 +11,23 @@
url=$(git config bash-completion.docker-hub-trigger-url) || exit 0
branch=master
-files="completions/Makefile\.am|test/requirements\.txt"
+files="test/test-cmd-list\.txt"
trigger=false
z40=0000000000000000000000000000000000000000
while read local_ref local_sha remote_ref remote_sha; do
case $remote_ref in */$branch) ;; *) continue ;; esac
- [ $local_sha != $z40 ] || continue # delete not handled (yet?)
+ [ $local_sha != $z40 ] || continue # delete not handled (yet?)
if [ $remote_sha = $z40 ]; then
list_files="git ls-tree -r --name-only $local_sha"
else
list_files="git diff --name-only $remote_sha..$local_sha"
fi
- ! $list_files | grep -qEx $files || { trigger=true; break; }
+ ! $list_files | grep -qEx $files || {
+ trigger=true
+ break
+ }
done
if $trigger; then
diff --git a/extra/make-changelog.py b/extra/make-changelog.py
index bb589775..c66b7048 100755
--- a/extra/make-changelog.py
+++ b/extra/make-changelog.py
@@ -1,30 +1,38 @@
#!/usr/bin/python3
-# -*- encoding: utf-8 -*-
+import sys
from collections import defaultdict
from email.utils import formatdate
-import sys
from textwrap import wrap
+from typing import Dict, List
import git
-repo = git.Repo('.')
-changelog = defaultdict(list)
+repo = git.Repo(".")
+changelog = defaultdict(list) # type: Dict[str, List[str]]
+
+if len(sys.argv) != 2:
+ print("Usage: %s SINCE-TAG" % __file__, file=sys.stderr)
+ sys.exit(2)
-for id in repo.iter_commits('%s..HEAD' % sys.argv[1]):
+for id in repo.iter_commits("%s..HEAD" % sys.argv[1]):
commit = repo.commit(id)
if not commit.summary.startswith("Merge pull request "):
changelog[commit.author.name].append(commit.summary)
-print('bash-completion (X.Y)')
-print('')
+print("bash-completion (X.Y)")
+print("")
for author in sorted(changelog.keys()):
- print(' [ %s ]' % author)
+ print(" [ %s ]" % author)
for log in changelog[author]:
- print('\n'.join(
- wrap(log, initial_indent=' * ', subsequent_indent=' ')))
- print('')
+ print(
+ "\n".join(
+ wrap(log, initial_indent=" * ", subsequent_indent=" ")
+ )
+ )
+ print("")
-print(' -- Ville Skyttä <ville.skytta@iki.fi> %s' %
- formatdate(localtime=True))
+print(
+ " -- Ville Skyttä <ville.skytta@iki.fi> %s" % formatdate(localtime=True)
+)