submitting-patches.rst , Linux kernel leverages
./scripts/get_maintainer.pl to get the maintainers of corresponding patches or kernel files. To be specify, this script takes a patch as input and gives back a list of email addresses. These email addresses are usually passed to git send-email  for patch submission.
However, it is really troublesome to copy email address into
After searching online, I found two great command options of
--to-cmd <str> * Email To: via `<str> $patch_path` --cc-cmd <str> * Email Cc: via `<str> $patch_path`
--to-cmd specifies a command to execute once per patch file which should generate patch file specific “To:” email addresses. Output of this command must be single email address per line. Default is the value of sendemail.tocmd configuration value.
The same to
--cc-cmd, except that the former is for “To:” and the latter is for “CC:”.
What to to next is to copy the following lines into
[sendemail] tocmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback --norolestats --nol" cccmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback --norolestats --nom"
Finally, when I need to submit a patch, just type the following command:
git send-email 0001-ieee802154-hwsim-Fix-memory-leak-in-hwsim_add_one.patch