#!/bin/bash

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

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

#set -xv

cd $WINESRC || exit 1

(git ls-files '*En.rc' | while read En; do
    # Janitorial patches done by me are not a stop condition.
    last=$(git log --reverse --format=%H:%an ..origin "$En" | grep -v Stefaniuc | cut -d: -f1 | 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)
    git ls-files --with-tree=origin '*.rc' | grep "^$dir" | grep -P -v '(En|rsrc|version(16)?).rc' |
	    xargs git log --pretty="tformat:%ct %H %s" ..$last --
done) | sort -n | cut -d " " -f 2-
