patchwork-apply.sh: remove explicit commit references
authorJo-Philipp Wich <jo@mein.io>
Sun, 4 Feb 2018 12:59:56 +0000 (13:59 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 4 Feb 2018 12:59:56 +0000 (13:59 +0100)
Mentioning explicit commit hashes proved to be unreliable, especially
when frequently rebasing the tree, so only post generic repository
references instead.

Also avoid clobbering subjects in the form "[TAG] subject [foo]" where
the prevously used sed pattern would reduce the entire subject to an
empty string.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
patchwork-apply.sh

index a7933304954038d82b2a2bf79d08359ce510a4cb..5c0da45873c8ef5f153ec5b58efbd551da4ba32f 100755 (executable)
@@ -38,7 +38,7 @@ get_subject() {
                subject="$subject$line"
        done
 
-       printf "%s\n" "$subject" | sed -e 's/^\[.*\] *//'
+       printf "%s\n" "$subject" | sed -e 's/^\[.*\] \+//'
 }
 
 get_hdr_list() {
@@ -99,27 +99,24 @@ format_reply() {
        esac
 
        case "$remote_host" in
-               git.lede-project.org|git.openwrt.org)
+               git.openwrt.org|git.lede-project.org)
                        case "$remote_repo" in
                                source.git|openwrt/openwrt.git)
-                                       echo "Merged into ${remote_ref##*/} with"
+                                       echo "Merged into ${remote_ref##*/}."
                                ;;
                                lede/*/staging.git|openwrt/staging/*.git)
-                                       echo "Merged into my staging tree with"
+                                       echo "Merged into my staging tree."
                                ;;
                                *)
-                                       echo "Merged into ${remote_repo:-the repository}, branch ${remote_ref##*/} with"
+                                       echo "Merged into ${remote_repo:-the repository}, branch ${remote_ref##*/}."
                                ;;
                        esac
                ;;
                *)
-                       echo "Merged with"
+                       echo "Merged."
                ;;
        esac
 
-       echo "http://$remote_host/?p=$remote_repo;a=commitdiff;h=$(git log -1 --format=%h)."
-       echo ""
-
        echo "Thank you!"
        echo ""
 }