mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-12-23 13:56:47 +02:00
d7d95ff2da
- 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
45 lines
895 B
Bash
Executable File
45 lines
895 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# gitenealogy - Trace the ancestry of a file in git across renames
|
|
#
|
|
# Written 2010 by Werner Almesberger
|
|
# Copyright 2010 Werner Almesberger
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
|
|
|
|
usage()
|
|
{
|
|
cat <<EOF 2>&1
|
|
usage: $0 repo-dir path
|
|
|
|
The file to trace must be at repo-dir/path
|
|
EOF
|
|
exit 1
|
|
}
|
|
|
|
|
|
if [ -z "$2" -o ! -z "$3" ]; then
|
|
usage
|
|
fi
|
|
|
|
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) }
|
|
END { if (c) print c, n; }'
|