Shared publicly  - 
 
Fun script of the day, I can't believe I have lived this long without it. Use at your own risk, and of course, change the last 'grep' to be your name, not mine.

On the other hand, it will keep me from seeing your patches, which might be a nice thing :)

----------------------
$ cat ~/bin/cc-get_maintainer
#!/bin/bash

M=`mktemp ~/tmp/names.XXXXXX` || exit 1
./scripts/get_maintainer.pl --file $1 | cut -f 1 -d '(' | grep '<' | grep -v Kroah > ${M}
while read NAME; do
echo "Cc: ${NAME}"
done < ${M}
rm ${M}
---------------------
13
2
Darren Hart's profile photoMorgawr Havenlost's profile photoRod Nayfield's profile photoCorentin Chary's profile photo
22 comments
 
have you found some clever means to have git call this automagically?
 
I can call it from within my editor when I'm editing the changelog entry. That's probably not what you meant, but surely you aren't automatically creating git commits for the kernel, only crazy people would do that... :)
 
I have things like cc-futex.txt which I pull in while editing the commit log. But like --signoff it would be nice if it could prepopulate the CC list from the maintainers script. Erring on the side of NOT spamming maintainers is of course a good thing though.
 
You want to spam^Wnotify the maintainers so they will apply your patch, it's the "I fixed the spelling of a comment" type people you probably don't want to bother with your patches.
 
I'm amazed no one has reduced this script to one single line of perl/python/ruby/zsh yet, interwebs, you disappoint me!
 
Ah, you didn't ask... and it occurred to me to try... but I was feeling lazy.
 
Is the temp file necessary?

./scripts/get_maintainer.pl --file $1 | cut -f 1 -d '(' | grep '<' | grep -v Kroah | while read NAME; do echo "Cc: ${NAME}"; done
 
+Svend Sorensen no, it isn't at all, thanks, I don't know why I had a temp file there, this originally came from a much larger script with lots of temp files, so I guess that was what I was thinking of at the moment.
 
Was it intentional to skip lines that only contained an email address without "Name <>" decorations? If not, then:

#!/bin/bash
./scripts/get_maintainer.pl --file "$1" | sed '/Kroah/d;s/(.*//;s/^/Cc: /'
 
While I'm not hell bent on POSIX compliance, I agree that $() is much more legible than `` and not so easily confused with the madness that is bash quoting. So I agree with +Fabio Erculiani that $() is the better approach.
 
Honestly, if you can be POSIX compliant with a simple change of a few characters, it would be pointless not to do so...
 
You don't really need the cut, there is "--no-rolestats" for that.
And for those who use git send-email to send mails you can simply use --cc-cmd="./scripts/get_maintainer.pl --no-rolestats"
 
+Thomas Nilsson so any bash doc i've read so far lies? Doc pointers are welcome
Add a comment...