Remove git version from .patch endpoints for reproducible patches
In an effort to make Arch Linux build reproducible they would like to add URLs to patches hosted in GitLab to their package sources.
To be clear, we are talking about links like these (randomly picked samples):
https://gitlab.com/gitlab-org/gitlab/-/commit/32becd9315e85d53f919e5f04000c3839aabc015.patch
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32730.patch
Right now, these URLs render a static diff but append the git version of the host. This is variable. So in case of an update of the gitaly host, the hash of the served patch would change.
Current patch (shortened)
From: foobar
Subject: subject
Body
---
doc/user/profile/index.md | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/doc/user/profile/index.md b/doc/user/profile/index.md
index 3610a2122b25..61d0a8e460ad 100644
--- a/doc/user/profile/index.md
+++ b/doc/user/profile/index.md
@@ -250,7 +250,27 @@ When the `_gitlab_session` expires or isn't available,
[... actual diff ...]
--
2.26.2
Requested patch (shortened)
From: foobar
Subject: subject
Body
---
doc/user/profile/index.md | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/doc/user/profile/index.md b/doc/user/profile/index.md
index 3610a2122b25..61d0a8e460ad 100644
--- a/doc/user/profile/index.md
+++ b/doc/user/profile/index.md
@@ -250,7 +250,27 @@ When the `_gitlab_session` expires or isn't available,
[... actual diff ...]
--
As proposed via Slack (GitLab internal) we should remove this git version to make the output patch generate the same hash regardless of the git version the gitaly host runs.
Notably, GitHub does not include the git version in their patch-files either.
cc @stanhu
cc @anthraxx @eschwartz
Edited by Zeger-Jan van de Weg