From e2f25d202ec80895693d66de83170c1140d9f049 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Thu, 2 Apr 2026 22:42:41 +0000 Subject: [PATCH 1/7] docs: correct information about reftable Our description of the reftable format is that it is experimental and subject to change, but that is no longer true. Remove this statement so as not to mislead users. In addition, the documentation says that the files format is the default, but that is not true if breaking changes mode is on. Correct this information with a conditional. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- Documentation/ref-storage-format.adoc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Documentation/ref-storage-format.adoc b/Documentation/ref-storage-format.adoc index 6a8db4712bd3f6..c5e29ec831e0c5 100644 --- a/Documentation/ref-storage-format.adoc +++ b/Documentation/ref-storage-format.adoc @@ -1,3 +1,8 @@ -`files`;; for loose files with packed-refs. This is the default. -`reftable`;; for the reftable format. This format is experimental and its - internals are subject to change. +`files`;; for loose files with packed-refs. +ifndef::with-breaking-changes[] + This is the default. +endif::with-breaking-changes[] +`reftable`;; for the reftable format. +ifdef::with-breaking-changes[] + This is the default. +endif::with-breaking-changes[] From 1dcfd677cea65ad65517d57e0659a23f25b53717 Mon Sep 17 00:00:00 2001 From: Pushkar Singh Date: Wed, 8 Apr 2026 16:00:06 +0000 Subject: [PATCH 2/7] archive: document --prefix handling of absolute and parent paths Clarify that --prefix is used as given and is not normalized, and may include leading slashes or parent directory components. Signed-off-by: Pushkar Singh Acked-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/git-archive.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/git-archive.adoc b/Documentation/git-archive.adoc index a0e3fe7996e57b..086bade6d8d8a2 100644 --- a/Documentation/git-archive.adoc +++ b/Documentation/git-archive.adoc @@ -54,6 +54,11 @@ OPTIONS Prepend / to paths in the archive. Can be repeated; its rightmost value is used for all tracked files. See below which value gets used by `--add-file`. ++ +The is used as given and is not normalized. It may +include leading slashes or parent directory components (e.g., +`../`). Some archive consumers may treat such paths as +potentially unsafe and adjust or warn during extraction. -o :: --output=:: From 9c30dddefdfe22329fdad84e80a4eca117df7bd7 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 9 Apr 2026 14:47:28 -0700 Subject: [PATCH 3/7] Revert "cmake: use writev(3p) wrapper as needed" This reverts commit 89152af176ea94ea8f3249115b6e00827fbbeb70; let's not use writev() for now. --- contrib/buildsystems/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index d7a087e5842a91..81b4306e72046c 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -376,7 +376,7 @@ endif() #function checks set(function_checks strcasestr memmem strlcpy strtoimax strtoumax strtoull - setenv mkdtemp poll pread memmem writev) + setenv mkdtemp poll pread memmem) #unsetenv,hstrerror are incompatible with windows build if(NOT WIN32) @@ -421,10 +421,6 @@ if(NOT HAVE_MEMMEM) list(APPEND compat_SOURCES compat/memmem.c) endif() -if(NOT HAVE_WRITEV) - list(APPEND compat_SOURCES compat/writev.c) -endif() - if(NOT WIN32) if(NOT HAVE_UNSETENV) list(APPEND compat_SOURCES compat/unsetenv.c) From 74fbd8a571abe7b15de01956ba4599e500c31ac0 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 9 Apr 2026 14:47:51 -0700 Subject: [PATCH 4/7] Revert "sideband: use writev(3p) to send pktlines" This reverts commit 26986f4cbaf38d84a82b0b35da211389ce49552c; let's not use writev() for now. --- sideband.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sideband.c b/sideband.c index 1ed6614eaf1baf..ea7c25211ef7e1 100644 --- a/sideband.c +++ b/sideband.c @@ -264,7 +264,6 @@ void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_ma const char *p = data; while (sz) { - struct iovec iov[2]; unsigned n; char hdr[5]; @@ -274,19 +273,12 @@ void send_sideband(int fd, int band, const char *data, ssize_t sz, int packet_ma if (0 <= band) { xsnprintf(hdr, sizeof(hdr), "%04x", n + 5); hdr[4] = band; - iov[0].iov_base = hdr; - iov[0].iov_len = 5; + write_or_die(fd, hdr, 5); } else { xsnprintf(hdr, sizeof(hdr), "%04x", n + 4); - iov[0].iov_base = hdr; - iov[0].iov_len = 4; + write_or_die(fd, hdr, 4); } - - iov[1].iov_base = (void *) p; - iov[1].iov_len = n; - - writev_or_die(fd, iov, ARRAY_SIZE(iov)); - + write_or_die(fd, p, n); p += n; sz -= n; } From dc1b8b2cc8da78c592a54ee4ca3776a7f83cbd31 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 9 Apr 2026 14:48:09 -0700 Subject: [PATCH 5/7] Revert "wrapper: introduce writev(3p) wrappers" This reverts commit 1970fcef93adcc5a35f6468d00a5a634d5af2b3c; let's not use writev() for now. --- wrapper.c | 41 ----------------------------------------- wrapper.h | 9 --------- write-or-die.c | 8 -------- write-or-die.h | 1 - 4 files changed, 59 deletions(-) diff --git a/wrapper.c b/wrapper.c index be8fa575e6f425..16f5a63fbb614a 100644 --- a/wrapper.c +++ b/wrapper.c @@ -323,47 +323,6 @@ ssize_t write_in_full(int fd, const void *buf, size_t count) return total; } -ssize_t writev_in_full(int fd, struct iovec *iov, int iovcnt) -{ - ssize_t total_written = 0; - - while (iovcnt) { - ssize_t bytes_written = writev(fd, iov, iovcnt); - if (bytes_written < 0) { - if (errno == EINTR || errno == EAGAIN) - continue; - return -1; - } - if (!bytes_written) { - errno = ENOSPC; - return -1; - } - - total_written += bytes_written; - - /* - * We first need to discard any iovec entities that have been - * fully written. - */ - while (iovcnt && (size_t)bytes_written >= iov->iov_len) { - bytes_written -= iov->iov_len; - iov++; - iovcnt--; - } - - /* - * Finally, we need to adjust the last iovec in case we have - * performed a partial write. - */ - if (iovcnt && bytes_written) { - iov->iov_base = (char *) iov->iov_base + bytes_written; - iov->iov_len -= bytes_written; - } - } - - return total_written; -} - ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset) { char *p = buf; diff --git a/wrapper.h b/wrapper.h index 27519b32d1782d..15ac3bab6e9748 100644 --- a/wrapper.h +++ b/wrapper.h @@ -47,15 +47,6 @@ ssize_t read_in_full(int fd, void *buf, size_t count); ssize_t write_in_full(int fd, const void *buf, size_t count); ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset); -/* - * Try to write all iovecs. Returns -1 in case an error occurred with a proper - * errno set, the number of bytes written otherwise. - * - * Note that the iovec will be modified as a result of this call to adjust for - * partial writes! - */ -ssize_t writev_in_full(int fd, struct iovec *iov, int iovcnt); - static inline ssize_t write_str_in_full(int fd, const char *str) { return write_in_full(fd, str, strlen(str)); diff --git a/write-or-die.c b/write-or-die.c index 5f522fb7287382..01a9a51fa2fcd7 100644 --- a/write-or-die.c +++ b/write-or-die.c @@ -96,14 +96,6 @@ void write_or_die(int fd, const void *buf, size_t count) } } -void writev_or_die(int fd, struct iovec *iov, int iovlen) -{ - if (writev_in_full(fd, iov, iovlen) < 0) { - check_pipe(errno); - die_errno("writev error"); - } -} - void fwrite_or_die(FILE *f, const void *buf, size_t count) { if (fwrite(buf, 1, count, f) != count) diff --git a/write-or-die.h b/write-or-die.h index a045bdfaef1b2e..ff0408bd849fd8 100644 --- a/write-or-die.h +++ b/write-or-die.h @@ -7,7 +7,6 @@ void fprintf_or_die(FILE *, const char *fmt, ...); void fwrite_or_die(FILE *f, const void *buf, size_t count); void fflush_or_die(FILE *f); void write_or_die(int fd, const void *buf, size_t count); -void writev_or_die(int fd, struct iovec *iov, int iovlen); /* * These values are used to help identify parts of a repository to fsync. From 7798034171030be0909c56377a4e0e10e6d2df93 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 9 Apr 2026 14:48:24 -0700 Subject: [PATCH 6/7] Revert "compat/posix: introduce writev(3p) wrapper" This reverts commit 3b9b2c2a29a1d529ca9884fa0a6529f6e2496abe; let's not use writev() for now. --- Makefile | 4 ---- compat/posix.h | 14 -------------- compat/writev.c | 44 -------------------------------------------- config.mak.uname | 2 -- meson.build | 1 - 5 files changed, 65 deletions(-) delete mode 100644 compat/writev.c diff --git a/Makefile b/Makefile index 5d22394c2ec1a6..cedc234173e377 100644 --- a/Makefile +++ b/Makefile @@ -2029,10 +2029,6 @@ ifdef NO_PREAD COMPAT_CFLAGS += -DNO_PREAD COMPAT_OBJS += compat/pread.o endif -ifdef NO_WRITEV - COMPAT_CFLAGS += -DNO_WRITEV - COMPAT_OBJS += compat/writev.o -endif ifdef NO_FAST_WORKING_DIRECTORY BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY endif diff --git a/compat/posix.h b/compat/posix.h index 94699a03fa5d69..faaae1b6555d1b 100644 --- a/compat/posix.h +++ b/compat/posix.h @@ -137,9 +137,6 @@ #include #include #include -#ifndef NO_WRITEV -#include -#endif #include #ifndef NO_SYS_SELECT_H #include @@ -326,17 +323,6 @@ int git_lstat(const char *, struct stat *); ssize_t git_pread(int fd, void *buf, size_t count, off_t offset); #endif -#ifdef NO_WRITEV -#define writev git_writev -#define iovec git_iovec -struct git_iovec { - void *iov_base; - size_t iov_len; -}; - -ssize_t git_writev(int fd, const struct iovec *iov, int iovcnt); -#endif - #ifdef NO_SETENV #define setenv gitsetenv int gitsetenv(const char *, const char *, int); diff --git a/compat/writev.c b/compat/writev.c deleted file mode 100644 index 3a94870a2f5855..00000000000000 --- a/compat/writev.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "../git-compat-util.h" -#include "../wrapper.h" - -ssize_t git_writev(int fd, const struct iovec *iov, int iovcnt) -{ - size_t total_written = 0; - size_t sum = 0; - - /* - * According to writev(3p), the syscall shall error with EINVAL in case - * the sum of `iov_len` overflows `ssize_t`. - */ - for (int i = 0; i < iovcnt; i++) { - if (iov[i].iov_len > maximum_signed_value_of_type(ssize_t) || - iov[i].iov_len + sum > maximum_signed_value_of_type(ssize_t)) { - errno = EINVAL; - return -1; - } - - sum += iov[i].iov_len; - } - - for (int i = 0; i < iovcnt; i++) { - const char *bytes = iov[i].iov_base; - size_t iovec_written = 0; - - while (iovec_written < iov[i].iov_len) { - ssize_t bytes_written = xwrite(fd, bytes + iovec_written, - iov[i].iov_len - iovec_written); - if (bytes_written < 0) { - if (total_written) - goto out; - return bytes_written; - } - if (!bytes_written) - goto out; - iovec_written += bytes_written; - total_written += bytes_written; - } - } - -out: - return (ssize_t) total_written; -} diff --git a/config.mak.uname b/config.mak.uname index ccb3f718812740..5feb5825587e65 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -459,7 +459,6 @@ ifeq ($(uname_S),Windows) SANE_TOOL_PATH ?= $(msvc_bin_dir_msys) HAVE_ALLOCA_H = YesPlease NO_PREAD = YesPlease - NO_WRITEV = YesPlease NEEDS_CRYPTO_WITH_SSL = YesPlease NO_LIBGEN_H = YesPlease NO_POLL = YesPlease @@ -675,7 +674,6 @@ ifeq ($(uname_S),MINGW) pathsep = ; HAVE_ALLOCA_H = YesPlease NO_PREAD = YesPlease - NO_WRITEV = YesPlease NEEDS_CRYPTO_WITH_SSL = YesPlease NO_LIBGEN_H = YesPlease NO_POLL = YesPlease diff --git a/meson.build b/meson.build index 8309942d184847..11488623bfd8f8 100644 --- a/meson.build +++ b/meson.build @@ -1429,7 +1429,6 @@ checkfuncs = { 'initgroups' : [], 'strtoumax' : ['strtoumax.c', 'strtoimax.c'], 'pread' : ['pread.c'], - 'writev' : ['writev.c'], } if host_machine.system() == 'windows' From d3b7a9b63d00e80c3de48356198f9bbc5105d814 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 10 Apr 2026 07:52:50 -0700 Subject: [PATCH 7/7] rust: we are way beyond 2.53 Earlier we timelined that we'd tune our build procedures to build with Rust by default in Git 2.53, but we are already in prerelease freeze for 2.54 now. Update the BreakingChanges document to delay it until Git 2.55 (slated for the end of June 2026). Noticed-by: brian m. carlson Helped-by: Derrick Stolee Signed-off-by: Junio C Hamano --- Documentation/BreakingChanges.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc index f814450d2f65ac..af59c43f42c8e6 100644 --- a/Documentation/BreakingChanges.adoc +++ b/Documentation/BreakingChanges.adoc @@ -190,7 +190,7 @@ milestones for the introduction of Rust: 1. Initially, with Git 2.52, support for Rust will be auto-detected by Meson and disabled in our Makefile so that the project can sort out the initial infrastructure. -2. In Git 2.53, both build systems will default-enable support for Rust. +2. In Git 2.55, both build systems will default-enable support for Rust. Consequently, builds will break by default if Rust is not available on the build host. The use of Rust can still be explicitly disabled via build flags.