mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-26 14:45:20 +02:00
c10d643c1f
- scripts/gitsch2ppm: extract schematics as PPM files from a specfific git revision - scripts/gitenealogy: show the commit history of a file, tracking renames - scripts/ppmdiff/Makefile, scripts/ppmdiff/ppmdiff.c: compare two PPM files and highlight differences - scripts/schhist2web: generate a browseable graphical revision history of schematics
30 lines
660 B
Bash
Executable File
30 lines
660 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()
|
|
{
|
|
echo "usage: $0 path" 2>&1
|
|
exit 1
|
|
}
|
|
|
|
|
|
[ -z "$1" -o ! -z "$2" ] && usage
|
|
[ ! -f "$1" ] && usage
|
|
|
|
git log --follow --name-status "$1" |
|
|
awk '
|
|
/^commit /{ if (c) print c, n; c = $2 }
|
|
{ if (NF) n = $(NF) }
|
|
END { if (c) print c, n; }'
|