From: Petr Baudis Date: Mon, 22 Sep 2008 15:44:49 +0000 (+0200) Subject: tg mail: Tidyup X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=commitdiff_plain;h=5fe44ffca84c42baa8c56687dd2a68f2799966f2 tg mail: Tidyup --- diff --git a/README b/README index 719b919..5fe7d09 100644 --- a/README +++ b/README @@ -282,10 +282,9 @@ tg mail patch header. Since it actually boils down to `git send-email` please refer to - it's documentation for details on how to setup email for git. + its documentation for details on how to setup email for git. - - TODO: tg mail patchfile to mail an already exported patch + TODO: 'tg mail patchfile' to mail an already exported patch TODO: mailing patch series TODO: specifying additional options and addresses on command line diff --git a/tg-mail.sh b/tg-mail.sh index f3abd2c..cf68155 100644 --- a/tg-mail.sh +++ b/tg-mail.sh @@ -19,7 +19,6 @@ while [ -n "$1" ]; do esac done -# TODO refactor me into something common? [ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')" base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" || die "not a TopGit-controlled branch" @@ -30,7 +29,7 @@ patchfile="$(mktemp -t tg-mail.XXXXXX)" $tg patch $name >"$patchfile" hlines=$(grep -n -m 1 '^---' "$patchfile" | sed 's/:---//') -header=$(head -$(($hlines - 1)) "$patchfile") +header=$(head -n $(($hlines - 1)) "$patchfile")