diff options
author | Leif Lindholm <leif.lindholm@linaro.org> | 2017-01-23 11:55:28 +0000 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2017-01-23 11:55:28 +0000 |
commit | 7b03728c501f92a6e386c3c83b3583a46af89b6b (patch) | |
tree | faed3bdefd5c9d43c30c9c59aedd1fbc73997863 | |
parent | 8c8bfc6263e81242ea51f1f9e304078dda70e149 (diff) |
add edk2-to-git-am.sh
SMTP strips <CR>, unix2dos/tofrodos put them back in, but git am
barfs at /dev/null<CR> - meaning any added or deleted files.
So add a script that creates something to keep git am happy.
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
-rwxr-xr-x | edk2-to-git-am.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/edk2-to-git-am.sh b/edk2-to-git-am.sh new file mode 100755 index 0000000..d3f8a27 --- /dev/null +++ b/edk2-to-git-am.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Convert one or more git patches that have had it's CR:s stripped out by SMTP +# into something th + +if [ $# -lt 1 ]; then + echo "usage: `basename $0` <filename>" >&2 + exit 1 +fi + +convert_file() +{ + sed -i "s/$/\r/g" "$1" + sed -i "s:^\(---\|+++ \)\(.*\)\r$:\1\2:g" "$1" +} + +while [ $# -gt 0 ]; do + convert_file "$1" + shift +done |