list only dirty repos
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
04e5b38887
commit
f1fbbb3c19
7
Makefile
7
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
|
||||
|
||||
|
|
7
http.go
7
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" {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue