add debugging printf's

This commit is contained in:
Jeff Carr 2025-07-08 15:48:59 -05:00
parent d0616fae03
commit 1c43978294
2 changed files with 17 additions and 2 deletions

11
http.go
View File

@ -17,7 +17,11 @@ func httpPost(url string, data []byte) ([]byte, error) {
var req *http.Request var req *http.Request
req, err = http.NewRequest(http.MethodPost, url, bytes.NewBuffer(data)) req, err = http.NewRequest(http.MethodPost, url, bytes.NewBuffer(data))
// log.Info("httpPost() with len", len(data), "url", url) log.Info("httpPost() with len", len(data), "url", url)
if err != nil {
log.Error(err)
return nil, err
}
usr, _ := user.Current() usr, _ := user.Current()
req.Header.Set("author", usr.Username) req.Header.Set("author", usr.Username)
@ -38,6 +42,7 @@ func httpPost(url string, data []byte) ([]byte, error) {
return body, err return body, err
} }
log.Info("gitpb.httpPost() worked", url)
return body, nil return body, nil
} }
@ -53,8 +58,10 @@ func (r *Repos) SubmitReposPB(url string) (*Repos, error) {
log.Info("httpPost() failed:", err) log.Info("httpPost() failed:", err)
return nil, err return nil, err
} }
log.Info("httpPost() worked with url:", url, "len(body) =", len(body))
if err := r.Unmarshal(body); err != nil { if err := r.Unmarshal(body); err != nil {
log.Info("Unmarshal() failed:", err) log.Info("SubmitReposPB() Unmarshal() failed:", err)
log.Printf("%s\n", body)
return nil, err return nil, err
} }

View File

@ -11,6 +11,13 @@ import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb" timestamppb "google.golang.org/protobuf/types/known/timestamppb"
) )
// redo this. use go-git2 ?
func (repo *Repo) allCommits() error {
return nil
}
/*
// this is dumb
func (repo *Repo) AllCommits() error { func (repo *Repo) AllCommits() error {
// tags := []string{"cd", "%(creatordate)", "%(*authordate)", "%(refname)", "%(subject)"} // tags := []string{"cd", "%(creatordate)", "%(*authordate)", "%(refname)", "%(subject)"}
// format := strings.Join(tags, "_,,,_%") // format := strings.Join(tags, "_,,,_%")
@ -27,6 +34,7 @@ func (repo *Repo) AllCommits() error {
repo.Times.NewestCommit = timestamppb.New(tmp) repo.Times.NewestCommit = timestamppb.New(tmp)
return nil return nil
} }
*/
// reload the tags // reload the tags
func (repo *Repo) reloadGitTags() error { func (repo *Repo) reloadGitTags() error {