git: update to 2.36.1

This commit is contained in:
Tom G. Christensen
2022-06-09 21:01:22 +02:00
parent 7fd485a7fd
commit 05d66dae1b
17 changed files with 463 additions and 79 deletions

View File

@@ -0,0 +1,27 @@
From 8f02890504e38cfc218cd424e2fe20c41798773f Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Fri, 3 Jun 2022 21:46:42 +0200
Subject: [PATCH 01/12] Ensure INET_ADDRSTRLEN is defined
---
git-compat-util.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/git-compat-util.h b/git-compat-util.h
index 58fd813bd0..a3fad66633 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -1489,3 +1489,10 @@ void sleep_millisec(int millisec);
int csprng_bytes(void *buf, size_t len);
#endif
+
+#if !defined(INET_ADDRSTRLEN)
+#define INET_ADDRSTRLEN 16
+#endif
+#if !defined(INET6_ADDRSTRLEN) && !defined(NO_IPV6)
+#define INET6_ADDRSTRLEN 46
+#endif
--
2.36.1

View File

@@ -0,0 +1,24 @@
From 348e8a06cc3b26369d2c094b60b9316eb4ef538f Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Sun, 5 Jun 2022 10:45:03 +0200
Subject: [PATCH 02/12] Ensure SCNuMAX is defined
---
git-compat-util.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/git-compat-util.h b/git-compat-util.h
index a3fad66633..668fbdbd0d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -1496,3 +1496,7 @@ int csprng_bytes(void *buf, size_t len);
#if !defined(INET6_ADDRSTRLEN) && !defined(NO_IPV6)
#define INET6_ADDRSTRLEN 46
#endif
+
+#ifndef SCNuMAX
+#define SCNuMAX PRIuMAX
+#endif
--
2.36.1

View File

@@ -0,0 +1,31 @@
From 22d5196f2dd513db37878d4e74efa05c398eb5ab Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Mon, 6 Jun 2022 10:57:29 +0200
Subject: [PATCH 03/12] Update common Solaris settings
---
config.mak.uname | 2 ++
1 file changed, 2 insertions(+)
diff --git a/config.mak.uname b/config.mak.uname
index 259d1511ca..bf9810c6c3 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -175,12 +175,14 @@ ifeq ($(uname_S),SunOS)
SHELL_PATH = /bin/bash
SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
HAVE_ALLOCA_H = YesPlease
+ HAVE_STRINGS_H = YesPlease
NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease
NO_MKDTEMP = YesPlease
NO_REGEX = YesPlease
NO_MSGFMT_EXTENDED_OPTIONS = YesPlease
HAVE_DEV_TTY = YesPlease
+ CC_LD_DYNPATH = -R
ifeq ($(uname_R),5.6)
SOCKLEN_T = int
NO_HSTRERROR = YesPlease
--
2.36.1

View File

@@ -0,0 +1,26 @@
From 59d2b3562ef56097377b02f2a465fb2e211eef36 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Mon, 6 Jun 2022 10:48:27 +0200
Subject: [PATCH 04/12] Use largefile environment on Solaris
See lfcompile(5) on a Solaris host.
---
config.mak.uname | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.mak.uname b/config.mak.uname
index bf9810c6c3..7de4f7c214 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -218,7 +218,7 @@ ifeq ($(uname_S),SunOS)
endif
INSTALL = /usr/ucb/install
TAR = gtar
- BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__
+ BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
ifeq ($(uname_O),Cygwin)
ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
--
2.36.1

View File

@@ -0,0 +1,53 @@
From 9d7ce21df4e14d271eeb0712f78de7cb07c73229 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Mon, 6 Jun 2022 12:02:40 +0200
Subject: [PATCH 05/12] Update settings for Solaris
Solaris 2.6 through 9 (at least) has a "broken" vsnprintf() and an
fopen() that will open directories.
---
config.mak.uname | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/config.mak.uname b/config.mak.uname
index 7de4f7c214..29af78fa33 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -185,6 +185,8 @@ ifeq ($(uname_S),SunOS)
CC_LD_DYNPATH = -R
ifeq ($(uname_R),5.6)
SOCKLEN_T = int
+ FREAD_READS_DIRECTORIES = UnfortunatelyYes
+ SNPRINTF_RETURNS_BOGUS = YesPlease
NO_HSTRERROR = YesPlease
NO_IPV6 = YesPlease
NO_SOCKADDR_STORAGE = YesPlease
@@ -196,6 +198,8 @@ ifeq ($(uname_S),SunOS)
endif
ifeq ($(uname_R),5.7)
NEEDS_RESOLV = YesPlease
+ FREAD_READS_DIRECTORIES = UnfortunatelyYes
+ SNPRINTF_RETURNS_BOGUS = YesPlease
NO_IPV6 = YesPlease
NO_SOCKADDR_STORAGE = YesPlease
NO_UNSETENV = YesPlease
@@ -205,12 +209,16 @@ ifeq ($(uname_S),SunOS)
GIT_TEST_CMP = cmp
endif
ifeq ($(uname_R),5.8)
+ FREAD_READS_DIRECTORIES = UnfortunatelyYes
+ SNPRINTF_RETURNS_BOGUS = YesPlease
NO_UNSETENV = YesPlease
NO_SETENV = YesPlease
NO_STRTOUMAX = YesPlease
GIT_TEST_CMP = cmp
endif
ifeq ($(uname_R),5.9)
+ FREAD_READS_DIRECTORIES = UnfortunatelyYes
+ SNPRINTF_RETURNS_BOGUS = YesPlease
NO_UNSETENV = YesPlease
NO_SETENV = YesPlease
NO_STRTOUMAX = YesPlease
--
2.36.1

View File

@@ -0,0 +1,26 @@
From fd7627442b3581e97d1275ae7e117d6521fe6500 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Mon, 6 Jun 2022 10:56:04 +0200
Subject: [PATCH 06/12] No pthread support for Solaris 2.6
Solaris 2.6 only conforms to POSIX.1c pthreads and does not support the
PTHREAD_MUTEX_RECURSIVE attribute.
---
config.mak.uname | 1 +
1 file changed, 1 insertion(+)
diff --git a/config.mak.uname b/config.mak.uname
index 29af78fa33..c458f7425f 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -194,6 +194,7 @@ ifeq ($(uname_S),SunOS)
NO_SETENV = YesPlease
NO_STRLCPY = YesPlease
NO_STRTOUMAX = YesPlease
+ NO_PTHREADS = YesPlease
GIT_TEST_CMP = cmp
endif
ifeq ($(uname_R),5.7)
--
2.36.1

View File

@@ -0,0 +1,24 @@
From a37e118bd4a5f2183998a26bd8a76f3ad4a49e26 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Mon, 6 Jun 2022 12:04:49 +0200
Subject: [PATCH 07/12] Solaris 2.6 needs libresolv
---
config.mak.uname | 1 +
1 file changed, 1 insertion(+)
diff --git a/config.mak.uname b/config.mak.uname
index c458f7425f..dc354578e8 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -185,6 +185,7 @@ ifeq ($(uname_S),SunOS)
CC_LD_DYNPATH = -R
ifeq ($(uname_R),5.6)
SOCKLEN_T = int
+ NEEDS_RESOLV = YesPlease
FREAD_READS_DIRECTORIES = UnfortunatelyYes
SNPRINTF_RETURNS_BOGUS = YesPlease
NO_HSTRERROR = YesPlease
--
2.36.1

View File

@@ -0,0 +1,40 @@
From 1019f9707006e87c308f01284fbf89183e4c3b0f Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Fri, 3 Jun 2022 21:50:15 +0200
Subject: [PATCH 08/12] Use better shell in t5545
---
t/t5545-push-options.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh
index 214228349a..deacfd910b 100755
--- a/t/t5545-push-options.sh
+++ b/t/t5545-push-options.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/ksh
test_description='pushing to a repository using push options'
@@ -19,7 +19,7 @@ mk_repo_pair () {
git config receive.denyCurrentBranch warn &&
mkdir -p .git/hooks &&
cat >.git/hooks/pre-receive <<-'EOF' &&
- #!/bin/sh
+ #!/bin/ksh
if test -n "$GIT_PUSH_OPTION_COUNT"; then
i=0
>hooks/pre-receive.push_options
@@ -33,7 +33,7 @@ mk_repo_pair () {
chmod u+x .git/hooks/pre-receive
cat >.git/hooks/post-receive <<-'EOF' &&
- #!/bin/sh
+ #!/bin/ksh
if test -n "$GIT_PUSH_OPTION_COUNT"; then
i=0
>hooks/post-receive.push_options
--
2.36.1

View File

@@ -0,0 +1,22 @@
From 28e8c4bf91e57939b12021686fd57760bddd277f Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Sun, 5 Jun 2022 22:04:22 +0200
Subject: [PATCH 09/12] Use better shell in t5801 helper
---
t/t5801/git-remote-testgit | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5801/git-remote-testgit b/t/t5801/git-remote-testgit
index 1544d6dc6b..0ed8050904 100755
--- a/t/t5801/git-remote-testgit
+++ b/t/t5801/git-remote-testgit
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/ksh
# Copyright (c) 2012 Felipe Contreras
# The first argument can be a url when the fetch/push command was a url
--
2.36.1

View File

@@ -0,0 +1,83 @@
From 03bf6cfe30481edc36269eb5ec4908186d40f9d8 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Fri, 3 Jun 2022 21:48:01 +0200
Subject: [PATCH 10/12] Avoid <stdint.h>
Solaris < 10 does not have <stdint.h> unless the compiler is gcc 4.5 or
higher.
---
compat/regex/regex.c | 2 +-
reftable/record.h | 2 +-
reftable/reftable-blocksource.h | 2 +-
reftable/reftable-record.h | 2 +-
reftable/reftable-writer.h | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/compat/regex/regex.c b/compat/regex/regex.c
index e6f4a5d177..8c3489fbbb 100644
--- a/compat/regex/regex.c
+++ b/compat/regex/regex.c
@@ -59,7 +59,7 @@
GNU regex allows. Include it before <regex.h>, which correctly
#undefs RE_DUP_MAX and sets it to the right value. */
#include <limits.h>
-#include <stdint.h>
+#include <inttypes.h>
#include <stdlib.h>
#ifdef GAWK
diff --git a/reftable/record.h b/reftable/record.h
index fd80cd451d..ccaee6bc1c 100644
--- a/reftable/record.h
+++ b/reftable/record.h
@@ -11,7 +11,7 @@ license that can be found in the LICENSE file or at
#include "system.h"
-#include <stdint.h>
+#include <inttypes.h>
#include "reftable-record.h"
diff --git a/reftable/reftable-blocksource.h b/reftable/reftable-blocksource.h
index 5aa3990a57..93e7563568 100644
--- a/reftable/reftable-blocksource.h
+++ b/reftable/reftable-blocksource.h
@@ -9,7 +9,7 @@ license that can be found in the LICENSE file or at
#ifndef REFTABLE_BLOCKSOURCE_H
#define REFTABLE_BLOCKSOURCE_H
-#include <stdint.h>
+#include <inttypes.h>
/* block_source is a generic wrapper for a seekable readable file.
*/
diff --git a/reftable/reftable-record.h b/reftable/reftable-record.h
index 67104f8fbf..ea20decea8 100644
--- a/reftable/reftable-record.h
+++ b/reftable/reftable-record.h
@@ -9,7 +9,7 @@ license that can be found in the LICENSE file or at
#ifndef REFTABLE_RECORD_H
#define REFTABLE_RECORD_H
-#include <stdint.h>
+#include <inttypes.h>
/*
* Basic data types
diff --git a/reftable/reftable-writer.h b/reftable/reftable-writer.h
index db8de197f6..420a9ce7e6 100644
--- a/reftable/reftable-writer.h
+++ b/reftable/reftable-writer.h
@@ -11,7 +11,7 @@ license that can be found in the LICENSE file or at
#include "reftable-record.h"
-#include <stdint.h>
+#include <inttypes.h>
#include <unistd.h> /* ssize_t */
/* Writing single reftables */
--
2.36.1

View File

@@ -0,0 +1,36 @@
From 3bf6c2bad87502241090a74f1c9f6e0acde04360 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Fri, 3 Jun 2022 22:50:46 +0200
Subject: [PATCH 11/12] Workaround for fileno() being a macro
On Solaris 2.6 build dies with:
http.c: In function 'http_request_reauth':
http.c:1921: warning: dereferencing 'void *' pointer
http.c:1921: error: request for member '_file' in something not a
structure or union
fileno() is defined as a macro and when expanded it tries to dereference
the pointer argument which fails since you cannot dereference a 'void
*' pointer.
Reference: https://stackoverflow.com/a/47581684
---
http.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/http.c b/http.c
index 229da4d148..06359b21a8 100644
--- a/http.c
+++ b/http.c
@@ -1918,7 +1918,7 @@ static int http_request_reauth(const char *url,
return HTTP_START_FAILED;
}
rewind(result);
- if (ftruncate(fileno(result), 0) < 0) {
+ if (ftruncate(fileno((FILE*)result), 0) < 0) {
error_errno("unable to truncate a file");
return HTTP_START_FAILED;
}
--
2.36.1

View File

@@ -0,0 +1,25 @@
From 4dbc0418a9c01afd13cdc3cddcb615d80806e865 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Sun, 5 Jun 2022 21:46:51 +0200
Subject: [PATCH 12/12] UTC is GMT on Solaris < 8
---
t/t0006-date.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t0006-date.sh b/t/t0006-date.sh
index 2490162071..776c7eb850 100755
--- a/t/t0006-date.sh
+++ b/t/t0006-date.sh
@@ -58,7 +58,7 @@ check_show unix-local "$TIME" '1466000000'
check_show 'format:%z' "$TIME" '+0200'
check_show 'format-local:%z' "$TIME" '+0000'
check_show 'format:%Z' "$TIME" ''
-check_show 'format-local:%Z' "$TIME" 'UTC'
+check_show 'format-local:%Z' "$TIME" 'GMT'
check_show 'format:%%z' "$TIME" '%z'
check_show 'format-local:%%z' "$TIME" '%z'
--
2.36.1

View File

@@ -1,14 +0,0 @@
diff -up git-1.8.1.5/git-compat-util.h.orig git-1.8.1.5/git-compat-util.h
--- git-1.8.1.5/git-compat-util.h.orig 2013-03-01 22:33:17.000000000 +0100
+++ git-1.8.1.5/git-compat-util.h 2013-04-28 18:02:29.670665000 +0200
@@ -651,3 +651,10 @@ void warn_on_inaccessible(const char *pa
struct passwd *xgetpwuid_self(void);
#endif
+
+#if !defined(INET_ADDRSTRLEN)
+#define INET_ADDRSTRLEN 16
+#endif
+#if !defined(INET6_ADDRSTRLEN) && !defined(NO_IPV6)
+#define INET6_ADDRSTRLEN 46
+#endif

View File

@@ -1,11 +0,0 @@
--- git-2.11.0/compat/regex/regex.c.stdint_h 2016-11-29 22:06:51.000000000 +0100
+++ git-2.11.0/compat/regex/regex.c 2016-12-20 22:58:12.054712000 +0100
@@ -60,7 +60,7 @@
GNU regex allows. Include it before <regex.h>, which correctly
#undefs RE_DUP_MAX and sets it to the right value. */
#include <limits.h>
-#include <stdint.h>
+#include <inttypes.h>
#ifdef GAWK
#undef alloca

View File

@@ -1,26 +0,0 @@
--- git-2.14.1/t/t5545-push-options.sh.tfix 2017-08-09 21:54:31.000000000 +0200
+++ git-2.14.1/t/t5545-push-options.sh 2017-09-24 20:37:42.373751000 +0200
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/ksh
test_description='pushing to a repository using push options'
@@ -13,7 +13,7 @@
git config receive.denyCurrentBranch warn &&
mkdir -p .git/hooks &&
cat >.git/hooks/pre-receive <<-'EOF' &&
- #!/bin/sh
+ #!/bin/ksh
if test -n "$GIT_PUSH_OPTION_COUNT"; then
i=0
>hooks/pre-receive.push_options
@@ -27,7 +27,7 @@
chmod u+x .git/hooks/pre-receive
cat >.git/hooks/post-receive <<-'EOF' &&
- #!/bin/sh
+ #!/bin/ksh
if test -n "$GIT_PUSH_OPTION_COUNT"; then
i=0
>hooks/post-receive.push_options