* [PATCH 0/2] A couple of fixes for create-pull-request
@ 2019-07-29 21:54 Paul Eggleton
2019-07-29 21:54 ` [PATCH 1/2] scripts/create-pull-request: improve handling of non-SSH remote URLs Paul Eggleton
2019-07-29 21:54 ` [PATCH 2/2] scripts/create-pull-request: fix putting subject containing / into cover letter Paul Eggleton
0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2019-07-29 21:54 UTC (permalink / raw)
To: openembedded-core
Fixes for a couple of minor issues with the create-pull-request script.
The following changes since commit a62d60fc3741aa5eaeccaaa562afda624c3e8a04:
weston: upgrade 6.0.0 -> 6.0.1 (2019-07-27 22:45:24 +0100)
are available in the Git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/create-pull-request
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/create-pull-request
Paul Eggleton (2):
scripts/create-pull-request: improve handling of non-SSH remote URLs
scripts/create-pull-request: fix putting subject containing / into cover letter
scripts/create-pull-request | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] scripts/create-pull-request: improve handling of non-SSH remote URLs
2019-07-29 21:54 [PATCH 0/2] A couple of fixes for create-pull-request Paul Eggleton
@ 2019-07-29 21:54 ` Paul Eggleton
2019-07-29 21:54 ` [PATCH 2/2] scripts/create-pull-request: fix putting subject containing / into cover letter Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2019-07-29 21:54 UTC (permalink / raw)
To: openembedded-core
When attempting to create a pull request, we look at the remote URL in
order to extract information to include in the cover letter. However,
the assumption was that the remote is an SSH URL i.e. containing '@'
which is not always the case (the pull and push URLs might be different,
or we might be pushing via https) - if it wasn't the script just gave up
leaving you to manually edit the URLs in the email. With a few minor
tweaks to the regexes the script will work for these cases as well.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/create-pull-request | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 3ce03d6c1a0..762828fd9ad 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -123,20 +123,12 @@ fi
# Rewrite private URLs to public URLs
# Determine the repository name for use in the WEB_URL later
-case "$REMOTE_URL" in
-*@*)
- USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?"
- PROTO_RE="[a-z][a-z+]*://"
- GIT_RE="\(^\($PROTO_RE\)\?$USER_RE@\)\([^:/]*\)[:/]\(.*\)"
- REMOTE_URL=${REMOTE_URL%.git}
- REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\4#")
- REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\3/\4#")
- ;;
-*)
- echo "WARNING: Unrecognized remote URL: $REMOTE_URL"
- echo " The pull and browse URLs will likely be incorrect"
- ;;
-esac
+USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?"
+PROTO_RE="[a-z][a-z+]*://"
+GIT_RE="\(^\($PROTO_RE\)\?\)\($USER_RE@\)\?\([^:/]*\)[:/]\(.*\)"
+REMOTE_URL=${REMOTE_URL%.git}
+REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\5#")
+REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\4/\5#")
if [ -z "$BRANCH" ]; then
BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] scripts/create-pull-request: fix putting subject containing / into cover letter
2019-07-29 21:54 [PATCH 0/2] A couple of fixes for create-pull-request Paul Eggleton
2019-07-29 21:54 ` [PATCH 1/2] scripts/create-pull-request: improve handling of non-SSH remote URLs Paul Eggleton
@ 2019-07-29 21:54 ` Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2019-07-29 21:54 UTC (permalink / raw)
To: openembedded-core
If a single-commit series had a shortlog containing a "/" character then
that prevented putting the shortlog into the subject of the cover letter
message. Use a different separating character with the sed command (one
much less likely to appear) in order to fix it.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/create-pull-request | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 762828fd9ad..8eefcf63a56 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -257,7 +257,7 @@ fi
# Replace the SUBJECT token with it.
if [ -n "$SUBJECT" ]; then
- sed -i -e "s/\*\*\* SUBJECT HERE \*\*\*/$SUBJECT/" "$CL"
+ sed -i -e "s\`\*\*\* SUBJECT HERE \*\*\*\`$SUBJECT\`" "$CL"
fi
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-29 21:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-29 21:54 [PATCH 0/2] A couple of fixes for create-pull-request Paul Eggleton
2019-07-29 21:54 ` [PATCH 1/2] scripts/create-pull-request: improve handling of non-SSH remote URLs Paul Eggleton
2019-07-29 21:54 ` [PATCH 2/2] scripts/create-pull-request: fix putting subject containing / into cover letter Paul Eggleton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox