grm

git repo manager for self-hosted git servers
git clone git://sink.krj.st/grm
Log | Files | Refs | README | LICENSE

commit bf984ddb645e8a4da3106cf7ab3d11832c71d63d
parent e99e7b93f5271eba961d8784a8ad55dc66004478
Author: krasjet <nil@krj.st>
Date:   Mon, 13 Jul 2020 05:32:25 -0700

rc: sort repos before building index

Diffstat:
Mgrm | 22++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/grm b/grm @@ -55,14 +55,14 @@ rebuild_index() { mkdir -p "${web_root}" || return 1; # 1. find all directories in $repos_root ending with .git # 2. filter all the public repos (with git-daemon-export-ok) - # 3. run stagit-index on the result - # 4. export result to index.html - find "${repos_root}/." ! -name . -prune \ - -type d -name "*.git" \ - \( \ - -exec test -e "{}/git-daemon-export-ok" \; \ - -exec stagit-index {} + \ - \) > "${web_root}/index.html" + # 3. sort the result + # 4. run stagit-index on the result + # 5. export result to index.html + find "${repos_root}/." ! -name . -prune \ + -type d -name "*.git" \ + -exec test -e "{}/git-daemon-export-ok" \;\ + -print | \ + sort | xargs stagit-index > "${web_root}/index.html" echo "[index] done!" } @@ -145,10 +145,8 @@ grm_list() { public) find "${repos_root}/." ! -name . -prune \ -type d -name "*.git" \ - \( \ - -exec test -e "{}/git-daemon-export-ok" \; \ - -exec basename {} '.git' \; \ - \) ;; + -exec test -e "{}/git-daemon-export-ok" \; \ + -exec basename {} '.git' \; ;; private) find "${repos_root}/." ! -name . -prune \ -type d -name "*.git" \