#!/bin/rc -e . /sys/lib/shithub/common.rc cd $1 shift rfork ne nl=' ' gituser=$1 repo=$2 refname=$3 repons $gituser $repo if(! ref=`{resolveref $refname}){ echo 'invalid ref '$refname'' exit } if(test -f $gitfs/$ref/hash) hash=`{cat $gitfs/$ref/hash} if not hash=$ref user_prelude $gituser $repo $hash # list branches in order of last change branches=`$nl{ls -Qt $gitfs/branch/heads/*/msg} if(! ~ $#branches 0){ echo -n '
branches:' for(b in $branches){ branch=`{basename `{basename -d $b}} if(test -f $gitfs/branch/heads/$branch/hash){ echo -n ' '$branch'' } } echo '' } echo '

Clone

clone: git://'$host/$gituser/$repo' gits://'$host/$gituser/$repo'
push: hjgit://'$host/$gituser/$repo'
' if(test -f $repodir/contact) echo ' patches to: '^`$nl{cat $repodir/contact}^'
' echo '
' if(test -f $gitfs/object/$hash/msg){ echo '

Last commit

' formatcommit $gituser $repo $hash } cd $gitfs/object/$hash/tree descfiles=(README^(.plan9 '' .md) readme^(.plan9 '' .md) desc description) echo '

About

'
done=()
for(f in $descfiles $repodir/^$descfiles)
	if(~ $#done 0 && test -f $f){
		htcat $f
		done=1
	}
if(~ $#done 0)
	echo 'this repo has no description'
echo '
	
'