#!/bin/sh
LAST=///
find "$@" -type d \( \! -name . -name '.*' -prune -o -print \) |
while read D; do
	case "$D" in
	"$LAST"*) continue ;;
	esac
	if [ -d "$D/.git" ]; then
		LAST=$D
		echo -n "$D	git	"
		echo `< "$D"/.git/config inisane | awk '$1 == "remote_origin_url" { print $2 }'`
	fi
	if [ -d "$D/.hg" ]; then
		LAST=$D
		echo -n "$D	hg	"
		< "$D"/.hg/hgrc sed -n '/^default = /{s/default = //; p;}'
	fi
	if [ -d "$D/.svn" ]; then
		LAST=$D
		echo -n "$D	svn	"
		< "$D"/.svn/entries head -n5 | tail -n1
	fi
	if [ -d "$D/CVS" ]; then
		LAST=$D
		echo -n "$D	cvs	"
		< "$D"/CVS/Root cat
	fi
done
