Skip to content

Rebase to v2.31.0-rc0 #3060

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

Merged
merged 908 commits into from
Feb 26, 2021
Merged

Rebase to v2.31.0-rc0 #3060

merged 908 commits into from
Feb 26, 2021

Conversation

dscho
Copy link
Member

@dscho dscho commented Feb 26, 2021

The usual pre-release PR, to run the build and test. The range-diff relative to main:

-  1:  d051ed77ee6 (upstream: d051ed77ee6) <   -:  ----------- .github/workflows/main.yml: run static-analysis on bionic
   4:  28651711432 =   1:  4fb2020e723 t9350: point out that refs are not updated correctly
   5:  efdb8617823 =   2:  06e4fcc778f transport-helper: add trailing --
   6:  b9fcbc3bfec =   3:  e756d7132c7 remote-helper: check helper status after import/export
  11:  5592029bd87 =   4:  51e9ddfaa32 Always auto-gc after calling a fast-import transport
   7:  027adf5cf9b =   5:  0800c4aec41 mingw: demonstrate a problem with certain absolute paths
   8:  bae4f3a5b10 =   6:  9e6746fcb22 archive: replace write_or_die() calls with write_block_or_die()
   9:  7a335e79297 =   7:  4a78421a9af gitk: prevent overly long command lines
  13:  3970e775606 =   8:  e33ca9200e0 mingw: allow absolute paths without drive prefix
  14:  80074994a48 =   9:  b8119ffef61 mingw: handle absolute paths in expand_user_path()
  15:  f3d73b5be8e =  10:  568879c444d archive: avoid spawning `gzip`
  16:  b2e5025c424 =  11:  80e9a3012c0 mingw: change core.fsyncObjectFiles = 1 by default
  10:  133d97bef28 =  12:  0bfac46046e clean: do not traverse mount points
  17:  a04072a5b6d =  13:  d0f9b71cf9f gitk: Escape file paths before piping to git log
  18:  a7d11daecd7 =  14:  a0cf6e021f5 clean: remove mount points when possible
  19:  efd9b93e3b8 !  15:  e92f3cd99b6 config.mak.uname: PCRE1 cleanup
    @@ Metadata
      ## Commit message ##
         config.mak.uname: PCRE1 cleanup
     
    -    no longer relevant after moving to PCRE2
    +    Style issue: a space was missing.
     
         Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]>
     
    @@ config.mak.uname: else
      		NO_GETTEXT =
      		USE_GETTEXT_SCHEME = fallthrough
     -		USE_LIBPCRE= YesPlease
    --		NO_LIBPCRE1_JIT = UnfortunatelyYes
     +		USE_LIBPCRE = YesPlease
      		NO_CURL =
      		USE_NED_ALLOCATOR = YesPlease
  20:  d3bddb0c7a7 !  16:  37100422b4d mingw: move Git for Windows' system config where users expect it
    @@ config.mak.uname: ifeq ($(uname_S),Windows)
      	CC = compat/vcbuild/scripts/clink.pl
      	AR = compat/vcbuild/scripts/lib.pl
     @@ config.mak.uname: else
    - 		NO_LIBPCRE1_JIT = UnfortunatelyYes
    + 		USE_LIBPCRE= YesPlease
      		NO_CURL =
      		USE_NED_ALLOCATOR = YesPlease
     +		ifeq (/mingw64,$(subst 32,64,$(prefix)))
  23:  a3213c203b7 =  17:  4c124008ec8 config: normalize the path of the system gitconfig
  27:  9334a78d193 !  18:  fc595fdc1ad mingw: include the Python parts in the build
    @@ Commit message
     
      ## config.mak.uname ##
     @@ config.mak.uname: else
    - 		NO_LIBPCRE1_JIT = UnfortunatelyYes
    + 		USE_LIBPCRE= YesPlease
      		NO_CURL =
      		USE_NED_ALLOCATOR = YesPlease
     +		NO_PYTHON =
  28:  583a47a9527 =  19:  84286eaa5cc Config option to disable side-band-64k for transport
  29:  3bb50829673 =  20:  767dbd6a9fa mingw: make sure `errno` is set correctly when socket operations fail
  30:  01551580c6b =  21:  ed329508e6f mingw: do resolve symlinks in `getcwd()`
  25:  7494778f0ea =  22:  94052d485f7 mingw: ensure valid CTYPE
  21:  a5328d2005c =  23:  426a40e2862 mingw: demonstrate a `git add` issue with NTFS junctions
  34:  a6b5b999a07 =  24:  2dda57381ff mingw: allow `git.exe` to be used instead of the "Git wrapper"
  24:  bfb8b0dfa26 !  25:  b4676917c27 strbuf_realpath(): use platform-dependent API if available
    @@ Commit message
         Signed-off-by: Johannes Schindelin <[email protected]>
     
      ## abspath.c ##
    -@@ abspath.c: char *strbuf_realpath(struct strbuf *resolved, const char *path,
    +@@ abspath.c: static char *strbuf_realpath_1(struct strbuf *resolved, const char *path,
      			goto error_out;
      	}
      
  36:  1dd3185a74e =  26:  c80c9e67b84 mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory
  31:  c04e1d0f20a =  27:  fd1289c14cf mingw: fix fatal error working on mapped network drives on Windows
  32:  f616882a151 =  28:  4186c320c1b clink.pl: fix MSVC compile script to handle libcurl-d.lib
  33:  57a24be4f88 =  29:  7717b372d7b mingw: implement a platform-specific `strbuf_realpath()`
  39:  e886b5648ec =  30:  c36c5e534f9 tests: exercise the RUNTIME_PREFIX feature
  40:  94c994c300c =  31:  1bfb79f348e http: use new "best effort" strategy for Secure Channel revoke checking
  35:  9a94f46df7c =  32:  258f3409835 vcxproj: unclash project directories with build outputs
  37:  6faef83cd57 =  33:  32e58eca805 t5505/t5516: allow running without `.git/branches/` in the templates
  41:  c0979d5ed63 !  34:  7e79b8c8697 t5505/t5516: fix white-space around redirectors
    @@ t/t5516-fetch-push.sh: test_expect_success 'push with branches' '
     @@ t/t5516-fetch-push.sh: EOF
      	git init no-thin &&
      	git --git-dir=no-thin/.git config receive.unpacklimit 0 &&
    - 	git push no-thin/.git refs/heads/master:refs/heads/foo &&
    + 	git push no-thin/.git refs/heads/main:refs/heads/foo &&
     -	echo modified >> path1 &&
     +	echo modified >>path1 &&
      	git commit -am modified &&
  38:  053e2f5d7e8 =  35:  8d71894a469 Allow `add -p` and `add -i` with a large number of files
  42:  df8ae7e29fd =  36:  9eae9164683 t3701: verify that we can add *lots* of files interactively
  43:  ad8e059490f =  37:  1173a78fefc git add -i: handle CR/LF line endings in the interactive input
  44:  0ea3f360ac1 =  38:  51f8ed4a806 commit: accept "scissors" with CR/LF line endings
  55:  2e0345f7c60 =  39:  aed3217d79e t0014: fix indentation
  56:  673aeddcb3a =  40:  788d8e8e508 prompt: Avoid using unset variables
  57:  cde6d5ba37c =  41:  28e0f5ee662 git-gui: accommodate for intent-to-add files
  22:  d3d15b1253e =  42:  8c8636b0680 vcpkg_install: detect lack of Git
  26:  ea9dd2f2e2c =  43:  b50e77a5f1a vcpkg_install: add comment regarding slow network connections
  46:  efdd8af4c96 =  44:  1f5219a95bf vcxproj: support building Windows/ARM64 binaries
  48:  7e40e6f358b =  45:  6a96e26843a vcbuild: install ARM64 dependencies when building ARM64 binaries
  50:  3276b57e898 =  46:  cd6d10ed385 vcbuild: add an option to install individual 'features'
  52:  d1f187a0ee7 =  47:  77c91e8d41c cmake: allow building for Windows/ARM64
  53:  371a6a1b73e =  48:  e2634c1fa90 win32: add a helper to run `git.exe` without a foreground window
  54:  3a560a31a0d =  49:  cfe788c1286 ci(vs-build) also build Windows/ARM64 artifacts
  58:  ad59407d910 =  50:  23cdfcaa180 git maintenance: avoid console window in scheduled tasks on Windows
  59:  76f66426717 =  51:  1c0b5fdac6f Add schannel to curl installation
  61:  e8162db788d =  52:  23f85926775 Add a GitHub workflow to generate Git for Windows' Pacman package
  62:  b94c873fd54 =  53:  77e57b666f1 git-artifacts: if GPG secrets are available, use them
  63:  796fd9b3b2e =  54:  e2e4e1e8bcb git-artifacts: also code-sign, if configured via the secrets
  64:  e70abc904b6 =  55:  17c853b95d5 git-artifacts: also build the installer
  65:  df2023ebd0d =  56:  2b92e5d8439 git-artifacts: also build portable, mingit and mingit-busybox
  66:  3ce6093571d =  57:  1e0011376f5 git-artifacts: also build 32-bit versions
   2:  ecf7ee3cd5a =  58:  d404e953fb0 cmake(install): include vcpkg dlls
  67:  4f391dd0193 =  59:  e73562893ce git-artifacts: also build the nuget package
 188:  bc69624f5f0 =  60:  01e93fd2c50 cmake: work around recent `vcpkg` update
  68:  a5755482f04 =  61:  5f060ea7701 git-artifacts: allow restricting which artifacts are built
  60:  91588e1e052 =  62:  1af44050b69 cmake(install): fix double .exe suffixes
   3:  fb3fcfbfc83 =  63:  32a09a55eaf GitHub Actions: Add vcpkg initialization step
- 12:  e5620e567c4 <   -:  ----------- diffcore-rename: speed up register_rename_src
- 45:  de932fb0941 (upstream: 31345d5545e) <   -:  ----------- maintenance: extract platform-specific scheduling
- 47:  6994522e032 (upstream: 16c56909298) <   -:  ----------- maintenance: include 'cron' details in docs
- 49:  9778b624794 (upstream: 2afe7e35672) <   -:  ----------- maintenance: use launchctl on macOS
- 51:  c16c04ee2fb (upstream: 3797a0a7b7a) <   -:  ----------- maintenance: use Windows scheduled tasks
  69:  38d54eb750a =  64:  27db33e668d git-artifacts: allow specifying repo/ref via workflow_dispatch
  70:  bed7652af78 =  65:  a7a6ce97016 git-artifacts: cache the build-installers artifact
  71:  3c977744f1e =  66:  3f8ebdaea33 git-artifacts: use the cached build-installers instead of makepkg-git
 187:  ab950aee5c6 =  67:  04f42d2dc97 git-artifacts: add ARM64 artifacts
  72:  180b0eeaa9c =  68:  0a880a87172 Win32: make FILETIME conversion functions public
  73:  9e83fc00555 =  69:  c0f84067d77 Win32: dirent.c: Move opendir down
  74:  fb96ad95c46 =  70:  b833c12cf91 mingw: make the dirent implementation pluggable
  75:  aad5e433879 =  71:  b7da16f681a Win32: make the lstat implementation pluggable
  76:  1a11b654643 =  72:  50f4f1d6dea add infrastructure for read-only file system level caches
  77:  7b77ff9cbb7 =  73:  e8e2a5d406d mingw: add a cache below mingw's lstat and dirent implementations
  78:  312b12887b8 =  74:  8bcd5c93e58 fscache: load directories only once
  79:  f5da0f7f926 =  75:  c0382a01d9b fscache: add key for GIT_TRACE_FSCACHE
  80:  cb553ad19c5 =  76:  e31c1fbac96 fscache: remember not-found directories
  81:  2236c1e0940 =  77:  8da790902ef fscache: add a test for the dir-not-found optimization
  82:  6874366c934 =  78:  65b543a2121 add: use preload-index and fscache for performance
  83:  f4e34d218af =  79:  fe152d0aa2e dir.c: make add_excludes aware of fscache during status
  84:  278289eb46c =  80:  c273634353f fscache: make fscache_enabled() public
  85:  a38b37bbe50 =  81:  7cd870643d1 dir.c: regression fix for add_excludes with fscache
  86:  139eff09327 =  82:  fbea56a895e fetch-pack.c: enable fscache for stats under .git/objects
  87:  ae4077f39c4 =  83:  e9548a35e7a checkout.c: enable fscache for checkout again
  88:  291c7848878 =  84:  e9b4aeb8641 Enable the filesystem cache (fscache) in refresh_index().
  89:  e56a9a7f47d =  85:  93613563d09 fscache: use FindFirstFileExW to avoid retrieving the short name
  90:  901e18803fb =  86:  3e6991e8578 status: disable and free fscache at the end of the status command
  91:  51a9f378b20 !  87:  46631ba908e fscache: add GIT_TEST_FSCACHE support
    @@ compat/win32/fscache.c: int fscache_enable(int enable)
      
     
      ## t/README ##
    -@@ t/README: GIT_TEST_DEFAULT_HASH=<hash-algo> specifies which hash algorithm to
    - use in the test scripts. Recognized values for <hash-algo> are "sha1"
    - and "sha256".
    +@@ t/README: and "sha256".
    + GIT_TEST_WRITE_REV_INDEX=<boolean>, when true enables the
    + 'pack.writeReverseIndex' setting.
      
     +GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
     +which adds a cache below mingw's lstat and dirent implementations.
  92:  5e91370091c =  88:  e0414b57aa5 fscache: add fscache hit statistics
  93:  1925137e540 =  89:  1fe0d8b0964 mem_pool: add GIT_TRACE_MEMPOOL support
  94:  96c3e229530 =  90:  ebe61b61733 fscache: fscache takes an initial size
  95:  74606644158 =  91:  43894f78c85 fscache: update fscache to be thread specific instead of global
  96:  ff4c6abaf5c =  92:  bce5d67f273 fscache: teach fscache to use mempool
  97:  bf111d8d274 =  93:  f7dcac530f5 fscache: make fscache_enable() thread safe
  98:  d5bfbfe94a0 =  94:  467df570d1e fscache: teach fscache to use NtQueryDirectoryFile
  99:  0e7710ea4e3 =  95:  606f68913ea unpack-trees: enable fscache for sparse-checkout
 103:  401d0f443e7 =  96:  e1d57f4b387 fscache: remember the reparse tag for each entry
 105:  a402f60de77 =  97:  1f30b0a37ac fscache: implement an FSCache-aware is_mount_point()
 109:  bf80f299039 =  98:  f600588f3e9 clean: make use of FSCache
 100:  d6c30781da9 =  99:  209d1c7e307 git-gui: provide question helper for retry fallback on Windows
 101:  ef8bf35d603 = 100:  618967af65f git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
 106:  5135d6e3fce = 101:  437ba4407bb gitk: Unicode file name support
 102:  8498033eebe = 102:  e466929707a git-gui--askyesno: fix funny text wrapping
 110:  89645cbcec4 = 103:  e589fbfa761 gitk: Use an external icon file on Windows
 104:  2ab5f2350c0 = 104:  0b0974729cf git-gui--askyesno: allow overriding the window title
 111:  be311a57b65 = 105:  68403202143 gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6
 107:  21328983e23 = 106:  44a5c70e61f respect core.hooksPath, falling back to .git/hooks
 108:  0cfeec33127 = 107:  45807d8fd3c git-gui--askyesno (mingw): use Git for Windows' icon, if available
 112:  39bd7e34087 = 108:  5b989e8bfac gitk: make the "list references" default window width wider
 113:  862ead009ab = 109:  83b7d5eb407 pack-objects (mingw): demonstrate a segmentation fault with large deltas
 114:  59f13158e89 = 110:  7ff50caa82b mingw: support long paths
 115:  ed94dbfb530 = 111:  2b304aa53e5 Win32: fix 'lstat("dir/")' with long paths
 116:  d5d33c81a95 ! 112:  d521d4ca18d mingw: ensure that core.longPaths is handled *always*
    @@ builtin/check-ref-format.c: int cmd_check_ref_format(int argc, const char **argv
     
      ## builtin/clone.c ##
     @@ builtin/clone.c: int cmd_clone(int argc, const char **argv, const char *prefix)
    - 
    - 	struct strvec ref_prefixes = STRVEC_INIT;
    + 	struct transport_ls_refs_options transport_ls_refs_options =
    + 		TRANSPORT_LS_REFS_OPTIONS_INIT;
      
     +	git_config(platform_core_config, NULL);
     +
    @@ builtin/merge-tree.c: int cmd_merge_tree(int argc, const char **argv, const char
      	buf3 = get_tree_descriptor(r, t+2, argv[3]);
     
      ## builtin/mktag.c ##
    -@@
    - #include "tag.h"
    - #include "replace-object.h"
    - #include "object-store.h"
    -+#include "config.h"
    - 
    - /*
    -  * A signature file has a very simple fixed format: four lines
     @@ builtin/mktag.c: int cmd_mktag(int argc, const char **argv, const char *prefix)
    - 	if (argc != 1)
    - 		usage("git mktag");
    + 			     builtin_mktag_options,
    + 			     builtin_mktag_usage, 0);
      
     +	git_config(git_default_config, NULL);
    - 	if (strbuf_read(&buf, 0, 4096) < 0) {
    - 		die_errno("could not read from stdin");
    - 	}
    + 	if (strbuf_read(&buf, 0, 0) < 0)
    + 		die_errno(_("could not read from stdin"));
    + 
     
      ## builtin/mktree.c ##
     @@
 117:  3e32e98693e = 113:  fd5f510a045 mingw: Support `git_terminal_prompt` with more terminals
 118:  84252d980bc = 114:  00f81fd4ce7 compat/terminal.c: only use the Windows console if bash 'read -r' fails
 119:  b61b8cdeb4e = 115:  749fe2182c3 mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
 120:  d2254ec607b ! 116:  a59fb8bc201 Unbreak interactive GPG prompt upon signing
    @@ t/t7004-tag.sh: test_expect_success GPG \
     -	'git tag -s fails if gpg is misconfigured (bad signature format)' \
     -	'test_config gpg.program echo &&
     -	 test_must_fail git tag -s -m tail tag-gpg-failure'
    +-
    +-# try to produce invalid signature
    +-test_expect_success GPG 'git verifies tag is valid with double signature' '
    +-	git tag -s -m tail tag-gpg-double-sig &&
    +-	git cat-file tag tag-gpg-double-sig >tag &&
    +-	othersigheader=$(test_oid othersigheader) &&
    +-	sed -ne "/^\$/q;p" tag >new-tag &&
    +-	cat <<-EOM >>new-tag &&
    +-	$othersigheader -----BEGIN PGP SIGNATURE-----
    +-	 someinvaliddata
    +-	 -----END PGP SIGNATURE-----
    +-	EOM
    +-	sed -e "1,/^tagger/d" tag >>new-tag &&
    +-	new_tag=$(git hash-object -t tag -w new-tag) &&
    +-	git update-ref refs/tags/tag-gpg-double-sig $new_tag &&
    +-	git verify-tag tag-gpg-double-sig &&
    +-	git fsck
    +-'
     -
      # try to sign with bad user.signingkey
      test_expect_success GPGSM \
 121:  f73b1638d73 = 117:  854cfafaad7 strbuf_readlink: don't call readlink twice if hint is the exact link size
 122:  f51d5cbe19a = 118:  e0cee445007 strbuf_readlink: support link targets that exceed PATH_MAX
 123:  fa5b1dded42 = 119:  1a6f7154505 lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
 124:  d9b9f98208c = 120:  8c178888bc4 Win32: don't call GetFileAttributes twice in mingw_lstat()
 125:  53041e53624 = 121:  884db88f2e7 Win32: implement stat() with symlink support
 126:  db64c8afcdf = 122:  a9968ce7b26 Win32: remove separate do_lstat() function
 127:  142f3fc4034 = 123:  be160f8eee3 Win32: let mingw_lstat() error early upon problems with reparse points
 128:  a929e92f35f = 124:  1a3d8f42f85 mingw: teach fscache and dirent about symlinks
 129:  f9d570875ea = 125:  f93b9f6f187 Win32: lstat(): return adequate stat.st_size for symlinks
 130:  097ce7da899 = 126:  4dcc9883833 Win32: factor out retry logic
 131:  c83b3f58308 = 127:  7beb33b26cc Win32: change default of 'core.symlinks' to false
 132:  f670e1f2990 = 128:  90877d25e88 Win32: add symlink-specific error codes
 133:  80205fa85fd = 129:  c4b0ba6cb5f Win32: mingw_unlink: support symlinks to directories
 134:  fad32ee1f2f = 130:  e9de5066f07 Win32: mingw_rename: support renaming symlinks
 135:  41541fe09fc = 131:  a4ad4162da0 Win32: mingw_chdir: change to symlink-resolved directory
 136:  2b50914d839 = 132:  4715c5d33c7 Win32: implement readlink()
 137:  3ea49b20d66 = 133:  abe39c43bb6 mingw: lstat: compute correct size for symlinks
 138:  55b7fbbf308 = 134:  194817dc0f0 Win32: implement basic symlink() functionality (file symlinks only)
 139:  47f7ed872ea = 135:  863ce6413a1 Win32: symlink: add support for symlinks to directories
 140:  11ed53568aa = 136:  0f3625dc5ff mingw: try to create symlinks without elevated permissions
 141:  17cf8f2e027 = 137:  516eb39f2d4 mingw: emulate stat() a little more faithfully
 142:  db975129750 = 138:  0f91dd10804 mingw: special-case index entries for symlinks with buggy size
 143:  b14f66f82bd = 139:  a8768209952 Win32: symlink: move phantom symlink creation to a separate function
 148:  29b13314ca6 = 140:  7117ee49add mingw: introduce code to detect whether we're inside a Windows container
 144:  d8aa0e7b4b6 = 141:  65fde092fad Introduce helper to create symlinks that knows about index_state
 150:  a40e02eaf66 = 142:  d96fdece8e9 mingw: when running in a Windows container, try to rename() harder
 145:  46b901b8192 = 143:  51a972c3d05 mingw: allow to specify the symlink type in .gitattributes
 152:  e11a18a72b7 = 144:  ad95cdb5f59 mingw: move the file_attr_to_st_mode() function definition
 146:  479734d58b7 = 145:  ff7f6639cd2 Win32: symlink: add test for `symlink` attribute
 154:  91060f3aabc = 146:  88c430d3491 mingw: Windows Docker volumes are *not* symbolic links
 147:  3906f743a74 = 147:  1eccc1a85bc mingw: explicitly specify with which cmd to prefix the cmdline
 149:  64771457d56 = 148:  2f8a838fc48 mingw: when path_lookup() failed, try BusyBox
 151:  522c4ac4db5 ! 149:  33fe4ceceba test-lib: avoid unnecessary Perl invocation
    @@ Commit message
         Signed-off-by: Johannes Schindelin <[email protected]>
     
      ## t/test-lib.sh ##
    -@@ t/test-lib.sh: fi
    +@@ t/test-lib.sh: EDITOR=:
      # /usr/xpg4/bin/sh and /bin/ksh to bail out.  So keep the unsets
      # deriving from the command substitution clustered with the other
      # ones.
 153:  3be41104075 ! 150:  8c230e5d413 tests: replace mingw_test_cmp with a helper in C
    @@ t/helper/test-tool.h
     
      ## t/test-lib-functions.sh ##
     @@ t/test-lib-functions.sh: test_expect_code () {
    - # - not all diff versions understand "-u"
      
      test_cmp () {
    + 	test "$#" -ne 2 && BUG "2 param"
     -	eval "$GIT_TEST_CMP" '"$@"'
     +	GIT_ALLOC_LIMIT=0 eval "$GIT_TEST_CMP" '"$@"'
      }
 155:  d3ce94db86f = 151:  bf0da8a658b test-tool: learn to act as a drop-in replacement for `iconv`
 156:  e0b8dc69cbc = 152:  de504df4d9c tests(mingw): if `iconv` is unavailable, use `test-helper --iconv`
-157:  928c18016de <   -:  ----------- tests: use t/diff-lib/* consistently
 172:  b8ba667d30d = 153:  64c94ebc455 mingw: kill child processes in a gentler way
 171:  71b325c48b4 = 154:  adba0237875 status: carry the --no-lock-index option for backwards-compatibility
 175:  6e840de02e5 = 155:  79d94c95d15 mingw: really handle SIGINT
 173:  51a32917a17 = 156:  cf78683aa09 status: reinstate --show-ignored-directory as a deprecated option
 176:  710da5e26af = 157:  adf4f6e18c9 status: verify that --show-ignored-directory prints a warning
 177:  9fa7de639c5 = 158:  a5d4862e7dd reset: reinstate support for the deprecated --stdin option
 185:  9c685ac696a = 159:  28e2342fa53 Add a GitHub workflow to monitor component updates
 178:  66fb933b0eb ! 160:  0664280e978 Modify the Code of Conduct for Git for Windows
    @@ CODE_OF_CONDUCT.md
      this code of conduct may be banned from the community.
      
      ## Our Pledge
    -@@ CODE_OF_CONDUCT.md: maintainers.
    +@@ CODE_OF_CONDUCT.md: representative at an online or offline event.
      ## Enforcement
      
      Instances of abusive, harassing, or otherwise unacceptable behavior may be
    --reported by contacting the project team at [email protected]. All
    --complaints will be reviewed and investigated and will result in a response
    --that is deemed necessary and appropriate to the circumstances. The project
    --team is obligated to maintain confidentiality with regard to the reporter of
    --an incident. Further details of specific enforcement policies may be posted
    --separately.
    -+reported by contacting the Git for Windows maintainer or Git's project team
    -+at [email protected]. All complaints will be reviewed and investigated
    -+and will result in a response that is deemed necessary and appropriate to the
    -+circumstances. The project team is obligated to maintain confidentiality with
    -+regard to the reporter of an incident. Further details of specific
    -+enforcement policies may be posted separately.
    - 
    - Project maintainers who do not follow or enforce the Code of Conduct in good
    - faith may face temporary or permanent repercussions as determined by other
    - members of the project's leadership.
    - 
    --The project leadership team can be contacted by email as a whole at
    -+The Git for Windows maintainer can be contacted at [email protected],
    -+and the Git project leadership team can be contacted by email as a whole at
    - [email protected], or individually:
    +-reported to the community leaders responsible for enforcement at
    [email protected], or individually:
    ++reported by contacting the Git for Windows maintainer or the community leaders
    ++responsible for enforcement at [email protected], or individually:
      
        - Ævar Arnfjörð Bjarmason <[email protected]>
    +   - Christian Couder <[email protected]>
 179:  348f642426e = 161:  bad59ed7970 CONTRIBUTING.md: add guide for first-time contributors
 180:  fdb7cf6f907 = 162:  a4e828c6c38 README.md: Add a Windows-specific preamble
 181:  3450f4a017b = 163:  0bfdb410711 Add an issue template
 182:  b5b5eb5bc93 = 164:  e0e5a32461c Modify the GitHub Pull Request template (to reflect Git for Windows)
 183:  58123d3570a = 165:  e63909b7fd0 .github: Add configuration for the Sentiment Bot
 184:  eac3ac28847 = 166:  5aaae9dbdcd Document how $HOME is set on Windows
 186:  3f7729625a3 = 167:  89c227d9202 SECURITY.md: document Git for Windows' policies
  -:  ----------- > 168:  6c4fd567176 tests: use t/lib-diff/* consistently
 158:  bc11af214af ! 169:  4c978e85531 gitattributes: mark .png files as binary
    @@ .gitattributes
     +*.png binary
      *.py eol=lf diff=python
      *.bat eol=crlf
    - /Documentation/**/*.txt eol=lf
    + CODE_OF_CONDUCT.md -whitespace
 159:  0125677eda6 ! 170:  fd6768e6a66 tests: move test PNGs into t/diff-lib/
    @@ Metadata
     Author: Johannes Schindelin <[email protected]>
     
      ## Commit message ##
    -    tests: move test PNGs into t/diff-lib/
    +    tests: move test PNGs into t/lib-diff/
     
         We already have a directory where we store files intended for use by
         multiple test scripts. The same directory is a better home for the
    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <[email protected]>
     
    - ## t/test-binary-1.png => t/diff-lib/test-binary-1.png ##
    + ## t/test-binary-1.png => t/lib-diff/test-binary-1.png ##
     
    - ## t/test-binary-2.png => t/diff-lib/test-binary-2.png ##
    + ## t/test-binary-2.png => t/lib-diff/test-binary-2.png ##
     
      ## t/t3307-notes-man.sh ##
     @@ t/t3307-notes-man.sh: test_expect_success 'example 1: notes to add an Acked-by line' '
    @@ t/t3307-notes-man.sh: test_expect_success 'example 1: notes to add an Acked-by l
      
      test_expect_success 'example 2: binary notes' '
     -	cp "$TEST_DIRECTORY"/test-binary-1.png . &&
    -+	cp "$TEST_DIRECTORY"/diff-lib/test-binary-1.png . &&
    ++	cp "$TEST_DIRECTORY"/lib-diff/test-binary-1.png . &&
      	git checkout B &&
      	blob=$(git hash-object -w test-binary-1.png) &&
      	git notes --ref=logo add -C "$blob" &&
    @@ t/t3903-stash.sh: test_expect_success 'stash -- <subdir> works with binary files
      	>subdir/untracked &&
      	>subdir/tracked &&
     -	cp "$TEST_DIRECTORY"/test-binary-1.png subdir/tracked-binary &&
    -+	cp "$TEST_DIRECTORY"/diff-lib/test-binary-1.png subdir/tracked-binary &&
    ++	cp "$TEST_DIRECTORY"/lib-diff/test-binary-1.png subdir/tracked-binary &&
      	git add subdir/tracked* &&
      	git stash -- subdir/ &&
      	test_path_is_missing subdir/tracked &&
    @@ t/t4012-diff-binary.sh: test_expect_success 'prepare repository' '
      	git update-index --add a b c d &&
      	echo git >a &&
     -	cat "$TEST_DIRECTORY"/test-binary-1.png >b &&
    -+	cat "$TEST_DIRECTORY"/diff-lib/test-binary-1.png >b &&
    ++	cat "$TEST_DIRECTORY"/lib-diff/test-binary-1.png >b &&
      	echo git >c &&
      	cat b b >d
      '
    @@ t/t4049-diff-stat-count.sh: test_expect_success 'binary changes do not count in
      	echo a >a &&
      	echo c >c &&
     -	cat "$TEST_DIRECTORY"/test-binary-1.png >d &&
    -+	cat "$TEST_DIRECTORY"/diff-lib/test-binary-1.png >d &&
    ++	cat "$TEST_DIRECTORY"/lib-diff/test-binary-1.png >d &&
      	cat >expect <<-\EOF &&
      	 a | 1 +
      	 c | 1 +
    @@ t/t6403-merge-file.sh: test_expect_success "expected conflict markers" '
      test_expect_success 'binary files cannot be merged' '
      	test_must_fail git merge-file -p \
     -		orig.txt "$TEST_DIRECTORY"/test-binary-1.png new1.txt 2> merge.err &&
    -+		orig.txt "$TEST_DIRECTORY"/diff-lib/test-binary-1.png new1.txt 2> merge.err &&
    ++		orig.txt "$TEST_DIRECTORY"/lib-diff/test-binary-1.png new1.txt 2> merge.err &&
      	grep "Cannot merge binary files" merge.err
      '
      
     
      ## t/t6407-merge-binary.sh ##
    -@@ t/t6407-merge-binary.sh: test_description='ask merge-recursive to merge binary files'
    +@@ t/t6407-merge-binary.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
      
      test_expect_success setup '
      
     -	cat "$TEST_DIRECTORY"/test-binary-1.png >m &&
    -+	cat "$TEST_DIRECTORY"/diff-lib/test-binary-1.png >m &&
    ++	cat "$TEST_DIRECTORY"/lib-diff/test-binary-1.png >m &&
      	git add m &&
      	git ls-files -s | sed -e "s/ 0	/ 1	/" >E1 &&
      	test_tick &&
    @@ t/t9200-git-cvsexportcommit.sh: test_expect_success \
           echo hello2 >B/newfile2.txt &&
     -     cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
     -     cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png &&
    -+     cp "$TEST_DIRECTORY"/diff-lib/test-binary-1.png C/newfile3.png &&
    -+     cp "$TEST_DIRECTORY"/diff-lib/test-binary-1.png D/newfile4.png &&
    ++     cp "$TEST_DIRECTORY"/lib-diff/test-binary-1.png C/newfile3.png &&
    ++     cp "$TEST_DIRECTORY"/lib-diff/test-binary-1.png D/newfile4.png &&
           git add A/newfile1.txt &&
           git add B/newfile2.txt &&
           git add C/newfile3.png &&
    @@ t/t9200-git-cvsexportcommit.sh: test_expect_success \
           echo Hello5  >E/newfile5.txt &&
     -     cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png &&
     -     cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png &&
    -+     cp "$TEST_DIRECTORY"/diff-lib/test-binary-2.png D/newfile4.png &&
    -+     cp "$TEST_DIRECTORY"/diff-lib/test-binary-1.png F/newfile6.png &&
    ++     cp "$TEST_DIRECTORY"/lib-diff/test-binary-2.png D/newfile4.png &&
    ++     cp "$TEST_DIRECTORY"/lib-diff/test-binary-1.png F/newfile6.png &&
           git add E/newfile5.txt &&
           git add F/newfile6.png &&
           git commit -a -m "Test: Remove, add and update" &&
    @@ t/t9200-git-cvsexportcommit.sh: test_expect_success \
            echo ok then >"G g/with spaces.txt" &&
            git add "G g/with spaces.txt" && \
     -      cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
    -+      cp "$TEST_DIRECTORY"/diff-lib/test-binary-1.png "G g/with spaces.png" && \
    ++      cp "$TEST_DIRECTORY"/lib-diff/test-binary-1.png "G g/with spaces.png" && \
            git add "G g/with spaces.png" &&
            git commit -a -m "With spaces" &&
            id=$(git rev-list --max-count=1 HEAD) &&
    @@ t/t9200-git-cvsexportcommit.sh: test_expect_success \
           'Update file with spaces in file name' \
           'echo Ok then >>"G g/with spaces.txt" &&
     -      cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
    -+      cat "$TEST_DIRECTORY"/diff-lib/test-binary-1.png \
    ++      cat "$TEST_DIRECTORY"/lib-diff/test-binary-1.png \
     +	>>"G g/with spaces.png" && \
            git add "G g/with spaces.png" &&
            git commit -a -m "Update with spaces" &&
    @@ t/t9200-git-cvsexportcommit.sh: test_expect_success !MINGW \
            echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
            git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
     -      cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
    -+      cp "$TEST_DIRECTORY"/diff-lib/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
    ++      cp "$TEST_DIRECTORY"/lib-diff/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
            git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
            git commit -a -m "Går det så går det" && \
            id=$(git rev-list --max-count=1 HEAD) &&
 160:  56154959821 = 171:  0d862031ec9 tests: only override sort & find if there are usable ones in /usr/bin/
 161:  cfdf22a07e4 ! 172:  b447d47e5ec tests: use the correct path separator with BusyBox
    @@ t/lib-proto-disable.sh: setup_ext_wrapper () {
      }
     
      ## t/t0021-conversion.sh ##
    -@@ t/t0021-conversion.sh: test_description='blob conversion via gitattributes'
    +@@ t/t0021-conversion.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
      . ./test-lib.sh
      
      TEST_ROOT="$PWD"
    @@ t/t2300-cd-to-toplevel.sh: test_cd_to_toplevel () {
     
      ## t/t3402-rebase-merge.sh ##
     @@ t/t3402-rebase-merge.sh: test_expect_success 'rebase -s funny -Xopt' '
    - 	git checkout -b test-funny master^ &&
    + 	git checkout -b test-funny main^ &&
      	test_commit funny &&
      	(
     -		PATH=./test-bin:$PATH &&
     +		PATH=./test-bin$PATH_SEP$PATH &&
    - 		git rebase -s funny -Xopt master
    + 		git rebase -s funny -Xopt main
      	) &&
      	test -f funny.was.run
     
    @@ t/t3418-rebase-continue.sh: test_expect_success 'rebase --continue remembers mer
      	(
     -		PATH=./test-bin:$PATH &&
     +		PATH=./test-bin$PATH_SEP$PATH &&
    - 		test_must_fail git rebase -s funny -Xopt master topic
    + 		test_must_fail git rebase -s funny -Xopt main topic
      	) &&
      	test -f funny.was.run &&
     @@ t/t3418-rebase-continue.sh: test_expect_success 'rebase --continue remembers merge strategy and options' '
    @@ t/t3418-rebase-continue.sh: test_expect_success 'rebase -i --continue handles me
      	(
     -		PATH=./test-bin:$PATH &&
     +		PATH=./test-bin$PATH_SEP$PATH &&
    - 		test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic
    + 		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' '
 162:  7e771c52c00 = 173:  db25ffbacaf mingw: only use Bash-ism `builtin pwd -W` when available
 163:  c123ac91b35 = 174:  7b40263dcaa tests (mingw): remove Bash-specific pwd option
 164:  a70c57f16d7 = 175:  50c0685cb2f test-lib: add BUSYBOX prerequisite
 165:  7827369f121 ! 176:  368621285f7 t0021: use Windows path when appropriate
    @@ Commit message
         Signed-off-by: Johannes Schindelin <[email protected]>
     
      ## t/t0021-conversion.sh ##
    -@@ t/t0021-conversion.sh: test_description='blob conversion via gitattributes'
    +@@ t/t0021-conversion.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
      
      . ./test-lib.sh
      
 166:  1152a717971 ! 177:  27682a62eee t5003: use binary file from t/diff-lib/
    @@ Metadata
     Author: Johannes Schindelin <[email protected]>
     
      ## Commit message ##
    -    t5003: use binary file from t/diff-lib/
    +    t5003: use binary file from t/lib-diff/
     
         At some stage, t5003-archive-zip wants to add a file that is not ASCII.
         To that end, it uses /bin/sh. But that file may actually not exist (it
    @@ t/t5003-archive-zip.sh: test_expect_success \
           echo simple textfile >a/a &&
           mkdir a/bin &&
     -     cp /bin/sh a/bin &&
    -+     cp "$TEST_DIRECTORY/diff-lib/test-binary-1.png" a/bin &&
    ++     cp "$TEST_DIRECTORY/lib-diff/test-binary-1.png" a/bin &&
           printf "text\r"	>a/text.cr &&
           printf "text\r\n"	>a/text.crlf &&
           printf "text\n"	>a/text.lf &&
 167:  8fcf06bba92 = 178:  8156251da2c t5532: workaround for BusyBox on Windows
 168:  6e605b8a261 = 179:  1e58c85668a t5605: special-case hardlink test for BusyBox-w32
 169:  12e905aa436 = 180:  bb51d2513aa t5813: allow for $PWD to be a Windows path
 170:  2c72688cbf5 = 181:  1e8a3319434 t9200: skip tests when $PWD contains a colon
 174:  b7c756e6e45 ! 182:  7665640dc56 mingw: add a Makefile target to copy test artifacts
    @@ config.mak.uname: else
     +
     +	install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
     +	install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
    -+	(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] diff-lib) | \
    ++	(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] lib-diff) | \
     +	(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
     +	install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
     +

The biggest changes are necessary because upstream renamed t/diff-lib/ to t/lib-diff/.

And of course, the test suite no longer uses master but main.

Finally, e5620e5 was dropped. See gitgitgadget#142 (comment) for details.

gitster and others added 30 commits February 25, 2021 16:43
Signed-off-by: Junio C Hamano <[email protected]>
This commit starts the rebase of f7b4570 to 4c4ac06
This happens only when the corresponding commits are not exported in
the current fast-export run. This can happen either when the relevant
commit is already marked, or when the commit is explicitly marked
as UNINTERESTING with a negative ref by another argument.

This breaks fast-export basec remote helpers.

Signed-off-by: Sverre Rabbelier <[email protected]>
[PT: ensure we add an additional element to the argv array]

Signed-off-by: Sverre Rabbelier <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Sverre Rabbelier <[email protected]>
After importing anything with fast-import, we should always let the
garbage collector do its job, since the objects are written to disk
inefficiently.

This brings down an initial import of http://selenic.com/hg from about
230 megabytes to about 14.

In the future, we may want to make this configurable on a per-remote
basis, or maybe teach fast-import about it in the first place.

Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, there are several categories of absolute paths. One such
category starts with a backslash and is implicitly relative to the
drive associated with the current working directory. Example:

	c:
	git clone https://github.com/git-for-windows/git \G4W

should clone into C:\G4W.

There is currently a problem with that, in that mingw_mktemp() does not
expect the _wmktemp() function to prefix the absolute path with the
drive prefix, and as a consequence, the resulting path does not fit into
the originally-passed string buffer. The symptom is a "Result too large"
error.

Reported by Juan Carlos Arevalo Baeza.

Signed-off-by: Johannes Schindelin <[email protected]>
MinGit for Windows comes without `gzip` bundled inside, git-archive uses
`gzip -cn` to compress tar files but for this to work, gzip needs to be
present on the host system.

In the next commit, we will change the gzip compression so that we no
longer spawn `gzip` but let zlib perform the compression in the same
process instead.

In preparation for this, we consolidate all the block writes into a
single function.

This closes git-for-windows#1970

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
To avoid running into command line limitations, some of Git's commands
support the `--stdin` option.

Let's use exactly this option in the three rev-list/log invocations in
gitk that would otherwise possibly run the danger of trying to invoke a
too-long command line.

While it is easy to redirect either stdin or stdout in Tcl/Tk scripts,
what we need here is both. We need to capture the output, yet we also
need to pipe in the revs/files arguments via stdin (because stdin does
not have any limit, unlike the command line). To help this, we use the
neat Tcl feature where you can capture stdout and at the same time feed
a fixed string as stdin to the spawned process.

One non-obvious aspect about this change is that the `--stdin` option
allows to specify revs, the double-dash, and files, but *no* other
options such as `--not`. This is addressed by prefixing the "negative"
revs with `^` explicitly rather than relying on the `--not` option
(thanks for coming up with that idea, Max!).

This fixes git-for-windows#1987

Analysis-and-initial-patch-by: Max Kirillov <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
When specifying an absolute path without a drive prefix, we convert that
path internally. Let's make sure that we handle that case properly, too
;-)

This fixes the command

	git clone https://github.com/git-for-windows/git \G4W

Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, an absolute POSIX path needs to be turned into a Windows
one.

Signed-off-by: Johannes Schindelin <[email protected]>
As we already link to the zlib library, we can perform the compression
without even requiring gzip on the host machine.

Signed-off-by: Rohit Ashiwal <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
From the documentation of said setting:

	This boolean will enable fsync() when writing object files.

	This is a total waste of time and effort on a filesystem that
	orders data writes properly, but can be useful for filesystems
	that do not use journalling (traditional UNIX filesystems) or
	that only journal metadata and not file contents (OS X’s HFS+,
	or Linux ext3 with "data=writeback").

The most common file system on Windows (NTFS) does not guarantee that
order, therefore a sudden loss of power (or any other event causing an
unclean shutdown) would cause corrupt files (i.e. files filled with
NULs). Therefore we need to change the default.

Note that the documentation makes it sound as if this causes really bad
performance. In reality, writing loose objects is something that is done
only rarely, and only a handful of files at a time.

Signed-off-by: Johannes Schindelin <[email protected]>
It seems to be not exactly rare on Windows to install NTFS junction
points (the equivalent of "bind mounts" on Linux/Unix) in worktrees,
e.g. to map some development tools into a subdirectory.

In such a scenario, it is pretty horrible if `git clean -dfx` traverses
into the mapped directory and starts to "clean up".

Let's just not do that. Let's make sure before we traverse into a
directory that it is not a mount point (or junction).

This addresses git-for-windows#607

Signed-off-by: Johannes Schindelin <[email protected]>
Windows' equivalent to "bind mounts", NTFS junction points, can be
unlinked without affecting the mount target. This is clearly what users
expect to happen when they call `git clean -dfx` in a worktree that
contains NTFS junction points: the junction should be removed, and the
target directory of said junction should be left alone (unless it is
inside the worktree).

Signed-off-by: Johannes Schindelin <[email protected]>
Style issue: a space was missing.

Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]>
Git for Windows' prefix is `/mingw64/` (or `/mingw32/` for 32-bit
versions), therefore the system config is located at the clunky location
`C:\Program Files\Git\mingw64\etc\gitconfig`.

This moves the system config into a more logical location: the `mingw64`
part of `C:\Program Files\Git\mingw64\etc\gitconfig` never made sense,
as it is a mere implementation detail. Let's skip the `mingw64` part and
move this to `C:\Program Files\Git\etc\gitconfig`.

Side note: in the rare (and not recommended) case a user chooses to
install 32-bit Git for Windows on a 64-bit system, the path will of
course be `C:\Program Files (x86)\Git\etc\gitconfig`.

Background: During the Git for Windows v1.x days, the system config was
located at `C:\Program Files (x86)\Git\etc\gitconfig`. With Git for
Windows v2.x, it moved to `C:\Program Files\Git\mingw64\gitconfig` (or
`C:\Program Files (x86)\Git\mingw32\gitconfig`). Rather than fixing it
back then, we tried to introduce a "Windows-wide" config, but that never
caught on.

Likewise, we move the system `gitattributes` into the same directory.

Obviously, we are cautious to do this only for the known install
locations `/mingw64` and `/mingw32`; If anybody wants to override that
while building their version of Git (e.g. via `make prefix=$HOME`), we
leave the default location of the system config and gitattributes alone.

Signed-off-by: Johannes Schindelin <[email protected]>
Git for Windows is compiled with a runtime prefix, and that runtime
prefix is typically `C:/Program Files/Git/mingw64`. As we want the
system gitconfig to live in the sibling directory `etc`, we define the
relative path as `../etc/gitconfig`.

However, as reported by Philip Oakley, the output of `git config
--show-origin --system -l` looks rather ugly, as it shows the path as
`file:C:/Program Files/Git/mingw64/../etc/gitconfig`, i.e. with the
`mingw64/../` part.

By normalizing the path, we get a prettier path.

Signed-off-by: Johannes Schindelin <[email protected]>
While Git for Windows does not _ship_ Python (in order to save on
bandwidth), MSYS2 provides very fine Python interpreters that users can
easily take advantage of, by using Git for Windows within its SDK.

Signed-off-by: Johannes Schindelin <[email protected]>
Since commit 0c499ea the send-pack builtin uses the side-band-64k
capability if advertised by the server.

Unfortunately this breaks pushing over the dump git protocol if used
over a network connection.

The detailed reasons for this breakage are (by courtesy of Jeff Preshing,
quoted from ttps://groups.google.com/d/msg/msysgit/at8D7J-h7mw/eaLujILGUWoJ):
----------------------------------------------------------------------------
MinGW wraps Windows sockets in CRT file descriptors in order to mimic the
functionality of POSIX sockets. This causes msvcrt.dll to treat sockets as
Installable File System (IFS) handles, calling ReadFile, WriteFile,
DuplicateHandle and CloseHandle on them. This approach works well in simple
cases on recent versions of Windows, but does not support all usage patterns.
In particular, using this approach, any attempt to read & write concurrently
on the same socket (from one or more processes) will deadlock in a scenario
where the read waits for a response from the server which is only invoked after
the write. This is what send_pack currently attempts to do in the use_sideband
codepath.
----------------------------------------------------------------------------

The new config option "sendpack.sideband" allows to override the side-band-64k
capability of the server, and thus makes the dump git protocol work.

Other transportation methods like ssh and http/https still benefit from
the sideband channel, therefore the default value of "sendpack.sideband"
is still true.

[jes: split out the documentation into Documentation/config/]

Signed-off-by: Thomas Braun <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Oliver Schneider <[email protected]>
The winsock2 library provides functions that work on different data
types than file descriptors, therefore we wrap them.

But that is not the only difference: they also do not set `errno` but
expect the callers to enquire about errors via `WSAGetLastError()`.

Let's translate that into appropriate `errno` values whenever the socket
operations fail so that Git's code base does not have to change its
expectations.

This closes git-for-windows#2404

Helped-by: Jeff Hostetler <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
As pointed out in git-for-windows#1676,
the `git rev-parse --is-inside-work-tree` command currently fails when
the current directory's path contains symbolic links.

The underlying reason for this bug is that `getcwd()` is supposed to
resolve symbolic links, but our `mingw_getcwd()` implementation did not.

We do have all the building blocks for that, though: the
`GetFinalPathByHandleW()` function will resolve symbolic links. However,
we only called that function if `GetLongPathNameW()` failed, for
historical reasons: the latter function was supported for a long time,
but the former API function was introduced only with Windows Vista, and
we used to support also Windows XP. With that support having been
dropped, we are free to call the symbolic link-resolving function right
away.

Signed-off-by: Johannes Schindelin <[email protected]>
A change between versions 2.4.1 and 2.6.0 of the MSYS2 runtime modified
how Cygwin's runtime (and hence Git for Windows' MSYS2 runtime
derivative) handles locales: d16a56306d (Consolidate wctomb/mbtowc calls
for POSIX-1.2008, 2016-07-20).

An unintended side-effect is that "cold-calling" into the POSIX
emulation will start with a locale based on the current code page,
something that Git for Windows is very ill-prepared for, as it expects
to be able to pass a command-line containing non-ASCII characters to the
shell without having those characters munged.

One symptom of this behavior: when `git clone` or `git fetch` shell out
to call `git-upload-pack` with a path that contains non-ASCII
characters, the shell tried to interpret the entire command-line
(including command-line parameters) as executable path, which obviously
must fail.

This fixes git-for-windows#1036

Signed-off-by: Johannes Schindelin <[email protected]>
NTFS junctions are somewhat similar in spirit to Unix bind mounts: they
point to a different directory and are resolved by the filesystem
driver. As such, they appear to `lstat()` as if they are directories,
not as if they are symbolic links.

_Any_ user can create junctions, while symbolic links can only be
created by non-administrators in Developer Mode on Windows 10. Hence
NTFS junctions are much more common "in the wild" than NTFS symbolic
links.

It was reported in git-for-windows#2481
that adding files via an absolute path that traverses an NTFS junction:
since 1e64d18 (mingw: do resolve symlinks in `getcwd()`), we resolve not
only symbolic links but also NTFS junctions when determining the
absolute path of the current directory. The same is not true for `git
add <file>`, where symbolic links are resolved in `<file>`, but not NTFS
junctions.

Signed-off-by: Johannes Schindelin <[email protected]>
Git for Windows wants to add `git.exe` to the users' `PATH`, without
cluttering the latter with unnecessary executables such as `wish.exe`.
To that end, it invented the concept of its "Git wrapper", i.e. a tiny
executable located in `C:\Program Files\Git\cmd\git.exe` (originally a
CMD script) whose sole purpose is to set up a couple of environment
variables and then spawn the _actual_ `git.exe` (which nowadays lives in
`C:\Program Files\Git\mingw64\bin\git.exe` for 64-bit, and the obvious
equivalent for 32-bit installations).

Currently, the following environment variables are set unless already
initialized:

- `MSYSTEM`, to make sure that the MSYS2 Bash and the MSYS2 Perl
  interpreter behave as expected, and

- `PLINK_PROTOCOL`, to force PuTTY's `plink.exe` to use the SSH
  protocol instead of Telnet,

- `PATH`, to make sure that the `bin` folder in the user's home
  directory, as well as the `/mingw64/bin` and the `/usr/bin`
  directories are included. The trick here is that the `/mingw64/bin/`
  and `/usr/bin/` directories are relative to the top-level installation
  directory of Git for Windows (which the included Bash interprets as
  `/`, i.e. as the MSYS pseudo root directory).

Using the absence of `MSYSTEM` as a tell-tale, we can detect in
`git.exe` whether these environment variables have been initialized
properly. Therefore we can call `C:\Program Files\Git\mingw64\bin\git`
in-place after this change, without having to call Git through the Git
wrapper.

Obviously, above-mentioned directories must be _prepended_ to the `PATH`
variable, otherwise we risk picking up executables from unrelated Git
installations. We do that by constructing the new `PATH` value from
scratch, appending `$HOME/bin` (if `HOME` is set), then the MSYS2 system
directories, and then appending the original `PATH`.

Side note: this modification of the `PATH` variable is independent of
the modification necessary to reach the executables and scripts in
`/mingw64/libexec/git-core/`, i.e. the `GIT_EXEC_PATH`. That
modification is still performed by Git, elsewhere, long after making the
changes described above.

While we _still_ cannot simply hard-link `mingw64\bin\git.exe` to `cmd`
(because the former depends on a couple of `.dll` files that are only in
`mingw64\bin`, i.e. calling `...\cmd\git.exe` would fail to load due to
missing dependencies), at least we can now avoid that extra process of
running the Git wrapper (which then has to wait for the spawned
`git.exe` to finish) by calling `...\mingw64\bin\git.exe` directly, via
its absolute path.

Testing this is in Git's test suite tricky: we set up a "new" MSYS
pseudo-root and copy the `git.exe` file into the appropriate location,
then verify that `MSYSTEM` is set properly, and also that the `PATH` is
modified so that scripts can be found in `$HOME/bin`, `/mingw64/bin/`
and `/usr/bin/`.

This addresses git-for-windows#2283

Signed-off-by: Johannes Schindelin <[email protected]>
Some platforms (e.g. Windows) provide API functions to resolve paths
much quicker. Let's offer a way to short-cut `strbuf_realpath()` on
those platforms.

Signed-off-by: Johannes Schindelin <[email protected]>
…ctory

Internally, Git expects the environment variable `HOME` to be set, and
to point to the current user's home directory.

This environment variable is not set by default on Windows, and
therefore Git tries its best to construct one if it finds `HOME` unset.

There are actually two different approaches Git tries: first, it looks
at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate
environments with roaming profiles, and a user generally wants their
global Git settings to be in a roaming profile.

Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a
valid location, Git will fall back to using `USERPROFILE` instead.

However, starting with Windows Vista, for secondary logons and services,
the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows'
system directory (usually `C:\Windows\system32`).

That is undesirable, and that location is usually write-protected anyway.

So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to
Windows' system directory before using it, falling back to `USERPROFILE`
if it does.

This fixes git-for-windows#2709

Initial-Path-by: Ivan Pozdeev <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
In 1e64d18 (mingw: do resolve symlinks in `getcwd()`) a problem was
introduced that causes git for Windows to stop working with certain
mapped network drives (in particular, drives that are mapped to
locations with long path names). Error message was "fatal: Unable to
read current working directory: No such file or directory". Present
change fixes this issue as discussed in
git-for-windows#2480

Signed-off-by: Bjoern Mueller <[email protected]>
Update clink.pl to link with either libcurl.lib or libcurl-d.lib
depending on whether DEBUG=1 is set.

Signed-off-by: Jeff Hostetler <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho added 25 commits February 26, 2021 09:52
This was pull request git-for-windows#1645 from ZCube/master

Support windows container.

Signed-off-by: Johannes Schindelin <[email protected]>
The idea of copying README and COPYING into t/lib-diff/ was to step away
from using files from outside t/ in tests. Let's really make sure that
we use the files from t/lib-diff/ instead of other versions of those
files.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
We already have a directory where we store files intended for use by
multiple test scripts. The same directory is a better home for the
test-binary-*.png files than t/.

Signed-off-by: Johannes Schindelin <[email protected]>
The idea is to allow running the test suite on MinGit with BusyBox
installed in /mingw64/bin/sh.exe. In that case, we will want to exclude
sort & find (and other Unix utilities) from being bundled.

Signed-off-by: Johannes Schindelin <[email protected]>
BusyBox-w32 is a true Win32 application, i.e. it does not come with a
POSIX emulation layer.

That also means that it does *not* use the Unix convention of separating
the entries in the PATH variable using colons, but semicolons.

However, there are also BusyBox ports to Windows which use a POSIX
emulation layer such as Cygwin's or MSYS2's runtime, i.e. using colons
as PATH separators.

As a tell-tale, let's use the presence of semicolons in the PATH
variable: on Unix, it is highly unlikely that it contains semicolons,
and on Windows (without POSIX emulation), it is virtually guaranteed, as
everybody should have both $SYSTEMROOT and $SYSTEMROOT/system32 in their
PATH.

Signed-off-by: Johannes Schindelin <[email protected]>
Traditionally, Git for Windows' SDK uses Bash as its default shell.
However, other Unix shells are available, too. Most notably, the Win32
port of BusyBox comes with `ash` whose `pwd` command already prints
Windows paths as Git for Windows wants them, while there is not even a
`builtin` command.

Therefore, let's be careful not to override `pwd` unless we know that
the `builtin` command is available.

Signed-off-by: Johannes Schindelin <[email protected]>
The -W option is only understood by MSYS2 Bash's pwd command. We already
make sure to override `pwd` by `builtin pwd -W` for MINGW, so let's not
double the effort here.

This will also help when switching the shell to another one (such as
BusyBox' ash) whose pwd does *not* understand the -W option.

Signed-off-by: Johannes Schindelin <[email protected]>
When running with BusyBox, we will want to avoid calling executables on
the PATH that are implemented in BusyBox itself.

Signed-off-by: Johannes Schindelin <[email protected]>
Since c6b0831 (docs: warn about possible '=' in clean/smudge filter
process values, 2016-12-03), t0021 writes out a file with quotes in its
name, and MSYS2's path conversion heuristics mistakes that to mean that
we are not talking about a path here.

Therefore, we need to use Windows paths, as the test-helper is a Win32
program that would otherwise have no idea where to look for the file.

Signed-off-by: Johannes Schindelin <[email protected]>
At some stage, t5003-archive-zip wants to add a file that is not ASCII.
To that end, it uses /bin/sh. But that file may actually not exist (it
is too easy to forget that not all the world is Unix/Linux...)! Besides,
we already have perfectly fine binary files intended for use solely by
the tests. So let's use one of them instead.

Signed-off-by: Johannes Schindelin <[email protected]>
While it may seem super convenient to some old Unix hands to simpy
require Perl to be available when running the test suite, this is a
major hassle on Windows, where we want to verify that Perl is not,
actually, required in a NO_PERL build.

As a super ugly workaround, we "install" a script into /usr/bin/perl
reading like this:

	#!/bin/sh

	# We'd much rather avoid requiring Perl altogether when testing
	# an installed Git. Oh well, that's why we cannot have nice
	# things.
	exec c:/git-sdk-64/usr/bin/perl.exe "$@"

The problem with that is that BusyBox assumes that the #! line in a
script refers to an executable, not to a script. So when it encounters
the line #!/usr/bin/perl in t5532's proxy-get-cmd, it barfs.

Let's help this situation by simply executing the Perl script with the
"interpreter" specified explicitly.

Signed-off-by: Johannes Schindelin <[email protected]>
When t5605 tries to verify that files are hardlinked (or that they are
not), it uses the `-links` option of the `find` utility.

BusyBox' implementation does not support that option, and BusyBox-w32's
lstat() does not even report the number of hard links correctly (for
performance reasons).

So let's just switch to a different method that actually works on
Windows.

Signed-off-by: Johannes Schindelin <[email protected]>
Git for Windows uses MSYS2's Bash to run the test suite, which comes
with benefits but also at a heavy price: on the plus side, MSYS2's
POSIX emulation layer allows us to continue pretending that we are on a
Unix system, e.g. use Unix paths instead of Windows ones, yet this is
bought at a rather noticeable performance penalty.

There *are* some more native ports of Unix shells out there, though,
most notably BusyBox-w32's ash. These native ports do not use any POSIX
emulation layer (or at most a *very* thin one, choosing to avoid
features such as fork() that are expensive to emulate on Windows), and
they use native Windows paths (usually with forward slashes instead of
backslashes, which is perfectly legal in almost all use cases).

And here comes the problem: with a $PWD looking like, say,
C:/git-sdk-64/usr/src/git/t/trash directory.t5813-proto-disable-ssh
Git's test scripts get quite a bit confused, as their assumptions have
been shattered. Not only does this path contain a colon (oh no!), it
also does not start with a slash.

This is a problem e.g. when constructing a URL as t5813 does it:
ssh://remote$PWD. Not only is it impossible to separate the "host" from
the path with a $PWD as above, even prefixing $PWD by a slash won't
work, as /C:/git-sdk-64/... is not a valid path.

As a workaround, detect when $PWD does not start with a slash on
Windows, and simply strip the drive prefix, using an obscure feature of
Windows paths: if an absolute Windows path starts with a slash, it is
implicitly prefixed by the drive prefix of the current directory. As we
are talking about the current directory here, anyway, that strategy
works.

Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, the current working directory is pretty much guaranteed to
contain a colon. If we feed that path to CVS, it mistakes it for a
separator between host and port, though.

This has not been a problem so far because Git for Windows uses MSYS2's
Bash using a POSIX emulation layer that also pretends that the current
directory is a Unix path (at least as long as we're in a shell script).

However, that is rather limiting, as Git for Windows also explores other
ports of other Unix shells. One of those is BusyBox-w32's ash, which is
a native port (i.e. *not* using any POSIX emulation layer, and certainly
not emulating Unix paths).

So let's just detect if there is a colon in $PWD and punt in that case.

Signed-off-by: Johannes Schindelin <[email protected]>
The Makefile target `install-mingit-test-artifacts` simply copies stuff
and things directly into a MinGit directory, including an init.bat
script to set everything up so that the tests can be run in a cmd
window.

Sadly, Git's test suite still relies on a Perl interpreter even if
compiled with NO_PERL=YesPlease. We punt for now, installing a small
script into /usr/bin/perl that hands off to an existing Perl of a Git
for Windows SDK.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Handle Ctrl+C in Git Bash nicely

Signed-off-by: Johannes Schindelin <[email protected]>
This branch allows third-party tools to call `git status
--no-lock-index` to avoid lock contention with the interactive Git usage
of the actual human user.

Signed-off-by: Johannes Schindelin <[email protected]>
…ored-directory-gracefully

Phase out `--show-ignored-directory` gracefully
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 <[email protected]>
…updates

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

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
Copy link
Member Author

dscho commented Feb 26, 2021

Please note that I punted on updating 928c180: This commit wants to make sure that only support files from t/diff-lib/ are used in in t7001. However, that directory was renamed to t/lib-diff/. What's worse: t7001 is undergoing a major overhaul via sv/t7001-modernize, which already made it to next and will likely be part of v2.31.0-rc1 or at least v2.31.0-rc2. I've punted and did not redo the entire diff-lib -> lib-diff rename, instead I already incorporated the style updates from sv/t7001-modernize and that rename in 6c4fd56. Slightly iffy, but it saves me tons of time (and will be moot by -rc2 anyway, I bet).

@dscho dscho merged commit c177856 into git-for-windows:main Feb 26, 2021
@dscho dscho deleted the rebase-to-v2.31.0-rc0 branch February 26, 2021 12:17
@dscho dscho added this to the Next release milestone Feb 26, 2021
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.