Skip to content

Commit

Permalink
Prepare for v2.47.0.windows.2 (#5221)
Browse files Browse the repository at this point in the history
At the moment, the Git maintainer is on vacation. While there _is_ an
interim maintainer, it seems as if v2.47.1 will need to wait for "the
end of the month".

However, I do not have the luxury of waiting for the end of the month,
as #5199 is stacking up comments relating various degrees of upset over
the lack of a new Git for Windows version that fixes fetches/pushes via
SSH.

To make it truly worth the effort, let's integrate a couple of topics
that have been integrated into upstream Git's `master` and `next`
branches in the meantime, topics I consider important enough to be
fast-tracked into a new Git for Windows version, since we already have
the need for one:

- 53d9f27 Merge branch 'jh/config-unset-doc-fix'
  Fixes incorrect documentation
- a89881e Merge branch 'js/doc-platform-support-link-fix'
  Fixes broken links in the documentation
- 784986f Merge branch 'jk/fsmonitor-event-listener-race-fix'
  CI-only: fixes 6h timeouts in the `osx-*` jobs
- 59bf8d2 Merge branch 'ps/cache-tree-w-broken-index-entry' into
next
Fixes segmentation faults e.g. after a checkout failed due to invalid
filenames and there is now a half-valid Git index
- ffd5653 Merge branch 'pb/clar-build-fix' into next
I suspect that this might cause some flakiness in (parallel) CI builds,
even if I have not personally noticed those flakes.
- fe0f4bc Merge branch 'db/submodule-fetch-with-remote-name-fix'
into next
  Seems like a bug fix submodule users might want
- 6860bff Merge branch 'sk/msvc-warnings' into next
This _should_ only affect builds with MS Visual C (which Git for Windows
does not use for the official builds), it's still a good idea to do, if
only to align with upstream Git's code.
  • Loading branch information
dscho committed Nov 22, 2024
2 parents efd5de5 + 690eb19 commit e592457
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Documentation/git-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SYNOPSIS
'git config list' [<file-option>] [<display-option>] [--includes]
'git config get' [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>
'git config set' [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>
'git config unset' [<file-option>] [--all] [--value=<value>] [--fixed-value] <name> <value>
'git config unset' [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>
'git config rename-section' [<file-option>] <old-name> <new-name>
'git config remove-section' [<file-option>] <name>
'git config edit' [<file-option>]
Expand Down
4 changes: 2 additions & 2 deletions Documentation/technical/platform-support.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ will be fixed in a later release:
notice problems before they are considered "done with review"; whereas
watching `master` means the stable branch could break for your platform, but
you have a decent chance of avoiding a tagged release breaking you. See "The
Policy" in link:../howto/maintain-git.txt["How to maintain Git"] for an
Policy" in link:../howto/maintain-git.html["How to maintain Git"] for an
overview of which branches are used in the Git project, and how.

* The bug report should include information about what platform you are using.
Expand Down Expand Up @@ -125,7 +125,7 @@ Compatible on `next`

To avoid reactive debugging and fixing when changes hit a release or stable, you
can aim to ensure `next` always works for your platform. (See "The Policy" in
link:../howto/maintain-git.txt["How to maintain Git"] for an overview of how
link:../howto/maintain-git.html["How to maintain Git"] for an overview of how
`next` is used in the Git project.) To do that:

* You should add a runner for your platform to the GitHub Actions or GitLab CI
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3975,6 +3975,7 @@ $(UNIT_TEST_DIR)/clar-decls.h: $(patsubst %,$(UNIT_TEST_DIR)/%.c,$(CLAR_TEST_SUI
done >$@
$(UNIT_TEST_DIR)/clar.suite: $(UNIT_TEST_DIR)/clar-decls.h
$(QUIET_GEN)awk -f $(UNIT_TEST_DIR)/clar-generate.awk $< >$(UNIT_TEST_DIR)/clar.suite
$(UNIT_TEST_DIR)/clar/clar.o: $(UNIT_TEST_DIR)/clar.suite
$(CLAR_TEST_OBJS): $(UNIT_TEST_DIR)/clar-decls.h
$(CLAR_TEST_OBJS): EXTRA_CPPFLAGS = -I$(UNIT_TEST_DIR)
$(CLAR_TEST_PROG): $(UNIT_TEST_DIR)/clar.suite $(CLAR_TEST_OBJS) $(GITLIBS) GIT-LDFLAGS
Expand Down
4 changes: 2 additions & 2 deletions builtin/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static const char *const builtin_config_usage[] = {
N_("git config list [<file-option>] [<display-option>] [--includes]"),
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>"),
N_("git config set [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>"),
N_("git config rename-section [<file-option>] <old-name> <new-name>"),
N_("git config remove-section [<file-option>] <name>"),
N_("git config edit [<file-option>]"),
Expand All @@ -43,7 +43,7 @@ static const char *const builtin_config_set_usage[] = {
};

static const char *const builtin_config_unset_usage[] = {
N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>"),
NULL
};

Expand Down
4 changes: 2 additions & 2 deletions compat/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

static inline void get_compiler_info(struct strbuf *info)
{
int len = info->len;
size_t len = info->len;
#ifdef __clang__
strbuf_addf(info, "clang: %s\n", __clang_version__);
#elif defined(__GNUC__)
Expand All @@ -27,7 +27,7 @@ static inline void get_compiler_info(struct strbuf *info)

static inline void get_libc_info(struct strbuf *info)
{
int len = info->len;
size_t len = info->len;

#ifdef __GLIBC__
strbuf_addf(info, "glibc: %s\n", gnu_get_libc_version());
Expand Down
23 changes: 14 additions & 9 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ int mingw_chmod(const char *filename, int mode)
*/
static int has_valid_directory_prefix(wchar_t *wfilename)
{
int n = wcslen(wfilename);
size_t n = wcslen(wfilename);

while (n > 0) {
wchar_t c = wfilename[--n];
Expand Down Expand Up @@ -1628,7 +1628,8 @@ static const char *parse_interpreter(const char *cmd)
{
static char buf[MAX_PATH];
char *p, *opt;
int n, fd;
ssize_t n; /* read() can return negative values */
int fd;

/* don't even try a .exe */
n = strlen(cmd);
Expand Down Expand Up @@ -1752,7 +1753,7 @@ static char *path_lookup(const char *cmd, int exe_only)
{
const char *path;
char *prog = NULL;
int len = strlen(cmd);
size_t len = strlen(cmd);
int isexe = len >= 4 && !strcasecmp(cmd+len-4, ".exe");

if (strpbrk(cmd, "/\\"))
Expand Down Expand Up @@ -2389,7 +2390,7 @@ char *mingw_getenv(const char *name)
#define GETENV_MAX_RETAIN 64
static char *values[GETENV_MAX_RETAIN];
static int value_counter;
int len_key, len_value;
size_t len_key, len_value;
wchar_t *w_key;
char *value;
wchar_t w_value[32768];
Expand All @@ -2401,7 +2402,8 @@ char *mingw_getenv(const char *name)
/* We cannot use xcalloc() here because that uses getenv() itself */
w_key = calloc(len_key, sizeof(wchar_t));
if (!w_key)
die("Out of memory, (tried to allocate %u wchar_t's)", len_key);
die("Out of memory, (tried to allocate %"PRIuMAX" wchar_t's)",
(uintmax_t)len_key);
xutftowcs(w_key, name, len_key);
/* GetEnvironmentVariableW() only sets the last error upon failure */
SetLastError(ERROR_SUCCESS);
Expand All @@ -2416,7 +2418,8 @@ char *mingw_getenv(const char *name)
/* We cannot use xcalloc() here because that uses getenv() itself */
value = calloc(len_value, sizeof(char));
if (!value)
die("Out of memory, (tried to allocate %u bytes)", len_value);
die("Out of memory, (tried to allocate %"PRIuMAX" bytes)",
(uintmax_t)len_value);
xwcstoutf(value, w_value, len_value);

/*
Expand All @@ -2434,7 +2437,7 @@ char *mingw_getenv(const char *name)

int mingw_putenv(const char *namevalue)
{
int size;
size_t size;
wchar_t *wide, *equal;
BOOL result;

Expand All @@ -2444,7 +2447,8 @@ int mingw_putenv(const char *namevalue)
size = strlen(namevalue) * 2 + 1;
wide = calloc(size, sizeof(wchar_t));
if (!wide)
die("Out of memory, (tried to allocate %u wchar_t's)", size);
die("Out of memory, (tried to allocate %" PRIuMAX " wchar_t's)",
(uintmax_t)size);
xutftowcs(wide, namevalue, size);
equal = wcschr(wide, L'=');
if (!equal)
Expand Down Expand Up @@ -4072,7 +4076,8 @@ static BOOL WINAPI handle_ctrl_c(DWORD ctrl_type)
*/
int wmain(int argc, const wchar_t **wargv)
{
int i, maxlen, exit_status;
int i, exit_status;
size_t maxlen;
char *buffer, **save;
const char **argv;

Expand Down
4 changes: 4 additions & 0 deletions compat/vcbuild/include/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ typedef _mode_t mode_t;

#ifndef _SSIZE_T_
#define _SSIZE_T_
#ifdef _WIN64
typedef __int64 _ssize_t;
#else
typedef long _ssize_t;
#endif /* _WIN64 */

#ifndef _OFF_T_
#define _OFF_T_
Expand Down

0 comments on commit e592457

Please sign in to comment.