GitLabgitlab-org

cli

main
ply8 git calls239 ms103 KiB5 cachedprotocol v2
420 lines16 KiBRaw
1package status
3import (
4 "context"
5 "errors"
6 "fmt"
7 "slices"
8 "strings"
9 "time"
11 "github.com/MakeNowJust/heredoc/v2"
12 "github.com/spf13/cobra"
13 "golang.org/x/oauth2"
15 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
17 "gitlab.com/gitlab-org/cli/internal/api"
18 "gitlab.com/gitlab-org/cli/internal/cmdutils"
19 "gitlab.com/gitlab-org/cli/internal/config"
20 "gitlab.com/gitlab-org/cli/internal/dbg"
21 "gitlab.com/gitlab-org/cli/internal/glinstance"
22 "gitlab.com/gitlab-org/cli/internal/iostreams"
23 "gitlab.com/gitlab-org/cli/internal/mcpannotations"
26type options struct {
27 hostname string
28 showToken bool
29 all bool
30 outputFormat string
32 defaultHostname string
33 httpClientOverride func(token, hostname string) (*api.Client, error) // used in tests to mock http client
34 io *iostreams.IOStreams
35 apiClient func(repoHost string) (*api.Client, error)
36 config func() config.Config
39func NewCmdStatus(f cmdutils.Factory, runE func(*options) error) *cobra.Command {
40 opts := &options{
41 io: f.IO(),
42 apiClient: f.ApiClient,
43 config: f.Config,
44 defaultHostname: f.DefaultHostname(),
45 }
47 cmd := &cobra.Command{
48 Use: "status",
49 Args: cobra.NoArgs,
50 ValidArgsFunction: cobra.NoFileCompletions,
51 Short: "View authentication status.",
52 Long: heredoc.Docf(`
53 Verifies and displays information about your authentication state.
55 By default, this command checks the authentication state of the GitLab instance
56 determined by your current context (%[1]sgit remote%[1]s, %[1]sGITLAB_HOST%[1]s environment variable,
57 or configuration). To check all configured instances, use %[1]s--all%[1]s.
58 To check a specific instance, use %[1]s--hostname%[1]s.
59 `, "`"),
60 Example: heredoc.Doc(`
61 # Check authentication status for the instance in your current context
62 glab auth status
64 # Check authentication status for all configured instances
65 glab auth status --all
67 # Check authentication status for a specific instance
68 glab auth status --hostname gitlab.example.com
70 # Display the authentication token alongside the status
71 glab auth status --show-token
73 # Print the authentication status of all configured instances as JSON
74 glab auth status --all --output json
75 `),
76 Annotations: map[string]string{
77 mcpannotations.Safe: "true",
78 },
79 RunE: func(cmd *cobra.Command, args []string) error {
80 if err := opts.validate(); err != nil {
81 return err
82 }
83 if runE != nil {
84 return runE(opts)
85 }
87 return opts.run(cmd.Context())
88 },
89 }
91 cmd.Flags().StringVarP(&opts.hostname, "hostname", "", "", "Check the authentication status of a specific instance.")
92 cmd.Flags().BoolVarP(&opts.showToken, "show-token", "t", false, "Display the authentication token.")
93 cmd.Flags().BoolVarP(&opts.all, "all", "a", false, "Check the authentication status of all configured instances.")
95 cmdutils.EnableJSONOutput(cmd, opts.io, &opts.outputFormat)
97 cmd.MarkFlagsMutuallyExclusive("all", "hostname")
99 return cmd
102type hostStatus struct {
103 Host string `json:"host"`
104 State string `json:"state"`
105 User string `json:"user,omitempty"`
106 Error string `json:"error,omitempty"`
107 TokenSource string `json:"token_source,omitempty"`
108 GitProtocol string `json:"git_protocol,omitempty"`
109 APIProtocol string `json:"api_protocol,omitempty"`
110 APIEndpoint string `json:"api_endpoint"`
111 GraphQLEndpoint string `json:"graphql_endpoint"`
112 Subfolder string `json:"subfolder,omitempty"`
113 SSHHost string `json:"ssh_host,omitempty"`
114 Warnings []string `json:"warnings,omitempty"`
117func (o *options) validate() error {
118 if o.showToken && o.outputFormat == "json" {
119 return &cmdutils.FlagError{Err: errors.New("--show-token cannot be used with --output json")}
120 }
121 return nil
124func (o *options) run(ctx context.Context) error {
125 c := o.io.Color()
126 cfg := o.config()
128 statusInfo := map[string][]string{}
130 instances, err := cfg.Hosts()
131 if len(instances) == 0 || err != nil {
132 return fmt.Errorf("no GitLab instances have been authenticated with glab; run `%s` to authenticate", c.Bold("glab auth login"))
133 }
135 // Determine which host(s) to check
136 // Priority: --hostname flag > --all flag > defaultHostname (from GITLAB_HOST/git remote)
137 if o.hostname == "" && !o.all {
138 // No explicit flags, use default hostname if it's not gitlab.com
139 // This means GITLAB_HOST or git remote has set a specific host
140 if o.defaultHostname != glinstance.DefaultHostname {
141 o.hostname = o.defaultHostname
142 }
143 // else: hostname stays empty, will check all instances (backward compatible)
144 }
146 if o.hostname != "" && !slices.Contains(instances, o.hostname) {
147 return fmt.Errorf("%s %s has not been authenticated with glab; run `%s %s` to authenticate", c.FailedIcon(), o.hostname, c.Bold("glab auth login --hostname"), c.Bold(o.hostname))
148 }
150 failedAuth := false
151 var hosts []hostStatus
152 for _, instance := range instances {
153 if o.hostname != "" && o.hostname != instance {
154 continue
155 }
156 hosts = append(hosts, hostStatus{Host: instance, State: "success"})
157 hs := &hosts[len(hosts)-1]
158 statusInfo[instance] = []string{}
159 addMsg := func(x string, ys ...any) {
160 statusInfo[instance] = append(statusInfo[instance], fmt.Sprintf(x, ys...))
161 }
163 token, tokenSource, tokenErr := cfg.GetWithSource(instance, "token", true)
164 apiClient, err := o.apiClient(instance)
165 if o.httpClientOverride != nil {
166 apiClient, _ = o.httpClientOverride(token, instance)
167 }
168 switch {
169 case tokenErr != nil:
170 // A read failure here is a real keyring error (locked, denied, or
171 // unavailable); surface it instead of proceeding with an empty token
172 // and a confusing 401.
173 failedAuth = true
174 hs.State, hs.Error = "error", fmt.Sprintf("could not read the token: %s", tokenErr)
175 addMsg("%s %s: could not read the token: %s", c.FailedIcon(), instance, tokenErr)
176 case err == nil:
177 authCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
178 user, resp, err := apiClient.Lab().Users.CurrentUser(gitlab.WithContext(authCtx))
179 cancel()
180 if err != nil {
181 failedAuth = true
182 hs.State, hs.Error = "error", sanitizeAuthError(err)
183 addMsg("%s %s: API call failed: %s", c.FailedIcon(), instance, hs.Error)
184 if resp != nil && resp.StatusCode == 401 && slices.Contains(config.EnvKeyEquivalence("token"), tokenSource) {
185 // An environment token is sent as a PAT even when the host is
186 // configured for OAuth, unless GLAB_IS_OAUTH2 says otherwise.
187 // Say so before the advice below, which assumes the token
188 // itself is wrong rather than the scheme it is sent with.
189 isOAuth2Cfg, isOAuth2Source, isOAuth2Err := cfg.GetWithSource(instance, "is_oauth2", true)
190 if isOAuth2Err != nil {
191 dbg.Debugf("could not read is_oauth2 for %s, skipping the scheme hint: %v", instance, isOAuth2Err)
192 }
193 if isOAuth2Cfg == "true" && !slices.Contains(config.EnvKeyEquivalence("is_oauth2"), isOAuth2Source) {
194 addMsg(" %s %s is configured for OAuth, but the token from %s is sent as a personal access token. If it is an OAuth token, set %s.",
195 c.WarnIcon(), instance, tokenSource, c.Bold("GLAB_IS_OAUTH2=true"))
196 }
197 addMsg(" %s Token is from environment variable %s. A wrapper may be injecting a different or expired token.", c.WarnIcon(), tokenSource)
198 addMsg(" %s To investigate, run %s: an alias such as 'op plugin run -- glab' means a wrapper (for example, a 1Password shell plugin) is injecting the token; a plain path rules that out.", c.WarnIcon(), c.Bold("type glab"))
199 addMsg(" %s To see the token value in use, run: %s", c.WarnIcon(), c.Bold("env | grep -E 'GITLAB_TOKEN|GITLAB_ACCESS_TOKEN|OAUTH_TOKEN'"))
200 }
201 } else {
202 hs.User = user.Username
203 addMsg("%s Logged in to %s as %s (%s)", c.GreenCheck(), instance, c.Bold(user.Username), tokenSource)
204 }
205 default:
206 failedAuth = true
207 hs.State, hs.Error = "error", fmt.Sprintf("failed to initialize api client: %s", err)
208 addMsg("%s %s: failed to initialize api client: %s", c.FailedIcon(), instance, err)
209 }
210 proto, _ := cfg.Get(instance, "git_protocol")
211 if proto != "" {
212 addMsg("%s Git operations for %s configured to use %s protocol.",
213 c.GreenCheck(), instance, c.Bold(proto))
214 }
215 apiProto, _ := cfg.Get(instance, "api_protocol")
216 apiHost, _ := cfg.Get(instance, "api_host")
217 subfolder, _ := cfg.Get(instance, "subfolder")
218 sshHost, _ := cfg.Get(instance, "ssh_host")
219 apiEndpoint := glinstance.APIEndpoint(instance, apiProto, apiHost, subfolder)
220 graphQLEndpoint := glinstance.GraphQLEndpoint(instance, apiProto, apiHost, subfolder)
221 hs.GitProtocol, hs.APIProtocol, hs.Subfolder, hs.SSHHost = proto, apiProto, subfolder, sshHost
222 hs.APIEndpoint, hs.GraphQLEndpoint = apiEndpoint, graphQLEndpoint
223 if apiProto != "" {
224 addMsg("%s API calls for %s are made over %s protocol.",
225 c.GreenCheck(), instance, c.Bold(apiProto))
226 addMsg("%s REST API Endpoint: %s",
227 c.GreenCheck(), c.Bold(apiEndpoint))
228 addMsg("%s GraphQL Endpoint: %s",
229 c.GreenCheck(), c.Bold(graphQLEndpoint))
230 }
231 if subfolder != "" {
232 addMsg("%s Subfolder: %s", c.GreenCheck(), c.Bold(subfolder))
233 }
234 if sshHost != "" {
235 addMsg("%s SSH Host: %s", c.GreenCheck(), c.Bold(sshHost))
236 }
237 // Skip the token-presence report when the read itself failed: the error
238 // is already shown above, and "No token found" would be misleading since
239 // the token was not simply absent.
240 if tokenErr == nil {
241 if api.IsTokenConfigured(token) {
242 hs.TokenSource = string(tokenSourceKind(tokenSource))
243 tokenDisplay := "**************************"
244 if o.showToken {
245 tokenDisplay = token
246 }
247 addMsg("%s Token found in %s: %s", c.GreenCheck(), tokenStorageDescription(tokenSource), tokenDisplay)
249 // Nudge users whose credentials are still stored as plaintext in the
250 // config file toward the keyring, which is now the default on login.
251 if isPlaintextTokenSource(tokenSource) {
252 addMsg("%s To store this token more securely, run %s to move it into the operating system keyring.",
253 c.WarnIcon(), c.Bold("glab auth login --hostname "+instance))
254 if config.SnapConfined() {
255 addMsg(" Under snap confinement, first run %s to grant keyring access.",
256 c.Bold(config.SnapConnectCommand))
257 }
258 }
259 } else {
260 hs.TokenSource = tokenSourceNone
261 addMsg("%s No token found (checked config file, keyring, and environment variables).", c.WarnIcon())
262 }
263 }
264 // Only worth saying when a token is actually stored: without one, the
265 // messages above already tell the user to log in again.
266 if tokenErr != nil || !api.IsTokenConfigured(token) {
267 continue
268 }
269 if msg, ok := incompleteOAuth2Warning(cfg, instance); ok {
270 hs.Warnings = append(hs.Warnings, msg)
271 addMsg("%s %s", c.WarnIcon(), msg)
272 addMsg(" To clear it, run %s.", c.Bold("glab auth login --hostname "+instance))
273 }
274 }
276 if o.outputFormat == "json" {
277 if err := o.io.PrintJSON(struct {
278 Hosts []hostStatus `json:"hosts"`
279 }{hosts}); err != nil {
280 return err
281 }
282 if failedAuth {
283 return cmdutils.SilentError
284 }
285 return nil
286 }
288 for _, instance := range instances {
289 if o.hostname != "" && o.hostname != instance {
290 continue
291 }
293 lines, ok := statusInfo[instance]
294 if !ok {
295 continue
296 }
297 o.io.LogErrorf("%s\n", c.Bold(instance))
298 for _, line := range lines {
299 o.io.LogErrorf(" %s\n", line)
300 }
301 }
303 envToken, envTokenSource := config.GetFromEnvWithSource("token")
304 if envToken != "" {
305 o.io.LogErrorf("\n%s Token is from environment variable %s. This takes precedence over tokens stored in config or keyring.\n", c.WarnIcon(), envTokenSource)
306 o.io.LogErrorf(" Run %s to find the source: an alias such as 'op plugin run -- glab' means a wrapper (for example, a 1Password shell plugin) is injecting it, which is expected and needs no action.\n", c.Bold("type glab"))
307 o.io.LogErrorf(" A plain path means it is set in your environment (for example, a shell profile such as ~/.bashrc or ~/.zshrc, or a CI/CD variable); remove it there so glab uses your stored credentials.\n")
308 }
310 if failedAuth {
311 return fmt.Errorf("\n%s could not authenticate to one or more of the configured GitLab instances", c.FailedIcon())
312 } else {
313 return nil
314 }
317// sanitizeAuthError returns a concise message for authentication errors. When
318// the OAuth token endpoint returns a non-2XX response without a structured
319// error (for example, an HTML 500 error page), golang.org/x/oauth2 embeds the
320// entire response body in the error string, which floods the terminal with
321// unhelpful markup. In that case, replace the body-containing portion with a
322// message that reports only the HTTP status, while preserving any surrounding
323// context added by an outer wrapper. Structured OAuth errors and all other
324// errors are already concise, so they are returned unchanged.
325func sanitizeAuthError(err error) string {
326 var retrieveErr *oauth2.RetrieveError
327 if errors.As(err, &retrieveErr) && retrieveErr.ErrorCode == "" {
328 status := "unknown status"
329 if retrieveErr.Response != nil {
330 status = retrieveErr.Response.Status
331 }
332 sanitized := fmt.Sprintf("oauth2: cannot fetch token: %s", status)
333 // A nil Response would make retrieveErr.Error() (and thus err.Error())
334 // panic, so return the sanitized message directly in that case.
335 // Otherwise swap only the noisy inner error string so that context from
336 // any outer wrapper (e.g. "token refresh: ...") is retained.
337 if retrieveErr.Response == nil {
338 return sanitized
339 }
340 return strings.Replace(err.Error(), retrieveErr.Error(), sanitized, 1)
341 }
342 return err.Error()
345// keyringTokenSource is the source label returned by the config layer when a
346// token is read from the operating system keyring.
347const keyringTokenSource = "keyring"
349// tokenSourceNone is reported in JSON output when no token is stored for a host.
350const tokenSourceNone = "none"
352// tokenKind is the storage class of a token, as reported in the JSON
353// token_source field.
354type tokenKind string
356const (
357 tokenKindKeyring tokenKind = "keyring"
358 tokenKindEnvironment tokenKind = "environment"
359 tokenKindConfigFile tokenKind = "config_file"
362// tokenSourceKind is the single place that classifies a config-layer token
363// source, so the text and JSON output cannot disagree about where a token lives.
364func tokenSourceKind(tokenSource string) tokenKind {
365 switch {
366 case tokenSource == keyringTokenSource:
367 return tokenKindKeyring
368 case slices.Contains(config.EnvKeyEquivalence("token"), tokenSource):
369 return tokenKindEnvironment
370 default:
371 return tokenKindConfigFile
372 }
375// tokenStorageDescription returns a human-readable description of where a
376// token was read from, for display in status output.
377func tokenStorageDescription(tokenSource string) string {
378 switch tokenSourceKind(tokenSource) {
379 case tokenKindKeyring:
380 return "operating system keyring"
381 case tokenKindEnvironment:
382 return "environment variable " + tokenSource
383 default:
384 return "configuration file (plaintext)"
385 }
388// incompleteOAuth2Warning reports a host configured for OAuth with no refresh
389// token stored. Nothing else in status catches this: GitLab accepts a personal
390// access token sent as a Bearer credential, so the API call above succeeds and
391// the host looks healthy. An is_oauth2 from the environment is left alone —
392// that is a tool driving glab with its own access token, by design.
393func incompleteOAuth2Warning(cfg config.Config, instance string) (string, bool) {
394 isOAuth2, isOAuth2Source, err := cfg.GetWithSource(instance, "is_oauth2", true)
395 if err != nil {
396 dbg.Debugf("could not read is_oauth2 for %s, skipping the incomplete-OAuth check: %v", instance, err)
397 return "", false
398 }
399 if isOAuth2 != "true" || slices.Contains(config.EnvKeyEquivalence("is_oauth2"), isOAuth2Source) {
400 return "", false
401 }
403 refreshToken, err := cfg.Get(instance, "oauth2_refresh_token")
404 if err != nil {
405 dbg.Debugf("could not read oauth2_refresh_token for %s, skipping the incomplete-OAuth check: %v", instance, err)
406 return "", false
407 }
408 if refreshToken != "" {
409 return "", false
410 }
412 return fmt.Sprintf("%s is configured for OAuth, but no refresh token is stored, so the token cannot be renewed when it expires. Either GitLab rejected the refresh token, or the host was switched to a personal access token without logging out.", instance), true
415// isPlaintextTokenSource reports whether the token was read from the plaintext
416// configuration file (rather than the keyring or an environment variable), in
417// which case status suggests migrating it to the keyring.
418func isPlaintextTokenSource(tokenSource string) bool {
419 return tokenSourceKind(tokenSource) == tokenKindConfigFile
Diagnostics8 git calls · 239 ms
CallStatusSizeTime0239 ms
discover200185 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=1
git.response.bytes=185
git.server.agent=git/2.56.g1891de4-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=185
git.pkt.payload.max=35
ls-refs20058 KiB2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=59849
git.response.cache=UPDATING
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=731
git.pkt.data=730
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=59849
git.pkt.payload.max=143
git.ls_refs.count=730
git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 1020032 KiB · hit1 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=32926
git.response.cache=HIT
git.response.duration_ms=1
git.fetch.filter=tree:0
git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=22
git.pkt.data=20
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=32926
git.pkt.payload.max=32046
git.sideband.band1.bytes=32046
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=80
git.pack.bytes=32046
git.pack.ofs_delta=36
git.pack.ref_delta=0
git.pack.chain.max=2
git.pack.trailer=cb0bad5d7ffc514895d8b21c4dd470327f90bc91
git.pack.full=44
Open pack map
fetchcombine:blob:none+tree:2 · deepen 12004.2 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=4273
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=combine:blob:none+tree:2
git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9
git.fetch.haves.count=0
git.fetch.deepen=1
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=4273
git.pkt.payload.max=4173
git.sideband.band1.bytes=4173
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=11
git.pack.bytes=4173
git.fetch.wide.objects=11
git.fetch.wide.extra_bytes=3930
git.fetch.wide.blobs=0
fetchtree:02001.8 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=1857
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=dce174ff8c632a19d17eea99c8a9b7c37fb2b592
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1857
git.pkt.payload.max=1830
git.sideband.band1.bytes=1830
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=1830
git.pack.trailer=fb03183b7909876778f740d196d7516811003517
Open pack map
fetchtree:0200358 B · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=358
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=5d783fac547a70b19ca138c47d067b44febb52da
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=358
git.pkt.payload.max=331
git.sideband.band1.bytes=331
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=331
git.pack.trailer=22a484e5ecad6d6e62b224e8a7f90cf5ff085938
Open pack map
fetchtree:0200138 B · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=226
git.response.bytes=138
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=b38d427eef3c1bdf03b9bb1ffc35513757d9e4fb
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=138
git.pkt.payload.max=111
git.sideband.band1.bytes=111
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=111
git.pack.trailer=22a22237517c18d88fa31b3ca9eb8b9b5bfc1afa
Open pack map
fetch2005.5 KiB226 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=5589
git.response.cache=MISS
git.response.duration_ms=226
git.fetch.wants=8524c9d85f4d80425d2a37ede815436a4dc08deb
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=5589
git.pkt.payload.max=5562
git.sideband.band1.bytes=5562
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://gitlab.com/gitlab-org/cli
Ref
refs/heads/main
Commit
0dd7574dce9e385c5c30540e6c15657adc6bdce9
cf-ray
a5e2c9ada8a94b67
Request
66b4f6bc…
Protocol
v2 · sha1
Agent
git/2.56.g1891de4-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format