Skip to content

Add ability to push and fetch stacked diffs metadata

Problem to solve

As a reviewer, it's very helpful to check out a diff stack locally. However, the current implementation does not allow for this to happen. This is because the ref entries in $GIT_DIR/refs/stacked/ do not follow the established ref format of containing a single git object reference. For example,

Proposal

Refactor the entries in $GIT_DIR/refs/stacked to point to a git object that has been 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.

Further details

You can push the stack metadata using git push origin '+refs/stacked/*:refs/stacked/*' and fetch them by simply changing push to fetch.

Links / references

  • git-hash-object
  • git-cat-file
  • git-notes - can be used as an alternative to git-hash-object. Instead, we can annotate a blob with the stack metadata.
  • git-prune - we'll eventually need a way to remove these blobs from the repository and avoid adding "keep arounds" (unreachable objects that bloat a repository). This command could be used to remove these blobs once a branch is merged. Needs to be explored further.
  • The Refspec - referenced by git push and git fetch
Edited by Oscar Tovar
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information