diff --git a/cmd/bd/docs.md b/cmd/bd/docs.md index 78a80f05..5da85135 100644 --- a/cmd/bd/docs.md +++ b/cmd/bd/docs.md @@ -69,6 +69,7 @@ The CLI is built on the Cobra framework and consists of command implementations **Fallback Resolution Chain** (important for development): - The `resolveCommitHash()` function first checks the ldflag, then checks runtime build info, returning empty if neither is available +- The `resolveBranch()` function checks ldflags, then build info's vcs.branch - it does NOT spawn git subprocesses (GH#1zonaz: prevents contention under high concurrency) - This allows the version command to work even in development environments where ldflags aren't set (useful for testing) **Testing Coverage** (`@/cmd/bd/version_test.go`): @@ -85,6 +86,6 @@ The CLI is built on the Cobra framework and consists of command implementations **Platform-Specific Considerations**: - The git extraction in Makefile uses POSIX shell constructs compatible with bash on all platforms - Windows builds via goreleaser set ldflags identically to Unix platforms -- The `symbolic-ref` fallback in resolveBranch works reliably even in fresh repos with no commits +- Branch info comes from build-time ldflags or vcs.branch in build info - no runtime git calls (GH#1zonaz) Created and maintained by Nori.