blob: 167b363668b8b53d752d5971798d3ca26c8f7f1f [file] [log] [blame]
Junio C Hamanoe6fc2342005-08-25 00:28:18 -07001#!/bin/sh
2
3cat <<\EOF
Thomas Ackermann48a8c262013-01-21 20:16:20 +01004Git Howto Index
Junio C Hamanoe6fc2342005-08-25 00:28:18 -07005===============
6
7Here is a collection of mailing list postings made by various
Thomas Ackermann2de9b712013-01-21 20:17:53 +01008people describing how they use Git in their workflow.
Junio C Hamanoe6fc2342005-08-25 00:28:18 -07009
10EOF
11
12for txt
13do
Elia Pintof25f5e62014-04-16 10:29:45 -070014 title=$(expr "$txt" : '.*/\(.*\)\.txt$')
15 from=$(sed -ne '
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070016 /^$/q
17 /^From:[ ]/{
18 s///
19 s/^[ ]*//
20 s/[ ]*$//
21 s/^/by /
22 p
Junio C Hamanof358c102005-08-26 12:35:51 -070023 }
Elia Pintof25f5e62014-04-16 10:29:45 -070024 ' "$txt")
Junio C Hamanof358c102005-08-26 12:35:51 -070025
Elia Pintof25f5e62014-04-16 10:29:45 -070026 abstract=$(sed -ne '
Junio C Hamanof358c102005-08-26 12:35:51 -070027 /^Abstract:[ ]/{
28 s/^[^ ]*//
29 x
30 s/.*//
31 x
32 : again
33 /^[ ]/{
34 s/^[ ]*//
35 H
36 n
37 b again
38 }
39 x
40 p
41 q
Elia Pintof25f5e62014-04-16 10:29:45 -070042 }' "$txt")
Junio C Hamanof358c102005-08-26 12:35:51 -070043
Junio C Hamano8d0991d2005-08-29 22:38:12 -070044 if grep 'Content-type: text/asciidoc' >/dev/null $txt
45 then
Elia Pintof25f5e62014-04-16 10:29:45 -070046 file=$(expr "$txt" : '\(.*\)\.txt$').html
Junio C Hamano8d0991d2005-08-29 22:38:12 -070047 else
48 file="$txt"
49 fi
50
51 echo "* link:$file[$title] $from
Junio C Hamanof358c102005-08-26 12:35:51 -070052$abstract
53
54"
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070055
56done