Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Documentation/BreakingChanges.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions Documentation/git-archive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ OPTIONS
Prepend <prefix>/ 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 <prefix> 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 <file>::
--output=<file>::
Expand Down
11 changes: 8 additions & 3 deletions Documentation/ref-storage-format.adoc
Original file line number Diff line number Diff line change
@@ -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[]
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions compat/posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/statvfs.h>
#ifndef NO_WRITEV
#include <sys/uio.h>
#endif
#include <termios.h>
#ifndef NO_SYS_SELECT_H
#include <sys/select.h>
Expand Down Expand Up @@ -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);
Expand Down
44 changes: 0 additions & 44 deletions compat/writev.c

This file was deleted.

2 changes: 0 additions & 2 deletions config.mak.uname
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,6 @@ checkfuncs = {
'initgroups' : [],
'strtoumax' : ['strtoumax.c', 'strtoimax.c'],
'pread' : ['pread.c'],
'writev' : ['writev.c'],
}

if host_machine.system() == 'windows'
Expand Down
14 changes: 3 additions & 11 deletions sideband.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -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;
}
Expand Down
41 changes: 0 additions & 41 deletions wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
8 changes: 0 additions & 8 deletions write-or-die.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion write-or-die.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down