mail.sh: improve show_new_revisions other branches handling
When showing new revisions for a branch, mail.sh excludes all
revisions that already appear in other branches. To do this
it needs to specify "--not" <all-the-other-branch-tips>.
Previously it was passing all the other branch tips on the
command line which fails (by exceeding the command line length
limit) in a repository with thousands of branches.
Fix this by using a different mechanism to generate the "--not"
list that uses standard input and avoids the problem.
When computing the other branch tips, it's necessary to exclude
the current branch being processed. Previously this was done
with a simple "grep -v -F $current_branch". Unfortunately that
excludes too much when the current branch is, for example,
"refs/heads/foo" and there's another branch named "refs/heads/foobar".
The problem is using -F "$current_branch" instead of
"^$current_branch$". But the latter would require escaping of any
regex characters to be used safely.
Fix this by switching to awk as the branch name can be passed in
without needing to be escaped and easily used to discard only
full matches. There is a POSIX grep option that could fix this
as well (-x), but since grep turns out to run just a bit slower
than awk (or sed) we use the awk solution instead.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>