git: 57d9640f3c36 - main - devel/git: fix bug commit-graph requires overflow generation data

From: Matthias Fechner <mfechner_at_FreeBSD.org>
Date: Tue, 07 Jun 2022 05:14:38 UTC
The branch main has been updated by mfechner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=57d9640f3c3669d318865222a743652a6952ba2d

commit 57d9640f3c3669d318865222a743652a6952ba2d
Author:     Matthias Fechner <mfechner@FreeBSD.org>
AuthorDate: 2022-06-06 06:02:05 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2022-06-07 05:14:23 +0000

    devel/git: fix bug  commit-graph requires overflow generation data
    
    Using www/gitlab-ce I see problems that git repositories got broken.
    Gitlab includes some patches for the git binary they build:
    https://gitlab.com/gitlab-org/gitaly/-/tree/master/_support/git-patches
    
    These patches should have no impact to normal git usage but fixes some
    ref handling problems, like:
    https://gitlab.com/gitlab-org/gitaly/-/blob/master/_support/git-patches/v2.36.0.gl1/0006-refs-skip-hooks-when-deleting-uncovered-packed-refs.patch
    
    The problem got visible that at any point it can happen that the repository
    got broken (by merges happen) and if you try to fetch it you get:
    "C:\Program Files\Git\bin\git.exe" pull --progress "origin"
    fatal: commit-graph requires overflow generation data but has none
    fatal: the remote end hung up unexpectedly
    Done
    
    PR:             263867
    Approved by:    garga (maintainer)
---
 devel/git/Makefile | 12 ++++++++++++
 devel/git/distinfo | 14 +++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/devel/git/Makefile b/devel/git/Makefile
index aed68e12257f..fc5ac547eb89 100644
--- a/devel/git/Makefile
+++ b/devel/git/Makefile
@@ -2,6 +2,7 @@
 
 PORTNAME=	git
 DISTVERSION=	2.36.1
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	KERNEL_ORG/software/scm/git
 DISTFILES=	${DISTNAME}${EXTRACT_SUFX} \
@@ -10,6 +11,17 @@ DISTFILES=	${DISTNAME}${EXTRACT_SUFX} \
 EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX} \
 		${PORTNAME}-manpages-${DISTVERSION}${EXTRACT_SUFX}
 
+# these patches are required for gitlab (gitaly)
+# without the patches repositories got broken
+PATCH_SITES=	https://gitlab.com/gitlab-org/gitaly/-/raw/master/_support/git-patches/v2.36.0.gl1/
+PATCHFILES=	0001-refs-extract-packed_refs_delete_refs-to-allow-contro.patch \
+		0002-refs-allow-passing-flags-when-beginning-transactions.patch \
+		0003-refs-allow-skipping-the-reference-transaction-hook.patch \
+		0004-refs-demonstrate-excessive-execution-of-the-referenc.patch \
+		0005-refs-do-not-execute-reference-transaction-hook-on-pa.patch \
+		0006-refs-skip-hooks-when-deleting-uncovered-packed-refs.patch
+PATCH_DIST_STRIP=	-p1
+
 MAINTAINER=	garga@FreeBSD.org
 COMMENT?=	Distributed source code management tool ${COMMENT_${FLAVOR}}
 
diff --git a/devel/git/distinfo b/devel/git/distinfo
index 2ad0cf54fd0e..9007ab73a9f7 100644
--- a/devel/git/distinfo
+++ b/devel/git/distinfo
@@ -1,7 +1,19 @@
-TIMESTAMP = 1652105214
+TIMESTAMP = 1654493758
 SHA256 (git-2.36.1.tar.xz) = 405d4a0ff6e818d1f12b3e92e1ac060f612adcb454f6299f70583058cb508370
 SIZE (git-2.36.1.tar.xz) = 7004044
 SHA256 (git-manpages-2.36.1.tar.xz) = b1e6e651333283bfe2abbdf10baa858f61c5ec9d3caacb30f44888d78d964e6f
 SIZE (git-manpages-2.36.1.tar.xz) = 503680
 SHA256 (git-htmldocs-2.36.1.tar.xz) = f2a44ee1acfc1b8e2ce9a90ae767226c862d5a6596bed0404de70fdef8e67c8d
 SIZE (git-htmldocs-2.36.1.tar.xz) = 1426284
+SHA256 (0001-refs-extract-packed_refs_delete_refs-to-allow-contro.patch) = c9c6b619d43ee49ac9beff22ec722a2a8a6a704a8039dc3de4dbfa1f89f77d34
+SIZE (0001-refs-extract-packed_refs_delete_refs-to-allow-contro.patch) = 5453
+SHA256 (0002-refs-allow-passing-flags-when-beginning-transactions.patch) = 95df2fc83975b5fb0f1ba871163cb9e28319639eea34d1eb5d74dd15ed64f78e
+SIZE (0002-refs-allow-passing-flags-when-beginning-transactions.patch) = 6773
+SHA256 (0003-refs-allow-skipping-the-reference-transaction-hook.patch) = fa115c854db9ee7960a9b0d7a50d9e47024e84d3139bf7fe9fda1fce88766222
+SIZE (0003-refs-allow-skipping-the-reference-transaction-hook.patch) = 1981
+SHA256 (0004-refs-demonstrate-excessive-execution-of-the-referenc.patch) = c102be748305bd569a9546dffb9fb97161fb60924e7cdd9a023226b2c0b3c18c
+SIZE (0004-refs-demonstrate-excessive-execution-of-the-referenc.patch) = 3143
+SHA256 (0005-refs-do-not-execute-reference-transaction-hook-on-pa.patch) = 526b06c57d0acef49feb2a456622c57ed870bfbfcfee1d4daab43a13fd0be9a0
+SIZE (0005-refs-do-not-execute-reference-transaction-hook-on-pa.patch) = 3106
+SHA256 (0006-refs-skip-hooks-when-deleting-uncovered-packed-refs.patch) = 927559891fc520dd3723eb1aad4a2ee4ab8337a14b25bf2f91502eb7904ec181
+SIZE (0006-refs-skip-hooks-when-deleting-uncovered-packed-refs.patch) = 4441