[PATCH] Add "Date" field while creating patches from commits
[guilt.git] / guilt-export
blob810665a4eae757b41d87cf2da0366c10ddaa4b4a
1 #!/bin/sh
3 # Copyright (c) Pierre Habouzit, 2007
6 USAGE="[<target_dir>]"
7 if [ -z "$GUILT_VERSION" ]; then
8 echo "Invoking `basename "$0"` directly is no longer supported." >&2
9 exit 1
12 _main() {
14 if [ $# -gt 1 ]; then
15 usage
17 target_dir=${1:-"patches"}
19 if [ -e "$target_dir" ]; then
20 die "Specified directory already exists"
23 trap "rm -rf \"$target_dir\"" 0
24 mkdir -p "$target_dir"
26 get_full_series | tee "$target_dir/series" | while read p; do
27 silent mkdir -p "`dirname $target_dir/$p`" || true
28 cp "$GUILT_DIR/$branch/$p" "$target_dir/$p"
29 done
31 trap - 0
32 disp "Series exported to \"$target_dir\" sucessfully."