#!/bin/bash
-TARGET=$HOME/linux-next-$$.email
+mail_dir=$(realpath --relative-to=. "$(dirname "$0")/../mails")
+printf -v TARGET '%s/%(i%Y-%m-%d+%s)T.email' "$mail_dir" -1
to="$1"
cc="$2"
subject="$3"
-(
+{
cat <<EOF
To: $to
Cc: $cc
Subject: $subject
-FIXME: Add owner of second tree to To:
- Add author(s)/SOB of conflicting commits.
-
EOF
cat
-) > $TARGET
+} > "$TARGET"
-gvim $TARGET
+gvim "$TARGET"
-echo "When you're finished editing you need to send $TARGET"
+printf 'When you are finished editing you need to send %s\n' "$TARGET"
exit 0