3 # One-shot git importer for Netwalk.
5 # Usage: Extract all tarballs up to 0.4.10 inclusive in some temporary
6 # directory, and then run:
7 # $ export-to-git > /tmp/some_file
8 # Then, in a new subdirectory, run:
9 # $ git init && git fast-import --date-format=rfc2822 < /tmp/some_file
13 echo -n "M 100644 inline "
14 if [[ $1 == "." ]]; then
19 echo "data "$
(stat
-c%s
$2)
29 elif [[ -d $F ]]; then
31 if [[ $1 == "." ]]; then
38 echo WARNING
! NO IDEA WHAT
$F IS
53 echo $LINE >> $TMPFILE
54 if [[ $LINE =~ ^
[A-Z
].
*200.$
]]; then
59 if [ -f $TMPFILE ]; then
64 cp netwalk-0.3
.2/HISTORY bighistory
66 tac netwalk-0.4
.10/NEWS | revnews
>> bighistory
69 # Version numbers don't sort well
70 LIST
="$(ls -d netwalk* | grep -v netwalk-0.4.10) netwalk-0.4.10"
73 if [[ -f HISTORY
]]; then
75 DATE
=$
(grep '^[A-Z]' $HISTFILE |
tail -1)
78 DATE
=$
(grep '^[A-Z]' $HISTFILE |
head -1)
80 echo "commit refs/heads/master
81 committer "Ben Lynn
" <blynn@cs.stanford.edu> $DATE
83 if [[ $LAST == "" ]]; then
86 sed -n '/'$LAST'\.tgz/,/'$DIR'\.tgz/p' < ../bighistory | sed -n '/^$/,$p' | sed -n '/^[A-Z]/,$p'