Skip to content

feat: add ability to push and fetch stacked diffs metadata

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you can request access to GitLab Duo.

Add ability to push and fetch stacked diffs metadata

Problem to solve

Currently, reviewers cannot easily check out a diff stack locally because the ref entries in $GIT_DIR/refs/stacked/ do not follow the established ref format of containing a single git object reference.

Proposal

This PR refactors the entries in $GIT_DIR/refs/stacked to point to a git object created via git hash-object. The stored git object can be pushed upstream, and the refs can be pushed and fetched using git push and git fetch.

Implementation details

  1. Modified Stack struct in stack_struct.go to include a MetadataHash field.
  2. Updated CreateStack function in stacked.go to create a Git object for stack metadata using git hash-object.
  3. Added PushStackMetadata and FetchStackMetadata functions to stack_struct.go for pushing and fetching stack metadata.
  4. Updated relevant tests in stack_struct_test.go and stacked_test.go.

Related Issues

Fixes #7631

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading