summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-27 11:16:33 -0500
committerJeff Carr <[email protected]>2025-09-27 11:17:35 -0500
commit8d311c65a7583b0da58d2c9870301acdf93ccb0d (patch)
tree94fa94f170c00c209b2c43220a94f2f3f9df67f8
parent80d3e94284766490cfa4dac8e9fb1e6d0c64b360 (diff)
add devel branchesv0.0.55
-rw-r--r--Makefile12
-rw-r--r--argv.go9
-rw-r--r--doRepos.go24
-rw-r--r--handleRepos.go2
4 files changed, 36 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index cbc480b..e392d12 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,8 @@ VERSION = $(shell git describe --tags)
# BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
BUILDTIME = $(shell date +%s)
-all: build
- ./forged repos
+all: install
+ forged repos
build: goimports
GO111MODULE=off go build \
@@ -36,13 +36,13 @@ start:
stop:
-systemctl stop forged.service
-run: build stop
- ./forged --daemon
+run: install stop
+ forged --daemon
# setcap 'cap_net_bind_service=+ep' forged # allow the binary to open ports below 1024
#
-run-clean: build
+run-clean: install
-rm /var/lib/forged/all-patches.pb
- ./forged --daemon
+ forged --daemon
# setcap 'cap_net_bind_service=+ep' forged # allow the binary to open ports below 1024
prod: build
diff --git a/argv.go b/argv.go
index 75385fe..c7576d1 100644
--- a/argv.go
+++ b/argv.go
@@ -39,10 +39,11 @@ type PatchCmd struct {
}
type ReposCmd struct {
- List *EmptyCmd `arg:"subcommand:list" help:"list the repos"`
- Pull *EmptyCmd `arg:"subcommand:pull" help:"'git pull' on the repos"`
- Scan *EmptyCmd `arg:"subcommand:scan" help:"scan the forged repo dir"`
- Fix *EmptyCmd `arg:"subcommand:fix" help:"try to fix the repo PB"`
+ List *EmptyCmd `arg:"subcommand:list" help:"list the repos"`
+ Pull *EmptyCmd `arg:"subcommand:pull" help:"'git pull' on the repos"`
+ Scan *EmptyCmd `arg:"subcommand:scan" help:"scan the forged repo dir"`
+ Fix *EmptyCmd `arg:"subcommand:fix" help:"try to fix the repo PB"`
+ Devel *EmptyCmd `arg:"subcommand:devel" help:"list repos with devel branches"`
// Reload *EmptyCmd `arg:"subcommand:reload" help:"do Reload() on each git repo"`
// Clean *EmptyCmd `arg:"subcommand:clean" help:"clean the repos"`
// Merge *EmptyCmd `arg:"subcommand:merge" help:"merge in new patchsets"`
diff --git a/doRepos.go b/doRepos.go
index f33385d..e65aab7 100644
--- a/doRepos.go
+++ b/doRepos.go
@@ -19,6 +19,17 @@ func doRepos() error {
// return doReposList()
return nil
}
+ if argv.Repos.Devel != nil {
+ found := gitpb.NewRepos()
+ for repo := range me.forge.Repos.IterAll() {
+ if repo.Tags.Devel == nil {
+ continue
+ }
+ found.Append(repo)
+ }
+ me.forge.PrintForgedTable(found)
+ return nil
+ }
if argv.Repos.Scan != nil {
log.Infof("start repos scan repos.Len()=%d %s\n", me.forge.Repos.Len(), me.forge.Config.ReposDir)
@@ -47,6 +58,19 @@ func doRepos() error {
}
continue
}
+ if repo.Tags.Devel == nil {
+ if repo.GetDevelBranchName() == "" {
+ repo.SetDevelBranchName("devel")
+ }
+ if found := repo.GetRemoteTag(repo.GetDevelBranchName()); found != nil {
+ log.Info("found devel tag ", repo.FullPath, found)
+ repo.Tags.Devel = proto.Clone(found).(*gitpb.GitTag)
+ config.SetChanged("repos", true)
+ } else {
+ // log.Info("not found devel tag (Reload() ?)", repo.FullPath)
+ }
+ continue
+ }
}
me.forge.SaveRepos()
/*
diff --git a/handleRepos.go b/handleRepos.go
index 34cb2b5..20cf66c 100644
--- a/handleRepos.go
+++ b/handleRepos.go
@@ -64,7 +64,7 @@ func addRequest(pb *gitpb.Repos, reqPB *httppb.HttpRequest) *gitpb.Repos {
func checkRequest(pb *gitpb.Repos, reqPB *httppb.HttpRequest) *gitpb.Repos {
checkPB := gitpb.NewRepos()
for repo := range pb.IterAll() {
- found := me.forge.Repos.FindByNamespace(repo.Namespace)
+ found := me.forge.PrepareCheckRepo(repo.Namespace)
if found == nil {
// don't know about this
continue