git: re-port git.patch onto 2.55.0
The patch was written against git 2.13.1 (2017) while the recipe fetches
2.55.0 — eight years of drift, seven of eight files rejecting. Rebased by
applying what still fit, hand-porting every reject against the current
source, and regenerating the whole patch from a pristine-vs-ported diff so
it is a coherent 2.55.0 patch rather than a 2.13 patch with fixups.
Per file, preserving the original Redox intent:
compat/bswap.h <machine/endian.h> for ntohl/htonl
compat/terminal.c __redox__ git_terminal_prompt branch; the file was
restructured, so it now precedes the generic #else
configure NO_IPV6=YesPlease
daemon.c logreport is a switch over LOG_DESTINATION_* in
2.55.0; guard the syslog arm and openlog instead of
the old if/else
git-compat-util.h SIG_DFL/SIG_IGN/SIG_ERR fallbacks
Makefile EXTLIBS=-lnghttp2; drop the three hardlink fallbacks
run-command.c dup_devnull is gone in 2.55.0; the four /dev/null
opens it replaced now use DEV_NULL directly
setup.c sanitize_stdfds uses xopen/xdup, which die
internally, so the old die_errno hunk is obsolete
Applies at --fuzz=0 with zero rejects across all eight files.
Also ac_cv_iconv_omits_bom=no: the 'iconv omits bom for utf-16 and
utf-32' probe is a RUN test and cannot execute while cross compiling.
Same mechanism as the neighbouring ac_cv_fread_reads_directories and
ac_cv_snprintf_returns_bogus entries.
One trap worth recording: a blanket '*.orig' cleanup before regenerating
the diff silently deleted t/t4256/1/mailinfo.c.orig, a real git test
fixture, which would have shipped as a deletion in the patch. Restored.
This commit is contained in:
+112
-105
@@ -1,19 +1,19 @@
|
||||
diff -ruwN git-2.13.1/compat/bswap.h source/compat/bswap.h
|
||||
--- git-2.13.1/compat/bswap.h 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/compat/bswap.h 2025-04-24 11:20:06.475749424 -0600
|
||||
diff -ruwN git-2.55.0/compat/bswap.h source/compat/bswap.h
|
||||
--- git-2.55.0/compat/bswap.h 2026-06-29 19:32:26.000000000 +0300
|
||||
+++ source/compat/bswap.h 2026-08-03 20:12:56.784770887 +0300
|
||||
@@ -1,3 +1,7 @@
|
||||
+#if defined(__redox__)
|
||||
+#include <machine/endian.h>
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* Let's make sure we always have a sane definition for ntohl()/htonl().
|
||||
* Some libraries define those as a function call, just to perform byte
|
||||
diff -ruwN git-2.13.1/compat/terminal.c source/compat/terminal.c
|
||||
--- git-2.13.1/compat/terminal.c 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/compat/terminal.c 2025-04-18 10:00:11.318697446 -0600
|
||||
@@ -137,6 +137,18 @@
|
||||
return buf.buf;
|
||||
#ifndef COMPAT_BSWAP_H
|
||||
#define COMPAT_BSWAP_H
|
||||
|
||||
diff -ruwN git-2.55.0/compat/terminal.c source/compat/terminal.c
|
||||
--- git-2.55.0/compat/terminal.c 2026-06-29 19:32:26.000000000 +0300
|
||||
+++ source/compat/terminal.c 2026-08-03 20:13:34.879634242 +0300
|
||||
@@ -581,6 +581,18 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#elif defined(__redox__)
|
||||
@@ -30,46 +30,33 @@ diff -ruwN git-2.13.1/compat/terminal.c source/compat/terminal.c
|
||||
+
|
||||
#else
|
||||
|
||||
char *git_terminal_prompt(const char *prompt, int echo)
|
||||
diff -ruwN git-2.13.1/configure source/configure
|
||||
--- git-2.13.1/configure 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/configure 2025-04-18 10:00:11.318697446 -0600
|
||||
@@ -6156,7 +6156,7 @@
|
||||
ac_res=$ac_cv_search_getaddrinfo
|
||||
if test "$ac_res" != no; then :
|
||||
int save_term(enum save_term_flags flags)
|
||||
diff -ruwN git-2.55.0/configure source/configure
|
||||
--- git-2.55.0/configure 2026-06-29 19:32:26.000000000 +0300
|
||||
+++ source/configure 2026-08-03 20:12:56.785551812 +0300
|
||||
@@ -6743,7 +6743,7 @@
|
||||
if test "$ac_res" != no
|
||||
then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
- NO_IPV6=
|
||||
+ NO_IPV6=YesPlease
|
||||
else
|
||||
NO_IPV6=YesPlease
|
||||
fi
|
||||
diff -ruwN git-2.13.1/daemon.c source/daemon.c
|
||||
--- git-2.13.1/daemon.c 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/daemon.c 2025-04-18 10:00:11.319697447 -0600
|
||||
@@ -71,13 +71,21 @@
|
||||
return hi->ip_address.buf;
|
||||
}
|
||||
|
||||
+#if defined(__redox__)
|
||||
+#define LOG_ERR 0
|
||||
+#define LOG_INFO 1
|
||||
+#endif
|
||||
+
|
||||
static void logreport(int priority, const char *err, va_list params)
|
||||
{
|
||||
+#if !defined(__redox__)
|
||||
if (log_syslog) {
|
||||
else case e in #(
|
||||
e) NO_IPV6=YesPlease ;;
|
||||
esac
|
||||
diff -ruwN git-2.55.0/daemon.c source/daemon.c
|
||||
--- git-2.55.0/daemon.c 2026-06-29 19:32:26.000000000 +0300
|
||||
+++ source/daemon.c 2026-08-03 20:14:13.921828994 +0300
|
||||
@@ -98,7 +98,9 @@
|
||||
case LOG_DESTINATION_SYSLOG: {
|
||||
char buf[1024];
|
||||
vsnprintf(buf, sizeof(buf), err, params);
|
||||
+#if !defined(__redox__)
|
||||
syslog(priority, "%s", buf);
|
||||
- } else {
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
/*
|
||||
* Since stderr is set to buffered mode, the
|
||||
* logging of different processes will not overlap
|
||||
@@ -888,8 +896,12 @@
|
||||
break;
|
||||
}
|
||||
case LOG_DESTINATION_STDERR:
|
||||
@@ -937,8 +939,12 @@
|
||||
|
||||
if (!reuseaddr)
|
||||
return 0;
|
||||
@@ -82,7 +69,7 @@ diff -ruwN git-2.13.1/daemon.c source/daemon.c
|
||||
}
|
||||
|
||||
struct socketlist {
|
||||
@@ -1174,11 +1186,7 @@
|
||||
@@ -1227,11 +1233,7 @@
|
||||
if (!group_name)
|
||||
c.gid = c.pass->pw_gid;
|
||||
else {
|
||||
@@ -94,22 +81,19 @@ diff -ruwN git-2.13.1/daemon.c source/daemon.c
|
||||
}
|
||||
|
||||
return &c;
|
||||
@@ -1348,10 +1356,12 @@
|
||||
usage(daemon_usage);
|
||||
@@ -1425,7 +1427,9 @@
|
||||
}
|
||||
|
||||
if (log_destination == LOG_DESTINATION_SYSLOG) {
|
||||
+#if !defined(__redox__)
|
||||
if (log_syslog) {
|
||||
openlog("git-daemon", LOG_PID, LOG_DAEMON);
|
||||
+#endif
|
||||
set_die_routine(daemon_die);
|
||||
} else
|
||||
+#endif
|
||||
/* avoid splitting a message in the middle */
|
||||
setvbuf(stderr, NULL, _IOFBF, 4096);
|
||||
|
||||
diff -ruwN git-2.13.1/git-compat-util.h source/git-compat-util.h
|
||||
--- git-2.13.1/git-compat-util.h 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/git-compat-util.h 2025-04-18 10:00:11.319697447 -0600
|
||||
diff -ruwN git-2.55.0/git-compat-util.h source/git-compat-util.h
|
||||
--- git-2.55.0/git-compat-util.h 2026-06-29 19:32:26.000000000 +0300
|
||||
+++ source/git-compat-util.h 2026-08-03 20:12:56.784854904 +0300
|
||||
@@ -1,6 +1,18 @@
|
||||
#ifndef GIT_COMPAT_UTIL_H
|
||||
#define GIT_COMPAT_UTIL_H
|
||||
@@ -126,10 +110,10 @@ diff -ruwN git-2.13.1/git-compat-util.h source/git-compat-util.h
|
||||
+#define SIG_ERR ((void (*)(int))-1)
|
||||
+#endif
|
||||
+
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
|
||||
@@ -323,6 +335,14 @@
|
||||
#if __STDC_VERSION__ - 0 < 199901L
|
||||
/*
|
||||
* Git is in a testing period for mandatory C99 support in the compiler. If
|
||||
@@ -202,6 +214,14 @@
|
||||
#define PATH_SEP ':'
|
||||
#endif
|
||||
|
||||
@@ -144,19 +128,19 @@ diff -ruwN git-2.13.1/git-compat-util.h source/git-compat-util.h
|
||||
#ifdef HAVE_PATHS_H
|
||||
#include <paths.h>
|
||||
#endif
|
||||
diff -ruwN git-2.13.1/Makefile source/Makefile
|
||||
--- git-2.13.1/Makefile 2017-06-05 08:08:11.000000000 +0700
|
||||
+++ source/Makefile 2025-09-01 04:41:10.339224568 +0700
|
||||
@@ -979,7 +979,7 @@
|
||||
BUILTIN_OBJS += builtin/write-tree.o
|
||||
diff -ruwN git-2.55.0/Makefile source/Makefile
|
||||
--- git-2.55.0/Makefile 2026-06-29 19:32:26.000000000 +0300
|
||||
+++ source/Makefile 2026-08-03 20:13:34.880603012 +0300
|
||||
@@ -952,7 +952,7 @@
|
||||
endif
|
||||
|
||||
GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB)
|
||||
GITLIBS = common-main.o $(LIB_FILE)
|
||||
-EXTLIBS =
|
||||
+EXTLIBS = -lnghttp2
|
||||
|
||||
GIT_USER_AGENT = git/$(GIT_VERSION)
|
||||
|
||||
@@ -1802,7 +1802,6 @@
|
||||
@@ -2688,7 +2688,6 @@
|
||||
|
||||
$(BUILT_INS): git$X
|
||||
$(QUIET_BUILT_IN)$(RM) $@ && \
|
||||
@@ -164,7 +148,7 @@ diff -ruwN git-2.13.1/Makefile source/Makefile
|
||||
ln -s $< $@ 2>/dev/null || \
|
||||
cp $< $@
|
||||
|
||||
@@ -2096,7 +2095,6 @@
|
||||
@@ -3002,7 +3001,6 @@
|
||||
|
||||
$(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
|
||||
$(QUIET_LNCP)$(RM) $@ && \
|
||||
@@ -172,47 +156,70 @@ diff -ruwN git-2.13.1/Makefile source/Makefile
|
||||
ln -s $< $@ 2>/dev/null || \
|
||||
cp $< $@
|
||||
|
||||
@@ -2449,14 +2447,12 @@
|
||||
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
|
||||
$(RM) "$$bindir/$$p" && \
|
||||
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
|
||||
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
|
||||
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
|
||||
@@ -3701,7 +3699,6 @@
|
||||
test -n "$(INSTALL_SYMLINKS)" && \
|
||||
ln -s "git$X" "$$bindir/$$p" || \
|
||||
{ test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
|
||||
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
|
||||
cp "$$bindir/git$X" "$$bindir/$$p" || exit; }; \
|
||||
done && \
|
||||
for p in $(BUILT_INS); do \
|
||||
$(RM) "$$execdir/$$p" && \
|
||||
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
|
||||
done && \
|
||||
@@ -2464,7 +2460,6 @@
|
||||
for p in $$remote_curl_aliases; do \
|
||||
$(RM) "$$execdir/$$p" && \
|
||||
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
|
||||
done && \
|
||||
diff -ruwN git-2.13.1/run-command.c source/run-command.c
|
||||
--- git-2.13.1/run-command.c 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/run-command.c 2025-04-18 10:00:11.320697447 -0600
|
||||
@@ -120,9 +120,9 @@
|
||||
#ifndef GIT_WINDOWS_NATIVE
|
||||
static inline void dup_devnull(int to)
|
||||
{
|
||||
- int fd = open("/dev/null", O_RDWR);
|
||||
+ int fd = open(DEV_NULL, O_RDWR);
|
||||
if (fd < 0)
|
||||
- die_errno(_("open /dev/null failed"));
|
||||
+ die_errno(_("open %s failed"), DEV_NULL);
|
||||
if (dup2(fd, to) < 0)
|
||||
die_errno(_("dup2(%d,%d) failed"), fd, to);
|
||||
close(fd);
|
||||
@@ -3712,7 +3709,6 @@
|
||||
test -n "$(INSTALL_SYMLINKS)" && \
|
||||
ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/git$X" "$$execdir/$$p" || \
|
||||
{ test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
cp "$$execdir/git$X" "$$execdir/$$p" || exit; }; \
|
||||
fi \
|
||||
@@ -3723,7 +3719,6 @@
|
||||
test -n "$(INSTALL_SYMLINKS)" && \
|
||||
ln -s "git-remote-http$X" "$$execdir/$$p" || \
|
||||
{ test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; } \
|
||||
done
|
||||
diff -ruwN git-2.55.0/run-command.c source/run-command.c
|
||||
--- git-2.55.0/run-command.c 2026-06-29 19:32:26.000000000 +0300
|
||||
+++ source/run-command.c 2026-08-03 20:13:34.879491326 +0300
|
||||
@@ -768,7 +768,7 @@
|
||||
notify_pipe[0] = notify_pipe[1] = -1;
|
||||
|
||||
if (cmd->no_stdin || cmd->no_stdout || cmd->no_stderr) {
|
||||
- null_fd = xopen("/dev/null", O_RDWR | O_CLOEXEC);
|
||||
+ null_fd = xopen(DEV_NULL, O_RDWR | O_CLOEXEC);
|
||||
set_cloexec(null_fd);
|
||||
}
|
||||
|
||||
@@ -915,21 +915,21 @@
|
||||
struct strvec nargv = STRVEC_INIT;
|
||||
|
||||
if (cmd->no_stdin)
|
||||
- fhin = open("/dev/null", O_RDWR);
|
||||
+ fhin = open(DEV_NULL, O_RDWR);
|
||||
else if (need_in)
|
||||
fhin = dup(fdin[0]);
|
||||
else if (cmd->in)
|
||||
fhin = dup(cmd->in);
|
||||
|
||||
if (cmd->no_stderr)
|
||||
- fherr = open("/dev/null", O_RDWR);
|
||||
+ fherr = open(DEV_NULL, O_RDWR);
|
||||
else if (need_err)
|
||||
fherr = dup(fderr[1]);
|
||||
else if (cmd->err > 2)
|
||||
fherr = dup(cmd->err);
|
||||
|
||||
if (cmd->no_stdout)
|
||||
- fhout = open("/dev/null", O_RDWR);
|
||||
+ fhout = open(DEV_NULL, O_RDWR);
|
||||
else if (cmd->stdout_to_stderr)
|
||||
fhout = dup(fherr);
|
||||
else if (need_out)
|
||||
diff -ruwN git-2.55.0/setup.c source/setup.c
|
||||
--- git-2.55.0/setup.c
|
||||
+++ source/setup.c
|
||||
--- git-2.55.0/setup.c 2026-06-29 19:32:26.000000000 +0300
|
||||
+++ source/setup.c 2026-08-03 20:11:54.415632841 +0300
|
||||
@@ -2176,7 +2176,7 @@
|
||||
/* if any standard file descriptor is missing open it to /dev/null */
|
||||
void sanitize_stdfds(void)
|
||||
|
||||
@@ -34,6 +34,7 @@ export CURL_CONFIG="${COOKBOOK_SYSROOT}/usr/bin/curl-config"
|
||||
--host="${GNU_TARGET}" \
|
||||
--prefix=/usr \
|
||||
ac_cv_fread_reads_directories=yes \
|
||||
ac_cv_iconv_omits_bom=no \
|
||||
ac_cv_snprintf_returns_bogus=yes \
|
||||
ac_cv_lib_curl_curl_global_init=yes
|
||||
"${COOKBOOK_MAKE}" "${MAKEFLAGS[@]}" -j"${COOKBOOK_MAKE_JOBS}"
|
||||
|
||||
Reference in New Issue
Block a user