list only dirty repos

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-04 06:16:52 -06:00
parent 04e5b38887
commit f1fbbb3c19
3 changed files with 15 additions and 1 deletions

View File

@ -49,12 +49,19 @@ redomod:
curl-help: curl-help:
curl --silent http://localhost:9419/help curl --silent http://localhost:9419/help
# only show repos that git reports as dirty
curl-list-dirty:
curl --silent http://localhost:9419/list?onlydirty=true
# only show repos that need to be merged to the master branch
curl-list-changed: curl-list-changed:
curl --silent http://localhost:9419/list?perfect=false curl --silent http://localhost:9419/list?perfect=false
# include repos that you probably can't git push commits
curl-list-include-readonly: curl-list-include-readonly:
curl --silent http://localhost:9419/list?readonly=true curl --silent http://localhost:9419/list?readonly=true
# list every repo found
curl-gitpull-everypackage: curl-gitpull-everypackage:
curl --silent http://localhost:9419/gitpull curl --silent http://localhost:9419/gitpull

View File

@ -93,6 +93,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
if route == "/list" { if route == "/list" {
readonly := r.URL.Query().Get("readonly") readonly := r.URL.Query().Get("readonly")
onlydirty := r.URL.Query().Get("onlydirty")
perfect := r.URL.Query().Get("perfect") perfect := r.URL.Query().Get("perfect")
var count int var count int
@ -102,6 +103,12 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
count += 1 count += 1
header := repo.StandardHeader() header := repo.StandardHeader()
if onlydirty == "true" {
if repo.CheckDirty() {
msg(w, header+"")
}
continue
}
if repo.ReadOnly() { if repo.ReadOnly() {
if readonly == "true" { if readonly == "true" {

View File

@ -24,7 +24,7 @@ func simpleRelease(w http.ResponseWriter, r *http.Request) {
// git pull (or go-clone of it doesn't exist) // git pull (or go-clone of it doesn't exist)
repo := me.repos.View.FindRepoByName(repoName) repo := me.repos.View.FindRepoByName(repoName)
if repo == nil { if repo == nil {
msg(w, "repo unknown: " + repoName) msg(w, "repo unknown: "+repoName)
return return
} }
header := repo.StandardHeader() header := repo.StandardHeader()