Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase to v2.41.0-rc0 #4426

Merged
merged 1,264 commits into from
May 17, 2023
Merged

Rebase to v2.41.0-rc0 #4426

merged 1,264 commits into from
May 17, 2023

Conversation

mjcheetham
Copy link
Member

@mjcheetham mjcheetham commented May 16, 2023

Many conflicts for this rebase were due to recent refactorings upstream around cache.h and other header files.

Range-diff relative to main:

  1:  f9250ebd2f =   1:  ff2d9865eb windows: ignore empty `PATH` elements
  2:  5e8d7701d9 =   2:  3e26f8b1b2 is_Cygwin: avoid `exec`ing anything
  3:  efabf5d00d =   3:  b846021c8f Move is_<platform> functions to the beginning
  4:  7969eafb17 =   4:  aa3d45225e Move the `_which` function (almost) to the top
  5:  7e65544c0e =   5:  c9990db802 Work around Tcl's default `PATH` lookup
  6:  63cac19ec5 =   6:  8209918221 gitk(Windows): avoid inadvertently calling executables in the worktree
  7:  c58421c0f4 =   7:  964e74d506 t9350: point out that refs are not updated correctly
  8:  133666c995 =   8:  e3087b0f5f transport-helper: add trailing --
  9:  7869a3b095 =   9:  ae687db89c remote-helper: check helper status after import/export
 10:  ae69a87148 =  10:  661307cea2 mingw: demonstrate a problem with certain absolute paths
 11:  90dfe3b501 <   -:  ---------- gitk: prevent overly long command lines
 12:  50f4da149f !  11:  989acfa0b6 Always auto-gc after calling a fast-import transport
    @@ Commit message
     
      ## transport-helper.c ##
     @@
    - #include "protocol.h"
    + #include "wrapper.h"
      
      static int debug;
     +/* TODO: put somewhere sensible, e.g. git_transport_options? */
 13:  c3c1d97a59 =  12:  7cc62a6e3e mingw: allow absolute paths without drive prefix
 14:  7972718273 !  13:  b2969cb7f3 mingw: change core.fsyncObjectFiles = 1 by default
    @@ Commit message
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## compat/mingw.c ##
    +@@
    + #include "gettext.h"
    + #define SECURITY_WIN32
    + #include <sspi.h>
    ++#include "../write-or-die.h"
    + 
    + #define HCAST(type, handle) ((type)(intptr_t)handle)
    + 
     @@ compat/mingw.c: int wmain(int argc, const wchar_t **wargv)
      #endif
      
 15:  5d38ab12a8 <   -:  ---------- gitk: Escape file paths before piping to git log
 16:  fd8e547ec1 =  14:  250dbf3626 mingw: include the Python parts in the build
 17:  01b79ab795 =  15:  d54659d3aa win32/pthread: avoid name clashes with winpthread
 18:  3b0ec2d267 =  16:  2cc9779ac9 git-compat-util: avoid redeclaring _DEFAULT_SOURCE
 20:  757ac25060 !  17:  1d0d360357 clean: do not traverse mount points
    @@ builtin/clean.c: static int remove_dirs(struct strbuf *path, const char *prefix,
      	if (!dir) {
      		/* an empty dir could be removed even if it is unreadble */
     
    - ## cache.h ##
    -@@ cache.h: int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
    - int normalize_path_copy(char *dst, const char *src);
    - int longest_ancestor_length(const char *path, struct string_list *prefixes);
    - char *strip_path_suffix(const char *path, const char *suffix);
    -+int is_mount_point_via_stat(struct strbuf *path);
    - int daemon_avoid_alias(const char *path);
    - 
    - /*
    -
      ## compat/mingw.c ##
     @@ compat/mingw.c: pid_t waitpid(pid_t pid, int *status, int options)
      	return -1;
    @@ path.c: char *strip_path_suffix(const char *path, const char *suffix)
      {
      	int sl, ndot;
     
    + ## path.h ##
    +@@ path.h: int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
    + int normalize_path_copy(char *dst, const char *src);
    + int longest_ancestor_length(const char *path, struct string_list *prefixes);
    + char *strip_path_suffix(const char *path, const char *suffix);
    ++int is_mount_point_via_stat(struct strbuf *path);
    + int daemon_avoid_alias(const char *path);
    + 
    + /*
    +
      ## t/t7300-clean.sh ##
     @@ t/t7300-clean.sh: test_expect_success 'traverse into directories that may have ignored entries' '
      	)
 19:  9e98acb329 =  18:  248cf0faf0 Import the source code of mimalloc v2.0.9
 22:  acaae57cf3 =  19:  6a039c6cc3 clean: remove mount points when possible
 21:  2cd5233d0f =  20:  ab5288681a mimalloc: adjust for building inside Git
 23:  9d221a311c =  21:  792aee5aa7 mimalloc: offer a build-time option to enable it
 24:  d4e8be4539 =  22:  ae5cccf4e7 mingw: use mimalloc
 25:  1bc6e61270 =  23:  0e850676b8 Config option to disable side-band-64k for transport
 26:  49ffe26791 =  24:  e499919ab3 mingw: make sure `errno` is set correctly when socket operations fail
 27:  35b683c9a7 =  25:  68a71697ad mingw: do resolve symlinks in `getcwd()`
 28:  8b82c0a866 =  26:  de660602c8 mingw: fix fatal error working on mapped network drives on Windows
 30:  41ce95005b =  27:  5334e5bb75 mingw: ensure valid CTYPE
 31:  97f9d3c82d =  28:  ac86f23e23 mingw: demonstrate a `git add` issue with NTFS junctions
 32:  b55d7fb279 =  29:  36060c9fb7 mingw: allow `git.exe` to be used instead of the "Git wrapper"
 33:  0f46878379 =  30:  e103d85454 strbuf_realpath(): use platform-dependent API if available
 35:  9c99b0f6a3 =  31:  6b222d47dc mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory
 36:  4c174a5264 =  32:  40b9818b04 http: use new "best effort" strategy for Secure Channel revoke checking
 29:  86164ada7c =  33:  eefc355e11 clink.pl: fix MSVC compile script to handle libcurl-d.lib
 37:  a3ee84a80c !  34:  dd06757e3e mingw: implement a platform-specific `strbuf_realpath()`
    @@ compat/mingw.h: static inline void convert_slashes(char *path)
     
      ## t/t0060-path-utils.sh ##
     @@ t/t0060-path-utils.sh: test_expect_success SYMLINKS 'real path works on symlinks' '
    - 	test "$sym" = "$(test-tool path-utils real_path "$dir2/syml")"
    + 	test_cmp expect actual
      '
      
     +test_expect_success MINGW 'real path works near drive root' '
    @@ t/t0060-path-utils.sh: test_expect_success SYMLINKS 'real path works on symlinks
     +
      test_expect_success SYMLINKS 'prefix_path works with absolute paths to work tree symlinks' '
      	ln -s target symlink &&
    - 	test "$(test-tool path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink"
    + 	echo "symlink" >expect &&
     
      ## t/t3700-add.sh ##
     @@ t/t3700-add.sh: test_expect_success CASE_INSENSITIVE_FS 'path is case-insensitive' '
 34:  1008eafe04 =  35:  3b3d99b50a vcxproj: unclash project directories with build outputs
 38:  6caa1a7629 =  36:  2c2ece9971 t5505/t5516: allow running without `.git/branches/` in the templates
 39:  035a3b8ca7 =  37:  1bfabd2cb3 t5505/t5516: fix white-space around redirectors
 40:  c06e05e431 =  38:  116cfb8cff t3701: verify that we can add *lots* of files interactively
 41:  98dd4b5dfc =  39:  edcf3d2ed1 git add -i: handle CR/LF line endings in the interactive input
 42:  aebab20efe =  40:  1835eac1de commit: accept "scissors" with CR/LF line endings
 45:  c2190f7215 =  41:  7652aa7f6d clink.pl: fix libexpatd.lib link error when using MSVC
 46:  5e885c57de =  42:  a9114bfdd6 Makefile: clean up .ilk files when MSVC=1
 47:  b7db6f5d33 =  43:  05c81bc3ca vcbuild: add support for compiling Windows resource files
 43:  51fa51555d =  44:  526d1589df t0014: fix indentation
 44:  6bd467c528 =  45:  913c2dc61c git-gui: accommodate for intent-to-add files
 48:  ee6f999cae =  46:  a744c63eb6 config.mak.uname: add git.rc to MSVC builds
 49:  e55951efa3 =  47:  ceed8218d7 clink.pl: ignore no-stack-protector arg on MSVC=1 builds
 50:  77c495dcf8 =  48:  ede97ba731 clink.pl: move default linker options for MSVC=1 builds
 51:  1bc1c33c40 =  49:  b3f46dff67 buildsystems: remove duplicate clause
 52:  c2cad8493b =  50:  ab08446e41 vcxproj: handle resource files, too
 53:  1b537b5611 =  51:  81a1cb8707 vcxproj: ignore -fno-stack-protector and -fno-common
 54:  456d070fcc =  52:  4bab165263 vcxproj: handle GUI programs, too
 60:  8fa79c03a5 =  53:  8fc6dd1955 win32: add a helper to run `git.exe` without a foreground window
 62:  0cd142274e =  54:  258d3e556b git maintenance: avoid console window in scheduled tasks on Windows
 55:  f4e062e005 =  55:  010623dab7 vcpkg_install: detect lack of Git
 56:  70d4ada7cd =  56:  84ffa03433 vcpkg_install: add comment regarding slow network connections
 57:  f5aa3e6881 =  57:  60e1a76108 vcxproj: support building Windows/ARM64 binaries
 58:  c65f3a2471 =  58:  21350c7250 vcbuild: install ARM64 dependencies when building ARM64 binaries
 59:  0df5903468 =  59:  14a0d892da vcbuild: add an option to install individual 'features'
 61:  577a87fe7f =  60:  abc0841007 cmake: allow building for Windows/ARM64
 63:  e6f3b27fe5 =  61:  7583106a68 ci(vs-build) also build Windows/ARM64 artifacts
 64:  c0ffd0fb55 =  62:  cad90d9721 cmake: install headless-git.
 65:  be66b71403 =  63:  373cedd527 Add schannel to curl installation
 66:  139549d4ec =  64:  099e5a4b05 subtree: update `contrib/subtree` `test` target
 67:  626787c509 =  65:  cbee15fe81 cmake(): allow setting HOST_CPU for cross-compilation
 68:  052106608e =  66:  3305479699 ci(vs-build): download the vcpkg artifacts using a dedicated Action
 69:  615de2be76 =  67:  2b88463839 mingw: allow for longer paths in `parse_interpreter()`
 70:  b70843186c =  68:  aa8dc1e345 compat/vcbuild: document preferred way to build in Visual Studio
 71:  02f6c90e0c =  69:  bbf1d39cbb http: optionally send SSL client certificate
 72:  1174232ed3 =  70:  adc7f2015d ci: run `contrib/subtree` tests in CI builds
 73:  c6322099a2 =  71:  ed6e2fd6ef CMake: default Visual Studio generator has changed
 74:  d9f5483c73 =  72:  9e3c24b588 hash-object: demonstrate a >4GB/LLP64 problem
 75:  5cb28893d4 =  73:  02db910682 .gitignore: add Visual Studio CMakeSetting.json file
 76:  9e2a8c5628 =  74:  dd6f636a71 hash_object_file_literally(): use size_t
 77:  813868495d =  75:  345dd6baba CMakeLists: add default "x64-windows" arch for Visual Studio
 78:  958e8660b4 =  76:  3455e87eb6 object-file.c: use size_t for header lengths
 79:  2ca5651ed5 =  77:  a80401f59c CMake: show Win32 and Generator_platform build-option values
 80:  54c149d7b6 =  78:  5148cfc0bc init: do parse _all_ core.* settings early
 81:  6142cbcf5c !  79:  906adbad15 Enable the built-in FSMonitor as an experimental feature
    @@ repo-settings.c
      static void repo_cfg_bool(struct repository *r, const char *key, int *dest,
      			  int def)
     @@ repo-settings.c: void prepare_repo_settings(struct repository *r)
    - 	if (experimental) {
    + 	repo_cfg_bool(r, "feature.experimental", &experimental, 0);
    + 
    + 	/* Defaults modified by feature.* */
    +-	if (experimental)
    ++	if (experimental) {
      		r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
    - 		r->settings.gc_cruft_packs = 1;
     +
     +		/*
     +		 * Force enable the builtin FSMonitor (unless the repo
    @@ repo-settings.c: void prepare_repo_settings(struct repository *r)
     +		    repo_config_get_maybe_bool(r, "core.fsmonitor", &value) > 0 &&
     +		    repo_config_get_bool(r, "core.useBuiltinFSMonitor", &value))
     +			fsm_settings__set_ipc(r);
    - 	}
    ++	}
      	if (manyfiles) {
      		r->settings.index_version = 4;
    + 		r->settings.index_skip_hash = 1;
 82:  cc636564f0 =  80:  305c7e3616 hash algorithms: use size_t for section lengths
 83:  1cca278c04 =  81:  3288c0dd3a hash-object --stdin: verify that it works with >4GB/LLP64
 84:  58af068e54 =  82:  17ebeea7b2 hash-object: add another >4GB/LLP64 test case
 85:  1784352a10 =  83:  f330be2610 setup: properly use "%(prefix)/" when in WSL
 86:  c424b4af03 =  84:  846c3061ff hash-object: add a >4GB/LLP64 test case using filtered input
 87:  a25fba36ee =  85:  8a7ca31f5c compat/mingw.c: do not warn when failing to get owner
 88:  28fd9d1e3a =  86:  5d37758bcb mingw: $env:TERM="xterm-256color" for newer OSes
 91:  d58abc1f11 =  87:  7c609cb499 vcxproj: allow building with `NO_PERL` again
 92:  067175ebd7 =  88:  8029c2264a vcxproj: require C11
 93:  5ae49af46f =  89:  2994f0852e vcxproj: ignore the `-pedantic` option
 89:  25cbbb1eb0 =  90:  c2b9e39faa winansi: check result and Buffer before using Name
 90:  9e5268bd7b !  91:  162632fb0d Add config option `windows.appendAtomically`
    @@ Documentation/config/windows.txt (new)
     +	set it false to turn it off.
     
      ## compat/mingw.c ##
    +@@
    + #include "gettext.h"
    + #define SECURITY_WIN32
    + #include <sspi.h>
    ++#include "../repository.h"
    + 
    + #define HCAST(type, handle) ((type)(intptr_t)handle)
    + 
     @@ compat/mingw.c: static int is_local_named_pipe_path(const char *filename)
      
      int mingw_open (const char *filename, int oflags, ...)
 94:  572168a9c8 =  92:  ef509aebe6 vcxproj: include reftable when committing `.vcxproj` files
 95:  303357248c =  93:  fc3b740a79 vcxproj: handle libreftable_test, too
 96:  b34fa7dc02 =  94:  5580331dbd vcxproj: avoid escaping double quotes in the defines
 97:  80beb77d3e =  95:  d54a051a89 ci: adjust Azure Pipeline for `runs_on_pool`
 98:  2a048f5a35 =  96:  b81d5851fe ci: stop linking the `prove` cache
 99:  e5ac8d012a =  97:  cf0af1cece ci: reinstate Azure Pipelines support
100:  3bd08a8d89 =  98:  dea6b4bc5b azure-pipeline: drop the `GETTEXT_POISON` job
101:  d2dddf8d60 =  99:  c06bcf3cc2 azure-pipeline: stop hard-coding `apt-get` calls
102:  e4c24552e5 = 100:  c7685155bd azure-pipeline: drop the code to write to/read from a file share
103:  7c32bbd197 = 101:  b1b9e6f064 azure-pipeline: use partial clone/parallel checkout to initialize minimal-sdk
104:  59c33e448a = 102:  11c9910f49 bswap.h: add support for built-in bswap functions
105:  bfce1c23b6 = 103:  0456155be4 azure-pipeline: downcase the job name of the `Linux32` job
106:  d5bb1b0863 = 104:  1b038fb6cf config.mak.uname: add support for clangarm64
107:  2698d74fcc = 105:  b0c0796453 azure-pipeline: run static-analysis on jammy
108:  3e1d4ffeef = 106:  fedf6b474b MinGW: link as terminal server aware
109:  8b2b1a74ee = 107:  86e57b790a Fix Windows version resources
110:  f696e2376f = 108:  0e6bc0cb32 ci: create clangarm64-build.yml
111:  a92c2336af = 109:  e391158953 status: fix for old-style submodules with commondir
112:  1a3b1a7623 = 110:  4137e08394 windows: skip linking `git-<command>` for built-ins
113:  570a121599 = 111:  86fafaaffc windows: fix Repository>Explore Working Copy
228:  5b65eaf624 = 112:  c3697c73ac http: optionally load libcurl lazily
229:  2ec30942ad = 113:  a077100c00 http: support lazy-loading libcurl also on Windows
230:  b6c1d09f8b = 114:  e3c4e3d8b9 http: when loading libcurl lazily, allow for multiple SSL backends
231:  2948d32d20 ! 115:  db01bec6ce mingw: do load libcurl dynamically by default
    @@ Commit message
     
      ## config.mak.uname ##
     @@ config.mak.uname: ifeq ($(uname_S),MINGW)
    - 	DEFAULT_HELP_FORMAT = html
      	HAVE_PLATFORM_PROCINFO = YesPlease
      	CSPRNG_METHOD = rtlgenrandom
    + 	BASIC_LDFLAGS += -municode
     +	LAZY_LOAD_LIBCURL = YesDoThatPlease
    - 	BASIC_LDFLAGS += -municode -Wl,--tsaware
      	COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
      	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
    + 	COMPAT_OBJS += compat/mingw.o compat/winansi.o \
114:  4c85c09425 = 116:  d48dbb9bd2 Win32: make FILETIME conversion functions public
115:  4781f30a64 = 117:  2314109865 Win32: dirent.c: Move opendir down
116:  b505e19d94 = 118:  342841265f mingw: make the dirent implementation pluggable
117:  2aa9f53412 = 119:  1afc272e0c Win32: make the lstat implementation pluggable
118:  d4d1185537 = 120:  939352c520 add infrastructure for read-only file system level caches
119:  fdd48ffa31 ! 121:  6250ef84b4 mingw: add a cache below mingw's lstat and dirent implementations
    @@ Commit message
     
      ## compat/win32/fscache.c (new) ##
     @@
    -+#include "../../cache.h"
    ++#include "../../git-compat-util.h"
     +#include "../../hashmap.h"
     +#include "../win32.h"
     +#include "fscache.h"
     +#include "../../dir.h"
    ++#include "../../abspath.h"
     +
     +static int initialized;
     +static volatile long enabled;
120:  01663adcff = 122:  77e761fd0d fscache: load directories only once
121:  188b6962f5 ! 123:  1d30e87be5 fscache: add key for GIT_TRACE_FSCACHE
    @@ Commit message
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## compat/win32/fscache.c ##
    -@@ compat/win32/fscache.c: static int initialized;
    +@@
    + #include "fscache.h"
    + #include "../../dir.h"
    + #include "../../abspath.h"
    ++#include "../../trace.h"
    + 
    + static int initialized;
      static volatile long enabled;
      static struct hashmap map;
      static CRITICAL_SECTION mutex;
122:  50fa590318 = 124:  8052726605 fscache: remember not-found directories
123:  f1645284ed = 125:  766a8d58af fscache: add a test for the dir-not-found optimization
124:  9133e6dbc7 = 126:  e66b612845 add: use preload-index and fscache for performance
125:  b2835af8bc = 127:  743fd86f75 dir.c: make add_excludes aware of fscache during status
126:  1217d8eed4 = 128:  7681338268 fscache: make fscache_enabled() public
127:  f785c90810 = 129:  5e67519a25 dir.c: regression fix for add_excludes with fscache
128:  63c0f0b0a6 = 130:  f6787c39fa fetch-pack.c: enable fscache for stats under .git/objects
129:  02300f1717 = 131:  ffadd6c3eb checkout.c: enable fscache for checkout again
130:  80e91a0e88 = 132:  43cbd0292d Enable the filesystem cache (fscache) in refresh_index().
131:  a041d5476c = 133:  f306b04137 fscache: use FindFirstFileExW to avoid retrieving the short name
132:  9f1eaca6ac = 134:  5a86711a9d status: disable and free fscache at the end of the status command
133:  373db70aac ! 135:  79a7a92cf0 fscache: add GIT_TEST_FSCACHE support
    @@ Commit message
     
      ## compat/win32/fscache.c ##
     @@
    - #include "../win32.h"
    - #include "fscache.h"
      #include "../../dir.h"
    + #include "../../abspath.h"
    + #include "../../trace.h"
     +#include "config.h"
      
      static int initialized;
134:  b5aa473734 = 136:  ea66443041 fscache: add fscache hit statistics
135:  9b31a27ffb ! 137:  ee715619b1 mem_pool: add GIT_TRACE_MEMPOOL support
    @@ Commit message
     
      ## mem-pool.c ##
     @@
    - #include "cache.h"
    + 
    + #include "git-compat-util.h"
      #include "mem-pool.h"
    ++#include "trace.h"
      
     +static struct trace_key trace_mem_pool = TRACE_KEY_INIT(MEMPOOL);
      #define BLOCK_GROWTH_SIZE (1024 * 1024 - sizeof(struct mp_block))
136:  b578b03172 = 138:  6aea5952ff fscache: fscache takes an initial size
137:  4aba9ac8c8 ! 139:  53a2d5ee46 fscache: update fscache to be thread specific instead of global
    @@ Commit message
     
      ## compat/win32/fscache.c ##
     @@
    - #include "../../dir.h"
    + #include "../../trace.h"
      #include "config.h"
      
     -static int initialized;
    @@ git-compat-util.h: static inline int is_missing_file_error(int errno_)
     
      ## preload-index.c ##
     @@
    - #include "thread-utils.h"
    - #include "repository.h"
    + #include "symlinks.h"
    + #include "trace2.h"
      
     +static struct fscache *fscache;
     +
138:  7e61f4b85c ! 140:  516764dab3 fscache: teach fscache to use mempool
    @@ Commit message
     
      ## compat/win32/fscache.c ##
     @@
    - #include "fscache.h"
    - #include "../../dir.h"
    + #include "../../abspath.h"
    + #include "../../trace.h"
      #include "config.h"
     +#include "../../mem-pool.h"
      
139:  b248bfd722 ! 141:  476d884b2d fscache: make fscache_enable() thread safe
    @@ Commit message
     
      ## compat/mingw.c ##
     @@
    - #include "dir.h"
    - #define SECURITY_WIN32
      #include <sspi.h>
    + #include "../write-or-die.h"
    + #include "../repository.h"
     +#include "win32/fscache.h"
      
      #define HCAST(type, handle) ((type)(intptr_t)handle)
140:  065f876ee7 ! 142:  0c90f7c769 fscache: teach fscache to use NtQueryDirectoryFile
    @@ Commit message
     
      ## compat/win32/fscache.c ##
     @@
    - #include "../../dir.h"
    + #include "../../trace.h"
      #include "config.h"
      #include "../../mem-pool.h"
     +#include "ntifs.h"
141:  a44206dba5 = 143:  e461edb670 unpack-trees: enable fscache for sparse-checkout
142:  8a778cf69b = 144:  e6d2e50912 fscache: remember the reparse tag for each entry
144:  56722efe05 = 145:  11abd4b912 git-gui: provide question helper for retry fallback on Windows
143:  db1d1a8108 = 146:  8a2b817ad3 fscache: implement an FSCache-aware is_mount_point()
146:  860974e3cb = 147:  5fb4663cdc git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
145:  1ac3ccfccc = 148:  5964f982e0 clean: make use of FSCache
147:  d93281a238 = 149:  20a791bf50 gitk: Unicode file name support
148:  c0444f887a = 150:  06614520d4 git-gui--askyesno: fix funny text wrapping
149:  b190fe46fb = 151:  d688ec1e88 gitk: Use an external icon file on Windows
150:  1574f1a854 = 152:  ccdbaabaa4 git-gui--askyesno: allow overriding the window title
152:  7d2e355bf3 = 153:  5c51f52a20 respect core.hooksPath, falling back to .git/hooks
151:  a7c735a012 = 154:  f742b29ddf gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6
153:  3af638af7e = 155:  da427f2aac git-gui--askyesno (mingw): use Git for Windows' icon, if available
154:  df307cb579 = 156:  54a5354fd6 gitk: make the "list references" default window width wider
155:  2471796251 = 157:  6132ebad4a pack-objects (mingw): demonstrate a segmentation fault with large deltas
156:  577dd09698 = 158:  465f37556c mingw: support long paths
157:  34c7cbec05 = 159:  1bacf9dadb Win32: fix 'lstat("dir/")' with long paths
160:  e4a2ced812 = 160:  70519ffb8a mingw: Support `git_terminal_prompt` with more terminals
161:  69bc44c118 = 161:  f3d3f8edb4 compat/terminal.c: only use the Windows console if bash 'read -r' fails
162:  fbd20e13bb = 162:  96d39329a0 mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
163:  2664b451c5 = 163:  4ca0eb50f3 Unbreak interactive GPG prompt upon signing
164:  b0efd015f8 = 164:  c733a8ac71 strbuf_readlink: don't call readlink twice if hint is the exact link size
158:  d854621de2 = 165:  8f38834d0e compat/fsmonitor/fsm-*-win32: support long paths
159:  db269f2543 ! 166:  422f32f29d clean: suggest using `core.longPaths` if paths are too long to remove
    @@ advice.h: struct string_list;
      	ADVICE_PUSH_ALREADY_EXISTS,
     
      ## builtin/clean.c ##
    +@@
    + #include "pathspec.h"
    + #include "help.h"
    + #include "prompt.h"
    ++#include "advice.h"
    + 
    + static int force = -1; /* unset */
    + static int interactive;
     @@ builtin/clean.c: static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
      			quote_path(path->buf, prefix, &quoted, 0);
      			errno = saved_errno;
165:  c9a6d25692 = 167:  0989f95969 strbuf_readlink: support link targets that exceed PATH_MAX
166:  dc99ee5a6f = 168:  42801b6e19 lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
167:  4108d5127a = 169:  b2a7968153 Win32: don't call GetFileAttributes twice in mingw_lstat()
168:  7d61f3aff5 = 170:  7f8a7de982 Win32: implement stat() with symlink support
169:  e825d46fde = 171:  815c438bd4 Win32: remove separate do_lstat() function
170:  5ba0e9721e = 172:  cd0a7cc017 Win32: let mingw_lstat() error early upon problems with reparse points
171:  0d51cc0a0c = 173:  adb9929c02 mingw: teach fscache and dirent about symlinks
172:  f4f1cd23ad = 174:  b2996129d5 Win32: lstat(): return adequate stat.st_size for symlinks
173:  d3d516da27 = 175:  f3a810eb20 Win32: factor out retry logic
174:  1812f78c8a = 176:  590f8858a0 Win32: change default of 'core.symlinks' to false
175:  f03a2e3452 = 177:  06dcfbe944 Win32: add symlink-specific error codes
176:  c8ba45b317 = 178:  6faca3cd8a Win32: mingw_unlink: support symlinks to directories
177:  daac584637 = 179:  6a81d59d25 Win32: mingw_rename: support renaming symlinks
178:  70b47f7e96 = 180:  f8d3f460d2 Win32: mingw_chdir: change to symlink-resolved directory
179:  e7a6ebc6da = 181:  7de95d1fca Win32: implement readlink()
180:  5b943a1cb9 = 182:  c6224d881f mingw: lstat: compute correct size for symlinks
181:  9298041718 = 183:  c0833842e6 Win32: implement basic symlink() functionality (file symlinks only)
182:  939393890e = 184:  91a0414a08 Win32: symlink: add support for symlinks to directories
183:  583303181f = 185:  eb6f96df00 mingw: try to create symlinks without elevated permissions
184:  4ac6ed0a98 = 186:  ab32125490 mingw: emulate stat() a little more faithfully
185:  6f2f982816 = 187:  4620ac0b11 mingw: special-case index entries for symlinks with buggy size
186:  a32d870558 = 188:  8d83db41a5 mingw: introduce code to detect whether we're inside a Windows container
187:  50c5502705 = 189:  012e180924 mingw: when running in a Windows container, try to rename() harder
188:  b9aa16e297 = 190:  9c28b4c89a Win32: symlink: move phantom symlink creation to a separate function
190:  5583e788de = 191:  a02e0ec868 Introduce helper to create symlinks that knows about index_state
192:  6e2e55a0e6 ! 192:  22496449ad mingw: allow to specify the symlink type in .gitattributes
    @@ Documentation/gitattributes.txt: sign `$` upon checkout.  Any byte sequence that
     
      ## compat/mingw.c ##
     @@
    - #define SECURITY_WIN32
    - #include <sspi.h>
    + #include "../write-or-die.h"
    + #include "../repository.h"
      #include "win32/fscache.h"
     +#include "../attr.h"
      
189:  a06965e43c = 193:  c47bf4ab4c mingw: move the file_attr_to_st_mode() function definition
193:  60c5b23022 = 194:  ab293f74ec Win32: symlink: add test for `symlink` attribute
191:  66184e7b7d = 195:  de52dcf192 mingw: Windows Docker volumes are *not* symbolic links
194:  61466db953 = 196:  9d59ad4d8a mingw: explicitly specify with which cmd to prefix the cmdline
195:  8a63cc46b6 ! 197:  b77ed2cb31 mingw: when path_lookup() failed, try BusyBox
    @@ Commit message
     
      ## compat/mingw.c ##
     @@
    - #include <sspi.h>
    + #include "../repository.h"
      #include "win32/fscache.h"
      #include "../attr.h"
     +#include "../string-list.h"
196:  6ee1c4eb33 = 198:  cd1e368a68 test-lib: avoid unnecessary Perl invocation
197:  d5ec1e48b4 = 199:  169d41432a test-tool: learn to act as a drop-in replacement for `iconv`
198:  5a0e28f5f3 = 200:  a5186f7a02 tests(mingw): if `iconv` is unavailable, use `test-helper --iconv`
199:  b952444924 = 201:  76a0343035 gitattributes: mark .png files as binary
200:  d387ae8fbf = 202:  820bc29f32 tests: move test PNGs into t/lib-diff/
201:  b3c4be9803 = 203:  ca2dad17dd tests: only override sort & find if there are usable ones in /usr/bin/
202:  8815f1cef5 ! 204:  854ae415eb tests: use the correct path separator with BusyBox
    @@ t/t2300-cd-to-toplevel.sh: test_cd_to_toplevel () {
      			cd_to_toplevel &&
      			[ "$(pwd -P)" = "$TOPLEVEL" ]
     
    - ## t/t3402-rebase-merge.sh ##
    -@@ t/t3402-rebase-merge.sh: test_expect_success 'rebase -s funny -Xopt' '
    - 	git checkout -b test-funny main^ &&
    - 	test_commit funny &&
    - 	(
    --		PATH=./test-bin:$PATH &&
    -+		PATH=./test-bin$PATH_SEP$PATH &&
    - 		git rebase -s funny -Xopt main
    - 	) &&
    - 	test -f funny.was.run
    -
      ## t/t3418-rebase-continue.sh ##
     @@ t/t3418-rebase-continue.sh: test_expect_success 'rebase --continue remembers merge strategy and options' '
    - 	EOF
    - 	chmod +x test-bin/git-merge-funny &&
    + 
    + 	rm -f actual &&
      	(
     -		PATH=./test-bin:$PATH &&
     +		PATH=./test-bin$PATH_SEP$PATH &&
    - 		test_must_fail git rebase -s funny -Xopt main topic
    + 		test_must_fail git rebase -s funny -X"option=arg with space" \
    + 				-Xop\"tion\\ -X"new${LF}line " main topic
      	) &&
    - 	test -f funny.was.run &&
     @@ t/t3418-rebase-continue.sh: test_expect_success 'rebase --continue remembers merge strategy and options' '
      	echo "Resolved" >F2 &&
      	git add F2 &&
    @@ t/t3418-rebase-continue.sh: test_expect_success 'rebase --continue remembers mer
     +		PATH=./test-bin$PATH_SEP$PATH &&
      		git rebase --continue
      	) &&
    - 	test -f funny.was.run
    -@@ t/t3418-rebase-continue.sh: test_expect_success 'rebase -i --continue handles merge strategy and options' '
    - 	EOF
    - 	chmod +x test-bin/git-merge-funny &&
    - 	(
    --		PATH=./test-bin:$PATH &&
    -+		PATH=./test-bin$PATH_SEP$PATH &&
    - 		test_must_fail git rebase -i -s funny -Xopt -Xfoo main topic
    - 	) &&
    - 	test -f funny.was.run &&
    -@@ t/t3418-rebase-continue.sh: test_expect_success 'rebase -i --continue handles merge strategy and options' '
    - 	echo "Resolved" >F2 &&
    - 	git add F2 &&
    - 	(
    --		PATH=./test-bin:$PATH &&
    -+		PATH=./test-bin$PATH_SEP$PATH &&
    - 		git rebase --continue
    - 	) &&
    - 	test -f funny.was.run
    + 	test_cmp expect actual
     
      ## t/t5615-alternate-env.sh ##
     @@ t/t5615-alternate-env.sh: test_expect_success 'access alternate via absolute path' '
203:  3c620d6073 = 205:  4b48d87169 mingw: only use Bash-ism `builtin pwd -W` when available
204:  e20de14eaa = 206:  60a02dd647 tests (mingw): remove Bash-specific pwd option
205:  85bc941de5 = 207:  4e194bdeb9 test-lib: add BUSYBOX prerequisite
206:  be084b8b88 = 208:  6912401876 t5003: use binary file from t/lib-diff/
207:  c8d18bdf07 = 209:  9d851df3e7 t5532: workaround for BusyBox on Windows
208:  36a1fa0f74 = 210:  9f7f7d84f9 t5605: special-case hardlink test for BusyBox-w32
209:  c76b8ec92a = 211:  974196372e t5813: allow for $PWD to be a Windows path
210:  b9db74d139 = 212:  f5b9d4f7cc t9200: skip tests when $PWD contains a colon
212:  81fe282d30 ! 213:  c06b844d37 mingw: kill child processes in a gentler way
    @@ Commit message
     
      ## compat/mingw.c ##
     @@
    - #include "../strbuf.h"
    - #include "../run-command.h"
      #include "../cache.h"
    + #include "../abspath.h"
    + #include "../alloc.h"
     +#include "win32/exit-process.h"
      #include "win32/lazyload.h"
      #include "../config.h"
    - #include "dir.h"
    + #include "../environment.h"
     @@ compat/mingw.c: int mingw_execvp(const char *cmd, char *const *argv)
      int mingw_kill(pid_t pid, int sig)
      {
211:  bada0fa25b = 214:  1b2571a964 mingw: add a Makefile target to copy test artifacts
213:  cd4beda1f3 = 215:  a212ccde21 mingw: do not call xutftowcs_path in mingw_mktemp
214:  5519b4cfc1 = 216:  d3a957a4c1 mingw: really handle SIGINT
215:  331542336d ! 217:  4cf0b3e1a2 Partially un-revert "editor: save and reset terminal after calling EDITOR"
    @@ Commit message
     
      ## editor.c ##
     @@
    - #include "strvec.h"
      #include "run-command.h"
      #include "sigchain.h"
    + #include "wrapper.h"
     +#include "compat/terminal.h"
      
      #ifndef DEFAULT_EDITOR
216:  1d9c2f258a ! 218:  a31dca4ebf reset: reinstate support for the deprecated --stdin option
    @@ Documentation/git-reset.txt: OPTIONS
     
      ## builtin/reset.c ##
     @@
    - #include "submodule-config.h"
    + #include "trace2.h"
      #include "dir.h"
      #include "add-interactive.h"
     +#include "strbuf.h"
    @@ builtin/reset.c: int cmd_reset(int argc, const char **argv, const char *prefix)
      	parse_args(&pathspec, argv, prefix, patch_mode, &rev);
      
     +	if (read_from_stdin) {
    -+		pathspec_from_file = "-";
    ++		pathspec_from_file = xstrdup("-");
     +		if (nul_term_line)
     +			pathspec_file_nul = 1;
     +	}
218:  4971a03d8e = 219:  7ef4a47e06 Describe Git for Windows' architecture [no ci]
219:  a452db1413 = 220:  6b74e0f063 Modify the Code of Conduct for Git for Windows
220:  25fac4c01c = 221:  f495082a64 CONTRIBUTING.md: add guide for first-time contributors
221:  8e7bbb96fa = 222:  5cd14037e3 README.md: Add a Windows-specific preamble
222:  934c11f7a2 = 223:  41bc4cfc48 Add an issue template
223:  87cf49e3f9 = 224:  03d51d83e9 Modify the GitHub Pull Request template (to reflect Git for Windows)
224:  1be71aaecc = 225:  97ac633594 .github: Add configuration for the Sentiment Bot
217:  bb01002fcd ! 226:  1f167c79d0 fsmonitor: reintroduce core.useBuiltinFSMonitor
    @@ Commit message
     
      ## Documentation/config/advice.txt ##
     @@ Documentation/config/advice.txt: advice.*::
    - 		Advice shown when either linkgit:git-add[1] or linkgit:git-rm[1]
    - 		is asked to update index entries outside the current sparse
      		checkout.
    + 	diverging::
    + 		Advice shown when a fast-forward is not possible.
     +	useCoreFSMonitorConfig::
     +		Advice shown if the deprecated 'core.useBuiltinFSMonitor' config
     +		setting is in use.
    @@ advice.h: struct string_list;
      };
     
      ## fsmonitor-settings.c ##
    +@@
    + #include "fsmonitor-ipc.h"
    + #include "fsmonitor-settings.h"
    + #include "fsmonitor-path-utils.h"
    ++#include "advice.h"
    + 
    + /*
    +  * We keep this structure defintion private and have getters
     @@ fsmonitor-settings.c: static struct fsmonitor_settings *alloc_settings(void)
      	return s;
      }
226:  81dd882099 = 227:  d4adc991a0 Add a GitHub workflow to monitor component updates
225:  3bcd5925c8 = 228:  a2146709c7 Document how $HOME is set on Windows
227:  7b30b87399 = 229:  d12bb9c8f9 SECURITY.md: document Git for Windows' policies

dscho and others added 30 commits May 16, 2023 14:23
As reported in newren/git-filter-repo#225, it
looks like 99 bytes is not really sufficient to represent e.g. the full
path to Python when installed via Windows Store (and this path is used
in the hasb bang line when installing scripts via `pip`).

Let's increase it to what is probably the maximum sensible path size:
MAX_PATH. This makes `parse_interpreter()` in line with what
`lookup_prog()` handles.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
We used to have that `make vcxproj` hack, but a hack it is. In the
meantime, we have a much cleaner solution: using CMake, either
explicitly, or even more conveniently via Visual Studio's built-in CMake
support (simply open Git's top-level directory via File>Open>Folder...).

Let's let the `README` reflect this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This adds support for a new http.sslAutoClientCert config value.

In cURL 7.77 or later the schannel backend does not automatically send
client certificates from the Windows Certificate Store anymore.

This config value is only used if http.sslBackend is set to "schannel",
and can be used to opt in to the old behavior and force cURL to send
client certificates.

This fixes git-for-windows#3292

Signed-off-by: Pascal Muller <pascalmuller@gmail.com>
Because `git subtree` (unlike most other `contrib` modules) is included as
part of the standard release of Git for Windows, its stability should be
verified as consistently as it is for the rest of git. By including the
`git subtree` tests in the CI workflow, these tests are as much of a gate to
merging and indicator of stability as the standard test suite.

Signed-off-by: Victoria Dye <vdye@github.com>
Correct some wording and inform users regarding the Visual Studio
changes (from V16.6) to the default generator.

Subsequent commits ensure that Git for Windows can be directly
opened in modern Visual Studio without needing special configuration
of the CMakeLists settings.

It appeares that internally Visual Studio creates it's own version of the
.sln file (etc.) for extension tools that expect them.

The large number of references below document the shifting of Visual Studio
default and CMake setting options.

refs: https://docs.microsoft.com/en-us/search/?scope=C%2B%2B&view=msvc-150&terms=Ninja

1. https://docs.microsoft.com/en-us/cpp/linux/cmake-linux-configure?view=msvc-160
(note the linux bit)
 "In Visual Studio 2019 version 16.6 or later ***, Ninja is the default
generator for configurations targeting a remote system or WSL. For more
information, see this post on the C++ Team Blog
[https://devblogs.microsoft.com/cppblog/linux-development-with-visual-studio-first-class-support-for-gdbserver-improved-build-times-with-ninja-and-updates-to-the-connection-manager/].

For more information about these settings, see CMakeSettings.json reference
[https://docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=msvc-160]."

2. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160
"CMake supports two files that allow users to specify common configure,
build, and test options and share them with others: CMakePresets.json
and CMakeUserPresets.json."

" Both files are supported in Visual Studio 2019 version 16.10 or later.
***"
3. https://devblogs.microsoft.com/cppblog/linux-development-with-visual-studio-first-class-support-for-gdbserver-improved-build-times-with-ninja-and-updates-to-the-connection-manager/
" Ninja has been the default generator (underlying build system) for
CMake configurations targeting Windows for some time***, but in Visual
Studio 2019 version 16.6 Preview 3*** we added support for Ninja on Linux."

4. https://docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=msvc-160
" `generator`: specifies CMake generator to use for this configuration.
May be one of:

    Visual Studio 2019 only:
        Visual Studio 16 2019
        Visual Studio 16 2019 Win64
        Visual Studio 16 2019 ARM

    Visual Studio 2017 and later:
        Visual Studio 15 2017
        Visual Studio 15 2017 Win64
        Visual Studio 15 2017 ARM
        Visual Studio 14 2015
        Visual Studio 14 2015 Win64
        Visual Studio 14 2015 ARM
        Unix Makefiles
        Ninja

Because Ninja is designed for fast build speeds instead of flexibility
and function, it is set as the default. However, some CMake projects may
be unable to correctly build using Ninja. If this occurs, you can
instruct CMake to generate Visual Studio projects instead.

To specify a Visual Studio generator in Visual Studio 2017, open the
settings editor from the main menu by choosing CMake | Change CMake
Settings. Delete "Ninja" and type "V". This activates IntelliSense,
which enables you to choose the generator you want."

"To specify a Visual Studio generator in Visual Studio 2019, right-click
on the CMakeLists.txt file in Solution Explorer and choose CMake
Settings for project > Show Advanced Settings > CMake Generator.

When the active configuration specifies a Visual Studio generator, by
default MSBuild.exe is invoked with` -m -v:minimal` arguments."

5. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160#enable-cmakepresetsjson-integration-in-visual-studio-2019
"Enable CMakePresets.json integration in Visual Studio 2019

CMakePresets.json integration isn't enabled by default in Visual Studio
2019. You can enable it for all CMake projects in Tools > Options >
CMake > General: (tick a box)" ... see more.

6. https://docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=msvc-140
(whichever v140 is..)
"CMake projects are supported in Visual Studio 2017 and later."

7. https://docs.microsoft.com/en-us/cpp/overview/what-s-new-for-cpp-2017?view=msvc-150
"Support added for the CMake Ninja generator."

8. https://docs.microsoft.com/en-us/cpp/overview/what-s-new-for-cpp-2017?view=msvc-150#cmake-support-via-open-folder
"CMake support via Open Folder
Visual Studio 2017 introduces support for using CMake projects without
converting to MSBuild project files (.vcxproj). For more information,
see CMake projects in Visual
Studio[https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-150].
Opening CMake projects with Open Folder automatically configures the
environment for C++ editing, building, and debugging." ... +more!

9. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160#supported-cmake-and-cmakepresetsjson-versions
"Visual Studio reads and evaluates CMakePresets.json and
CMakeUserPresets.json itself and doesn't invoke CMake directly with the
--preset option. So, CMake version 3.20 or later isn't strictly required
when you're building with CMakePresets.json inside Visual Studio. We
recommend using CMake version 3.14 or later."

10. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160#enable-cmakepresetsjson-integration-in-visual-studio-2019
"If you don't want to enable CMakePresets.json integration for all CMake
projects, you can enable CMakePresets.json integration for a single
CMake project by adding a CMakePresets.json file to the root of the open
folder. You must close and reopen the folder in Visual Studio to
activate the integration.

11. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160#default-configure-presets
***(doesn't actually say which version..)
"Default Configure Presets
If no CMakePresets.json or CMakeUserPresets.json file exists, or if
CMakePresets.json or CMakeUserPresets.json is invalid, Visual Studio
will fall back*** on the following default Configure Presets:

Windows example
JSON
{
  "name": "windows-default",
  "displayName": "Windows x64 Debug",
  "description": "Sets Ninja generator, compilers, x64 architecture,
build and install directory, debug build type",
  "generator": "Ninja",
  "binaryDir": "${sourceDir}/out/build/${presetName}",
  "architecture": {
    "value": "x64",
    "strategy": "external"
  },
  "cacheVariables": {
    "CMAKE_BUILD_TYPE": "Debug",
    "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
  },
  "vendor": {
    "microsoft.com/VisualStudioSettings/CMake/1.0": {
      "hostOS": [ "Windows" ]
    }
  }
},
"

Signed-off-by: Philip Oakley <philipoakley@iee.email>
On LLP64 systems, such as Windows, the size of `long`, `int`, etc. is
only 32 bits (for backward compatibility). Git's use of `unsigned long`
for file memory sizes in many places, rather than size_t, limits the
handling of large files on LLP64 systems (commonly given as `>4GB`).

Provide a minimum test for handling a >4GB file. The `hash-object`
command, with the  `--literally` and without `-w` option avoids
writing the object, either loose or packed. This avoids the code paths
hitting the `bigFileThreshold` config test code, the zlib code, and the
pack code.

Subsequent patches will walk the test's call chain, converting types to
`size_t` (which is larger in LLP64 data models) where appropriate.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The CMakeSettings.json file is tool generated. Developers may track it
should they provide additional settings.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
The previous commit adds a test that demonstrates a problem in the
`hash-object --literally` command, manifesting in an unnecessary file
size limit on systems using the LLP64 data model (which includes
Windows).

Walking the affected code path is `cmd_hash_object()` >> `hash_fd()` >>
`hash_literally()` >> `hash_object_file_literally()`.

The function `hash_object_file_literally()` is the first with a file
length parameter (via a mem buffer). This commit changes the type of
that parameter to the LLP64 compatible `size_t` type.

There are no other uses of the function. The `strbuf` type is already
`size_t` compatible.

Note: The hash-object test does not yet pass. Subsequent commits will
continue to walk the call tree's lower level functions to identify
further fixes.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In Git-for-Windows, work on using ARM64 has progressed. The
commit 2d94b77 (cmake: allow building for Windows/ARM64, 2020-12-04)
failed to notice that /compat/vcbuild/vcpkg_install.bat will default to
using the "x64-windows" architecture for the vcpkg installation if not set,
but CMake is not told of this default. Commit 635b6d9 (vcbuild: install
ARM64 dependencies when building ARM64 binaries, 2020-01-31) later updated
vcpkg_install.bat to accept an arch (%1) parameter, but retained the default.

This default is neccessary for the use case where the project directory is
opened directly in Visual Studio, which will find and build a CMakeLists.txt
file without any parameters, thus expecting use of the default setting.

Also Visual studio will generate internal .sln solution and .vcxproj project
files needed for some extension tools. Inform users of the additional
.sln/.vcxproj generation.

** How to test:
 rm -rf '.vs' # remove old visual studio settings
 rm -rf 'compat/vcbuild/vcpkg' # remove any vcpkg downloads
 rm -rf 'contrib/buildsystems/out' # remove builds & CMake artifacts
 with a fresh Visual Studio Community Edition, File>>Open>>(git *folder*)
   to load the project (which will take some time!).
 check for successful compilation.
The implicit .sln (etc.) are in the hidden .vs directory created by
Visual Studio.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Continue walking the code path for the >4GB `hash-object --literally`
test. The `hash_object_file_literally()` function internally uses both
`hash_object_file()` and `write_object_file_prepare()`. Both function
signatures use `unsigned long` rather than `size_t` for the mem buffer
sizes. Use `size_t` instead, for LLP64 compatibility.

While at it, convert those function's object's header buffer length to
`size_t` for consistency. The value is already upcast to `uintmax_t` for
print format compatibility.

Note: The hash-object test still does not pass. A subsequent commit
continues to walk the call tree's lower level hash functions to identify
further fixes.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Ensure key CMake option values are part of the CMake output to
facilitate user support when tool updates impact the wider CMake
actions, particularly ongoing 'improvements' in Visual Studio.

These CMake displays perform the same function as the build-options.txt
provided in the main Git for Windows. CMake is already chatty.
The setting of CMAKE_EXPORT_COMPILE_COMMANDS is also reported.

Include the environment's CMAKE_EXPORT_COMPILE_COMMANDS value which
may have been propogated to CMake's internal value.

Testing the CMAKE_EXPORT_COMPILE_COMMANDS processing can be difficult
in the Visual Studio environment, as it may be cached in many places.
The 'environment' may include the OS, the user shell, CMake's
own environment, along with the Visual Studio presets and caches.

See previous commit for arefacts that need removing for a clean test.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
In Git for Windows, `has_symlinks` is set to 0 by default. Therefore, we
need to parse the config setting `core.symlinks` to know if it has been
set to `true`. In `git init`, we must do that before copying the
templates because they might contain symbolic links.

Even if the support for symbolic links on Windows has not made it to
upstream Git yet, we really should make sure that all the `core.*`
settings are parsed before proceeding, as they might very well change
the behavior of `git init` in a way the user intended.

This fixes git-for-windows#3414

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
If `feature.experimental` and `feature.manyFiles` are set and the user
has not explicitly turned off the builtin FSMonitor, we now start
the built-in FSMonitor by default.

Only forcing it when UNSET matches the behavior of UPDATE_DEFAULT_BOOL()
used for other repo settings.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Continue walking the code path for the >4GB `hash-object --literally`
test to the hash algorithm step for LLP64 systems.

This patch lets the SHA1DC code use `size_t`, making it compatible with
LLP64 data models (as used e.g. by Windows).

The interested reader of this patch will note that we adjust the
signature of the `git_SHA1DCUpdate()` function without updating _any_
call site. This certainly puzzled at least one reviewer already, so here
is an explanation:

This function is never called directly, but always via the macro
`platform_SHA1_Update`, which is usually called via the macro
`git_SHA1_Update`. However, we never call `git_SHA1_Update()` directly
in `struct git_hash_algo`. Instead, we call `git_hash_sha1_update()`,
which is defined thusly:

    static void git_hash_sha1_update(git_hash_ctx *ctx,
                                     const void *data, size_t len)
    {
        git_SHA1_Update(&ctx->sha1, data, len);
    }

i.e. it contains an implicit downcast from `size_t` to `unsigned long`
(before this here patch). With this patch, there is no downcast anymore.

With this patch, finally, the t1007-hash-object.sh "files over 4GB hash
literally" test case is fixed.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Just like the `hash-object --literally` code path, the `--stdin` code
path also needs to use `size_t` instead of `unsigned long` to represent
memory sizes, otherwise it would cause problems on platforms using the
LLP64 data model (such as Windows).

To limit the scope of the test case, the object is explicitly not
written to the object store, nor are any filters applied.

The `big` file from the previous test case is reused to save setup time;
To avoid relying on that side effect, it is generated if it does not
exist (e.g. when running via `sh t1007-*.sh --long --run=1,41`).

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
To complement the `--stdin` and `--literally` test cases that verify
that we can hash files larger than 4GB on 64-bit platforms using the
LLP64 data model, here is a test case that exercises `hash-object`
_without_ any options.

Just as before, we use the `big` file from the previous test case if it
exists to save on setup time, otherwise generate it.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
To verify that the `clean` side of the `clean`/`smudge` filter code is
correct with regards to LLP64 (read: to ensure that `size_t` is used
instead of `unsigned long`), here is a test case using a trivial filter,
specifically _not_ writing anything to the object store to limit the
scope of the test case.

As in previous commits, the `big` file from previous test cases is
reused if available, to save setup time, otherwise re-generated.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In the case of Git for Windows (say, in a Git Bash window) running in a
Windows Subsystem for Linux (WSL) directory, the GetNamedSecurityInfoW()
call in is_path_owned_By_current_side() returns an error code other than
ERROR_SUCCESS. This is consistent behavior across this boundary.

In these cases, the owner would always be different because the WSL
owner is a different entity than the Windows user.

The change here is to suppress the error message that looks like this:

  error: failed to get owner for '//wsl.localhost/...' (1)

Before this change, this warning happens for every Git command,
regardless of whether the directory is marked with safe.directory.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
For Windows builds >= 15063 set $env:TERM to "xterm-256color" instead of
"cygwin" because they have a more capable console system that supports
this. Also set $env:COLORTERM="truecolor" if unset.

$env:TERM is initialized so that ANSI colors in color.c work, see
29a3963 (Win32: patch Windows environment on startup, 2012-01-15).

See git-for-windows#3629 regarding problems caused by always setting
$env:TERM="cygwin".

This is the same heuristic used by the Cygwin runtime.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is another fall-out of the recent refactoring flurry.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This fixes the build after 7bc341e (git-compat-util: add a test
balloon for C99 support, 2021-12-01).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is now passed by default, ever since 6a8cbc4 (developer: enable
pedantic by default, 2021-09-03).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
NtQueryObject under Wine can return a success but fill out no name.
In those situations, Wine will set Buffer to NULL, and set result to
the sizeof(OBJECT_NAME_INFORMATION).

Running a command such as

echo "$(git.exe --version 2>/dev/null)"

will crash due to a NULL pointer dereference when the code attempts to
null terminate the buffer, although, weirdly, removing the subshell or
redirecting stdout to a file will not trigger the crash.

Code has been added to also check Buffer and Length to ensure the check
is as robust as possible due to the current behavior being fragile at
best, and could potentially change in the future

This code is based on the behavior of NtQueryObject under wine and
reactos.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Atomic append on windows is only supported on local disk files, and it may
cause errors in other situations, e.g. network file system. If that is the
case, this config option should be used to turn atomic append off.

Co-Authored-By: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: 孙卓识 <sunzhuoshi@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Since ef8a6c6 (reftable: utility functions, 2021-10-07) we not only
have a libreftable, but also a libreftable_test.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Visual Studio 2022 does not like that at all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
These refactorings are really gifts that keep on giving.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is not useful because we do not have any persisted directory anymore,
not since dropping our Travis CI support.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho and others added 16 commits May 17, 2023 10:25
The sentiment bot will help detect when things get too heated.
Hopefully.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…dvice

clean: suggest using `core.longPaths` if paths are too long to remove
Git documentation refers to $HOME and $XDG_CONFIG_HOME often, but does not specify how or where these values come from on Windows where neither is set by default. The new documentation reflects the behavior of setup_windows_environment() in compat/mingw.c.

Signed-off-by: Alejandro Barreto <alejandro.barreto@ni.com>
This is the recommended way on GitHub to describe policies revolving around
security issues and about supported versions.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request git-for-windows#1645 from ZCube/master

Support windows container.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Handle Ctrl+C in Git Bash nicely

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
A fix for calling `vim` in Windows Terminal caused a regression and was
reverted. We partially un-revert this, to get the fix again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This topic branch re-adds the deprecated --stdin/-z options to `git
reset`. Those patches were overridden by a different set of options in
the upstream Git project before we could propose `--stdin`.

We offered this in MinGit to applications that wanted a safer way to
pass lots of pathspecs to Git, and these applications will need to be
adjusted.

Instead of `--stdin`, `--pathspec-from-file=-` should be used, and
instead of `-z`, `--pathspec-file-nul`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Originally introduced as `core.useBuiltinFSMonitor` in Git for Windows
and developed, improved and stabilized there, the built-in FSMonitor
only made it into upstream Git (after unnecessarily long hemming and
hawing and throwing overly perfectionist style review sticks into the
spokes) as `core.fsmonitor = true`.

In Git for Windows, with this topic branch, we re-introduce the
now-obsolete config setting, with warnings suggesting to existing users
how to switch to the new config setting, with the intention to
ultimately drop the patch at some stage.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…updates

Start monitoring updates of Git for Windows' component in the open
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member

dscho commented May 17, 2023

On further thought, I decided to include #4420, too, since it has been verified to fix a critical bug for some users. Will force-push the changes in a moment.

@dscho
Copy link
Member

dscho commented May 17, 2023

/git-artifacts

The tag-git workflow run was started

@dscho dscho mentioned this pull request May 17, 2023
@dscho
Copy link
Member

dscho commented May 17, 2023

@rimrul thank you for triggering a re-run of https://github.com/git-for-windows/git-for-windows-automation/actions/runs/5001089177. However, the problem is more fundamental, it's a wide-spread bug in git-for-windows-automation where it does not pass the owner/repo information to the check-run-action. That's why you see "undefined" in https://github.com/git-for-windows/git-for-windows-automation/actions/runs/5001089177/jobs/8961583670#step:16:97.

I am actually working on a fix, just got interrupted by meetings.

@dscho
Copy link
Member

dscho commented May 17, 2023

I am actually working on a fix, just got interrupted by meetings.

Here is the attempt to build the x86_64 artifacts again, incidentally validating git-for-windows/git-for-windows-automation#47: https://github.com/git-for-windows/git-for-windows-automation/actions/runs/5002350972

@dscho
Copy link
Member

dscho commented May 17, 2023

I am actually working on a fix, just got interrupted by meetings.

Here is the attempt to build the x86_64 artifacts again, incidentally validating git-for-windows/git-for-windows-automation#47: https://github.com/git-for-windows/git-for-windows-automation/actions/runs/5002350972

Whoops. The check run's URL was not updated correctly.

@dscho
Copy link
Member

dscho commented May 17, 2023

So the pre-flight check list passed okay, but I was greeted with the SmartScreen warning about my new code-signing certificate. I think it better to mention this in the release notes.

@dscho
Copy link
Member

dscho commented May 17, 2023

/add release note blurb Please also note that the code-signing certificate used to sign Git for Windows' executables was renewed and may cause Smart Screen to show a warning until the certificate has gained a certain minimum reputation.

The workflow run was started

@dscho
Copy link
Member

dscho commented May 17, 2023

/git-artifacts

git-artifacts-x86_64 run already exists at https://github.com/git-for-windows/git/runs/13547631156.
git-artifacts-i686 run already exists at https://github.com/git-for-windows/git/runs/13543604455.
No workflows need to be run!

@dscho
Copy link
Member

dscho commented May 17, 2023

git-artifacts-x86_64 run already exists at https://github.com/git-for-windows/git/runs/13547631156. git-artifacts-i686 run already exists at https://github.com/git-for-windows/git/runs/13543604455. No workflows need to be run!

Oh yay. Gotta trigger them manually, I guess.

@dscho
Copy link
Member

dscho commented May 17, 2023

/release

The release-git workflow run was started

@dscho dscho merged commit 0608d02 into git-for-windows:main May 17, 2023
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New git version] v2.41.0-rc0