From b9c6962ad5b2f735d8281eb03646cefcf01886de Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Oct 2025 07:46:00 +0000 Subject: [PATCH 1/7] mingw: avoid relative `#include`s We want to make them relative to the top-level directory. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- compat/mingw.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index 8538e3d1729d25..da99473f56d451 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1,22 +1,22 @@ #define USE_THE_REPOSITORY_VARIABLE #define DISABLE_SIGN_COMPARE_WARNINGS -#include "../git-compat-util.h" +#include "git-compat-util.h" #include "win32.h" #include #include #include #include -#include "../strbuf.h" -#include "../run-command.h" -#include "../abspath.h" -#include "../alloc.h" +#include "strbuf.h" +#include "run-command.h" +#include "abspath.h" +#include "alloc.h" #include "win32/lazyload.h" -#include "../config.h" -#include "../environment.h" -#include "../trace2.h" -#include "../symlinks.h" -#include "../wrapper.h" +#include "config.h" +#include "environment.h" +#include "trace2.h" +#include "symlinks.h" +#include "wrapper.h" #include "dir.h" #include "gettext.h" #define SECURITY_WIN32 From 15b8abde07de2cbce2dac3630324ead349e168ee Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Oct 2025 07:46:01 +0000 Subject: [PATCH 2/7] mingw: order `#include`s alphabetically It allows for more consistent patches that way. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- compat/mingw.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index da99473f56d451..736a07a028ab4d 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -2,25 +2,25 @@ #define DISABLE_SIGN_COMPARE_WARNINGS #include "git-compat-util.h" -#include "win32.h" -#include -#include -#include -#include -#include "strbuf.h" -#include "run-command.h" #include "abspath.h" #include "alloc.h" -#include "win32/lazyload.h" #include "config.h" +#include "dir.h" #include "environment.h" -#include "trace2.h" +#include "gettext.h" +#include "run-command.h" +#include "strbuf.h" #include "symlinks.h" +#include "trace2.h" +#include "win32.h" +#include "win32/lazyload.h" #include "wrapper.h" -#include "dir.h" -#include "gettext.h" +#include +#include +#include #define SECURITY_WIN32 #include +#include #include #define STATUS_DELETE_PENDING ((NTSTATUS) 0xC0000056) From 3860985105a40f425effc49642693e90e84e1863 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Oct 2025 07:46:22 +0000 Subject: [PATCH 3/7] refs: forbid clang to complain about unreachable code When `NO_SYMLINK_HEAD` is defined, `create_ref_symlink()` is hard-coded as `(-1)`, and as a consequence the condition `!create_ref_symlink()` always evaluates to false, rendering any code guarded by that condition unreachable. Therefore, clang is _technically_ correct when it complains about unreachable code. It does completely miss the fact that this is okay because on _other_ platforms, where `NO_SYMLINK_HEAD` is not defined, the code isn't unreachable at all. Let's use the same trick as in 82e79c63642c (git-compat-util: add NOT_CONSTANT macro and use it in atfork_prepare(), 2025-03-17) to appease clang while at the same time keeping the `-Wunreachable` flag to potentially find _actually_ unreachable code. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- refs/files-backend.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 088b52c740b9ff..814decf323e14d 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -3186,7 +3186,13 @@ static int files_transaction_finish(struct ref_store *ref_store, * next update. If not, we try and create a regular symref. */ if (update->new_target && refs->prefer_symlink_refs) - if (!create_ref_symlink(lock, update->new_target)) + /* + * By using the `NOT_CONSTANT()` trick, we can avoid + * errors by `clang`'s `-Wunreachable` logic that would + * report that the `continue` statement is not reachable + * when `NO_SYMLINK_HEAD` is `#define`d. + */ + if (NOT_CONSTANT(!create_ref_symlink(lock, update->new_target))) continue; if (update->flags & REF_NEEDS_COMMIT) { From 55269ece0473833af19958672f58d7b85cfb4b7c Mon Sep 17 00:00:00 2001 From: "D. Ben Knoble" Date: Mon, 6 Oct 2025 08:59:29 -0400 Subject: [PATCH 4/7] doc: explain the impact of stash.index on --autostash options With 9842c0c749 (stash: honor stash.index in apply, pop modes, 2025-09-21) merged in a5d4779e6e (Merge branch 'dk/stash-apply-index', 2025-09-29), we did not advertise the connection between the new config option stash.index and the implicit use of git-stash via --autostash (which may also be configured). Do so. Signed-off-by: D. Ben Knoble Signed-off-by: Junio C Hamano --- Documentation/config/stash.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/config/stash.adoc b/Documentation/config/stash.adoc index e556105a15bd46..fcb9a4a7a0faa0 100644 --- a/Documentation/config/stash.adoc +++ b/Documentation/config/stash.adoc @@ -2,6 +2,10 @@ stash.index:: If this is set to true, `git stash apply` and `git stash pop` will behave as if `--index` was supplied. Defaults to false. See the descriptions in linkgit:git-stash[1]. ++ +This also affects invocations of linkgit:git-stash[1] via `--autostash` from +commands like linkgit:git-merge[1], linkgit:git-rebase[1], and +linkgit:git-pull[1]. stash.showIncludeUntracked:: If this is set to true, the `git stash show` command will show From b3ac6e737db8635aaed0c355ebaf291b63fb0461 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 8 Oct 2025 13:48:46 +0200 Subject: [PATCH 5/7] doc: fix accidental literal blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make sure that normal paragraphs in most user-facing docs[1] don’t use literal blocks. This can easily happen if you try to maintain indentation in order to continue a block; that might work in e.g. Markdown variants, but not in AsciiDoc. The fixes are straightforward, i.e. just deindent the block and maybe add line continuations. The only exception is git-sparse-checkout(1) where we also replace indentation used for *intended* literal blocks with `----`. † 1: These have not been considered: • `Documentation/howto/` • `Documentation/technical/` • `Documentation/gitprotocol*` Signed-off-by: Kristoffer Haugsbakk Acked-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/config/core.adoc | 4 +- Documentation/git-config.adoc | 18 +++---- Documentation/git-rev-parse.adoc | 14 ++--- Documentation/git-shortlog.adoc | 4 +- Documentation/git-sparse-checkout.adoc | 72 ++++++++++++++++---------- 5 files changed, 64 insertions(+), 48 deletions(-) diff --git a/Documentation/config/core.adoc b/Documentation/config/core.adoc index 3fbe83eef1612c..8866ed27714b4a 100644 --- a/Documentation/config/core.adoc +++ b/Documentation/config/core.adoc @@ -75,8 +75,8 @@ The built-in file system monitor is currently available only on a limited set of supported platforms. Currently, this includes Windows and MacOS. + - Otherwise, this variable contains the pathname of the "fsmonitor" - hook command. +Otherwise, this variable contains the pathname of the "fsmonitor" +hook command. + This hook command is used to identify all files that may have changed since the requested date/time. This information is used to speed up diff --git a/Documentation/git-config.adoc b/Documentation/git-config.adoc index 511b2e26bfb00f..a633ab8ec3a9e1 100644 --- a/Documentation/git-config.adoc +++ b/Documentation/git-config.adoc @@ -117,15 +117,15 @@ OPTIONS --comment :: Append a comment at the end of new or modified lines. - - If __ begins with one or more whitespaces followed - by "#", it is used as-is. If it begins with "#", a space is - prepended before it is used. Otherwise, a string " # " (a - space followed by a hash followed by a space) is prepended - to it. And the resulting string is placed immediately after - the value defined for the variable. The __ must - not contain linefeed characters (no multi-line comments are - permitted). ++ +If __ begins with one or more whitespaces followed +by "#", it is used as-is. If it begins with "#", a space is +prepended before it is used. Otherwise, a string " # " (a +space followed by a hash followed by a space) is prepended +to it. And the resulting string is placed immediately after +the value defined for the variable. The __ must +not contain linefeed characters (no multi-line comments are +permitted). --all:: With `get`, return all values for a multi-valued key. diff --git a/Documentation/git-rev-parse.adoc b/Documentation/git-rev-parse.adoc index cc32b4b4f0f999..18383e52af72ad 100644 --- a/Documentation/git-rev-parse.adoc +++ b/Documentation/git-rev-parse.adoc @@ -174,13 +174,13 @@ for another option. Allow oids to be input from any object format that the current repository supports. - - Specifying "sha1" translates if necessary and returns a sha1 oid. - - Specifying "sha256" translates if necessary and returns a sha256 oid. - - Specifying "storage" translates if necessary and returns an oid in - encoded in the storage hash algorithm. ++ +Specifying "sha1" translates if necessary and returns a sha1 oid. ++ +Specifying "sha256" translates if necessary and returns a sha256 oid. ++ +Specifying "storage" translates if necessary and returns an oid in +encoded in the storage hash algorithm. Options for Objects ~~~~~~~~~~~~~~~~~~~ diff --git a/Documentation/git-shortlog.adoc b/Documentation/git-shortlog.adoc index d8ab38dcc1f1a6..aa92800c69ccc3 100644 --- a/Documentation/git-shortlog.adoc +++ b/Documentation/git-shortlog.adoc @@ -44,8 +44,8 @@ OPTIONS describe each commit. '' can be any string accepted by the `--format` option of 'git log', such as '* [%h] %s'. (See the "PRETTY FORMATS" section of linkgit:git-log[1].) - - Each pretty-printed commit will be rewrapped before it is shown. ++ +Each pretty-printed commit will be rewrapped before it is shown. --date=:: Show dates formatted according to the given date string. (See diff --git a/Documentation/git-sparse-checkout.adoc b/Documentation/git-sparse-checkout.adoc index 529a8edd9c1ed8..b5fe5da041676c 100644 --- a/Documentation/git-sparse-checkout.adoc +++ b/Documentation/git-sparse-checkout.adoc @@ -264,34 +264,50 @@ patterns in non-cone mode has a number of shortcomings: inconsistent. * It has edge cases where the "right" behavior is unclear. Two examples: - - First, two users are in a subdirectory, and the first runs - git sparse-checkout set '/toplevel-dir/*.c' - while the second runs - git sparse-checkout set relative-dir - Should those arguments be transliterated into - current/subdirectory/toplevel-dir/*.c - and - current/subdirectory/relative-dir - before inserting into the sparse-checkout file? The user who typed - the first command is probably aware that arguments to set/add are - supposed to be patterns in non-cone mode, and probably would not be - happy with such a transliteration. However, many gitignore-style - patterns are just paths, which might be what the user who typed the - second command was thinking, and they'd be upset if their argument - wasn't transliterated. - - Second, what should bash-completion complete on for set/add commands - for non-cone users? If it suggests paths, is it exacerbating the - problem above? Also, if it suggests paths, what if the user has a - file or directory that begins with either a '!' or '#' or has a '*', - '\', '?', '[', or ']' in its name? And if it suggests paths, will - it complete "/pro" to "/proc" (in the root filesystem) rather than to - "/progress.txt" in the current directory? (Note that users are - likely to want to start paths with a leading '/' in non-cone mode, - for the same reason that .gitignore files often have one.) - Completing on files or directories might give nasty surprises in - all these cases. ++ +First, two users are in a subdirectory, and the first runs ++ +---- +git sparse-checkout set '/toplevel-dir/*.c' +---- ++ +while the second runs ++ +---- +git sparse-checkout set relative-dir +---- ++ +Should those arguments be transliterated into ++ +---- +current/subdirectory/toplevel-dir/*.c +---- ++ +and ++ +---- +current/subdirectory/relative-dir +---- ++ +before inserting into the sparse-checkout file? The user who typed +the first command is probably aware that arguments to set/add are +supposed to be patterns in non-cone mode, and probably would not be +happy with such a transliteration. However, many gitignore-style +patterns are just paths, which might be what the user who typed the +second command was thinking, and they'd be upset if their argument +wasn't transliterated. ++ +Second, what should bash-completion complete on for set/add commands +for non-cone users? If it suggests paths, is it exacerbating the +problem above? Also, if it suggests paths, what if the user has a +file or directory that begins with either a '!' or '#' or has a '*', +'\', '?', '[', or ']' in its name? And if it suggests paths, will +it complete "/pro" to "/proc" (in the root filesystem) rather than to +"/progress.txt" in the current directory? (Note that users are +likely to want to start paths with a leading '/' in non-cone mode, +for the same reason that .gitignore files often have one.) +Completing on files or directories might give nasty surprises in +all these cases. * The excessive flexibility made other extensions essentially impractical. `--sparse-index` is likely impossible in non-cone From 2cebca05824057493f4b2ef9cd86333a04ed4a7e Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Mon, 13 Oct 2025 17:56:01 -0400 Subject: [PATCH 6/7] builtin/cat-file.c: simplify calling `report_object_status()` In b0b910e052 (cat-file.c: add batch handling for submodules, 2025-06-02), we began handling submodule entries specially when batching cat-file like so: $ echo :sha1collisiondetection | git.compile cat-file --batch-check 855827c583bc30645ba427885caa40c5b81764d2 submodule Commit b0b910e052 notes that submodules are handled differently than non-existent objects, which print " ", since there is (a) no object to resolve the OID of in the first place, and as commit b0b910e052 notes, (b) for submodules in particular, it is useful to know what commit it points at without having to spawn another Git process. That commit does so by calling report_object_status() and passing in "oid_to_hex(&data->oid)" for the "obj_name" parameter. This is unnecessary, however, since report_object_status() will do the same automatically if given a NULL "obj_name" argument. That behavior dates back to 6a951937ae (cat-file: add --batch-all-objects option, 2015-06-22), so rely on that instead of having the caller open-code that part of report_object_status(). Signed-off-by: Taylor Blau Signed-off-by: Junio C Hamano --- builtin/cat-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 4b23fcecbd8e7a..71b94c8b3fb34f 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -497,7 +497,7 @@ static void batch_object_write(const char *obj_name, OBJECT_INFO_LOOKUP_REPLACE); if (ret < 0) { if (data->mode == S_IFGITLINK) - report_object_status(opt, oid_to_hex(&data->oid), &data->oid, "submodule"); + report_object_status(opt, NULL, &data->oid, "submodule"); else report_object_status(opt, obj_name, &data->oid, "missing"); return; From 133d151831d32bdcc02422599a3f26cef44f929b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 20 Oct 2025 14:11:52 -0700 Subject: [PATCH 7/7] The twenty-first batch Signed-off-by: Junio C Hamano --- Documentation/RelNotes/2.52.0.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/RelNotes/2.52.0.adoc b/Documentation/RelNotes/2.52.0.adoc index ef5f91fcc034ad..1e41b7380aebe0 100644 --- a/Documentation/RelNotes/2.52.0.adoc +++ b/Documentation/RelNotes/2.52.0.adoc @@ -376,3 +376,7 @@ including security updates, are included in this release. (merge 1c573a3451 en/doc-merge-tree-describe-merge-base later to maint). (merge 84a6bf7965 ja/doc-markup-attached-paragraph-fix later to maint). (merge 399694384b kh/doc-patch-id-markup-fix later to maint). + (merge 15b8abde07 js/mingw-includes-cleanup later to maint). + (merge 3860985105 js/unreachable-workaround-for-no-symlink-head later to maint). + (merge b3ac6e737d kh/doc-continued-paragraph-fix later to maint). + (merge 2cebca0582 tb/cat-file-objectmode-update later to maint).