docs(v2/config): explain why message-typed fields need explicit required

What

Adds a "Gotchas" section to v2/config/README.md explaining why a message-typed field (like ServerConfig in the Quick Start example) needs an explicit (buf.validate.field).required = true, while scalar fields do not.

Why

option features.field_presence = IMPLICIT only affects presence tracking for scalar fields (string, int32, bool, and similar). A singular message-typed field (ServerConfig, google.protobuf.Duration, google.protobuf.Timestamp, or any other nested message) always tracks explicit presence in Protobuf Editions, regardless of this file-level option — there is no way to turn it off. protovalidate skips a field's constraints whenever the field has presence and is unset, so an omitted message-typed field silently passes validation at its zero value unless it carries an explicit required = true.

The existing Quick Start example already demonstrates the correct pattern (ServerConfig server = 2 [(buf.validate.field).required = true];) but doesn't explain why it's needed there and not on the scalar version field above it. This MR adds that explanation as a general gotcha (not tied to any specific consumer), plus a one-line pointer comment on the example itself.

Changes

  • v2/config/README.md: new "Gotchas" section before "Best Practices"; one-line comment on the Quick Start ServerConfig field.
  • .gitignore: ignore .worktrees/, used for isolated git worktree workspaces during development.

Test plan

Docs-only change, no code affected.

Merge request reports

Loading
Loading