diff --git a/scripts/git-pre-commit b/scripts/git-pre-commit index e8161e9..8d816bd 100755 --- a/scripts/git-pre-commit +++ b/scripts/git-pre-commit @@ -43,6 +43,10 @@ while read stat file garbage; do case "$file" in patches.*/*) git cat-file blob :$file >"$tmp" + if [ -z "$(diffstat -p1 -l "$tmp")" ] ; then + echo "$file" is empty patch + err=1 + fi "$dir/check-patchhdr" $update --stdin "$file" <"$tmp" || err=1 "$dir/check-patchfmt" --stdin "$file" <"$tmp" || err=1 "$dir/check-patch-blacklist" $(dirname "$dir")/blacklist.conf "$file" <$tmp || err=1 diff --git a/scripts/git_sort/git_sort.py b/scripts/git_sort/git_sort.py index a6102da..16af2c7 100755 --- a/scripts/git_sort/git_sort.py +++ b/scripts/git_sort/git_sort.py @@ -209,7 +209,9 @@ remotes = ( Head(RepoURL("https://github.com/kdave/btrfs-devel.git"), "misc-next"), Head(RepoURL("git://anongit.freedesktop.org/drm/drm"), "drm-next"), Head(RepoURL("git://anongit.freedesktop.org/drm/drm-misc"), "drm-misc-next"), + Head(RepoURL("gregkh/driver-core.git"), "driver-core-next"), Head(RepoURL("gregkh/tty.git"), "tty-next"), + Head(RepoURL("gregkh/usb.git"), "usb-next"), Head(RepoURL("jj/linux-apparmor.git"), "apparmor-next"), Head(RepoURL("pablo/nf.git")), Head(RepoURL("pablo/nf-next.git")), diff --git a/scripts/git_sort/lib.py b/scripts/git_sort/lib.py index 4a4f9d3..bf3a834 100644 --- a/scripts/git_sort/lib.py +++ b/scripts/git_sort/lib.py @@ -35,6 +35,11 @@ import git_sort from patch import Patch import series_conf +try: + from collections.abc import MutableSet +except ImportError: + from collections import MutableSet + # https://stackoverflow.com/a/952952 flatten = lambda l: [item for sublist in l for item in sublist] @@ -566,7 +571,7 @@ class Link(object): __slots__ = 'prev', 'next', 'key', '__weakref__' -class OrderedSet(collections.MutableSet): +class OrderedSet(MutableSet): 'Set the remembers the order elements were added' # Big-O running times for all methods are the same as for regular sets. # The internal self.__map dictionary maps keys to links in a doubly linked list. diff --git a/scripts/osc_wrapper b/scripts/osc_wrapper index 64bb1e2..83f98c1 100755 --- a/scripts/osc_wrapper +++ b/scripts/osc_wrapper @@ -86,10 +86,17 @@ check_dir_commit() get_branch() { - local res version sp + local res version sp githead + + githead=$(git rev-parse --git-dir)/HEAD + + if ! test -r "$githead"; then + echo "Warning: Could not find a git HEAD" >&2 + exit + fi # First, try the local branch name - res=$(sed -ne 'y|/|:|; s|^ref: refs:heads:||p' "$topdir/.git/HEAD" 2>/dev/null) + res=$(sed -ne 'y|/|:|; s|^ref: refs:heads:||p' $githead 2>/dev/null) if test -n "$res"; then if project_exists "$kotd_namespace:$res"; then echo "$res"