#!/bin/bash

# WARNING: The script assumes there is a branch checked out that tracks
#          the "stable" aka wine-1.0 branch.

#WINESRC="$HOME/j/wine/source/wine"
WINESRC="$HOME/work/wine"

#set -xv

cd $WINESRC || exit 1

(find -name \*En.rc | while read En; do
    last=$(git log --reverse --pretty=format:%H ..origin "$En" | head -n 1)
    if [ -n "$last" ]; then
	# The git range specifier includes the boundaries into the range
	last="$last^"
    else
	last="origin"
    fi
    dir=$(dirname $En)
    find "$dir" -name \*.rc | grep -P -v '(En|rsrc|version(16)?).rc' |
	    xargs git log --pretty="tformat:%ct %H %s" ..$last
done) | sort -n | cut -d " " -f 2-
