From: Jo-Philipp Wich Date: Sun, 4 Feb 2018 12:59:56 +0000 (+0100) Subject: patchwork-apply.sh: remove explicit commit references X-Git-Url: http://git.openwrt.org/feed/routing.git;lede-17.01?a=commitdiff_plain;h=8ad55b2ff8b1b218176872806b3415f4affac059;p=maintainer-tools.git patchwork-apply.sh: remove explicit commit references 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 --- diff --git a/patchwork-apply.sh b/patchwork-apply.sh index a793330..5c0da45 100755 --- a/patchwork-apply.sh +++ b/patchwork-apply.sh @@ -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 "" }