Skip to content

Commit 6684735

Browse files
committed
git-remote-entire: unify git protocol agent and HTTP User-Agent
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> Entire-Checkpoint: 730d0e755ea2
1 parent c9ad967 commit 6684735

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

cmd/git-remote-entire/main.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ func run(args []string) int {
6767
return 128
6868
}
6969

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

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

0 commit comments

Comments
 (0)