git-remote-entire: unify git protocol agent and HTTP User-Agent · Entire

git-remote-entire: unify git protocol agent and HTTP User-Agent

6684735→main·

pjbgf·1mo ago·1 file·+10 added/-9 removed

The previous commit stamped the HTTP User-Agent with versioninfo.Version while the git protocol agent kept its prior versioninfo.Commit format, leaving two different identifiers for the same binary. Use the version-stamped form for both — server-side log analysis can correlate git protocol agent and HTTP access-log entries without translation, and the conventional binary/version shape matches what the rest of the entire HTTP clients advertise.

Assisted-by: Claude Opus 4.7 noreply@anthropic.com Signed-off-by: Paulo Gomes paulo@entire.io

Sessions

730d0e755ea2View transcript

Changes

1

66 unmodified lines

67
68
69
70
71
72
73
74
75
76
70
71
72
73
74
75
76
77
78
79
78
79
80
81
82
83

66 unmodified lines

return 128
    
    // Build info drives the identifiers the helper advertises upstream:
    // githelper.Agent rides in the git protocol pkt-line agent= capability
    // (commit-stamped, since that's what git's existing tooling expects);
    // httpUserAgent rides in the HTTP User-Agent header on every outbound
    // request so the server can attribute traffic in access logs
    // (version-stamped, to match the conventional binary/version form
    // used by the rest of the entire HTTP clients).
    // Build info drives the identifier the helper advertises upstream.
    // One string covers both surfaces:
    //   - githelper.Agent rides in the git protocol pkt-line agent=
    //     capability appended to upload-pack / receive-pack / v2 requests.
    //   - httpUserAgent rides in the HTTP User-Agent header on every
    //     outbound request so server access logs can attribute traffic.
    // Using the same value keeps the two log surfaces correlatable.
    versioninfo.Load()
    githelper.Agent = remotehelper.BinaryName + "/" + versioninfo.Commit
    httpUserAgent := remotehelper.BinaryName + "/" + versioninfo.Version
    helperAgent := remotehelper.BinaryName + "/" + versioninfo.Version
    githelper.Agent = helperAgent
    httpUserAgent := helperAgent

rawURL := args[2]
    parsedURL, err := url.Parse(rawURL)