From f1fbbb3c199abc0c233d92831088cff0cce86831 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 4 Nov 2024 06:16:52 -0600 Subject: [PATCH] list only dirty repos Signed-off-by: Jeff Carr --- Makefile | 7 +++++++ http.go | 7 +++++++ simpleRelease.go | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 77c790d..a42023b 100644 --- a/Makefile +++ b/Makefile @@ -49,12 +49,19 @@ redomod: curl-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 --silent http://localhost:9419/list?perfect=false +# include repos that you probably can't git push commits curl-list-include-readonly: curl --silent http://localhost:9419/list?readonly=true +# list every repo found curl-gitpull-everypackage: curl --silent http://localhost:9419/gitpull diff --git a/http.go b/http.go index a3780ad..6d64a0c 100644 --- a/http.go +++ b/http.go @@ -93,6 +93,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if route == "/list" { readonly := r.URL.Query().Get("readonly") + onlydirty := r.URL.Query().Get("onlydirty") perfect := r.URL.Query().Get("perfect") var count int @@ -102,6 +103,12 @@ func okHandler(w http.ResponseWriter, r *http.Request) { count += 1 header := repo.StandardHeader() + if onlydirty == "true" { + if repo.CheckDirty() { + msg(w, header+"") + } + continue + } if repo.ReadOnly() { if readonly == "true" { diff --git a/simpleRelease.go b/simpleRelease.go index 684b634..881bc26 100644 --- a/simpleRelease.go +++ b/simpleRelease.go @@ -24,7 +24,7 @@ func simpleRelease(w http.ResponseWriter, r *http.Request) { // git pull (or go-clone of it doesn't exist) repo := me.repos.View.FindRepoByName(repoName) if repo == nil { - msg(w, "repo unknown: " + repoName) + msg(w, "repo unknown: "+repoName) return } header := repo.StandardHeader()