[go: up one dir, main page]

Skip to content

Use `git replay` in our rebase implementation

Our rebase implementation in https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/git/localrepo/rebase.go currently works like this:

  • we use git rev-list to get a pick-only todo_list for a rebase,
  • we scan the todo_list,
  • we use git merge-tree to merge the tree of each commit in the todo_list
  • we create a commit on top of each merged tree using git commit-tree.

While this works well, doesn't require a working tree and allows us to not use libgit2/git2go, this is quite inefficient and requires a lot of custom code.

Now that git replay has be merged and released in Git 2.44.0 (February 2024), we can start using it to replace all the above steps.

/cc @jcaigitlab

Edited by Christian Couder
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information