* [RFC] Script for isolating maintainer email.
@ 2013-07-13 7:40 Alexandru Juncu
2013-07-13 8:01 ` Borislav Petkov
0 siblings, 1 reply; 4+ messages in thread
From: Alexandru Juncu @ 2013-07-13 7:40 UTC (permalink / raw)
Cc: alexj, linux-kernel
Hello!
I found the need for a script that doesn't require me to copy part of the
output from get_maintainer.pl into git send-email and could do both with
one command.
I don't know if there is something similar already implemented. If there is,
please point me to it. If not, maybe somebody finds it useful.
Used on top of get_maintainer.pl, it generates the list of
emails required for git send-email.
The output can be used as a process expansion into the arguments of
git send-email. Example:
git send-email $(scripts/get_email.sh my.patch) my.patch
Signed-off-by: Alexandru Juncu <alexj@rosedu.org>
---
scripts/get_email.sh | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100755 scripts/get_email.sh
diff --git a/scripts/get_email.sh b/scripts/get_email.sh
new file mode 100755
index 0000000..a71d56d
--- /dev/null
+++ b/scripts/get_email.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+if [ -e scripts/get_maintainer.pl ]; then
+ if [ $# -lt 1 ]; then
+ echo "Script needs a patch file as a parameter."
+ exit 1
+fi
+
+ IFS=$'\n'
+ for line in $(scripts/get_maintainer.pl $1); do
+ email_regexp="\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b"
+ email=$(grep -E -o $email_regexp<<<$line)
+ if [ $(grep "maintainer" <<< $line) ]; then
+ list="$list --to $email"
+ else
+ list="$list --cc $email"
+ fi
+ done
+ echo $list
+
+else
+ echo "You should run this from the root of the source tree."
+ exit 1
+fi
--
1.7.10.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] Script for isolating maintainer email.
2013-07-13 7:40 [RFC] Script for isolating maintainer email Alexandru Juncu
@ 2013-07-13 8:01 ` Borislav Petkov
2013-07-13 8:05 ` Alexandru Juncu
0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2013-07-13 8:01 UTC (permalink / raw)
To: Alexandru Juncu; +Cc: linux-kernel
On Sat, Jul 13, 2013 at 10:40:41AM +0300, Alexandru Juncu wrote:
> Hello!
>
> I found the need for a script that doesn't require me to copy part of the
> output from get_maintainer.pl into git send-email and could do both with
> one command.
What's wrong with adding this to get_maintainer.pl itself? I.e.,
git send-email --cc-cmd=./scripts/get_maintainer.pl my.patch ...
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] Script for isolating maintainer email.
2013-07-13 8:01 ` Borislav Petkov
@ 2013-07-13 8:05 ` Alexandru Juncu
2013-07-13 8:17 ` Borislav Petkov
0 siblings, 1 reply; 4+ messages in thread
From: Alexandru Juncu @ 2013-07-13 8:05 UTC (permalink / raw)
To: Borislav Petkov; +Cc: linux-kernel
On 13 July 2013 11:01, Borislav Petkov <bp@alien8.de> wrote:
> On Sat, Jul 13, 2013 at 10:40:41AM +0300, Alexandru Juncu wrote:
>> Hello!
>>
>> I found the need for a script that doesn't require me to copy part of the
>> output from get_maintainer.pl into git send-email and could do both with
>> one command.
>
> What's wrong with adding this to get_maintainer.pl itself? I.e.,
>
> git send-email --cc-cmd=./scripts/get_maintainer.pl my.patch ...
Nothing wrong at all. It's just that, to my shame, I don't know Perl.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] Script for isolating maintainer email.
2013-07-13 8:05 ` Alexandru Juncu
@ 2013-07-13 8:17 ` Borislav Petkov
0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2013-07-13 8:17 UTC (permalink / raw)
To: Alexandru Juncu; +Cc: linux-kernel
On Sat, Jul 13, 2013 at 11:05:04AM +0300, Alexandru Juncu wrote:
> Nothing wrong at all. It's just that, to my shame, I don't know Perl.
Now would be the right time to get your feet wet :-)
>From quickly skimming over it, it is almost ready:
./scripts/get_maintainer.pl --email --norolestats <patch>
gives you already the email addresses. What it would need is simply
adjusting the output to what --cc-cmd expects.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-13 8:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-13 7:40 [RFC] Script for isolating maintainer email Alexandru Juncu
2013-07-13 8:01 ` Borislav Petkov
2013-07-13 8:05 ` Alexandru Juncu
2013-07-13 8:17 ` Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®