chiark
/
gitweb
/
~ian
/
topgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
603df20
)
tg mail: Fix $header string construction
author
Petr Baudis
<pasky@suse.cz>
Thu, 25 Sep 2008 16:55:28 +0000
(18:55 +0200)
committer
Petr Baudis
<pasky@suse.cz>
Thu, 25 Sep 2008 16:55:28 +0000
(18:55 +0200)
Prevents e.g. misinterpreting From: line at the body start.
tg-mail.sh
patch
|
blob
|
history
diff --git
a/tg-mail.sh
b/tg-mail.sh
index 24e5f67b2742b8edf6fd6213f58d6546a27e013c..fb686e945a457e08ed00e16a78f40792a2a99443 100644
(file)
--- a/
tg-mail.sh
+++ b/
tg-mail.sh
@@
-29,10
+29,9
@@
base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)"
patchfile="$(mktemp -t tg-mail.XXXXXX)"
-$tg patch
$name
>"$patchfile"
+$tg patch
"$name"
>"$patchfile"
-hlines=$(grep -n -m 1 '^---' "$patchfile" | sed 's/:---//')
-header=$(head -n $(($hlines - 1)) "$patchfile")
+header="$(sed -e '/^$/,$d' "$patchfile")"