shithub: shithub

Download patch

ref: 653a66db903cea4e30c1958a3fe4050876404e01
parent: 5dfaaeae031cb1feb118a1121266d87f214af3b4
author: Ori Bernstein <[email protected]>
date: Sun Nov 29 21:35:27 EST 2020

list: show user name headers

There were a lot of repos on shithub (Thanks sigrid),
so it was getting harder to scan for a single user.
Add usernames when listing user dirs, for simpler
scanning of the list.

--- a/shithub
+++ b/shithub
@@ -84,9 +84,14 @@
 case 'list'
 	rfork m
 	prelude Repolist
-	echo '	<h1>Repos</h1>
-		<dl>'
+	echo '	<h1>Repos</h1>'
+	udir=()
 	for(repo in `$nl{ls */}){
+		ndir=`{basename -d $repo}
+		if(! ~ $udir $ndir){
+			echo '<h3>'$ndir'</h3>'
+			echo '<dl>'
+		}
 		if(test -e $repo/.git/webpublish){
 			echo '<dt><a href="/git/'$repo'/HEAD/info.html">'$repo'</a></dt>'
 			echo '<dd>'
@@ -97,6 +102,10 @@
 			if not
 				echo 'code some guy wrote'
 			echo '</dd>'
+		}
+		if(! ~ $udir $ndir){
+			echo '</dl>'
+			udir=$ndir
 		}
 	}
 	echo '</dl>'