Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add script to export to mbox

  • Loading branch information...
commit cd13c317d9c4369dd005c8eca5a1ba1288ada697 1 parent 40e0b8f
@singpolyma authored
Showing with 30 additions and 0 deletions.
  1. +30 −0 bin/git-ticket-export
View
30 bin/git-ticket-export
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+SUBDIRECTORY_OK=1
+if ! . "`git --exec-path`/git-sh-setup"; then
+ exit 1
+fi
+if ! cd_to_toplevel; then
+ exit 1
+fi
+
+mkdir -p .tickets
+cd .tickets
+
+case $1 in
+ mbox)
+ IFS="
+ "
+ for MESSAGE in *; do
+ FROM="`grep -i '^From' "$MESSAGE" | sed -e's/^From:\? *//'`"
+ DATE="`grep -i '^Date' "$MESSAGE" | sed -e's/^Date:\? *//'`"
+ echo "From $FROM $DATE"
+ cat "$MESSAGE"
+ echo
+ done
+ ;;
+ *)
+ echo "Format not supported." 1>&2
+ exit 1
+ ;;
+esac
Please sign in to comment.
Something went wrong with that request. Please try again.