174306 Commits

Author SHA1 Message Date
Andrey Zabavnikov
be899febc5 status: fix for old-style submodules with commondir
In f9b7573f6b00 (repository: free fields before overwriting them,
2017-09-05), Git was taught to release memory before overwriting it, but
357a03ebe9e0 (repository.c: move env-related setup code back to
environment.c, 2018-03-03) changed the code so that it would not
_always_ be overwritten.

As a consequence, the `commondir` attribute would point to
already-free()d memory.

This seems not to cause problems in core Git, but there are add-on
patches in Git for Windows where the `commondir` attribute is
subsequently used and causing invalid memory accesses e.g. in setups
containing old-style submodules (i.e. the ones with a `.git` directory
within theirs worktrees) that have `commondir` configured.

This fixes https://github.com/git-for-windows/git/pull/4083.

Signed-off-by: Andrey Zabavnikov <zabavnikov@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-02-02 18:10:16 +01:00
Johannes Schindelin
d74db2d801 Merge branch 'fixes-from-the-git-mailing-list'
These fixes have been sent to the Git mailing list but have not been
picked up by the Git project yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-02-02 18:10:09 +01:00
Jeff King
f1b0016b13 grep: prevent ^$ false match at end of file
In some implementations, `regexec_buf()` assumes that it is fed lines;
Without `REG_NOTEOL` it thinks the end of the buffer is the end of a
line. Which makes sense, but trips up this case because we are not
feeding lines, but rather a whole buffer. So the final newline is not
the start of an empty line, but the true end of the buffer.

This causes an interesting bug:

  $ echo content >file.txt
  $ git grep --no-index -n '^$' file.txt
  file.txt:2:

This bug is fixed by making the end of the buffer consistently the end
of the final line.

The patch was applied from
https://lore.kernel.org/git/20250113062601.GD767856@coredump.intra.peff.net/

Reported-by: Olly Betts <olly@survex.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-02-02 18:10:09 +01:00
Johannes Schindelin
7ca734fce0 Merge branch 'disallow-control-characters-in-sideband-channel'
This addresses:

- CVE-2024-52005:

	Insufficient neutralization of ANSI escape sequences in sideband
	payload can be used to mislead Git users into believing that
	certain remote-generated messages actually originate from Git.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
2026-02-02 18:10:08 +01:00
Johannes Schindelin
70565d9f20 unix-socket: avoid leak when initialization fails
When a Unix socket is initialized, the current directory's path is
stored so that the cleanup code can `chdir()` back to where it was
before exit.

If the path that needs to be stored exceeds the default size of the
`sun_path` attribute of `struct sockaddr_un` (which is defined as a
108-sized byte array on Linux), a larger buffer needs to be allocated so
that it can hold the path, and it is the responsibility of the
`unix_sockaddr_cleanup()` function to release that allocated memory.

In Git's CI, this stack allocation is not necessary because the code is
checked out to `/home/runner/work/git/git`. Concatenate the path
`t/trash directory.t0301-credential-cache/.cache/git/credential/socket`
and a terminating NUL, and you end up with 96 bytes, 12 shy of the
default `sun_path` size.

However, I use worktrees with slightly longer paths:
`/home/me/projects/git/yes/i/nest/worktrees/to/organize/them/` is more
in line with what I have. When I recently tried to locally reproduce a
failure of the `linux-leaks` CI job, this t0301 test failed (where it
had not failed in CI).

The reason: When `credential-cache` tries to reach its daemon initially
by calling `unix_sockaddr_init()`, it is expected that the daemon cannot
be reached (the idea is to spin up the daemon in that case and try
again). However, when this first call to `unix_sockaddr_init()` fails,
the code returns early from the `unix_stream_connect()` function
_without_ giving the cleanup code a chance to run, skipping the
deallocation of above-mentioned path.

The fix is easy: do not return early but instead go directly to the
cleanup code.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-02-02 18:10:08 +01:00
Johannes Schindelin
e6a90de08e sideband: do allow ANSI color sequences by default
The preceding two commits introduced special handling of the sideband
channel to neutralize ANSI escape sequences before sending the payload
to the terminal, and `sideband.allowControlCharacters` to override that
behavior.

However, some `pre-receive` hooks that are actively used in practice
want to color their messages and therefore rely on the fact that Git
passes them through to the terminal.

In contrast to other ANSI escape sequences, it is highly unlikely that
coloring sequences can be essential tools in attack vectors that mislead
Git users e.g. by hiding crucial information.

Therefore we can have both: Continue to allow ANSI coloring sequences to
be passed to the terminal, and neutralize all other ANSI escape
sequences.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-02-02 18:10:08 +01:00
Johannes Schindelin
268465a5f7 sideband: introduce an "escape hatch" to allow control characters
The preceding commit fixed the vulnerability whereas sideband messages
(that are under the control of the remote server) could contain ANSI
escape sequences that would be sent to the terminal verbatim.

However, this fix may not be desirable under all circumstances, e.g.
when remote servers deliberately add coloring to their messages to
increase their urgency.

To help with those use cases, give users a way to opt-out of the
protections: `sideband.allowControlCharacters`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-02-02 18:10:08 +01:00
Johannes Schindelin
873fe23b56 sideband: mask control characters
The output of `git clone` is a vital component for understanding what
has happened when things go wrong. However, these logs are partially
under the control of the remote server (via the "sideband", which
typically contains what the remote `git pack-objects` process sends to
`stderr`), and is currently not sanitized by Git.

This makes Git susceptible to ANSI escape sequence injection (see
CWE-150, https://cwe.mitre.org/data/definitions/150.html), which allows
attackers to corrupt terminal state, to hide information, and even to
insert characters into the input buffer (i.e. as if the user had typed
those characters).

To plug this vulnerability, disallow any control character in the
sideband, replacing them instead with the common `^<letter/symbol>`
(e.g. `^[` for `\x1b`, `^A` for `\x01`).

There is likely a need for more fine-grained controls instead of using a
"heavy hammer" like this, which will be introduced subsequently.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-02-02 18:10:08 +01:00
Johannes Schindelin
a7ac2046fa Start the merging-rebase to v2.53.0
This commit starts the rebase of 2fab893deb18888f140913717c53821b75657958 to a978e09acb5a3db0959fc757df17b27e8706d26b
2026-02-02 18:09:59 +01:00
Junio C Hamano
67ad42147a Git 2.53
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-01 18:15:01 -08:00
Junio C Hamano
6f328bc9e3 l10n-2.53.0-v1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE37vMEzKDqYvVxs51k24VDd1FMtUFAml+C8cACgkQk24VDd1F
 MtX/AA/+L3XJD3hcwz6BbCqZdIYSdj324KylNHHfsNZ0jw6DH5SwAR91/6VM4wzH
 7yqelAYydWwp265EkfGQNSxY8zPL5YCAd9/xYyNG3oZu7wbJwT13KovWgX2sXr43
 dWXFJIurXNBpiOeJi+82ghmaRS5SfPW1YFConUFj7zsFq3Bb4iXYt2KZ65FpiR5Z
 JJEkqEXi1a8YiuO/b0kTior4kuHyEyOVnzI7OrQihhAls3YQvf8L46zKcDqr/gPp
 6MoiNIFPWomyJl0stNRb9W5w3sr5UDgJ2aR/qj7MutA/2JN7mOqmCB6uGroMmxCU
 FV+gBqhj56di/+sQ0c446NLPUa3nSO4JP5TiUO8MUhP8BnEGopemngpyJLpWzhSr
 0tG5LK32RtMmszBM+XNV247oWL9IiePdhcy6FZr2JIRrVGBpN6RtkmlRKcdAxUIC
 7k+g4u1LzM9vVeLjm8brIMQ78TLY2tL/eOl91fl+5tTRvsJvC4tydIaqEb1k/L9/
 sCj5GMmVs0hxdXMXLtArlbzYvNl0cwkJnqehpQuFkowJmqjAnAV9gKUkId2iaRQh
 TGq9ukCSzwn1XpIsC1o477JoQm+hzCFOFXCESuj9+il4ndfZ+BQgsp7Omb12U0TY
 f4upg2lJJokcoqd0HJoXXD2dkayZlslVhwY7X03BlHRd3VRbiYk=
 =MkCD
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.53.0-v1' of https://github.com/git-l10n/git-po

l10n-2.53.0-v1

* tag 'l10n-2.53.0-v1' of https://github.com/git-l10n/git-po:
  l10n: zh_CN: standardize glossary terms
  l10n: zh_CN: updated translation for 2.53
  l10n: zh_CN: fix inconsistent use of standard vs. wide colons
  l10n: fr: v2.53
  l10n: zh_TW.po: update Git 2.53 translation
  l10n: tr: Update Turkish translations
  l10n: sv.po: Update Swedish translation
  l10n: po-id for 2.53
  l10n: ga.po: Fix git-po-helper warnings
  l10n: bg.po: Updated Bulgarian translation (6091t)
  l10n: ga.po: Update Irish translation for Git 2.53
2026-02-01 18:13:52 -08:00
Carlo Marcelo Arenas Belón
239b7f686c RelNotes: fully spell negation
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-01 18:07:39 -08:00
Jiang Xin
532543fa46 Merge branch 'jx/zh_CN' of github.com:jiangxin/git
* 'jx/zh_CN' of github.com:jiangxin/git:
  l10n: zh_CN: standardize glossary terms
  l10n: zh_CN: updated translation for 2.53
  l10n: zh_CN: fix inconsistent use of standard vs. wide colons
2026-01-31 21:32:54 +08:00
Jiang Xin
5a83d800f3 Merge branch 'l10n/zh-TW/git-2-53' of github.com:l10n-tw/git-po
* 'l10n/zh-TW/git-2-53' of github.com:l10n-tw/git-po:
  l10n: zh_TW.po: update Git 2.53 translation
2026-01-31 21:20:06 +08:00
Jiang Xin
e996719801 Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.53
2026-01-31 21:15:38 +08:00
Jiang Xin
8ef65d7efd Merge branch 'l10n-ga-2.53' of github.com:aindriu80/git-po
* 'l10n-ga-2.53' of github.com:aindriu80/git-po:
  l10n: ga.po: Fix git-po-helper warnings
  l10n: ga.po: Update Irish translation for Git 2.53
2026-01-31 21:13:55 +08:00
Jiang Xin
b386b3aea7 Merge branch 'master' of github.com:alshopov/git-po
* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (6091t)
2026-01-31 21:11:50 +08:00
Jiang Xin
af1a298e2c Merge branch 'fr_2.53' of github.com:jnavila/git
* 'fr_2.53' of github.com:jnavila/git:
  l10n: fr: v2.53
2026-01-31 21:08:43 +08:00
Jiang Xin
6f75c474d7 Merge branch 'tr-l10n' of github.com:bitigchi/git-po
* 'tr-l10n' of github.com:bitigchi/git-po:
  l10n: tr: Update Turkish translations
2026-01-31 21:06:38 +08:00
Jiang Xin
3eaaa7fea4 Merge branch 'master' of github.com:nafmo/git-l10n-sv
* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation
2026-01-31 21:03:10 +08:00
Jiang Xin
eb816ef79e l10n: zh_CN: standardize glossary terms
Add preferred Chinese terminology notes and align existing translations
to the updated glossary. AI-assisted review was used to check and
improve legacy translations.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-01-31 20:51:27 +08:00
Junio C Hamano
2258446484 RelNotes: correct "fast-import" option name
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-01-30 09:50:03 -08:00
Jiang Xin
3065daed59 l10n: zh_CN: updated translation for 2.53
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-01-29 21:42:38 +08:00
Jiang Xin
eb3cfc6b2f l10n: zh_CN: fix inconsistent use of standard vs. wide colons
Replace mixed usage of standard (ASCII) colons ':' with full-width
(wide) colons ':' in Chinese translations to ensure typographic
consistency, as reported by CAESIUS-TIM [1].

Full-width punctuation is preferred in Chinese localization for better
readability and adherence to typesetting conventions.

[1]: https://github.com/git-l10n/git-po/issues/884

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-01-29 21:42:38 +08:00
Jean-Noël Avila
72dd507505 l10n: fr: v2.53
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2026-01-28 19:43:46 +01:00
Yi-Jyun Pan
b47610d61d
l10n: zh_TW.po: update Git 2.53 translation
Co-authored-by: Lumynous <lumynou5.tw@gmail.com>
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2026-01-28 22:51:42 +08:00
Johannes Schindelin
3832dd2481 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.53.0-rc2.windows.1
2026-01-28 14:30:10 +01:00
Johannes Schindelin
8b56f08b72 Merge pull request #2837 from dscho/monitor-component-updates
Start monitoring updates of Git for Windows' component in the open
2026-01-28 14:30:10 +01:00
Johannes Schindelin
9b086470e9 Merge branch 'deprecate-core.useBuiltinFSMonitor'
Originally introduced as `core.useBuiltinFSMonitor` in Git for Windows
and developed, improved and stabilized there, the built-in FSMonitor
only made it into upstream Git (after unnecessarily long hemming and
hawing and throwing overly perfectionist style review sticks into the
spokes) as `core.fsmonitor = true`.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:10 +01:00
Johannes Schindelin
d5f1dfddd2 Merge branch 'phase-out-reset-stdin'
This topic branch re-adds the deprecated --stdin/-z options to `git
reset`. Those patches were overridden by a different set of options in
the upstream Git project before we could propose `--stdin`.

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

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:10 +01:00
Johannes Schindelin
b77992d6a8 Merge branch 'un-revert-editor-save-and-reset'
A fix for calling `vim` in Windows Terminal caused a regression and was
reverted. We partially un-revert this, to get the fix again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:10 +01:00
Johannes Schindelin
6fda530210 SECURITY.md: document Git for Windows' policies
This is the recommended way on GitHub to describe policies revolving around
security issues and about supported versions.

Helped-by: Sven Strickroth <email@cs-ware.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
9e508167ec dependabot: help keeping GitHub Actions versions up to date
See https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot#enabling-dependabot-version-updates-for-actions for details.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Victoria Dye
aadd41abdf fsmonitor: reintroduce core.useBuiltinFSMonitor
Reintroduce the 'core.useBuiltinFSMonitor' config setting (originally added
in 0a756b2a25 (fsmonitor: config settings are repository-specific,
2021-03-05)) after its removal from the upstream version of FSMonitor.

Upstream, the 'core.useBuiltinFSMonitor' setting was rendered obsolete by
"overloading" the 'core.fsmonitor' setting to take a boolean value. However,
several applications (e.g., 'scalar') utilize the original config setting,
so it should be preserved for a deprecation period before complete removal:

* if 'core.fsmonitor' is a boolean, the user is correctly using the new
  config syntax; do not use 'core.useBuiltinFSMonitor'.
* if 'core.fsmonitor' is unspecified, use 'core.useBuiltinFSMonitor'.
* if 'core.fsmonitor' is a path, override and use the builtin FSMonitor if
  'core.useBuiltinFSMonitor' is 'true'; otherwise, use the FSMonitor hook
  indicated by the path.

Additionally, for this deprecation period, advise users to switch to using
'core.fsmonitor' to specify their use of the builtin FSMonitor.

Signed-off-by: Victoria Dye <vdye@github.com>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
0239e4a571 Merge pull request #1170 from dscho/mingw-kill-process
Handle Ctrl+C in Git Bash nicely

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Philip Oakley
14a252e678 Modify the GitHub Pull Request template (to reflect Git for Windows)
Git for Windows accepts pull requests; Core Git does not. Therefore we
need to adjust the template (because it only matches core Git's
project management style, not ours).

Also: direct Git for Windows enhancements to their contributions page,
space out the text for easy reading, and clarify that the mailing list
is plain text, not HTML.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
58c26230eb Add a GitHub workflow to monitor component updates
Rather than using private IFTTT Applets that send mails to this
maintainer whenever a new version of a Git for Windows component was
released, let's use the power of GitHub workflows to make this process
publicly visible.

This workflow monitors the Atom/RSS feeds, and opens a ticket whenever a
new version was released.

Note: Bash sometimes releases multiple patched versions within a few
minutes of each other (i.e. 5.1p1 through 5.1p4, 5.0p15 and 5.0p16). The
MSYS2 runtime also has a similar system. We can address those patches as
a group, so we shouldn't get multiple issues about them.

Note further: We're not acting on newlib releases, OpenSSL alphas, Perl
release candidates or non-stable Perl releases. There's no need to open
issues about them.

Co-authored-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
921085e742 Merge branch 'wsl-file-mode-bits'
This patch introduces support to set special NTFS attributes that are
interpreted by the Windows Subsystem for Linux as file mode bits, UID
and GID.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Brendan Forster
fa4ba97ec5 Add an issue template
With improvements by Clive Chan, Adric Norris, Ben Bodenmiller and
Philip Oakley.

Helped-by: Clive Chan <cc@clive.io>
Helped-by: Adric Norris <landstander668@gmail.com>
Helped-by: Ben Bodenmiller <bbodenmiller@hotmail.com>
Helped-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Brendan Forster <brendan@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
cc6638dbfe Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
992862351f README.md: Add a Windows-specific preamble
Includes touch-ups by 마누엘, Philip Oakley and 孙卓识.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
75ab9302a4 Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2026-01-28 14:30:09 +01:00
Derrick Stolee
0a7316bf46 CONTRIBUTING.md: add guide for first-time contributors
Getting started contributing to Git can be difficult on a Windows
machine. CONTRIBUTING.md contains a guide to getting started, including
detailed steps for setting up build tools, running tests, and
submitting patches to upstream.

[includes an example by Pratik Karki how to submit v2, v3, v4, etc.]

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
5ee11b692d mingw: try resetting the read-only bit if rename fails (#4527)
With this patch, Git for Windows works as intended on mounted APFS
volumes (where renaming read-only files would fail).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
8721a8b3c0 Modify the Code of Conduct for Git for Windows
The Git project followed Git for Windows' lead and added their Code of
Conduct, based on the Contributor Covenant v1.4, later updated to v2.0.

We adapt it slightly to Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
891ba58c15 Merge 'docker-volumes-are-no-symlinks'
This was pull request #1645 from ZCube/master

Support windows container.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
2b232771ce Describe Git for Windows' architecture [no ci]
The Git for Windows project has grown quite complex over the years,
certainly much more complex than during the first years where the
`msysgit.git` repository was abusing Git for package management purposes
and the `git/git` fork was called `4msysgit.git`.

Let's describe the status quo in a thorough way.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00
Johannes Schindelin
2972e4e633 Merge branch 'msys2' 2026-01-28 14:30:09 +01:00
Johannes Schindelin
b961f120a3 Merge branch 'long-paths' 2026-01-28 14:30:09 +01:00
Johannes Schindelin
cff360f5ac Merge branch 'gitk-and-git-gui-patches'
These are Git for Windows' Git GUI and gitk patches. We will have to
decide at some point what to do about them, but that's a little lower
priority (as Git GUI seems to be unmaintained for the time being, and
the gitk maintainer keeps a very low profile on the Git mailing list,
too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-01-28 14:30:09 +01:00