1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

Allow schhist2web and friends to run from a directory outside the working tree.

- scripts/gitenealogy: now requires the repository directory to be passed
- scripts/schhist2web: adapted for above change
- scripts/schhist2web: change to the repository's directory before each
  call to git
- scripts/Makefile: added demo upload and Xue build
- scripts/Makefile (all): added usage information
This commit is contained in:
Werner Almesberger
2010-08-27 19:32:52 -03:00
parent 627d7d790b
commit d7d95ff2da
3 changed files with 49 additions and 12 deletions

View File

@@ -14,15 +14,30 @@
usage()
{
echo "usage: $0 path" 2>&1
cat <<EOF 2>&1
usage: $0 repo-dir path
The file to trace must be at repo-dir/path
EOF
exit 1
}
[ -z "$1" -o ! -z "$2" ] && usage
[ ! -f "$1" ] && usage
if [ -z "$2" -o ! -z "$3" ]; then
usage
fi
git log --follow --name-status "$1" |
if [ ! -d "$1" -o ! -d "$1/.git" ]; then
echo "no git repository at $1" 1>&2
exit 1
fi
if [ ! -f "$1/$2" ]; then
echo "cannot find $2" 2>&1
exit 1
fi
cd "$1" || exit
git log --follow --name-status "$2" |
awk '
/^commit /{ if (c) print c, n; c = $2 }
{ if (NF) n = $(NF) }