GitLabgitlab-org

cli

main
ply8 git calls213 ms102 KiB5 cachedprotocol v2
451 lines16 KiBRaw
1package update
3import (
4 "context"
5 "errors"
6 "fmt"
7 "io"
8 "strings"
10 "charm.land/huh/v2"
11 "github.com/MakeNowJust/heredoc/v2"
12 "github.com/spf13/cobra"
14 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
16 "gitlab.com/gitlab-org/cli/internal/api"
17 "gitlab.com/gitlab-org/cli/internal/cmdutils"
18 "gitlab.com/gitlab-org/cli/internal/commands/mr/mrutils"
19 "gitlab.com/gitlab-org/cli/internal/iostreams"
20 "gitlab.com/gitlab-org/cli/internal/mcpannotations"
21 "gitlab.com/gitlab-org/cli/internal/text"
22 "gitlab.com/gitlab-org/cli/internal/utils"
25func NewCmdUpdate(f cmdutils.Factory) *cobra.Command {
26 var attach []string
27 var state string
29 mrUpdateCmd := &cobra.Command{
30 Use: "update [<id> | <branch>]",
31 Short: `Update a merge request.`,
32 Long: heredoc.Docf(`
33 Defaults to the currently checked-out branch. Use %[1]s--fill%[1]s to
34 automatically fill the title and description from the commit history.
36 %[1]s--attach%[1]s uploads a file and references it at the end of the description. Repeat the flag for more than one file, or pass %[1]s-%[1]s to read the file from standard input. Without %[1]s--description%[1]s the references are added to the description the merge request already has, instead of replacing it.
37 %[2]s`, "`", fmt.Sprintf(text.ExperimentalFlagString, "`--attach`")),
38 Example: heredoc.Doc(`
39 # Mark a merge request as ready
40 glab mr update 23 --ready
42 # Mark a merge request as draft
43 glab mr update 23 --draft
45 # Updates the merge request for the current branch
46 glab mr update --draft
48 # Select the open merge request when a branch also has merged requests
49 glab mr update feature-branch --state opened --ready
51 # Update merge request with commit information
52 glab mr update 23 --fill --fill-commit-body --yes
54 # Read the description from a file
55 glab mr update 23 --description-file description.md
57 # Read the description from standard input
58 cat description.md | glab mr update 23 --description-file -
60 # Add a screenshot to the existing description
61 glab mr update 23 --attach ./screenshot.png`),
62 Args: cobra.MaximumNArgs(1),
63 Annotations: map[string]string{
64 mcpannotations.Destructive: "true",
65 },
66 RunE: func(cmd *cobra.Command, args []string) error {
67 var err error
68 var actions []string
69 var ua *cmdutils.UserAssignments // assignees
70 var ur *cmdutils.UserAssignments // reviewers
71 c := f.IO().Color()
73 // Check for autofill flags
74 autofill, _ := cmd.Flags().GetBool("fill")
75 fillCommitBody, _ := cmd.Flags().GetBool("fill-commit-body")
77 if !autofill && fillCommitBody {
78 return &cmdutils.FlagError{Err: errors.New("--fill-commit-body should be used with --fill")}
79 }
81 if cmd.Flags().Changed("unassign") && cmd.Flags().Changed("assignee") {
82 return &cmdutils.FlagError{Err: errors.New("--assignee and --unassign are mutually exclusive")}
83 }
85 // Parse assignees Early so we can fail early in case of conflicts
86 if cmd.Flags().Changed("assignee") {
87 givenAssignees, err := cmd.Flags().GetStringSlice("assignee")
88 if err != nil {
89 return err
90 }
91 ua = cmdutils.ParseAssignees(givenAssignees)
93 err = ua.VerifyAssignees()
94 if err != nil {
95 return &cmdutils.FlagError{Err: fmt.Errorf("--assignee: %w", err)}
96 }
97 }
99 if cmd.Flags().Changed("reviewer") {
100 givenReviewers, err := cmd.Flags().GetStringSlice("reviewer")
101 if err != nil {
102 return err
103 }
104 ur = cmdutils.ParseAssignees(givenReviewers)
105 ur.AssignmentType = cmdutils.ReviewerAssignment
107 err = ur.VerifyAssignees()
108 if err != nil {
109 return &cmdutils.FlagError{Err: fmt.Errorf("--reviewer: %w", err)}
110 }
111 }
113 if cmd.Flags().Changed("lock-discussion") && cmd.Flags().Changed("unlock-discussion") {
114 return &cmdutils.FlagError{
115 Err: errors.New("--lock-discussion and --unlock-discussion can't be used together"),
116 }
117 }
119 if err := cmdutils.ResolveDescriptionFile(f.IO(), cmd); err != nil {
120 return err
121 }
123 client, err := f.GitLabClient()
124 if err != nil {
125 return err
126 }
128 mr, repo, err := mrutils.MRFromArgs(cmd.Context(), f, args, state)
129 if err != nil {
130 return err
131 }
133 l := &gitlab.UpdateMergeRequestOptions{}
134 var mergeTitle string
135 var mergeBody string
137 // Handle autofill functionality
138 if autofill {
139 title, body, err := mrutils.AutofillMRFromCommits(mr.TargetBranch, mr.SourceBranch, fillCommitBody)
140 if err != nil {
141 return fmt.Errorf("failed to autofill MR content: %w", err)
142 }
144 // Check if --yes flag is provided to skip confirmation
145 skipConfirmation, _ := cmd.Flags().GetBool("yes")
147 // Validate that we can prompt if confirmation is needed
148 if !skipConfirmation && !f.IO().IsInteractive() {
149 return &cmdutils.FlagError{
150 Err: errors.New("--yes required with --fill for non-interactive mode"),
151 }
152 }
154 // Show preview and ask for confirmation unless --yes is provided
155 if !skipConfirmation {
156 // Determine what title will be applied
157 var proposedTitle string
158 if cmd.Flags().Changed("title") {
159 var err error
160 proposedTitle, err = cmd.Flags().GetString("title")
161 if err != nil {
162 return err
163 }
164 } else {
165 proposedTitle = title // from autofill
166 }
168 // Determine what description will be applied
169 var proposedDescription string
170 if cmd.Flags().Changed("description") {
171 var err error
172 proposedDescription, err = cmd.Flags().GetString("description")
173 if err != nil {
174 return err
175 }
176 // Special case for editor mode
177 if proposedDescription == "-" {
178 proposedDescription = "(from editor)"
179 }
180 } else {
181 proposedDescription = body // from autofill
182 }
184 writeUpdatePreview(f.IO().StdOut, proposedTitle, proposedDescription)
186 action, err := confirmUpdateSurvey(cmd.Context(), f)
187 if err != nil {
188 // iostreams.Run already prints "Cancelled." for user cancellation
189 if errors.Is(err, iostreams.ErrUserCancelled) {
190 return nil
191 }
192 return err
193 }
195 if action == cmdutils.CancelAction {
196 f.IO().LogInfo("Cancelled.")
197 return nil
198 }
199 }
201 // Only set title and body if not explicitly provided by user
202 if !cmd.Flags().Changed("title") {
203 mergeTitle = title
204 actions = append(actions, "updated title with commit info")
205 }
206 if !cmd.Flags().Changed("description") {
207 mergeBody = body
208 actions = append(actions, "updated body with commit info")
209 }
210 }
212 isDraft, _ := cmd.Flags().GetBool("draft")
213 isWIP, _ := cmd.Flags().GetBool("wip")
214 if m, _ := cmd.Flags().GetString("title"); m != "" {
215 actions = append(actions, fmt.Sprintf("updated title to %q", m))
216 mergeTitle = m
217 }
218 if mergeTitle == "" {
219 mergeTitle = mr.Title
220 }
221 if isDraft || isWIP {
222 var alreadyPresent bool
223 if isDraft {
224 mergeTitle, alreadyPresent = cmdutils.EnsureTitlePrefix(mergeTitle, "Draft:")
225 if alreadyPresent {
226 actions = append(actions, "already a Draft")
227 } else {
228 actions = append(actions, "marked as Draft")
229 }
230 } else {
231 mergeTitle, alreadyPresent = cmdutils.EnsureTitlePrefix(mergeTitle, "WIP:")
232 if alreadyPresent {
233 actions = append(actions, "already a WIP")
234 } else {
235 actions = append(actions, "marked as WIP")
236 }
237 }
238 } else if isReady, _ := cmd.Flags().GetBool("ready"); isReady {
239 actions = append(actions, "marked as ready")
240 mergeTitle = cmdutils.StripTitlePrefixes(mergeTitle)
241 }
243 l.Title = new(mergeTitle)
244 if m, _ := cmd.Flags().GetBool("lock-discussion"); m {
245 actions = append(actions, "locked discussion")
246 l.DiscussionLocked = new(m)
247 }
248 if m, _ := cmd.Flags().GetBool("unlock-discussion"); m {
249 actions = append(actions, "unlocked discussion")
250 l.DiscussionLocked = new(false)
251 }
253 if m, _ := cmd.Flags().GetString("description"); m != "" {
254 actions = append(actions, "updated body")
256 // Edit the body via editor
257 if m == "-" {
258 editor, err := cmdutils.GetEditor(f.Config)
259 if err != nil {
260 return err
261 }
263 l.Description = new("")
264 err = cmdutils.EditorPrompt(cmd.Context(), f.IO(), l.Description, "Body", mr.Description, editor)
265 if err != nil {
266 return err
267 }
268 } else {
269 l.Description = new(m)
270 }
271 } else if mergeBody != "" {
272 // Use autofilled body if available and no explicit body provided
273 l.Description = new(mergeBody)
274 }
276 if len(attach) > 0 {
277 body, err := cmdutils.AppendAttachmentsToUpdate(cmd.Context(), f.IO(), client, repo.FullName(), l.Description, func() (string, error) { return mr.Description, nil }, attach)
278 if err != nil {
279 return err
280 }
282 actions = append(actions, fmt.Sprintf("attached %s", utils.Pluralize(len(attach), "file")))
283 l.Description = &body
284 }
286 if m, _ := cmd.Flags().GetStringSlice("label"); len(m) != 0 {
287 actions = append(actions, fmt.Sprintf("added labels %s", strings.Join(m, " ")))
288 l.AddLabels = (*gitlab.LabelOptions)(&m)
289 }
290 if m, _ := cmd.Flags().GetStringSlice("unlabel"); len(m) != 0 {
291 actions = append(actions, fmt.Sprintf("removed labels %s", strings.Join(m, " ")))
292 l.RemoveLabels = (*gitlab.LabelOptions)(&m)
293 }
294 if m, _ := cmd.Flags().GetString("target-branch"); m != "" {
295 actions = append(actions, fmt.Sprintf("set target branch to %q", m))
296 l.TargetBranch = new(m)
297 }
298 if ok := cmd.Flags().Changed("milestone"); ok {
299 if m, _ := cmd.Flags().GetString("milestone"); m != "" || m == "0" {
300 mID, err := cmdutils.ParseMilestone(client, repo, m)
301 if err != nil {
302 return err
303 }
304 actions = append(actions, fmt.Sprintf("added milestone %q", m))
305 l.MilestoneID = new(mID)
306 } else {
307 actions = append(actions, "unassigned milestone")
308 l.MilestoneID = new(int64(0))
309 }
310 }
311 if cmd.Flags().Changed("unassign") {
312 l.AssigneeIDs = &[]int64{0} // 0 or an empty int[] is the documented way to unassign
313 actions = append(actions, "unassigned all users")
314 }
315 if ua != nil {
316 if len(ua.ToReplace) != 0 {
317 l.AssigneeIDs, actions, err = ua.UsersFromReplaces(client, actions)
318 if err != nil {
319 return err
320 }
321 } else if len(ua.ToAdd) != 0 || len(ua.ToRemove) != 0 {
322 l.AssigneeIDs, actions, err = ua.UsersFromAddRemove(nil, mr.Assignees, client, actions)
323 if err != nil {
324 return err
325 }
326 }
327 }
329 if ur != nil {
330 if len(ur.ToReplace) != 0 {
331 l.ReviewerIDs, actions, err = ur.UsersFromReplaces(client, actions)
332 if err != nil {
333 return err
334 }
335 } else if len(ur.ToAdd) != 0 || len(ur.ToRemove) != 0 {
336 l.ReviewerIDs, actions, err = ur.UsersFromAddRemove(nil, mr.Reviewers, client, actions)
337 if err != nil {
338 return err
339 }
340 }
341 }
343 if removeSource, _ := cmd.Flags().GetBool("remove-source-branch"); removeSource {
345 if mr.ForceRemoveSourceBranch {
346 actions = append(actions, "disabled removal of source branch on merge.")
347 } else {
348 actions = append(actions, "enabled removal of source branch on merge.")
349 }
351 l.RemoveSourceBranch = new(!mr.ForceRemoveSourceBranch)
352 }
354 if squashBeforeMerge, _ := cmd.Flags().GetBool("squash-before-merge"); squashBeforeMerge {
356 if mr.Squash {
357 actions = append(actions, "disabled squashing of commits before merge.")
358 } else {
359 actions = append(actions, "enabled squashing of commits before merge.")
360 }
362 l.Squash = new(!mr.Squash)
363 }
365 f.IO().LogInfof("- Updating merge request !%d\n", mr.IID)
367 mr, err = api.UpdateMR(client, repo.FullName(), mr.IID, l)
368 if err != nil {
369 return err
370 }
372 for _, s := range actions {
373 f.IO().LogInfof("%s %s\n", c.GreenCheck(), s)
374 }
376 f.IO().LogInfo(mrutils.DisplayMR(c, &mr.BasicMergeRequest, f.IO().IsaTTY))
377 return nil
378 },
379 }
381 mrUpdateCmd.Flags().Var(cmdutils.NewEnumValue([]string{"opened", "closed", "merged", "locked", "any"}, "any", &state), "state", "Filter by state when selecting a merge request by branch: opened, closed, merged, locked, any. Ignored for IDs and URLs.")
382 mrUpdateCmd.Flags().BoolP("draft", "", false, "Mark merge request as a draft.")
383 mrUpdateCmd.Flags().BoolP("ready", "r", false, "Mark merge request as ready to be reviewed and merged.")
384 mrUpdateCmd.Flags().BoolP("wip", "", false, "Mark merge request as a work in progress. Alternative to --draft.")
385 mrUpdateCmd.Flags().StringP("title", "t", "", "Title of merge request.")
386 mrUpdateCmd.Flags().BoolP("lock-discussion", "", false, "Lock discussion on merge request.")
387 mrUpdateCmd.Flags().BoolP("unlock-discussion", "", false, "Unlock discussion on merge request.")
388 mrUpdateCmd.Flags().StringP("description", "d", "", "Merge request description. Set to \"-\" to open an editor.")
389 mrUpdateCmd.Flags().StringSliceP("label", "l", []string{}, "Add labels.")
390 mrUpdateCmd.Flags().StringSliceP("unlabel", "u", []string{}, "Remove labels.")
391 mrUpdateCmd.Flags().
392 StringSliceP("assignee", "a", []string{}, "Assign users via username. Prefix with '!' or '-' to remove from existing assignees, '+' to add. Otherwise, replace existing assignees with given users. Multiple usernames can be comma-separated or specified by repeating the flag.")
393 mrUpdateCmd.Flags().
394 StringSliceP("reviewer", "", []string{}, "Request review from users by their usernames. Prefix with '!' or '-' to remove from existing reviewers, '+' to add. Otherwise, replace existing reviewers with given users. Multiple usernames can be comma-separated or specified by repeating the flag.")
395 mrUpdateCmd.Flags().Bool("unassign", false, "Unassign all users.")
396 mrUpdateCmd.Flags().
397 BoolP("squash-before-merge", "", false, "Toggles the option to squash commits into a single commit when merging.")
398 mrUpdateCmd.Flags().BoolP("remove-source-branch", "", false, "Toggles the removal of the source branch on merge.")
399 mrUpdateCmd.Flags().StringP("milestone", "m", "", "Title of the milestone to assign. Set to \"\" or 0 to unassign.")
400 mrUpdateCmd.Flags().String("target-branch", "", "Set target branch.")
402 // Add new autofill flags
403 mrUpdateCmd.Flags().BoolP("fill", "f", false, "Do not prompt for title or body, and just use commit info.")
404 mrUpdateCmd.Flags().Bool("fill-commit-body", false, "Fill body with each commit body when multiple commits. Can only be used with --fill.")
405 mrUpdateCmd.Flags().BoolP("yes", "y", false, "Skip confirmation prompt.")
406 cmdutils.AddDescriptionFileFlag(mrUpdateCmd, "merge request")
407 cmdutils.AddAttachFlag(mrUpdateCmd, &attach, "description")
409 return mrUpdateCmd
412// writeUpdatePreview prints the proposed title and description to w before asking for confirmation.
413// Multi-line values are indented so continuation lines align with the first line of content.
414func writeUpdatePreview(w io.Writer, title, description string) {
415 fmt.Fprintf(w, "\nProposed changes:\n") //nolint:forbidigo // w is a generic io.Writer, exercised directly with a strings.Builder in tests
416 if title != "" {
417 lines := strings.Split(title, "\n")
418 fmt.Fprintf(w, " Title: %s\n", lines[0]) //nolint:forbidigo // w is a generic io.Writer, exercised directly with a strings.Builder in tests
419 for _, line := range lines[1:] {
420 fmt.Fprintf(w, " %s\n", line) //nolint:forbidigo // w is a generic io.Writer, exercised directly with a strings.Builder in tests
421 }
422 }
423 if description != "" {
424 lines := strings.Split(description, "\n")
425 fmt.Fprintf(w, " Description: %s\n", lines[0]) //nolint:forbidigo // w is a generic io.Writer, exercised directly with a strings.Builder in tests
426 for _, line := range lines[1:] {
427 fmt.Fprintf(w, " %s\n", line) //nolint:forbidigo // w is a generic io.Writer, exercised directly with a strings.Builder in tests
428 }
429 }
430 fmt.Fprintf(w, "\n") //nolint:forbidigo // w is a generic io.Writer, exercised directly with a strings.Builder in tests
433func confirmUpdateSurvey(ctx context.Context, f cmdutils.Factory) (cmdutils.Action, error) {
434 shouldProceed := false // default value
436 confirm := huh.NewConfirm().
437 Title("What would you like to do?").
438 Affirmative("Proceed with changes").
439 Negative("Cancel").
440 Value(&shouldProceed)
442 err := f.IO().Run(ctx, confirm)
443 if err != nil {
444 return cmdutils.CancelAction, fmt.Errorf("could not prompt: %w", err)
445 }
447 if shouldProceed {
448 return cmdutils.SubmitAction, nil
449 }
450 return cmdutils.CancelAction, nil
Diagnostics8 git calls · 213 ms
CallStatusSizeTime0213 ms
discover200185 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
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 KiB3 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=3
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 · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=32926
git.response.cache=HIT
git.response.duration_ms=4
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 · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=4273
git.response.cache=HIT
git.response.duration_ms=4
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:0200746 B · hit2 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=746
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=f3d413a22af5a9c2fe9aa49709b1cb36d1351a7f
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=746
git.pkt.payload.max=719
git.sideband.band1.bytes=719
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=719
git.pack.trailer=330baf80c59a4208b55120dff7dd824b7952b790
Open pack map
fetchtree:0200202 B · hit2 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=202
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=fa6643fe030fa248faec6c90791640385205057a
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=202
git.pkt.payload.max=175
git.sideband.band1.bytes=175
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=175
git.pack.trailer=5de59e2c2970b3a7ffbcd12e501883f267881024
Open pack map
fetch2004.4 KiB199 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=199
git.response.bytes=4549
git.response.cache=MISS
git.response.duration_ms=199
git.fetch.wants=bf50da77ea63846b604c6bfe90ae35f6a997a9d1
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=4549
git.pkt.payload.max=4522
git.sideband.band1.bytes=4522
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
a5e2ddb4bd372308
Request
a954b378…
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