* [PATCH] create-pull-request: Add -l location switch
@ 2011-05-10 18:55 Tom Rini
2011-05-10 19:18 ` Otavio Salvador
0 siblings, 1 reply; 8+ messages in thread
From: Tom Rini @ 2011-05-10 18:55 UTC (permalink / raw)
To: openembedded-core
Add a -l switch that takes an argument of either github or gitorious
and will make the cover letter have a fill-in-the-blank of where the
changes are on either github or gitorious.
Signed-off-by: Tom Rini <tom_rini@mentor.com>
---
scripts/create-pull-request | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 784b48c..2e02d82 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -18,6 +18,7 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to
-b contrib_branch Branch-name in the $PULL_URL
-s subject The subject to be inserted into the summary email
-p prefix Use [prefix N/M] instead of [PATCH N/M] as the subject prefix
+ -l location The location (github or gitorious) where the changes are if not in the default contrib repository
Examples:
$CMD -b nitin/basic
@@ -28,7 +29,7 @@ EOM
}
# Parse and validate arguments
-while getopts "b:hi:m:o:r:s:p:" OPT; do
+while getopts "b:hi:i:l:m:o:r:s:p:" OPT; do
case $OPT in
b)
CONTRIB_BRANCH="$OPTARG"
@@ -40,6 +41,22 @@ while getopts "b:hi:m:o:r:s:p:" OPT; do
i)
COMMIT_ID="$OPTARG"
;;
+ l)
+ case $OPTARG in
+ github)
+ PULL_URL="git://github.com/PROJECT/REPO.git"
+ WEB_URL_PREFIX="https://github.com/PROJECT/REPO/tree/"
+ ;;
+ gitorious)
+ PULL_URL="git://gitorious.org/PROJECT/REPO.git"
+ WEB_URL_PREFIX="http://gitorious.org/PROJECTS/REPO/commits/"
+ ;;
+ *)
+ echo "ERROR: Unknown location where the changes are hosted"
+ exit 1
+ ;;
+ esac
+ ;;
m)
BODY="$OPTARG"
if [ ! -e "$BODY" ]; then
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] create-pull-request: Add -l location switch
2011-05-10 18:55 [PATCH] create-pull-request: Add -l location switch Tom Rini
@ 2011-05-10 19:18 ` Otavio Salvador
2011-05-10 23:01 ` Tom Rini
2011-05-11 5:43 ` Darren Hart
0 siblings, 2 replies; 8+ messages in thread
From: Otavio Salvador @ 2011-05-10 19:18 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, May 10, 2011 at 15:55, Tom Rini <tom_rini@mentor.com> wrote:
> Add a -l switch that takes an argument of either github or gitorious
> and will make the cover letter have a fill-in-the-blank of where the
> changes are on either github or gitorious.
Another possibility would be to use git config interface to store
those. You might have something like:
[oe-core-pull-request]
mode = github
user = foo
or
[oe-core-pull-request]
mode = gitorious
user = bar
This could be used to fill the fields in a proper way since those are
predictable.
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] create-pull-request: Add -l location switch
2011-05-10 19:18 ` Otavio Salvador
@ 2011-05-10 23:01 ` Tom Rini
2011-05-11 6:02 ` Martin Jansa
` (2 more replies)
2011-05-11 5:43 ` Darren Hart
1 sibling, 3 replies; 8+ messages in thread
From: Tom Rini @ 2011-05-10 23:01 UTC (permalink / raw)
To: openembedded-core
On 05/10/2011 12:18 PM, Otavio Salvador wrote:
> On Tue, May 10, 2011 at 15:55, Tom Rini <tom_rini@mentor.com> wrote:
>> Add a -l switch that takes an argument of either github or gitorious
>> and will make the cover letter have a fill-in-the-blank of where the
>> changes are on either github or gitorious.
>
> Another possibility would be to use git config interface to store
> those. You might have something like:
>
> [oe-core-pull-request]
> mode = github
> user = foo
>
> or
>
> [oe-core-pull-request]
> mode = gitorious
> user = bar
>
> This could be used to fill the fields in a proper way since those are
> predictable.
If I had a good bit more time, I might re-write the script in python and
parse .ini files (same syntax as gitconfig) so that lots of useful
defaults could be saved. But here's the real test, given that you're an
intended user, would you use the -l switch or just make a local change
to the script like Martin showed?
--
Tom Rini
Mentor Graphics Corporation
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] create-pull-request: Add -l location switch
2011-05-10 23:01 ` Tom Rini
@ 2011-05-11 6:02 ` Martin Jansa
2011-05-11 17:03 ` Richard Purdie
2011-05-12 0:55 ` Otavio Salvador
2 siblings, 0 replies; 8+ messages in thread
From: Martin Jansa @ 2011-05-11 6:02 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1500 bytes --]
On Tue, May 10, 2011 at 04:01:06PM -0700, Tom Rini wrote:
> On 05/10/2011 12:18 PM, Otavio Salvador wrote:
> > On Tue, May 10, 2011 at 15:55, Tom Rini <tom_rini@mentor.com> wrote:
> >> Add a -l switch that takes an argument of either github or gitorious
> >> and will make the cover letter have a fill-in-the-blank of where the
> >> changes are on either github or gitorious.
> >
> > Another possibility would be to use git config interface to store
> > those. You might have something like:
> >
> > [oe-core-pull-request]
> > mode = github
> > user = foo
> >
> > or
> >
> > [oe-core-pull-request]
> > mode = gitorious
> > user = bar
> >
> > This could be used to fill the fields in a proper way since those are
> > predictable.
>
> If I had a good bit more time, I might re-write the script in python and
> parse .ini files (same syntax as gitconfig) so that lots of useful
> defaults could be saved. But here's the real test, given that you're an
> intended user, would you use the -l switch or just make a local change
> to the script like Martin showed?
I would still use local copy of script just because in this case it has
selective name and I can find it already with right params in bash history.
To have the same comfort with -l switch you would have to provide bash
completition config :).
And yes -l switch is good thing, I can replace my copies with simple
alias now..
Regards,
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] create-pull-request: Add -l location switch
2011-05-10 23:01 ` Tom Rini
2011-05-11 6:02 ` Martin Jansa
@ 2011-05-11 17:03 ` Richard Purdie
2011-05-11 18:28 ` Darren Hart
2011-05-12 0:55 ` Otavio Salvador
2 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2011-05-11 17:03 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, 2011-05-10 at 16:01 -0700, Tom Rini wrote:
> On 05/10/2011 12:18 PM, Otavio Salvador wrote:
> > On Tue, May 10, 2011 at 15:55, Tom Rini <tom_rini@mentor.com> wrote:
> >> Add a -l switch that takes an argument of either github or gitorious
> >> and will make the cover letter have a fill-in-the-blank of where the
> >> changes are on either github or gitorious.
> >
> > Another possibility would be to use git config interface to store
> > those. You might have something like:
> >
> > [oe-core-pull-request]
> > mode = github
> > user = foo
> >
> > or
> >
> > [oe-core-pull-request]
> > mode = gitorious
> > user = bar
> >
> > This could be used to fill the fields in a proper way since those are
> > predictable.
>
> If I had a good bit more time, I might re-write the script in python and
> parse .ini files (same syntax as gitconfig) so that lots of useful
> defaults could be saved. But here's the real test, given that you're an
> intended user, would you use the -l switch or just make a local change
> to the script like Martin showed?
FWIW, we could at least extract a url from the .config of the git
repository with a command like "git remote -v show oe-core-pull-request"
Cheers,
Richard
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] create-pull-request: Add -l location switch
2011-05-11 17:03 ` Richard Purdie
@ 2011-05-11 18:28 ` Darren Hart
0 siblings, 0 replies; 8+ messages in thread
From: Darren Hart @ 2011-05-11 18:28 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 05/11/2011 10:03 AM, Richard Purdie wrote:
> On Tue, 2011-05-10 at 16:01 -0700, Tom Rini wrote:
>> On 05/10/2011 12:18 PM, Otavio Salvador wrote:
>>> On Tue, May 10, 2011 at 15:55, Tom Rini <tom_rini@mentor.com> wrote:
>>>> Add a -l switch that takes an argument of either github or gitorious
>>>> and will make the cover letter have a fill-in-the-blank of where the
>>>> changes are on either github or gitorious.
>>>
>>> Another possibility would be to use git config interface to store
>>> those. You might have something like:
>>>
>>> [oe-core-pull-request]
>>> mode = github
>>> user = foo
>>>
>>> or
>>>
>>> [oe-core-pull-request]
>>> mode = gitorious
>>> user = bar
>>>
>>> This could be used to fill the fields in a proper way since those are
>>> predictable.
>>
>> If I had a good bit more time, I might re-write the script in python and
>> parse .ini files (same syntax as gitconfig) so that lots of useful
>> defaults could be saved. But here's the real test, given that you're an
>> intended user, would you use the -l switch or just make a local change
>> to the script like Martin showed?
>
> FWIW, we could at least extract a url from the .config of the git
> repository with a command like "git remote -v show oe-core-pull-request"
It just depends on specific naming... hrm... or we could specify the
remote on the command line instead of the full URL. That would make the
specification each time much less onerous.
We would have to rewrite 'ssh://git@' to 'git://' for some URLs as I
suspect most users don't have different push/fetch URLs (I don't).
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] create-pull-request: Add -l location switch
2011-05-10 23:01 ` Tom Rini
2011-05-11 6:02 ` Martin Jansa
2011-05-11 17:03 ` Richard Purdie
@ 2011-05-12 0:55 ` Otavio Salvador
2 siblings, 0 replies; 8+ messages in thread
From: Otavio Salvador @ 2011-05-12 0:55 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, May 10, 2011 at 20:01, Tom Rini <tom_rini@mentor.com> wrote:
> On 05/10/2011 12:18 PM, Otavio Salvador wrote:
>> On Tue, May 10, 2011 at 15:55, Tom Rini <tom_rini@mentor.com> wrote:
>>> Add a -l switch that takes an argument of either github or gitorious
>>> and will make the cover letter have a fill-in-the-blank of where the
>>> changes are on either github or gitorious.
>>
>> Another possibility would be to use git config interface to store
>> those. You might have something like:
>>
>> [oe-core-pull-request]
>> mode = github
>> user = foo
>>
>> or
>>
>> [oe-core-pull-request]
>> mode = gitorious
>> user = bar
>>
>> This could be used to fill the fields in a proper way since those are
>> predictable.
>
> If I had a good bit more time, I might re-write the script in python and
> parse .ini files (same syntax as gitconfig) so that lots of useful
> defaults could be saved. But here's the real test, given that you're an
> intended user, would you use the -l switch or just make a local change
> to the script like Martin showed?
(devel)~/hacking/el/openembedded-core% git config --add --path
oe-pull-request.mode github
(devel)~/hacking/el/openembedded-core% git config --get oe-pull-request.mode
github
This does the trick! ;-)
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] create-pull-request: Add -l location switch
2011-05-10 19:18 ` Otavio Salvador
2011-05-10 23:01 ` Tom Rini
@ 2011-05-11 5:43 ` Darren Hart
1 sibling, 0 replies; 8+ messages in thread
From: Darren Hart @ 2011-05-11 5:43 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 05/10/2011 12:18 PM, Otavio Salvador wrote:
> On Tue, May 10, 2011 at 15:55, Tom Rini <tom_rini@mentor.com> wrote:
>> Add a -l switch that takes an argument of either github or gitorious
>> and will make the cover letter have a fill-in-the-blank of where the
>> changes are on either github or gitorious.
>
> Another possibility would be to use git config interface to store
> those. You might have something like:
>
> [oe-core-pull-request]
> mode = github
> user = foo
>
> or
>
> [oe-core-pull-request]
> mode = gitorious
> user = bar
>
> This could be used to fill the fields in a proper way since those are
> predictable.
I was going to suggest something similar.
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-05-12 0:58 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-10 18:55 [PATCH] create-pull-request: Add -l location switch Tom Rini
2011-05-10 19:18 ` Otavio Salvador
2011-05-10 23:01 ` Tom Rini
2011-05-11 6:02 ` Martin Jansa
2011-05-11 17:03 ` Richard Purdie
2011-05-11 18:28 ` Darren Hart
2011-05-12 0:55 ` Otavio Salvador
2011-05-11 5:43 ` Darren Hart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox