feat: use git-replay for rebasing (#7527)

Closes #7525

This is better for performance, because it can do more work in-memory. It also preserves unknown headers, which can be important for some clients. For example, Jujutsu uses a non-standard "change-id" header to track commits across rebase and amend, but regular git-rebase drops such unknown headers.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7527
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Remo Senekowitsch <remo@buenzli.dev>
Co-committed-by: Remo Senekowitsch <remo@buenzli.dev>
This commit is contained in:
Remo Senekowitsch 2025-04-29 20:51:56 +00:00 committed by Gusted
parent 32e64ccd34
commit ec076e66d8
4 changed files with 94 additions and 18 deletions

View file

@ -123,7 +123,7 @@ func TestSyncConfigGPGFormat(t *testing.T) {
t.Run("Old version", func(t *testing.T) {
oldVersion, err := version.NewVersion("2.33.0")
require.NoError(t, err)
defer test.MockVariableValue(&gitVersion, oldVersion)()
defer test.MockVariableValue(&GitVersion, oldVersion)()
require.ErrorContains(t, syncGitConfig(), "ssh signing requires Git >= 2.34.0")
})