echo $(git log --oneline HEAD~100..HEAD | grep "${1}" | awk {'print $1'})
}
+# Remove "Name" if present in email address. Needed because of a bug in
+# get_maintainer.pl even if we specify the "--non" option.
+# Arg #1: "Name <email>" or "email"
+format_email()
+{
+ local mail="${1}"
+
+ if echo "${mail}" | grep -q '<'; then
+ mail=$(echo ${mail} | sed "s@.*<\(.*\)>@\1@")
+ else
+ mail="${mail}"
+ fi
+
+ echo "${mail}"
+}
+
# Because the cover letter is a special case and not a real patch, running
# get_maintainer.pl on it would not return any TO or CC addresses.
# Therefore, manually run get_maintainer.pl on the concatenation of all the
CC_MAIL="$(${CC_CMD} /tmp/all.patch)"
while IFS= read -r line; do
+ line=$(format_email "${line}")
TO_OPTS="${TO_OPTS} --to ${line}"
done <<< "${TO_MAIL}"
while IFS= read -r line; do
+ line=$(format_email "${line}")
CC_OPTS="${CC_OPTS} --cc ${line}"
done <<< "${CC_MAIL}"
}