Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

knotserver/git: log stderr from failing git subprocesses

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>

author
Anirudh Oppiliappan
committer
Tangled
date (Jun 17, 2026, 11:38 AM +0300) commit f7c606c7 parent b3ee1d8d change-id mrztvrxt
+7 -1
+7 -1
knotserver/git/merge.go
··· 173 173 {"-C", g.path, "config", "advice.mergeConflict", "false"}, 174 174 {"-C", g.path, "config", "advice.amWorkDir", "false"}, 175 175 } { 176 + var cfgStderr bytes.Buffer 176 177 cfgCmd, _ := wrapCmd(exec.Command("git", cfgArgs...)) 177 - cfgCmd.Run() //nolint:errcheck // best-effort config 178 + cfgCmd.Stderr = &cfgStderr 179 + if err := cfgCmd.Run(); err != nil { 180 + log.Printf("git config %v failed (non-fatal): err=%v stderr=%q", cfgArgs, err, cfgStderr.String()) 181 + } 178 182 } 179 183 180 184 // if patch is a format-patch, apply using 'git am' ··· 227 231 228 232 if err := cmd.Run(); err != nil { 229 233 conflicts := parseGitApplyErrors(stderr.String()) 234 + log.Printf("git commit failed: err=%v stderr=%q", err, stderr.String()) 230 235 return &ErrMerge{ 231 236 Message: "patch cannot be applied cleanly", 232 237 Conflicts: conflicts, ··· 293 298 294 299 if err := cmd.Run(); err != nil { 295 300 conflicts := parseGitApplyErrors(stderr.String()) 301 + log.Printf("git am failed: err=%v stderr=%q", err, stderr.String()) 296 302 return plumbing.ZeroHash, &ErrMerge{ 297 303 Message: "patch cannot be applied cleanly", 298 304 Conflicts: conflicts,