summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
4 daysMerge branch 'ta/command-list-guides-sync-lint' into jchjchJunio C Hamano3-3/+10
A new linter test has been added to Documentation/lint-manpages.sh to ensure that all non-command manual pages (guides and developer interfaces) listed in Documentation/Makefile are present in command-list.txt, replacing an older comment that reminded developers to keep them in sync. * ta/command-list-guides-sync-lint: lint-docs: check the guide list in command-list.txt command-list: add gitformat-loose(5) and gitpacking(7)
4 daysMerge branch 'ps/odb-pluggable-fsck' into jchJunio C Hamano14-259/+394
The consistency checks for the object database (fsck) have been decoupled from the generic builtin implementation and moved into the backend-specific object source layers, making them pluggable for different object storage formats. * ps/odb-pluggable-fsck: builtin/fsck: move loose object verification into the loose source builtin/fsck: move multi-pack index verification into the packed source builtin/fsck: move bitmap verification into the packed source builtin/fsck: move reverse index verification into the packed source builtin/fsck: move packfile verification into the packed source odb: provide infrastructure for pluggable fsck checks builtin/fsck: don't check alternates with "--no-full" builtin/fsck: de-globalize option handling builtin/fsck: merge `fsck_obj_buffer()` and `fsck_obj()` builtin/fsck: use `fsck_obj_buffer()` when checking loose objects
4 daysMerge branch 'ps/odb-alternates-at-creation' into jchJunio C Hamano12-221/+263
The setup of alternates has been deferred to object database creation time during clone, which drops the unused ad-hoc alternate writing API, simplifying the object database backend interface. * ps/odb-alternates-at-creation: odb/source: remove the ability to write alternates builtin/clone: write alternates via `odb_create_on_disk()` odb/source: support writing alternates when creating the database builtin/clone: move setup of alternates for non-shared local clones builtin/clone: move setup of alternates for shared local clones builtin/clone: refactor handling of "--reference{,-if-able}" builtin/clone: move around `setup_reference()` builtin/clone: defer setup of the object database setup: split up concerns of `init_db()`
4 daysMerge branch 'dw/config-read-both-global' into jchJunio C Hamano6-31/+194
The git config --global read operations have been updated to respect both $HOME/.gitconfig and $XDG_CONFIG_HOME/git/config, fixing an inconsistency where only the former was read when both configuration files are present. * dw/config-read-both-global: config: read global scope via config_sequence config: let sequence require a successful file path: use forward slashes in XDG config on Windows
4 daysMerge branch 'vv/branch-recurse-no-start-ref' into jchJunio C Hamano3-5/+44
The --recurse-submodules option in 'git branch' has been fixed to avoid a crash when the start point is not a reference (e.g., a raw object ID). The creation path now skips setting up tracking and properly forwards the absent tracking name to the submodule helper. * vv/branch-recurse-no-start-ref: branch: allow recursion with no tracking name branch: do not track a start point with no ref
4 daysMerge branch 'as/utimensat-utimes' into jchJunio C Hamano19-93/+163
The codebase has been updated to use the newer utimensat() POSIX function instead of the obsolescent utime(), allowing high-precision timestamps while preserving fallback compatibility. * as/utimensat-utimes: compat/posix: drop legacy <utime.h> header and shims treewide: use utimensat(2) instead of legacy utime(3p) compat/posix: introduce utimensat(2) wrapper
4 daysMerge branch 'ap/http-preserve-wwwauth-redirect' into jchJunio C Hamano5-1/+78
When an HTTP request triggers a redirect and the target yields an authentication challenge, the WWW-Authenticate headers received during the redirect are now explicitly preserved across the credential URL update, fixing an issue where they were incorrectly cleared. * ap/http-preserve-wwwauth-redirect: http: preserve wwwauth_headers across redirects
4 daysMerge branch 'cl/regexec-macos-leak' into jchJunio C Hamano8-0/+157
A compatibility workaround has been introduced for macOS to address a memory leak in the system regex engine when it encounters invalid multibyte sequences. The workaround segments the input buffer at invalid byte boundaries and searches each valid segment separately using regexec(), avoiding the leaking path. * cl/regexec-macos-leak: SQUASH??? regexec: work around macOS TRE leak on invalid UTF-8
4 daysMerge branch 'ij/subtree-reject-v2-config' into jchJunio C Hamano2-0/+36
The shell script implementation of 'git subtree' has been updated to check for the presence of the configuration file of the new Rust implementation, preventing users from accidentally running the old script on repositories already managed by the new tool. * ij/subtree-reject-v2-config: git-subtree: Bail out if we find output from Rust rewrite (test) git-subtree: Bail out if we find output from Rust rewrite
4 daysMerge branch 'dk/use-nsec-runtime' into jchJunio C Hamano12-48/+57
The build-time knob 'USE_NSEC' for nanosecond stat precision has been converted to a runtime configuration 'core.useNanosec', allowing distributions to bundle one binary that adapts to filesystem capabilities dynamically. * dk/use-nsec-runtime: core: convert build-time USE_NSEC into runtime core.useNanosec environment: align repo_config_values_init with struct declaration meson: expose knob for xmlto relative links in manuals
4 daysMerge branch 'yt/pathspec-negative-prefix' into jchJunio C Hamano3-17/+59
The pathspec matching logic has been updated to avoid out-of-bounds memory accesses when a negative pathspec is shorter than the common prefix of positive pathspecs. * yt/pathspec-negative-prefix: dir: find common prefix among non-exclude pathspec items dir: do not apply prefix to negative pathspecs
4 daysMerge branch 'kn/receive-report-hook' into jchJunio C Hamano5-48/+401
A new hook 'report' is added to 'git receive-pack', which runs after reference updates and allows the server to filter or modify the packet-line status report sent back to the client. * kn/receive-report-hook: hook: introduce the receive-report hook receive-pack: move message generation to separate function receive-pack: drop static variables to track report status version doc: add proc-receive hook info in 'git-receive-pack.adoc'
4 daysMerge branch 'ps/odb-stop-registering-in-memory-sources' into jchJunio C Hamano33-247/+168
The mechanism to register in-memory alternate object sources has been removed, as submodule object databases are now accessed natively via their own repository structures. This simplifies object database management and prepares the codebase for migrating alternate tracking into the files backend. * ps/odb-stop-registering-in-memory-sources: odb: remove the ability to link sources ad-hoc t/helper: stop registering alternates in "ref-store" command t/helper: adapt read-midx to not link ad-hoc source anymore builtin/multi-pack-index: refuse unknown sources with "--object-dir=" odb/packed: fix memory leaks when freeing source tmp-objdir: drop unused function to register alternate odb: remove infrastructure to register submodule sources builtin/grep: stop registering submodule ODB as source submodule-config: stop registering submodule sources submodule-config: stop using `the_hash_algo` submodule-config: remove uses of `the_repository` cache-tree: remove dependency on `the_repository` cache-tree: drop `the_repository` in `cache_tree_fully_valid()`
4 days### match nextJunio C Hamano0-0/+0
4 daysMerge branch 'js/mingw-build-updates' into jchJunio C Hamano6-37/+153
A collection of patches from Git for Windows has been upstreamed, mostly focusing on simplifying and robustifying build configurations for MinGW/MSYS2, dropping obsolete compatibility options, and allowing the main 'git.exe' to be used directly without the extra wrapper process on Windows. * js/mingw-build-updates: t0060: adjust the code style mingw: allow `git.exe` to be used instead of the "Git wrapper" mingw: ensure valid CTYPE mingw: always define `ETC_*` for MSYS2 environments windows: skip linking `git-<command>` for built-ins mingw: rely on MSYS2's metadata instead of hard-coding it mingw: only enable the MSYS2-specific stuff when compiling in MSYS2 mingw: set the prefix and HOST_CPU as per MSYS2's settings mingw: avoid over-specifying `--pic-executable` mingw: only use -Wl,--large-address-aware for 32-bit builds mingw: drop the -D_USE_32BIT_TIME_T option mingw: stop hard-coding `CC = gcc` mingw: include the Python parts in the build
4 daysMerge branch 'ta/lint-gitlink-older-perl-fix' into jchJunio C Hamano1-1/+1
The development helper script to lint gitlink references in the documentation has been updated to avoid a newer Perl regular expression syntax that breaks on older Perl versions. * ta/lint-gitlink-older-perl-fix: lint-gitlink: don't use empty lower bound in .{0,8}
4 daysMerge branch 'jc/history-missing-tree-errorfix' into jchJunio C Hamano1-0/+4
Running "git history" in a corrupt repository can (unsurprisingly) segfault when a necessary tree object is not found. * jc/history-missing-tree-errorfix: history: do not dereference NULL when parent tree is missing
4 daysMerge branch 'as/cherry-pick-no-commit-doc' into jchJunio C Hamano2-2/+9
The documentation for 'git cherry-pick' has been updated to clarify that the '--no-commit' option intentionally skips setting the 'CHERRY_PICK_HEAD' ref. A test has also been added to ensure this behavior holds even when the operation stops for conflicts. * as/cherry-pick-no-commit-doc: doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD t3507: check no CHERRY_PICK_HEAD after conflicting --no-commit
4 daysMerge branch 'kh/doc-datamodel' into jchJunio C Hamano5-7/+24
The gitdatamodel documentation page has been linked from a handful of key documentaiton pages. * kh/doc-datamodel: doc: datamodel: link to the glossary doc: glossary: link four of the terms to gitdatamodel(7) doc: git: link to the gitdatamodel(7) tutorial doc: git: list gitdatamodel(7) as a concept guide
4 daysMerge branch 'jk/ci-use-system-asciidoctor' into jchJunio C Hamano1-1/+0
The CI script to install dependencies for the documentation build has been updated to install asciidoctor directly via the system package manager instead of pinning to an older version via gem. Additionally, an obsolete variable used for retired Azure Pipelines environments has been removed. * jk/ci-use-system-asciidoctor: ci: drop ALREADY_HAVE_ASCIIDOCTOR variable ci: fix missing Ruby dependency in "documentation" job
4 daysMerge branch 'ps/ci-depends-on-ruby' into jchJunio C Hamano1-1/+1
The CI job that builds the documentation failed because it lacked the 'gem' command. The 'asciidoc' package apparently stopped pulling in the 'ruby' package as a transitive dependency. The CI script has been updated to explicitly install 'ruby'. * ps/ci-depends-on-ruby: ci: fix missing Ruby dependency in "documentation" job
4 daysMerge branch 'tn/fetch-pack-trace-packfile-uri' into jchJunio C Hamano2-1/+18
The process of downloading packfile URIs in protocol v2 has been instrumented with a Trace2 region. This visibility allows tracking the cumulative time spent downloading external packs and the number of advertised URIs without emitting a separate event per pack. * tn/fetch-pack-trace-packfile-uri: fetch-pack: trace packfile URI downloads
4 daysMerge branch 'sa/rev-list-missing-only' into jchJunio C Hamano3-5/+99
The git rev-list command has been augmented with a '--missing-only' option that filters the output to only show missing objects, stripping the leading '?' character and suppressing present objects, which is useful when used in combination with '--missing=print' or '--missing=print-info'. * sa/rev-list-missing-only: rev-list: add --missing-only option to filter output
4 daysMerge branch 'ps/tune-rerere-gc' into jchJunio C Hamano5-53/+144
"git maintenance" triggered "rerere gc" in unappropriate times and interfered with "git rebase" etc. too much. The conditions "rerere gc" gets triggered have been tweaked. * ps/tune-rerere-gc: builtin/maintenance: improve heuristic for "rerere gc" rerere: extract logic to determine whether entries are stale
4 daysMerge branch 'jc/pathspec-match-const' into jchJunio C Hamano2-4/+4
Two members in "struct pathspec_item" were of type "char *", but nobody updated the string through these pointers. They have been made "const char *" instead. * jc/pathspec-match-const: pathspec: match and original in pathspec_item are const
4 daysMerge branch 'hn/checkout-m-autostash-refine' into jchJunio C Hamano8-68/+179
The autostash fallback in 'git checkout -m' has been refined to only retry when there are local changes. Additionally, a blank line now visually separates autostash conflict advice from the subsequent branch-switch message. * hn/checkout-m-autostash-refine: checkout: separate autostash conflict advice from branch-switch message stash: reserve exit status 1 for conflicts
4 daysMerge branch 'jk/ci-bump-debian-to-12' into jchJunio C Hamano2-6/+6
The CI job for Debian 11 has been updated to use Debian 12, as the former is now out of the LTS period. * jk/ci-bump-debian-to-12: ci: bump debian-11 job to debian-12
4 daysMerge branch 'jk/submodule-error-leak' into jchJunio C Hamano3-4/+26
The error path in 'git submodule--helper' has been updated to plug a memory leak when a repository handle could not be obtained, leveraging an updated idempotent repo_clear(). * jk/submodule-error-leak: submodule--helper: free URL when repository setup fails repository: make repo_clear() idempotent
4 daysMerge branch 'wf/imap-send-draft' into jchJunio C Hamano3-3/+29
The 'git imap-send' command has been taught to take the '--draft' option to mark uploaded messages as drafts, which helps some email clients render them properly for editing and sending. * wf/imap-send-draft: imap-send: add --draft to set IMAP \Draft flag
4 daysMerge branch 'en/no-amend-during-conflicts' into jchJunio C Hamano7-27/+299
Teach 'am', 'revert', and 'rebase' that running 'commit --amend' or a partial 'commit <paths>' makes no sense during operations that stop and return control to the user to resolve conflicts left in the working tree, just like 'cherry-pick' and 'merge' do. * en/no-amend-during-conflicts: commit: refuse partial commits during conflict resolution commit: refuse to amend during conflict resolution commit: reword the empty-commit rebase amend error commit: allow a partial commit when a rebase pick becomes empty commit: clarify FROM_REBASE_PICK and is_from_rebase() names
4 daysMerge branch 'mm/lib-httpd-cgi-safe' into jchJunio C Hamano5-26/+143
CGI helper scripts used by HTTP-related test scripts have been updated to use atomic filesystem operations, preventing race conditions when Apache handles concurrent requests. * mm/lib-httpd-cgi-safe: t/lib-httpd: document writing concurrency-safe CGI helpers t/lib-httpd: make http-429 first-request check atomic t/lib-httpd: fix apply-one-time-script race under concurrent requests
4 daysGit 2.56-rc0HEADv2.56.0-rc0mastermainJunio C Hamano2-1/+27
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysMerge branch 'en/midx-missing-pack-fallback'Junio C Hamano10-20/+200
The object lookup machinery has been taught to gracefully recover when a multi-pack-index points to an owning pack that was removed during a concurrent geometric repack, and 'git replay' has been fixed to not segfault when reading such missing objects. * en/midx-missing-pack-fallback: packfile: recover when a multi-pack-index names a removed pack mktree: do not use OBJECT_INFO_QUICK when checking objects mktree: plug per-tree leak in --batch mode replay: fail gracefully when a merge input is unreadable
4 daysMerge branch 'jk/rev-info-argv-to-free'Junio C Hamano3-11/+57
The memory ownership of argv elements passed to the revision machinery has been made more robust by keeping logically "freed" elements alive until the rev_info struct is released, preventing use-after-free bugs when options store references to them. * jk/rev-info-argv-to-free: revision: simplify mark_argv_for_free() callers revision: hang on to "freed" argv elements
4 daysMerge branch 'tc/replay-linearize'Junio C Hamano5-28/+196
The 'git replay' command has been taught the '--linearize' option to drop merge commits and linearize the replayed history, mimicking 'git rebase --no-rebase-merges'. * tc/replay-linearize: replay: offer an option to linearize the commit topology replay: resolve the replay base outside pick_regular_commit() replay: add helper to put entry into replayed_commits
4 daysMerge branch 'hk/typofix'Junio C Hamano2-2/+2
Various spelling mistakes in comments and test descriptions have been corrected. * hk/typofix: versioncmp: fix typo in versioncmp.c, t/t0022-crlf-rename.sh
4 daysMerge branch 'rs/worktree-add-basename-fixes'Junio C Hamano2-19/+31
The string extraction logic for the branch name and worktree name from the given path in 'git worktree add' has been corrected and simplified to avoid out-of-bounds reads and improper handling of trailing slashes. * rs/worktree-add-basename-fixes: worktree add: let worktree_basename() return string copy worktree add: trim slashes when deriving branch name from path worktree add: reject separator-only path worktree add: don't read out of bounds in worktree_basename()
4 daysMerge branch 'hn/ci-cancel-stale-pr-runs'Junio C Hamano1-9/+11
GitHub Actions CI workflow runs triggered by pull requests have been configured to cancel older runs when a new push is made to the same pull request. * hn/ci-cancel-stale-pr-runs: ci: cancel stale pull request workflow runs
4 daysMerge branch 'ns/ref-symref-additional-tests'Junio C Hamano2-3/+18
A few tests for the reference handling subsystem have been added to exercise the handling of forbidden characters and symbolic references. * ns/ref-symref-additional-tests: t1402: test forbidden characters in refnames t1401: check symbolic-ref failure and --quiet silence on a non-symbolic ref
4 dayst0060: adjust the code styleJohannes Schindelin1-1/+2
These days, the test cases are less free-form than in the wild old days of the Git project. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: allow `git.exe` to be used instead of the "Git wrapper"Johannes Schindelin6-4/+127
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 https://github.com/git-for-windows/git/issues/2283 Note: This keeps the same, hard-coded MSYSTEM platform support for CMake as before, and introduces an `msystem' and `mingw-prefix` knob for Meson (read: neither CMake nor Meson will automatically inherit the setting from the current build environment). Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: ensure valid CTYPEJohannes Schindelin1-0/+3
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 https://github.com/git-for-windows/git/issues/1036 Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: always define `ETC_*` for MSYS2 environmentsJohannes Schindelin1-6/+4
Special-casing even more configurations simply does not make sense. Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 dayswindows: skip linking `git-<command>` for built-insJohannes Schindelin1-0/+2
It is merely a historical wart that, say, `git-commit` exists in the `libexec/git-core/` directory, a tribute to the original idea to let Git be essentially a bunch of Unix shell scripts revolving around very few "plumbing" (AKA low-level) commands. Git has evolved a lot from there. These days, most of Git's functionality is contained within the `git` executable, in the form of "built-in" commands. To accommodate for scripts that use the "dashed" form of Git commands, even today, Git provides hard-links that make the `git` executable available as, say, `git-commit`, just in case that an old script has not been updated to invoke `git commit`. Those hard-links do not come cheap: they take about half a minute for every build of Git on Windows, they are mistaken for taking up huge amounts of space by some Windows Explorer versions that do not understand hard-links, and therefore many a "bug" report had to be addressed. The "dashed form" has been officially deprecated in Git version 1.5.4, which was released on February 2nd, 2008, i.e. a very long time ago. This deprecation was never finalized by skipping these hard-links, but we can start the process now, in Git for Windows. Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: rely on MSYS2's metadata instead of hard-coding itJohannes Schindelin1-8/+6
MSYS2 defines some helpful environment variables, e.g. `MSYSTEM`. There is code in Git for Windows to ensure that that `MSYSTEM` variable is set, hard-coding a default. However, the existing solution jumps through hoops to reconstruct the proper default, and is even incomplete doing so, as we found out when we extended it to support CLANGARM64. This is absolutely unnecessary because there is already a perfectly valid `MSYSTEM` value we can use at build time. This is even true when building the MINGW32 variant on a MINGW64 system because `makepkg-mingw` will override the `MSYSTEM` value as per the `MINGW_ARCH` array. The same is equally true for the `/mingw64`, `/mingw32` and `/clangarm64` prefix: those values are already available via the `MINGW_PREFIX` environment variable, and we just need to pass that setting through. Only when `MINGW_PREFIX` is not set (as is the case in Git for Windows' minimal SDK, where only `MSYSTEM` is guaranteed to be set correctly), we use as fall-back the top-level directory whose name is the down-cased value of the `MSYSTEM` variable. Incidentally, this also broadens the support to all the configurations supported by the MSYS2 project, i.e. clang64 & ucrt64, too. Helped-by: Johannes Sixt <j6t@kdbg.org> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: only enable the MSYS2-specific stuff when compiling in MSYS2Johannes Schindelin1-2/+2
The tell-tale is the presence of the `MSYSTEM` value while compiling, of course. In that case, we want to ensure that `MSYSTEM` is set when running `git.exe`, and also enable the magic MSYS2 tty detection. Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: set the prefix and HOST_CPU as per MSYS2's settingsJohannes Schindelin1-12/+6
MSYS2 already defines a couple of helpful environment variables, and we can use those to infer the installation location as well as the CPU. No need for hard-coding ;-) Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: avoid over-specifying `--pic-executable`Johannes Schindelin1-3/+3
In bf2d5d8239e (Don't let ld strip relocations, 2016-01-16) (picked from https://github.com/git-for-windows/git/pull/612/commits/6a237925bf10), Git for Windows introduced the `-Wl,-pic-executable` flag, specifying the exact entry point via `-e`. This required discerning between i686 and x86_64 code because the former required the symbol to be prefixed with an underscore, the latter did not. As per https://sourceware.org/bugzilla/show_bug.cgi?id=10865, the specified symbols are already the default, though. So let's drop the overly-specific definition. Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: only use -Wl,--large-address-aware for 32-bit buildsJohannes Schindelin1-4/+2
That option only matters there, and is in fact only really understood in those builds; UCRT64 versions of GCC, for example, do not know what to do with that option. Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 daysmingw: drop the -D_USE_32BIT_TIME_T optionJohannes Schindelin1-1/+0
This option was added in fa93bb20d72 (MinGW: Fix stat definitions to work with MinGW runtime version 4.0, 2013-09-11), i.e. a _long_ time ago. So long, in fact, that it still targeted MinGW. But we switched to mingw-w64 in 2015, which seems not to share the problem, and therefore does not require a fix. Even worse: This flag is incompatible with UCRT64, which we are about to support by way of upstreaming `mingw-w64-git` to the MSYS2 project, see https://github.com/msys2/MINGW-packages/pull/26470 for details. So let's send that option into its well-deserved retirement. Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>