sm-discuss AT lists.ibiblio.org
Subject: Public SourceMage Discussion List
List archive
[SM-Discuss] update-history: a script for very-very-lazy gurus
- From: Ismael Luceno <ismael.luceno AT gmail.com>
- To: sm-discuss AT lists.ibiblio.org
- Subject: [SM-Discuss] update-history: a script for very-very-lazy gurus
- Date: Sun, 30 Mar 2008 08:25:57 -0300
Hi lazy people (if you're not lazy, don't read this e-mail :P).
The following script will make your life even easier, updating
HISTORY for you. Next week I will write a script to tie the laces of
your shoes :P.
#!/bin/sh
[ $# = 0 ] && {
echo "Usage: $0 <msg> [file]..."
exit
}
MSG="$1"; shift
DATE="`date --rfc-3339=date`"
NAME="`git-config --get user.name`"
EMAIL="`git-config --get user.email`"
PREVDIR=
FILES=
{ git-ls-files -m -d "$@"; echo; } | while read FILE; do
DIR="`dirname "$FILE"`"
if [ -n "$PREVDIR" -a "$PREVDIR" != "$DIR" ]; then
mv "$PREVDIR/HISTORY" "$PREVDIR/HISTORY.old"
FILES="`echo "$FILES" | sed 's/^, //'`"
cat > "$PREVDIR/HISTORY" << EOF
$DATE $NAME <$EMAIL>
* $FILES: $MSG
EOF
cat "$PREVDIR/HISTORY.old" >> "$PREVDIR/HISTORY"
rm -f "$PREVDIR/HISTORY.old"
FILES=
fi
FILES="$FILES, `basename "$FILE"`"
PREVDIR="$DIR"
done
--
Ismael Luceno
Attachment:
signature.asc
Description: PGP signature
-
[SM-Discuss] update-history: a script for very-very-lazy gurus,
Ismael Luceno, 03/30/2008
- Re: [SM-Discuss] update-history: a script for very-very-lazy gurus, Andraž 'ruskie' Levstik, 03/30/2008
-
Re: [SM-Discuss] update-history: a script for very-very-lazy gurus,
Jaka Kranjc, 03/30/2008
-
Re: [SM-Discuss] update-history: a script for very-very-lazy gurus,
Ismael Luceno, 03/30/2008
- Re: [SM-Discuss] update-history: a script for very-very-lazy gurus, Andraž 'ruskie' Levstik, 03/30/2008
-
Re: [SM-Discuss] update-history: a script for very-very-lazy gurus,
Ismael Luceno, 03/30/2008
Archive powered by MHonArc 2.6.24.