From 823d537fa7bd35a5218ef2f625a8e4598c47cd3a Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Fri, 8 Aug 2025 15:43:12 +0200 Subject: [PATCH 001/283] doc: git-log: fix description list b27be108c89 (doc: git-log: convert log config to new doc format, 2025-07-07) intended to convert a paragraph describing the different options for `log.decorate` into a description list. But the literal block syntax was used by mistake. Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/config/log.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/config/log.adoc b/Documentation/config/log.adoc index 16e00e8d296aa1..f20cc25cd7c3bf 100644 --- a/Documentation/config/log.adoc +++ b/Documentation/config/log.adoc @@ -23,14 +23,14 @@ be used. Print out the ref names of any commits that are shown by the log command. Possible values are: + ----- +-- `short`;; the ref name prefixes `refs/heads/`, `refs/tags/` and `refs/remotes/` are not printed. `full`;; the full ref name (including prefix) are printed. `auto`;; if the output is going to a terminal, the ref names are shown as if `short` were given, otherwise no ref names are shown. ----- +-- + This is the same as the `--decorate` option of the `git log`. From cf7efa4f331d6eceaae97aad5c2f9ce9d1293ecc Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Fri, 8 Aug 2025 20:32:02 +0100 Subject: [PATCH 002/283] t6137-*.sh: fix test failure on cygwin Commit 6fd1106aa4 ("t3700: Skip a test with backslashes in pathspec", 2009-03-13) introduced the BSLASHPSPEC prerequisite. This prerequisite allows tests to check for systems that can use backslashes in pathspecs (e.g. to escape glob special characters). On windows (and cygwin), this does not work because backslashes are used as directory separators, and git eagerly converts them to forward slashes. This test file uses the FUNNYNAMES prerequisite to skip this test file on windows, despite not really being appropriate for this test, which does not hold on cygwin. The FUNNYNAMES prerequisite is set when the system can create files with embedded quotes ("), tabs or newlines in the name. Since cygwin can satisfy FUNNYNAMES, but not BSLASHPSPEC, this leads to test failures on cygwin. In order to skip these tests on cygwin, replace the FUNNYNAMES prerequisite with BSLASHPSPEC, so that this test file is skipped on both windows and cygwin. While here, fix a few test titles as well. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- t/t6137-pathspec-wildcards-literal.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t6137-pathspec-wildcards-literal.sh b/t/t6137-pathspec-wildcards-literal.sh index 20abad5667df28..17a03085ef396d 100755 --- a/t/t6137-pathspec-wildcards-literal.sh +++ b/t/t6137-pathspec-wildcards-literal.sh @@ -3,8 +3,8 @@ test_description='test wildcards and literals with git add/commit (subshell styl . ./test-lib.sh -test_have_prereq FUNNYNAMES || { - skip_all='skipping: needs FUNNYNAMES (non-Windows only)' +test_have_prereq BSLASHPSPEC || { + skip_all='skipping: needs BSLASHPSPEC (backslashes in pathspecs)' test_done } @@ -184,7 +184,7 @@ test_expect_success 'add wildcard f?z' ' ) ' -test_expect_success 'add literal \? literal' ' +test_expect_success 'add literal \?' ' git init test-q-lit && ( cd test-q-lit && @@ -241,7 +241,7 @@ test_expect_success 'add literal hello\?world' ' ) ' -test_expect_success 'add literal [abc]' ' +test_expect_success 'add literal \[abc\]' ' git init test-brackets-lit && ( cd test-brackets-lit && @@ -280,7 +280,7 @@ test_expect_success 'commit: wildcard *' ' ) ' -test_expect_success 'commit: literal *' ' +test_expect_success 'commit: literal \*' ' git init test-c-asterisk-lit && ( cd test-c-asterisk-lit && @@ -328,7 +328,7 @@ test_expect_success 'commit: literal f\*' ' ) ' -test_expect_success 'commit: wildcard pathspec limits commit' ' +test_expect_success 'commit: wildcard f**' ' git init test-c-pathlimit && ( cd test-c-pathlimit && From 741f36c7d9c87648cc4ecb68eb9156fa50769e56 Mon Sep 17 00:00:00 2001 From: Knut Harald Ryager Date: Mon, 11 Aug 2025 22:04:32 +0000 Subject: [PATCH 003/283] docs: remove stray bracket from git-clone synopsis The synopsis section has an extra closing bracket, like this: [--filter=] [--also-filter-submodules]] The extra one is not the one at the end of this line; it is the one after "...=". The "--also-filter-submodules" option was added by f05da2b4 (clone, submodule: pass partial clone filters to submodules, 2022-02-04). Because it makes sense only when used with the "--filter=" option, these two options are enclosed in a pair of brackets. The extra one was added by 76880f05 (doc: git-clone: apply new documentation formatting guidelines, 2024-03-29) by mistake. Remove the extra and incorrect closing bracket, so that the line reads: [--filter= [--also-filter-submodules]] Signed-off-by: Knut Harald Ryager Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index de8d8f58930ecf..c0d8e1e89779d5 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -16,7 +16,7 @@ git clone [--template=] [--depth ] [--[no-]single-branch] [--no-tags] [--recurse-submodules[=]] [--[no-]shallow-submodules] [--[no-]remote-submodules] [--jobs ] [--sparse] [--[no-]reject-shallow] - [--filter=] [--also-filter-submodules]] [--] + [--filter= [--also-filter-submodules]] [--] [] DESCRIPTION From 7d4a5fef7dcb0e3a7e900ae6da9bd006a6208da9 Mon Sep 17 00:00:00 2001 From: Daniele Sassoli Date: Thu, 14 Aug 2025 14:33:54 +0000 Subject: [PATCH 004/283] count-objects: document count-objects pack 0bdaa12169b (git-count-objects.txt: describe each line in -v output, 2013-02-08) forgot to include `packs`. Signed-off-by: Daniele Sassoli Signed-off-by: Junio C Hamano --- Documentation/git-count-objects.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/git-count-objects.txt b/Documentation/git-count-objects.txt index 97f9f1261010f5..eeee6b9f7f4ac0 100644 --- a/Documentation/git-count-objects.txt +++ b/Documentation/git-count-objects.txt @@ -28,6 +28,8 @@ size: disk space consumed by loose objects, in KiB (unless -H is specified) + in-pack: the number of in-pack objects + +packs: the number of pack files ++ size-pack: disk space consumed by the packs, in KiB (unless -H is specified) + prune-packable: the number of loose objects that are also present in From bcb20dda833dc71a729af50bdfb86c5d252307b1 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Wed, 20 Aug 2025 08:16:05 +0200 Subject: [PATCH 005/283] doc/gitk: update reference to the external project Gitk is now maintained by Johannes Sixt and the repository can be cloned from a new URL. b59358100c20 (Update the official repo of gitk, 2024-12-24) could have updated this instance in the manual, too, but the opportunity was missed. Update it now. Do give credit to Paul Mackerras as the inventor of the program. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- Documentation/gitk.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt index 35b39960296b69..d90396904eecda 100644 --- a/Documentation/gitk.txt +++ b/Documentation/gitk.txt @@ -163,16 +163,16 @@ used by default. If '$XDG_CONFIG_HOME' is not set it defaults to History ------- -Gitk was the first graphical repository browser. It's written in -tcl/tk. +Gitk was the first graphical repository browser, written by +Paul Mackerras in Tcl/Tk. 'gitk' is actually maintained as an independent project, but stable versions are distributed as part of the Git suite for the convenience of end users. -gitk-git/ comes from Paul Mackerras's gitk project: +`gitk-git/` comes from Johannes Sixt's gitk project: - git://ozlabs.org/~paulus/gitk + https://github.com/j6t/gitk SEE ALSO -------- From f38786baa7c2d7ada1e9470c2a0797d1292c529e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Date: Wed, 20 Aug 2025 23:23:19 +0200 Subject: [PATCH 006/283] doc: fix asciidoc format compatibility in pretty-formats.adoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Asciidoc.py and Asciidoctor do not process the '+' verbatim the same way. A span is detected when the format sign (here '+')is preceded by a non-word character. It seems that '{nbsp}' is considered a non-word sign by Asciidoc.py, but not by Asciidoctor. Using a double format-sign opens 'unconstrained' span, independent on the preceding character in both engines. The '+' sign is used instead of the backtick '`' because it is not processed as synopsis in asciidoc.py. Unfortunately, the post-processing of verbatim synopsis in asciidoctor cannot be bypassed and formatting of the parentheses is forced in syntax sign instead of keywords, unless a proper grammar analyzer is used. Signed-off-by: Jean-Noël Avila Signed-off-by: Junio C Hamano --- Documentation/pretty-formats.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/pretty-formats.adoc b/Documentation/pretty-formats.adoc index 9ed0417fc811e5..618ddc4a0c819f 100644 --- a/Documentation/pretty-formats.adoc +++ b/Documentation/pretty-formats.adoc @@ -233,11 +233,11 @@ colon and zero or more comma-separated options. Option values may contain literal formatting codes. These must be used for commas (`%x2C`) and closing parentheses (`%x29`), due to their role in the option syntax. + -** `prefix=`: Shown before the list of ref names. Defaults to "{nbsp}+(+". +** `prefix=`: Shown before the list of ref names. Defaults to "{nbsp}++(++". ** `suffix=`: Shown after the list of ref names. Defaults to "+)+". ** `separator=`: Shown between ref names. Defaults to "+,+{nbsp}". ** `pointer=`: Shown between HEAD and the branch it points to, if any. - Defaults to "{nbsp}+->+{nbsp}". + Defaults to "{nbsp}++->++{nbsp}". ** `tag=`: Shown before tag names. Defaults to "`tag:`{nbsp}". + From ac7096723b6a42c177ffb2fbe1c4f4c5dc59e752 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 21 Aug 2025 08:06:52 -0700 Subject: [PATCH 007/283] config: document includeIf conditions consistently When 399b1984 (config: include file if remote URL matches a glob, 2022-01-18) added the 'hasconfig:remote.*.url:' condition to be used in the "includeIf..path" configuration, the keyword was added with an extra colon in the documentation. The section that documents these condition begins with this preamble: The condition starts with a keyword followed by a colon and some data whose format and meaning depends on the keyword. Supported keywords are: which makes it clear that the colon that comes between the condition keyword (e.g. "gitdir") and the parameter (aka "some data") is not a part of the keyword. Lose the extra colon. Also rewrite description of all keywords to clarify that "some data" does not directly follow "keyword", and the colon is not a part of keyword. Signed-off-by: Junio C Hamano --- Documentation/config.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 8c0b3ed8075214..ee1f80cad6191f 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -114,8 +114,7 @@ whose format and meaning depends on the keyword. Supported keywords are: `gitdir`:: - - The data that follows the keyword `gitdir:` is used as a glob + The data that follows the keyword `gitdir` and a colon is used as a glob pattern. If the location of the .git directory matches the pattern, the include condition is met. + @@ -148,7 +147,7 @@ refer to linkgit:gitignore[5] for details. For convenience: case-insensitively (e.g. on case-insensitive file systems) `onbranch`:: - The data that follows the keyword `onbranch:` is taken to be a + The data that follows the keyword `onbranch` and a colon is taken to be a pattern with standard globbing wildcards and two additional ones, `**/` and `/**`, that can match multiple path components. If we are in a worktree where the name of the branch that is @@ -161,8 +160,8 @@ all branches that begin with `foo/`. This is useful if your branches are organized hierarchically and you would like to apply a configuration to all the branches in that hierarchy. -`hasconfig:remote.*.url:`:: - The data that follows this keyword is taken to +`hasconfig:remote.*.url`:: + The data that follows this keyword and a colon is taken to be a pattern with standard globbing wildcards and two additional ones, `**/` and `/**`, that can match multiple components. The first time this keyword is seen, the rest of From 374579c6d41ab9ca58031aa3759881013c061940 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Fri, 22 Aug 2025 17:20:35 +0200 Subject: [PATCH 008/283] doc: interpret-trailers: close all pairs of single quotes Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-interpret-trailers.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/git-interpret-trailers.adoc b/Documentation/git-interpret-trailers.adoc index 82c8780d932f33..fd335fe772ab99 100644 --- a/Documentation/git-interpret-trailers.adoc +++ b/Documentation/git-interpret-trailers.adoc @@ -142,8 +142,8 @@ OPTIONS provided with '--if-exists' overrides the `trailer.ifExists` and any applicable `trailer..ifExists` configuration variables and applies to all '--trailer' options until the next occurrence of - '--if-exists' or '--no-if-exists'. Upon encountering '--no-if-exists, clear the - effect of any previous use of '--if-exists, such that the relevant configuration + '--if-exists' or '--no-if-exists'. Upon encountering '--no-if-exists', clear the + effect of any previous use of '--if-exists', such that the relevant configuration variables are no longer overridden. Possible actions are `addIfDifferent`, `addIfDifferentNeighbor`, `add`, `replace` and `doNothing`. @@ -154,8 +154,8 @@ OPTIONS provided with '--if-missing' overrides the `trailer.ifMissing` and any applicable `trailer..ifMissing` configuration variables and applies to all '--trailer' options until the next occurrence of - '--if-missing' or '--no-if-missing'. Upon encountering '--no-if-missing, - clear the effect of any previous use of '--if-missing, such that the relevant + '--if-missing' or '--no-if-missing'. Upon encountering '--no-if-missing', + clear the effect of any previous use of '--if-missing', such that the relevant configuration variables are no longer overridden. Possible actions are `doNothing` or `add`. From 37001cdbc4e0cc1a1dbffdb0d07ce1bd3533f2a9 Mon Sep 17 00:00:00 2001 From: Daniele Sassoli Date: Sat, 23 Aug 2025 09:12:11 +0000 Subject: [PATCH 009/283] doc: clarify which remotes can be used with GitGitGadget The docs mostly point to using git/git as one's remote, however, when it comes to Sending a PR to GitGitGadget section, the reader is told to use gitgitgadget/git, with no mention of git/git, potentially leading to some confusion. Clarify that both gitgitgadget/git and git/git can be used, albeit with some differences. Signed-off-by: Daniele Sassoli Acked-by: Elijah Newren Signed-off-by: Junio C Hamano --- Documentation/MyFirstContribution.adoc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc index afcf4b46c11ab2..52366fe0eb06fc 100644 --- a/Documentation/MyFirstContribution.adoc +++ b/Documentation/MyFirstContribution.adoc @@ -896,10 +896,13 @@ Now you should be able to go and check out your newly created branch on GitHub. === Sending a PR to GitGitGadget In order to have your code tested and formatted for review, you need to start by -opening a Pull Request against `gitgitgadget/git`. Head to -https://github.com/gitgitgadget/git and open a PR either with the "New pull -request" button or the convenient "Compare & pull request" button that may -appear with the name of your newly pushed branch. +opening a Pull Request against either `gitgitgadget/git` or `git/git`. Head to +https://github.com/gitgitgadget/git or https://github.com/git/git and open a PR +either with the "New pull request" button or the convenient "Compare & pull +request" button that may appear with the name of your newly pushed branch. + +The differences between using `gitgitgadget/git` and `git/git` as your base can +be found [here](https://gitgitgadget.github.io/#should-i-use-gitgitgadget-on-gitgitgadgets-git-fork-or-on-gits-github-mirror) Review the PR's title and description, as they're used by GitGitGadget respectively as the subject and body of the cover letter for your change. Refer From 785628b173f167ddce96f12829de56588a850355 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Fri, 22 Aug 2025 20:52:24 +0200 Subject: [PATCH 010/283] doc/format-patch: adjust Thunderbird MUA hint to new add-on There are three tips how to compose a non-line-wrapped patch with Thunderbird. The first one suggests use of an add-on. The one referenced has long been superseded by a different one. Update the link to the new one. Mention that additional configuration is required to make the add-on work. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- Documentation/git-format-patch.adoc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Documentation/git-format-patch.adoc b/Documentation/git-format-patch.adoc index a8b53db9a6635b..a9cf37182e2d85 100644 --- a/Documentation/git-format-patch.adoc +++ b/Documentation/git-format-patch.adoc @@ -587,13 +587,19 @@ an external editor to keep Thunderbird from mangling the patches. Approach #1 (add-on) ^^^^^^^^^^^^^^^^^^^^ -Install the Toggle Word Wrap add-on that is available from -https://addons.mozilla.org/thunderbird/addon/toggle-word-wrap/ -It adds a menu entry "Enable Word Wrap" in the composer's "Options" menu +Install the Toggle Line Wrap add-on that is available from +https://addons.thunderbird.net/thunderbird/addon/toggle-line-wrap +It adds a button "Line Wrap" to the composer's toolbar that you can tick off. Now you can compose the message as you otherwise do (cut + paste, 'git format-patch' | 'git imap-send', etc), but you have to insert line breaks manually in any text that you type. +As a bonus feature, the add-on can detect patch text in the composer +and warns when line wrapping has not yet been turned off. + +The add-on requires a few tweaks of the advanced configuration +(about:config). These are listed on the download page. + Approach #2 (configuration) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Three steps: From 44dce6541ca2e9f3af045055fe62996a8f221660 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Sun, 24 Aug 2025 21:46:51 +0200 Subject: [PATCH 011/283] doc: config: replace backtick with apostrophe for possessive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert back to “Git's” which was used before d30c5cc4592 (doc: convert git-mergetool options to new synopsis style, 2025-05-25) accidentally changed it. Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/config/mergetool.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/config/mergetool.adoc b/Documentation/config/mergetool.adoc index 6be506145c150b..7064f5a462cb56 100644 --- a/Documentation/config/mergetool.adoc +++ b/Documentation/config/mergetool.adoc @@ -65,7 +65,7 @@ endif::[] During a merge, Git will automatically resolve as many conflicts as possible and write the `$MERGED` file containing conflict markers around any conflicts that it cannot resolve; `$LOCAL` and `$REMOTE` normally - are the versions of the file from before Git`s conflict + are the versions of the file from before Git's conflict resolution. This flag causes `$LOCAL` and `$REMOTE` to be overwritten so that only the unresolved conflicts are presented to the merge tool. Can be configured per-tool via the `mergetool..hideResolved` From 457534d0417d047b943f76a849f256b739894ce9 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Mon, 25 Aug 2025 21:16:12 +0200 Subject: [PATCH 012/283] progress: pay attention to (customized) delay time Using one of the start_delayed_*() functions, clients of the progress API can request that a progress meter is only shown after some time. To do that, the implementation intends to count down the number of seconds stored in struct progress by observing flag progress_update, which the timer interrupt handler sets when a second has elapsed. This works during the first second of the delay. But the code forgets to reset the flag to zero, so that subsequent calls of display_progress() think that another second has elapsed and decrease the count again until zero is reached. Due to the frequency of the calls, this happens without an observable delay in practice, so that the effective delay is always just one second. This bug has been with us since the inception of the feature. Despite having been touched on various occasions, such as 8aade107dd84 (progress: simplify "delayed" progress API), 9c5951cacf5c (progress: drop delay-threshold code), and 44a4693bfcec (progress: create GIT_PROGRESS_DELAY), the short delay went unnoticed. Copy the flag state into a local variable and reset the global flag right away so that we can detect the next clock tick correctly. Since we have not had any complaints that the delay of one second is too short nor that GIT_PROGRESS_DELAY is ignored, people seem to be comfortable with the status quo. Therefore, set the default to 1 to keep the current behavior. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- Documentation/git.adoc | 2 +- progress.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/git.adoc b/Documentation/git.adoc index 743b7b00e4d751..03e9e69d257c1d 100644 --- a/Documentation/git.adoc +++ b/Documentation/git.adoc @@ -684,7 +684,7 @@ other `GIT_PROGRESS_DELAY`:: A number controlling how many seconds to delay before showing - optional progress indicators. Defaults to 2. + optional progress indicators. Defaults to 1. `GIT_EDITOR`:: This environment variable overrides `$EDITOR` and `$VISUAL`. diff --git a/progress.c b/progress.c index 8d5ae70f3a9ec7..8315bdc3d4a77a 100644 --- a/progress.c +++ b/progress.c @@ -114,16 +114,19 @@ static void display(struct progress *progress, uint64_t n, const char *done) const char *tp; struct strbuf *counters_sb = &progress->counters_sb; int show_update = 0; + int update = !!progress_update; int last_count_len = counters_sb->len; - if (progress->delay && (!progress_update || --progress->delay)) + progress_update = 0; + + if (progress->delay && (!update || --progress->delay)) return; progress->last_value = n; tp = (progress->throughput) ? progress->throughput->display.buf : ""; if (progress->total) { unsigned percent = n * 100 / progress->total; - if (percent != progress->last_percent || progress_update) { + if (percent != progress->last_percent || update) { progress->last_percent = percent; strbuf_reset(counters_sb); @@ -133,7 +136,7 @@ static void display(struct progress *progress, uint64_t n, const char *done) tp); show_update = 1; } - } else if (progress_update) { + } else if (update) { strbuf_reset(counters_sb); strbuf_addf(counters_sb, "%"PRIuMAX"%s", (uintmax_t)n, tp); show_update = 1; @@ -166,7 +169,6 @@ static void display(struct progress *progress, uint64_t n, const char *done) } fflush(stderr); } - progress_update = 0; } } @@ -281,7 +283,7 @@ static int get_default_delay(void) static int delay_in_secs = -1; if (delay_in_secs < 0) - delay_in_secs = git_env_ulong("GIT_PROGRESS_DELAY", 2); + delay_in_secs = git_env_ulong("GIT_PROGRESS_DELAY", 1); return delay_in_secs; } From 716d905792ebc6fcaf3860d9356fe4dd6ce61715 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 25 Aug 2025 22:11:01 +0000 Subject: [PATCH 013/283] docs: note that extensions.compatobjectformat is incomplete The compatibility object format is only implemented for loose objects, not packed objects, so anyone attempting to push or fetch data into a repository with this option will likely not see it work as expected. In addition, the underlying storage of loose object mapping is likely to change because the current format is inefficient and does not handle important mapping information such as that of submodules. It would have been preferable to initially document that this was not yet ready for prime time, but we did not do so. We hinted at the fact that this functionality is incomplete in the description, but did not say so explicitly. Let's do so now: indicate that this feature is incomplete and subject to change and that the option is not designed to be used by end users. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- Documentation/config/extensions.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/config/extensions.adoc b/Documentation/config/extensions.adoc index 9e2f321a6d776f..829f2523fcbca4 100644 --- a/Documentation/config/extensions.adoc +++ b/Documentation/config/extensions.adoc @@ -14,6 +14,10 @@ compatObjectFormat:: compatObjectFormat. As well as being able to use oids encoded in compatObjectFormat in addition to oids encoded with objectFormat to locally specify objects. ++ +Note that the functionality enabled by this extension is incomplete and subject +to change. It currently exists only to allow development and testing of +the underlying feature and is not designed to be enabled by end users. noop:: This extension does not change git's behavior at all. It is useful only From fafc9b08b83fb4510aad7226739d87ac810362d2 Mon Sep 17 00:00:00 2001 From: Aditya Garg Date: Tue, 26 Aug 2025 15:09:22 +0000 Subject: [PATCH 014/283] docs: update sendmail docs to use more secure SMTP server for Gmail Earlier recommendation by IETF with RFC 2595 was to deprecate implicit TLS in preference for upgrade an initially unencrypted connection with STARTTLS command. These days, however, IETF recommends that connections be made using "Implicit TLS", in preference to STARTTLS and the like, completely reversing their earlier position, in RFC8314. Update the GMail example to use the implicit TLS to match the current recommendation at port 465. Signed-off-by: Aditya Garg Signed-off-by: Junio C Hamano --- Documentation/git-send-email.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/git-send-email.adoc b/Documentation/git-send-email.adoc index 5335502d68fc7b..c610909a92cc3e 100644 --- a/Documentation/git-send-email.adoc +++ b/Documentation/git-send-email.adoc @@ -521,10 +521,10 @@ edit `~/.gitconfig` to specify your account settings: ---- [sendemail] - smtpEncryption = tls + smtpEncryption = ssl smtpServer = smtp.gmail.com smtpUser = yourname@gmail.com - smtpServerPort = 587 + smtpServerPort = 465 ---- Gmail does not allow using your regular password for `git send-email`. @@ -542,10 +542,10 @@ if you want to use `OAUTHBEARER`, edit your `~/.gitconfig` file and add ---- [sendemail] - smtpEncryption = tls + smtpEncryption = ssl smtpServer = smtp.gmail.com smtpUser = yourname@gmail.com - smtpServerPort = 587 + smtpServerPort = 465 smtpAuth = OAUTHBEARER ---- From 0eeacde50e71cc320016f0bcf9f8b17d5168cbfd Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Tue, 26 Aug 2025 16:35:25 -0700 Subject: [PATCH 015/283] Makefile: build libgit-rs and libgit-sys serially "make -JN" with INCLUDE_LIBGIT_RS enabled causes cargo lock warnings and can trigger ld errors during the build. The build errors are caused by two inner "make" invocations getting triggered concurrently: once inside of libgit-sys and another inside of libgit-rs. Make libgit-rs depend on libgit-sys so that "make" prevents them from running concurrently. Apply the same logic to the test invocations. Use cargo's "--manifest-path" option instead of "cd" in the recipes. Signed-off-by: David Aguilar Acked-by: Kyle Lippincott Signed-off-by: Junio C Hamano --- Makefile | 11 +++++------ t/Makefile | 14 ++++---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 70d1543b6b8688..13ac35a151c6a6 100644 --- a/Makefile +++ b/Makefile @@ -3946,13 +3946,12 @@ unit-tests: $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG) t/helper/test-tool$X $(MAKE) -C t/ unit-tests .PHONY: libgit-sys libgit-rs -libgit-sys libgit-rs: - $(QUIET)(\ - cd contrib/$@ && \ - cargo build \ - ) +libgit-sys: + $(QUIET)cargo build --manifest-path contrib/libgit-sys/Cargo.toml +libgit-rs: libgit-sys + $(QUIET)cargo build --manifest-path contrib/libgit-rs/Cargo.toml ifdef INCLUDE_LIBGIT_RS -all:: libgit-sys libgit-rs +all:: libgit-rs endif LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o diff --git a/t/Makefile b/t/Makefile index 791e0a097893e9..29dd226c7dcd90 100644 --- a/t/Makefile +++ b/t/Makefile @@ -190,15 +190,9 @@ perf: .PHONY: libgit-sys-test libgit-rs-test libgit-sys-test: - $(QUIET)(\ - cd ../contrib/libgit-sys && \ - cargo test \ - ) -libgit-rs-test: - $(QUIET)(\ - cd ../contrib/libgit-rs && \ - cargo test \ - ) + $(QUIET)cargo test --manifest-path ../contrib/libgit-sys/Cargo.toml +libgit-rs-test: libgit-sys-test + $(QUIET)cargo test --manifest-path ../contrib/libgit-rs/Cargo.toml ifdef INCLUDE_LIBGIT_RS -all:: libgit-sys-test libgit-rs-test +all:: libgit-rs-test endif From 1b5a6bfff323297bef85bb36fe65e8c18cf6bc73 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 27 Aug 2025 04:07:02 -0400 Subject: [PATCH 016/283] curl: add support for curl_global_trace() components In addition to the regular trace information produced by CURLOPT_VERBOSE, recent curl versions can enable or disable tracing of specific subsystems using a call to curl_global_trace(). This level of detail may or may not be useful for us in Git as mere users of libcurl, but there's one case where we need it for a test. In t5564, we set up a socks proxy, access it with GIT_TRACE_CURL set, and expect to find socks-related messages in the output. This test is broken in the release candidates for libcurl 8.16, as those socks messages are no longer produced in the trace. The problem bisects to curl's commit ab5e0bfddc (pytest: add SOCKS tests and scoring, 2025-07-21). There the socks messages were moved from generic infof() messages to the component-specific CURL_TRC_CF() system. And so we do not see them by default, but only if "socks" is enabled as a logging component. Teach Git's http code to accept a component list from the environment and pass it into curl_global_trace(). We can then use that in the test to enable the correct component. It should be safe to do so unconditionally. In older versions of curl which don't support this call, setting the environment variable is a noop. Likewise, any versions of curl which don't recognize the "socks" component should silently ignore it. The manpage for curl_global_trace() says this: The config string is a list of comma-separated component names. Names are case-insensitive and unknown names are ignored. The special name "all" applies to all components. Names may be prefixed with '+' or '-' to enable or disable detailed logging for a component. The list of component names is not part of curl's public API. Names may be added or disappear in future versions of libcurl. Since unknown names are silently ignored, outdated log configurations does not cause errors when upgrading libcurl. Given that, some names can be expected to be fairly stable and are listed below for easy reference. So this should let us make the test work on all versions without worrying about confusing older (or newer) versions. For the same reason, I've opted not to document this interface. This is deep internal voodoo for which we can make no promises to users. In fact, I was tempted to simply hard-code "socks" to let our test pass and not expose anything. But I suspect a little run-time flexibility may come in handy in the future when debugging or dealing with similar logging issues. I also considered just putting "all" into such a hard-coded default. But if you try it, you will see that many of the components are quite verbose and likely not interesting. They would clutter up our trace output if we enabled them by default. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- git-curl-compat.h | 7 +++++++ http.c | 8 ++++++++ t/t5564-http-proxy.sh | 4 +++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/git-curl-compat.h b/git-curl-compat.h index aa8eed7ed2b5e3..659e5a3875e3d6 100644 --- a/git-curl-compat.h +++ b/git-curl-compat.h @@ -45,6 +45,13 @@ #define GIT_CURL_HAVE_CURLOPT_PROTOCOLS_STR 1 #endif +/** + * curl_global_trace() was added in 8.3.0, released September 2023. + */ +#if LIBCURL_VERSION_NUM >= 0x080300 +#define GIT_CURL_HAVE_GLOBAL_TRACE 1 +#endif + /** * CURLOPT_TCP_KEEPCNT was added in 8.9.0, released in July, 2024. */ diff --git a/http.c b/http.c index d88e79fbde9c4c..86254a3ebab23f 100644 --- a/http.c +++ b/http.c @@ -1347,6 +1347,14 @@ void http_init(struct remote *remote, const char *url, int proactive_auth) if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) die("curl_global_init failed"); +#ifdef GIT_CURL_HAVE_GLOBAL_TRACE + { + const char *comp = getenv("GIT_TRACE_CURL_COMPONENTS"); + if (comp) + curl_global_trace(comp); + } +#endif + if (proactive_auth && http_proactive_auth == PROACTIVE_AUTH_NONE) http_proactive_auth = PROACTIVE_AUTH_IF_CREDENTIALS; diff --git a/t/t5564-http-proxy.sh b/t/t5564-http-proxy.sh index b27e481f95bc4d..c3903faf2d3e6f 100755 --- a/t/t5564-http-proxy.sh +++ b/t/t5564-http-proxy.sh @@ -72,7 +72,9 @@ test_expect_success SOCKS_PROXY 'clone via Unix socket' ' test_when_finished "rm -rf clone" && test_config_global http.proxy "socks4://localhost$PWD/%2530.sock" && { { - GIT_TRACE_CURL=$PWD/trace git clone "$HTTPD_URL/smart/repo.git" clone 2>err && + GIT_TRACE_CURL=$PWD/trace \ + GIT_TRACE_CURL_COMPONENTS=socks \ + git clone "$HTTPD_URL/smart/repo.git" clone 2>err && grep -i "SOCKS4 request granted" trace } || old_libcurl_error err From 2f4bf83ffc4ffd0a9ed13121d712beb4c1b9f276 Mon Sep 17 00:00:00 2001 From: "Kyle E. Mitchell" Date: Mon, 1 Sep 2025 11:04:18 -0700 Subject: [PATCH 017/283] doc: fix formatting of function-wrap shell alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a missed backtick to the end of a code segment so that it will be rendered like preceding examples. I deeply appreciate the thoroughness of this documentation. I noticed the formatting discrepancy reading https://git-scm.com/docs/git-config. Signed-off-by: Kyle E. Mitchell Acked-by: Jean-Noël AVILA Signed-off-by: Junio C Hamano --- Documentation/config/alias.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/config/alias.adoc b/Documentation/config/alias.adoc index 2c5db0ad8428e8..95825354bf1cdd 100644 --- a/Documentation/config/alias.adoc +++ b/Documentation/config/alias.adoc @@ -38,6 +38,6 @@ it will be treated as a shell command. For example, defining ** A convenient way to deal with this is to write your script operations in an inline function that is then called with any arguments from the command-line. For example `alias.cmd = "!c() { - echo $1 | grep $2 ; }; c" will correctly execute the prior example. + echo $1 | grep $2 ; }; c"` will correctly execute the prior example. ** Setting `GIT_TRACE=1` can help you debug the command being run for your alias. From bb4a83bb94e9307d9ec9bb87731effa37e58c86a Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Tue, 2 Sep 2025 22:35:46 +0200 Subject: [PATCH 018/283] doc: add missing backtick for inline-verbatim Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/fetch-options.adoc | 2 +- Documentation/git-multi-pack-index.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/fetch-options.adoc b/Documentation/fetch-options.adoc index b01372e4b3c659..65f7d1e7c7b435 100644 --- a/Documentation/fetch-options.adoc +++ b/Documentation/fetch-options.adoc @@ -1,7 +1,7 @@ --[no-]all:: Fetch all remotes, except for the ones that has the `remote..skipFetchAll` configuration variable set. - This overrides the configuration variable fetch.all`. + This overrides the configuration variable `fetch.all`. -a:: --append:: diff --git a/Documentation/git-multi-pack-index.adoc b/Documentation/git-multi-pack-index.adoc index 631d5c7d15c0de..15b333041764be 100644 --- a/Documentation/git-multi-pack-index.adoc +++ b/Documentation/git-multi-pack-index.adoc @@ -28,7 +28,7 @@ OPTIONS --[no-]progress:: Turn progress on/off explicitly. If neither is specified, progress is shown if standard error is connected to a terminal. Supported by - sub-commands `write`, `verify`, `expire`, and `repack. + sub-commands `write`, `verify`, `expire`, and `repack`. The following subcommands are available: From b0d97aac19b91886e4ae8745d56746e1df4d1457 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Tue, 2 Sep 2025 22:35:47 +0200 Subject: [PATCH 019/283] doc: remove extra backtick for inline-verbatim Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-fast-import.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-fast-import.adoc b/Documentation/git-fast-import.adoc index 58a2eaa51a8034..a54fcd7f21dd48 100644 --- a/Documentation/git-fast-import.adoc +++ b/Documentation/git-fast-import.adoc @@ -597,7 +597,7 @@ External data format:: + Here usually `` must be either a mark reference (`:`) set by a prior `blob` command, or a full 40-byte SHA-1 of an -existing Git blob object. If `` is `040000`` then +existing Git blob object. If `` is `040000` then `` must be the full 40-byte SHA-1 of an existing Git tree object or a mark reference set with `--import-marks`. From bf5c224537532eb61b2c6d88162c9dffd8bcfd96 Mon Sep 17 00:00:00 2001 From: Mikhail Malinouski Date: Wed, 3 Sep 2025 14:50:40 +0000 Subject: [PATCH 020/283] docs: fix typo in worktree.adoc 'extension' The documentation incorrectly referred to the extension without an 's'. This fixes the typo for clarity. Signed-off-by: Mikhail Malinouski Signed-off-by: Junio C Hamano --- Documentation/config/worktree.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/config/worktree.adoc b/Documentation/config/worktree.adoc index 5e35c7d018aecd..9e3f84f748c4aa 100644 --- a/Documentation/config/worktree.adoc +++ b/Documentation/config/worktree.adoc @@ -15,5 +15,5 @@ worktree.useRelativePaths:: different locations or environments. Defaults to "false". + Note that setting `worktree.useRelativePaths` to "true" implies enabling the -`extension.relativeWorktrees` config (see linkgit:git-config[1]), +`extensions.relativeWorktrees` config (see linkgit:git-config[1]), thus making it incompatible with older versions of Git. From 069c15d256ed5308d09a7a16d64c8af2416bed58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Thu, 4 Sep 2025 19:58:25 +0200 Subject: [PATCH 021/283] object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expose the expected type of the second parameter of extend_abbrev_len() instead of casting a void pointer internally. Just a single caller passes in a void pointer, the rest pass the correct type. Let the compiler help keeping it that way. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- object-name.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/object-name.c b/object-name.c index 88d1313028cf0b..6c6c38d3ccaad1 100644 --- a/object-name.c +++ b/object-name.c @@ -691,10 +691,9 @@ static inline char get_hex_char_from_oid(const struct object_id *oid, return hex[oid->hash[pos >> 1] & 0xf]; } -static int extend_abbrev_len(const struct object_id *oid, void *cb_data) +static int extend_abbrev_len(const struct object_id *oid, + struct min_abbrev_data *mad) { - struct min_abbrev_data *mad = cb_data; - unsigned int i = mad->init_len; while (mad->hex[i] && mad->hex[i] == get_hex_char_from_oid(oid, i)) i++; From 31397bc4f7fd16dbafcc6d6d1e99808282689ba7 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Mon, 8 Sep 2025 22:28:45 +0200 Subject: [PATCH 022/283] doc: fast-import: replace literal block with paragraph 68061e34702 (fast-import: disallow "feature export-marks" by default, 2019-08-29) added the documentation for this option. The second paragraph is a literal block but it looks like it should just be a regular paragraph. Signed-off-by: Kristoffer Haugsbakk Acked-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/git-fast-import.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/git-fast-import.adoc b/Documentation/git-fast-import.adoc index 58a2eaa51a8034..08b93f6f430339 100644 --- a/Documentation/git-fast-import.adoc +++ b/Documentation/git-fast-import.adoc @@ -61,10 +61,10 @@ OPTIONS currently impacts only the `export-marks`, `import-marks`, and `import-marks-if-exists` feature commands. + - Only enable this option if you trust the program generating the - fast-import stream! This option is enabled automatically for - remote-helpers that use the `import` capability, as they are - already trusted to run their own code. +Only enable this option if you trust the program generating the +fast-import stream! This option is enabled automatically for +remote-helpers that use the `import` capability, as they are +already trusted to run their own code. Options for Frontends ~~~~~~~~~~~~~~~~~~~~~ From e1d062e8ba0b72f49e9ef9713cc7011c330baab8 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 10 Sep 2025 15:12:17 +0200 Subject: [PATCH 023/283] odb: drop deprecated wrapper functions In the Git 2.51 release cycle we've refactored the object database layer to access objects via `struct object_database` directly. To make the transition a bit easier we have retained some of the old-style functions in case those were widely used. Now that Git 2.51 has been released it's time to clean up though and drop these old wrappers. Do so and adapt the small number of newly added users to use the new functions instead. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- builtin/pack-objects.c | 6 +++--- odb.h | 33 --------------------------------- t/helper/test-pack-deltas.c | 10 ++++------ 3 files changed, 7 insertions(+), 42 deletions(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 53a225625039ea..ff6900b6545a24 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -3774,7 +3774,7 @@ static void show_object_pack_hint(struct object *object, const char *name, enum stdin_packs_mode mode = *(enum stdin_packs_mode *)data; if (mode == STDIN_PACKS_MODE_FOLLOW) { if (object->type == OBJ_BLOB && - !has_object(the_repository, &object->oid, 0)) + !odb_has_object(the_repository->objects, &object->oid, 0)) return; add_object_entry(&object->oid, object->type, name, 0); } else { @@ -4591,8 +4591,8 @@ static int add_objects_by_path(const char *path, /* Skip objects that do not exist locally. */ if ((exclude_promisor_objects || arg_missing_action != MA_ERROR) && - oid_object_info_extended(the_repository, oid, &oi, - OBJECT_INFO_FOR_PREFETCH) < 0) + odb_read_object_info_extended(the_repository->objects, oid, &oi, + OBJECT_INFO_FOR_PREFETCH) < 0) continue; exclude = is_oid_uninteresting(the_repository, oid); diff --git a/odb.h b/odb.h index 3dfc66d75a3d20..e8b9dff9480ded 100644 --- a/odb.h +++ b/odb.h @@ -475,37 +475,4 @@ static inline int odb_write_object(struct object_database *odb, return odb_write_object_ext(odb, buf, len, type, oid, NULL, 0); } -/* Compatibility wrappers, to be removed once Git 2.51 has been released. */ -#include "repository.h" - -static inline int oid_object_info_extended(struct repository *r, - const struct object_id *oid, - struct object_info *oi, - unsigned flags) -{ - return odb_read_object_info_extended(r->objects, oid, oi, flags); -} - -static inline int oid_object_info(struct repository *r, - const struct object_id *oid, - unsigned long *sizep) -{ - return odb_read_object_info(r->objects, oid, sizep); -} - -static inline void *repo_read_object_file(struct repository *r, - const struct object_id *oid, - enum object_type *type, - unsigned long *size) -{ - return odb_read_object(r->objects, oid, type, size); -} - -static inline int has_object(struct repository *r, - const struct object_id *oid, - unsigned flags) -{ - return odb_has_object(r->objects, oid, flags); -} - #endif /* ODB_H */ diff --git a/t/helper/test-pack-deltas.c b/t/helper/test-pack-deltas.c index 4caa024b1ebe73..4981401eaa6664 100644 --- a/t/helper/test-pack-deltas.c +++ b/t/helper/test-pack-deltas.c @@ -51,16 +51,14 @@ static void write_ref_delta(struct hashfile *f, unsigned long size, base_size, delta_size, compressed_size, hdrlen; enum object_type type; void *base_buf, *delta_buf; - void *buf = repo_read_object_file(the_repository, - oid, &type, - &size); + void *buf = odb_read_object(the_repository->objects, + oid, &type, &size); if (!buf) die("unable to read %s", oid_to_hex(oid)); - base_buf = repo_read_object_file(the_repository, - base, &type, - &base_size); + base_buf = odb_read_object(the_repository->objects, + base, &type, &base_size); if (!base_buf) die("unable to read %s", oid_to_hex(base)); From 29fe658ffbd40e6f0343728a978c215fc1e1d11a Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:11 +0200 Subject: [PATCH 024/283] =?UTF-8?q?Makefile:=20don=E2=80=99t=20add=20whatc?= =?UTF-8?q?hanged=20after=20it=20has=20been=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 07572f220a8 (whatchanged: remove when built with WITH_BREAKING_CHANGES, 2025-05-12) set up the removal of git-whatchanged(1) when `WITH_BREAKING_CHANGES` is active. Part of that work was removing it from `commands` in `git.c`. But the Makefile still lists it as a builtin. That leaves it in the limbo of being linked but not being callable; you get the generic error about not being able to call it as a *builtin*: $ git whatchanged fatal: cannot handle whatchanged as a builtin instead of the expected: $ git whatchanged git: 'whatchanged' is not a git command. See 'git --help'. Based-on-patch-by: Jeff King Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index e11340c1ae77ba..9311da5bb1547a 100644 --- a/Makefile +++ b/Makefile @@ -883,7 +883,9 @@ BUILT_INS += git-stage$X BUILT_INS += git-status$X BUILT_INS += git-switch$X BUILT_INS += git-version$X +ifndef WITH_BREAKING_CHANGES BUILT_INS += git-whatchanged$X +endif # what 'all' will build but not install in gitexecdir OTHER_PROGRAMS += git$X From 5f31632ed7d8c2928b5cdd7a1358367415d24535 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:12 +0200 Subject: [PATCH 025/283] git: add `deprecated` category to --list-cmds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With 145 builtin commands (according to `git --list-cmds=builtins`), users are probably not keeping on top of which ones (if any) are deprecated. Let’s expand the experimental `--list-cmds`[1] to allow users and programs to query for this information. We will also use this in an upcoming commit to implement `is_deprecated_command`. [1]: Using something which is experimental to query for deprecations is perhaps not the most ideal approach, but it is simple to implement and better than having to scan the documentation Acked-by: Patrick Steinhardt Helped-by: Patrick Steinhardt Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git.adoc | 3 ++- git.c | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Documentation/git.adoc b/Documentation/git.adoc index 743b7b00e4d751..a2f0838b168c24 100644 --- a/Documentation/git.adoc +++ b/Documentation/git.adoc @@ -219,7 +219,8 @@ If you just want to run git as if it was started in `` then use List commands by group. This is an internal/experimental option and may change or be removed in the future. Supported groups are: builtins, parseopt (builtin commands that use - parse-options), main (all commands in libexec directory), + parse-options), deprecated (deprecated builtins), + main (all commands in libexec directory), others (all other commands in `$PATH` that have git- prefix), list- (see categories in command-list.txt), nohelpers (exclude helper commands), alias and config diff --git a/git.c b/git.c index 83eac0aeab75d6..511efdf20569b0 100644 --- a/git.c +++ b/git.c @@ -28,6 +28,7 @@ #define NEED_WORK_TREE (1<<3) #define DELAY_PAGER_CONFIG (1<<4) #define NO_PARSEOPT (1<<5) /* parse-options is not used */ +#define DEPRECATED (1<<6) struct cmd_struct { const char *cmd; @@ -51,7 +52,9 @@ const char git_more_info_string[] = static int use_pager = -1; -static void list_builtins(struct string_list *list, unsigned int exclude_option); +static void list_builtins(struct string_list *list, + unsigned int include_option, + unsigned int exclude_option); static void exclude_helpers_from_list(struct string_list *list) { @@ -88,7 +91,7 @@ static int list_cmds(const char *spec) int len = sep - spec; if (match_token(spec, len, "builtins")) - list_builtins(&list, 0); + list_builtins(&list, 0, 0); else if (match_token(spec, len, "main")) list_all_main_cmds(&list); else if (match_token(spec, len, "others")) @@ -99,6 +102,8 @@ static int list_cmds(const char *spec) list_aliases(&list); else if (match_token(spec, len, "config")) list_cmds_by_config(&list); + else if (match_token(spec, len, "deprecated")) + list_builtins(&list, DEPRECATED, 0); else if (len > 5 && !strncmp(spec, "list-", 5)) { struct strbuf sb = STRBUF_INIT; @@ -322,7 +327,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) if (!strcmp(cmd, "parseopt")) { struct string_list list = STRING_LIST_INIT_DUP; - list_builtins(&list, NO_PARSEOPT); + list_builtins(&list, 0, NO_PARSEOPT); for (size_t i = 0; i < list.nr; i++) printf("%s ", list.items[i].string); string_list_clear(&list, 0); @@ -590,7 +595,7 @@ static struct cmd_struct commands[] = { { "notes", cmd_notes, RUN_SETUP }, { "pack-objects", cmd_pack_objects, RUN_SETUP }, #ifndef WITH_BREAKING_CHANGES - { "pack-redundant", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT }, + { "pack-redundant", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT | DEPRECATED }, #endif { "pack-refs", cmd_pack_refs, RUN_SETUP }, { "patch-id", cmd_patch_id, RUN_SETUP_GENTLY | NO_PARSEOPT }, @@ -647,7 +652,7 @@ static struct cmd_struct commands[] = { { "verify-tag", cmd_verify_tag, RUN_SETUP }, { "version", cmd_version }, #ifndef WITH_BREAKING_CHANGES - { "whatchanged", cmd_whatchanged, RUN_SETUP }, + { "whatchanged", cmd_whatchanged, RUN_SETUP | DEPRECATED }, #endif { "worktree", cmd_worktree, RUN_SETUP }, { "write-tree", cmd_write_tree, RUN_SETUP }, @@ -668,11 +673,16 @@ int is_builtin(const char *s) return !!get_builtin(s); } -static void list_builtins(struct string_list *out, unsigned int exclude_option) +static void list_builtins(struct string_list *out, + unsigned int include_option, + unsigned int exclude_option) { + if (include_option && exclude_option) + BUG("'include_option' and 'exclude_option' are mutually exclusive"); for (size_t i = 0; i < ARRAY_SIZE(commands); i++) { - if (exclude_option && - (commands[i].option & exclude_option)) + if (include_option && !(commands[i].option & include_option)) + continue; + if (exclude_option && (commands[i].option & exclude_option)) continue; string_list_append(out, commands[i].cmd); } From b4f9282d8db88619b2becac7f4ee2cad75a72ff9 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:13 +0200 Subject: [PATCH 026/283] git: move seen-alias bookkeeping into handle_alias(...) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We are about to complicate the command handling by allowing *deprecated* builtins to be shadowed by aliases. We need to organize the code in order to facilitate that.[1] The code in the `while(1)` speculatively adds commands to the list before finding out if it’s an alias. Let’s instead move it inside `handle_alias(...)`—where it conceptually belongs anyway—and in turn only run this logic when we have found an alias.[2] [1]: We will do that with an additional call to `handle_alias(1)` inside the loop. *Not* moving this code leaves a blind spot; we will miss alias looping crafted via deprecated builtin names [2]: Also rename the list to a more descriptive name Based-on-patch-by: Jeff King Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- git.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/git.c b/git.c index 511efdf20569b0..ef1e7b205aa8e8 100644 --- a/git.c +++ b/git.c @@ -365,7 +365,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) return (*argv) - orig_argv; } -static int handle_alias(struct strvec *args) +static int handle_alias(struct strvec *args, struct string_list *expanded_aliases) { int envchanged = 0, ret = 0, saved_errno = errno; int count, option_count; @@ -376,6 +376,8 @@ static int handle_alias(struct strvec *args) alias_command = args->v[0]; alias_string = alias_lookup(alias_command); if (alias_string) { + struct string_list_item *seen; + if (args->nr == 2 && !strcmp(args->v[1], "-h")) fprintf_ln(stderr, _("'%s' is aliased to '%s'"), alias_command, alias_string); @@ -423,6 +425,25 @@ static int handle_alias(struct strvec *args) if (!strcmp(alias_command, new_argv[0])) die(_("recursive alias: %s"), alias_command); + string_list_append(expanded_aliases, alias_command); + seen = unsorted_string_list_lookup(expanded_aliases, + new_argv[0]); + + if (seen) { + struct strbuf sb = STRBUF_INIT; + for (size_t i = 0; i < expanded_aliases->nr; i++) { + struct string_list_item *item = &expanded_aliases->items[i]; + + strbuf_addf(&sb, "\n %s", item->string); + if (item == seen) + strbuf_addstr(&sb, " <=="); + else if (i == expanded_aliases->nr - 1) + strbuf_addstr(&sb, " ==>"); + } + die(_("alias loop detected: expansion of '%s' does" + " not terminate:%s"), expanded_aliases->items[0].string, sb.buf); + } + trace_argv_printf(new_argv, "trace: alias expansion: %s =>", alias_command); @@ -806,8 +827,7 @@ static void execv_dashed_external(const char **argv) static int run_argv(struct strvec *args) { int done_alias = 0; - struct string_list cmd_list = STRING_LIST_INIT_DUP; - struct string_list_item *seen; + struct string_list expanded_aliases = STRING_LIST_INIT_DUP; while (1) { /* @@ -859,35 +879,17 @@ static int run_argv(struct strvec *args) /* .. then try the external ones */ execv_dashed_external(args->v); - seen = unsorted_string_list_lookup(&cmd_list, args->v[0]); - if (seen) { - struct strbuf sb = STRBUF_INIT; - for (size_t i = 0; i < cmd_list.nr; i++) { - struct string_list_item *item = &cmd_list.items[i]; - - strbuf_addf(&sb, "\n %s", item->string); - if (item == seen) - strbuf_addstr(&sb, " <=="); - else if (i == cmd_list.nr - 1) - strbuf_addstr(&sb, " ==>"); - } - die(_("alias loop detected: expansion of '%s' does" - " not terminate:%s"), cmd_list.items[0].string, sb.buf); - } - - string_list_append(&cmd_list, args->v[0]); - /* * It could be an alias -- this works around the insanity * of overriding "git log" with "git show" by having * alias.log = show */ - if (!handle_alias(args)) + if (!handle_alias(args, &expanded_aliases)) break; done_alias = 1; } - string_list_clear(&cmd_list, 0); + string_list_clear(&expanded_aliases, 0); return done_alias; } From bf68b116997a0471dfccf7dcced00eb7d8b66982 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:14 +0200 Subject: [PATCH 027/283] git: allow alias-shadowing deprecated builtins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-whatchanged(1) is deprecated and you need to pass `--i-still-use-this` in order to force it to work as before. There are two affected users, or usages: 1. people who use the command in scripts; and 2. people who are used to using it interactively. For (1) the replacement is straightforward.[1] But people in (2) might like the name or be really used to typing it.[3] An obvious first thought is to suggest aliasing `whatchanged` to the git-log(1) equivalent.[1] But this doesn’t work and is awkward since you cannot shadow builtins via aliases. Now you are left in an uncomfortable limbo; your alias won’t work until the command is removed for good. Let’s lift this limitation by allowing *deprecated* builtins to be shadowed by aliases. The only observed demand for aliasing has been for git-whatchanged(1), not for git-pack-redundant(1). But let’s be consistent and treat all deprecated commands the same. [1]: git log --raw --no-merges With a minor caveat: you get different outputs if you happen to have empty commits (no changes)[2] [2]: https://lore.kernel.org/git/20250825085428.GA367101@coredump.intra.peff.net/ [3]: https://lore.kernel.org/git/BL3P221MB0449288C8B0FA448A227FD48833AA@BL3P221MB0449.NAMP221.PROD.OUTLOOK.COM/ Based-on-patch-by: Jeff King Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/config/alias.adoc | 3 ++- git.c | 17 ++++++++++++++ t/t0014-alias.sh | 40 +++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/Documentation/config/alias.adoc b/Documentation/config/alias.adoc index 2c5db0ad8428e8..3c8fab3a95c599 100644 --- a/Documentation/config/alias.adoc +++ b/Documentation/config/alias.adoc @@ -3,7 +3,8 @@ alias.*:: after defining `alias.last = cat-file commit HEAD`, the invocation `git last` is equivalent to `git cat-file commit HEAD`. To avoid confusion and troubles with script usage, aliases that - hide existing Git commands are ignored. Arguments are split by + hide existing Git commands are ignored except for deprecated + commands. Arguments are split by spaces, the usual shell quoting and escaping are supported. A quote pair or a backslash can be used to quote them. + diff --git a/git.c b/git.c index ef1e7b205aa8e8..8c85da84c30534 100644 --- a/git.c +++ b/git.c @@ -824,12 +824,29 @@ static void execv_dashed_external(const char **argv) exit(128); } +static int is_deprecated_command(const char *cmd) +{ + struct cmd_struct *builtin = get_builtin(cmd); + return builtin && (builtin->option & DEPRECATED); +} + static int run_argv(struct strvec *args) { int done_alias = 0; struct string_list expanded_aliases = STRING_LIST_INIT_DUP; while (1) { + /* + * Allow deprecated commands to be overridden by aliases. This + * creates a seamless path forward for people who want to keep + * using the name after it is gone, but want to skip the + * deprecation complaint in the meantime. + */ + if (is_deprecated_command(args->v[0]) && + handle_alias(args, &expanded_aliases)) { + done_alias = 1; + continue; + } /* * If we tried alias and futzed with our environment, * it no longer is safe to invoke builtins directly in diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh index 854d59ec58c25a..1b196ed9d6d1c8 100755 --- a/t/t0014-alias.sh +++ b/t/t0014-alias.sh @@ -27,6 +27,20 @@ test_expect_success 'looping aliases - internal execution' ' test_grep "^fatal: alias loop detected: expansion of" output ' +test_expect_success 'looping aliases - deprecated builtins' ' + test_config alias.whatchanged pack-redundant && + test_config alias.pack-redundant whatchanged && + cat >expect <<-EOF && + ${SQ}whatchanged${SQ} is aliased to ${SQ}pack-redundant${SQ} + ${SQ}pack-redundant${SQ} is aliased to ${SQ}whatchanged${SQ} + fatal: alias loop detected: expansion of ${SQ}whatchanged${SQ} does not terminate: + whatchanged <== + pack-redundant ==> + EOF + test_must_fail git whatchanged -h 2>actual && + test_cmp expect actual +' + # This test is disabled until external loops are fixed, because would block # the test suite for a full minute. # @@ -55,4 +69,30 @@ test_expect_success 'tracing a shell alias with arguments shows trace of prepare test_cmp expect actual ' +can_alias_deprecated_builtin () { + cmd="$1" && + # some git(1) commands will fail for `-h` (the case for + # git-status as of 2025-09-07) + test_might_fail git status -h >expect && + test_file_not_empty expect && + test_might_fail git -c alias."$cmd"=status "$cmd" -h >actual && + test_cmp expect actual +} + +test_expect_success 'can alias-shadow deprecated builtins' ' + for cmd in $(git --list-cmds=deprecated) + do + can_alias_deprecated_builtin "$cmd" || return 1 + done +' + +test_expect_success 'can alias-shadow via two deprecated builtins' ' + # some git(1) commands will fail... (see above) + test_might_fail git status -h >expect && + test_file_not_empty expect && + test_might_fail git -c alias.whatchanged=pack-redundant \ + -c alias.pack-redundant=status whatchanged -h >actual && + test_cmp expect actual +' + test_done From 65d33db48e5a2c6dbf3f33d6eaa987f55dabe26a Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:15 +0200 Subject: [PATCH 028/283] t0014: test shadowing of aliases for a sample of builtins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit added tests for shadowing deprecated builtins. Let’s make the test suite more complete by exercising a sample of the builtins and in turn test the documentation for git-config(1): To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored except for deprecated commands. Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- t/t0014-alias.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh index 1b196ed9d6d1c8..07a53e7366ef4b 100755 --- a/t/t0014-alias.sh +++ b/t/t0014-alias.sh @@ -95,4 +95,21 @@ test_expect_success 'can alias-shadow via two deprecated builtins' ' test_cmp expect actual ' +cannot_alias_regular_builtin () { + cmd="$1" && + # some git(1) commands will fail... (see above) + test_might_fail git "$cmd" -h >expect && + test_file_not_empty expect && + test_might_fail git -c alias."$cmd"=status "$cmd" -h >actual && + test_cmp expect actual +} + +test_expect_success 'cannot alias-shadow a sample of regular builtins' ' + for cmd in grep check-ref-format interpret-trailers \ + checkout-index fast-import diagnose rev-list prune + do + cannot_alias_regular_builtin "$cmd" || return 1 + done +' + test_done From 098230f725e66fe9e346f4db995116d0aef4e0cf Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:16 +0200 Subject: [PATCH 029/283] you-still-use-that??: help the user help themselves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Give the user a list of suggestions for what to do when they run a deprecated command. The first order of action will be to check the breaking changes document;[1] this short error message says nothing about why this command is deprecated, and in any case going into any kind of detail might overwhelm the user. Then they can find out if this has been discussed on the mailing list. Then users who e.g. are using git-whatchanged(1) can learn that this is arguably a plug-in replacement: git log --raw --no-merges Finally they are invited to send an email to the mailing list. Also drop the “please add” part in favor of just using the “refusing” die-message; these two would have been right after each other in this new version. Also drop “Thanks” since it now would require a new paragraph. [1]: www.git-scm.com has a disclaimer for these internal documents that says that “This information is specific to the Git project”. That’s misleading in this particular case. But users are unlikely to get discouraged from reading about why they (or their programs) cannot run a command any more; it clearly concerns them. Helped-by: Eric Sunshine Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- usage.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/usage.c b/usage.c index 81913236a4a2ab..35dc57eb07ef8e 100644 --- a/usage.c +++ b/usage.c @@ -7,6 +7,7 @@ #include "git-compat-util.h" #include "gettext.h" #include "trace2.h" +#include "strbuf.h" static void vfreportf(FILE *f, const char *prefix, const char *err, va_list params) { @@ -377,12 +378,24 @@ void bug_fl(const char *file, int line, const char *fmt, ...) NORETURN void you_still_use_that(const char *command_name) { + struct strbuf percent_encoded = STRBUF_INIT; + strbuf_add_percentencode(&percent_encoded, + command_name, + STRBUF_ENCODE_SLASH); + fprintf(stderr, _("'%s' is nominated for removal.\n" - "If you still use this command, please add an extra\n" - "option, '--i-still-use-this', on the command line\n" - "and let us know you still use it by sending an e-mail\n" - "to . Thanks.\n"), - command_name); + "If you still use this command, here's what you can do:\n" + "\n" + "- read https://git-scm.com/docs/BreakingChanges.html\n" + "- check if anyone has discussed this on the mailing\n" + " list and if they came up with something that can\n" + " help you: https://lore.kernel.org/git/?q=%s\n" + "- send an email to to let us\n" + " know that you still use this command and were unable\n" + " to determine a suitable replacement\n" + "\n"), + command_name, percent_encoded.buf); + strbuf_release(&percent_encoded); die(_("refusing to run without --i-still-use-this")); } From 5a31252702da61ddabc68f3f8ac7a2cffc19a542 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:17 +0200 Subject: [PATCH 030/283] whatchanged: hint about git-log(1) and aliasing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There have been quite a few `--i-still-use-this` user reports since Git 2.51.0 was released.[1][2] And it doesn’t seem like they are reading the man page about the git-log(1) equivalent. Tell them what options to plug into git-log(1), either as a replacement command or as an alias.[3] That template produces almost the same output[4] and is arguably a plug-in replacement. Concretely, add an optional `hint` argument so that we can use it right after the initial error line. Also mention the same concrete options in the documentation while we’re at it. [1]: E.g., • https://lore.kernel.org/git/e1a69dea-bcb6-45fc-83d3-9e50d32c410b@5y5.one/ • https://lore.kernel.org/git/1011073f-9930-4360-a42f-71eb7421fe3f@chrispalmer.uk/#t • https://lore.kernel.org/git/9fcbfcc4-79f9-421f-b9a4-dc455f7db485@acm.org/#t • https://lore.kernel.org/git/83241BDE-1E0D-489A-9181-C608E9FCC17B@gmail.com/ [2]: The error message on 2.51.0 does tell them to report it, unconditionally [3]: We allow aliasing deprecated builtins now for people who are very used to the command name or just like it a lot [4]: You only get different outputs if you happen to have empty commits (no changes)[4] [5]: https://lore.kernel.org/git/20250825085428.GA367101@coredump.intra.peff.net/ Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-whatchanged.adoc | 6 +++++- builtin/log.c | 8 +++++++- builtin/pack-redundant.c | 2 +- git-compat-util.h | 2 +- usage.c | 14 ++++++++++---- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Documentation/git-whatchanged.adoc b/Documentation/git-whatchanged.adoc index d21484026fe805..e71d2aa2d27ea6 100644 --- a/Documentation/git-whatchanged.adoc +++ b/Documentation/git-whatchanged.adoc @@ -24,7 +24,11 @@ Shows commit logs and diff output each commit introduces. New users are encouraged to use linkgit:git-log[1] instead. The `whatchanged` command is essentially the same as linkgit:git-log[1] -but defaults to showing the raw format diff output and skipping merges. +but defaults to showing the raw format diff output and skipping merges: + +---- +git log --raw --no-merges +---- The command is primarily kept for historical reasons; fingers of many people who learned Git long before `git log` was invented by diff --git a/builtin/log.c b/builtin/log.c index c2f8bbf86301a9..1d1e6e9130a7ed 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -543,7 +543,13 @@ int cmd_whatchanged(int argc, cmd_log_init(argc, argv, prefix, &rev, &opt, &cfg); if (!cfg.i_still_use_this) - you_still_use_that("git whatchanged"); + you_still_use_that("git whatchanged", + _("\n" + "hint: You can replace 'git whatchanged ' with:\n" + "hint:\tgit log --raw --no-merges\n" + "hint: Or make an alias:\n" + "hint:\tgit config set --global alias.whatchanged 'log --raw --no-merges'\n" + "\n")); if (!rev.diffopt.output_format) rev.diffopt.output_format = DIFF_FORMAT_RAW; diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c index fe81c293e3af6f..5d5ae4afa28f50 100644 --- a/builtin/pack-redundant.c +++ b/builtin/pack-redundant.c @@ -626,7 +626,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix UNUSED, s } if (!i_still_use_this) - you_still_use_that("git pack-redundant"); + you_still_use_that("git pack-redundant", NULL); if (load_all_packs) load_all(); diff --git a/git-compat-util.h b/git-compat-util.h index 9408f463e31b51..398e0fac4fab60 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -460,7 +460,7 @@ void warning_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); void show_usage_if_asked(int ac, const char **av, const char *err); -NORETURN void you_still_use_that(const char *command_name); +NORETURN void you_still_use_that(const char *command_name, const char *hint); #ifndef NO_OPENSSL #ifdef APPLE_COMMON_CRYPTO diff --git a/usage.c b/usage.c index 35dc57eb07ef8e..7545a616453449 100644 --- a/usage.c +++ b/usage.c @@ -376,7 +376,8 @@ void bug_fl(const char *file, int line, const char *fmt, ...) va_end(ap); } -NORETURN void you_still_use_that(const char *command_name) + +NORETURN void you_still_use_that(const char *command_name, const char *hint) { struct strbuf percent_encoded = STRBUF_INIT; strbuf_add_percentencode(&percent_encoded, @@ -384,8 +385,13 @@ NORETURN void you_still_use_that(const char *command_name) STRBUF_ENCODE_SLASH); fprintf(stderr, - _("'%s' is nominated for removal.\n" - "If you still use this command, here's what you can do:\n" + _("'%s' is nominated for removal.\n"), command_name); + + if (hint) + fputs(hint, stderr); + + fprintf(stderr, + _("If you still use this command, here's what you can do:\n" "\n" "- read https://git-scm.com/docs/BreakingChanges.html\n" "- check if anyone has discussed this on the mailing\n" @@ -395,7 +401,7 @@ NORETURN void you_still_use_that(const char *command_name) " know that you still use this command and were unable\n" " to determine a suitable replacement\n" "\n"), - command_name, percent_encoded.buf); + percent_encoded.buf); strbuf_release(&percent_encoded); die(_("refusing to run without --i-still-use-this")); } From a9235f6fa7bcdff08238c33ce5f87135119ab03b Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:18 +0200 Subject: [PATCH 031/283] whatchanged: remove not-even-shorter clause MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The closest equivalent is `git log --raw --no-merges`. Also change to “defaults” (implicit plural). Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/git-whatchanged.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-whatchanged.adoc b/Documentation/git-whatchanged.adoc index e71d2aa2d27ea6..436e219b7d0692 100644 --- a/Documentation/git-whatchanged.adoc +++ b/Documentation/git-whatchanged.adoc @@ -15,7 +15,7 @@ WARNING ------- `git whatchanged` has been deprecated and is scheduled for removal in a future version of Git, as it is merely `git log` with different -default; `whatchanged` is not even shorter to type than `log --raw`. +defaults. DESCRIPTION ----------- From 54a60e5b38578dea9303c282589b3dac8a83ff75 Mon Sep 17 00:00:00 2001 From: Kristoffer Haugsbakk Date: Wed, 17 Sep 2025 22:24:19 +0200 Subject: [PATCH 032/283] BreakingChanges: remove claim about whatchanged reports This was written in e836757e14b (whatschanged: list it in BreakingChanges document, 2025-05-12) which was on the same topic that added the `--i-still-use-this` requirement.[1] Maybe it was a work-in-progress comment/status. [1]: jc/you-still-use-whatchanged Signed-off-by: Kristoffer Haugsbakk Signed-off-by: Junio C Hamano --- Documentation/BreakingChanges.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc index f8d2eba061c82a..c4985163c3cd5d 100644 --- a/Documentation/BreakingChanges.adoc +++ b/Documentation/BreakingChanges.adoc @@ -235,7 +235,7 @@ These features will be removed. equivalent `git log --raw`. We have nominated the command for removal, have changed the command to refuse to work unless the `--i-still-use-this` option is given, and asked the users to report - when they do so. So far there hasn't been a single complaint. + when they do so. + The command will be removed. From 5a12fd2a8c850df311aa149c9bad87b7cb002abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Date: Sat, 27 Sep 2025 21:39:45 +0200 Subject: [PATCH 033/283] doc: change the markup of paragraphs following a nested list item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Asciidoctor and asciidoc.py have different behaviors when a paragraph follows a nested list item. Asciidoctor has a bug[1] that makes it keep a plus sign (+) used to attached paragraphs at the beginning of the paragraph. This commit uses workarounds to avoid this problem by using second level definition lists and open blocks. [1]:https://github.com/asciidoctor/asciidoctor/issues/4704 Signed-off-by: Jean-Noël Avila Signed-off-by: Junio C Hamano --- Documentation/config/extensions.adoc | 23 +++++++++++------------ Documentation/pretty-formats.adoc | 6 ++++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Documentation/config/extensions.adoc b/Documentation/config/extensions.adoc index 9e2f321a6d776f..49a7598ca5cd13 100644 --- a/Documentation/config/extensions.adoc +++ b/Documentation/config/extensions.adoc @@ -3,8 +3,7 @@ extensions.*:: `core.repositoryFormatVersion` is not `1`. See linkgit:gitrepository-layout[5]. + --- -compatObjectFormat:: +compatObjectFormat::: Specify a compatibility hash algorithm to use. The acceptable values are `sha1` and `sha256`. The value specified must be different from the value of `extensions.objectFormat`. This allows client level @@ -15,18 +14,18 @@ compatObjectFormat:: compatObjectFormat in addition to oids encoded with objectFormat to locally specify objects. -noop:: +noop::: This extension does not change git's behavior at all. It is useful only for testing format-1 compatibility. + For historical reasons, this extension is respected regardless of the `core.repositoryFormatVersion` setting. -noop-v1:: +noop-v1::: This extension does not change git's behavior at all. It is useful only for testing format-1 compatibility. -objectFormat:: +objectFormat::: Specify the hash algorithm to use. The acceptable values are `sha1` and `sha256`. If not specified, `sha1` is assumed. + @@ -34,7 +33,7 @@ Note that this setting should only be set by linkgit:git-init[1] or linkgit:git-clone[1]. Trying to change it after initialization will not work and will produce hard-to-diagnose issues. -partialClone:: +partialClone::: When enabled, indicates that the repo was created with a partial clone (or later performed a partial fetch) and that the remote may have omitted sending certain unwanted objects. Such a remote is called a @@ -46,14 +45,14 @@ The value of this key is the name of the promisor remote. For historical reasons, this extension is respected regardless of the `core.repositoryFormatVersion` setting. -preciousObjects:: +preciousObjects::: If enabled, indicates that objects in the repository MUST NOT be deleted (e.g., by `git-prune` or `git repack -d`). + For historical reasons, this extension is respected regardless of the `core.repositoryFormatVersion` setting. -refStorage:: +refStorage::: Specify the ref storage format to use. The acceptable values are: + include::../ref-storage-format.adoc[] @@ -63,13 +62,13 @@ Note that this setting should only be set by linkgit:git-init[1] or linkgit:git-clone[1]. Trying to change it after initialization will not work and will produce hard-to-diagnose issues. -relativeWorktrees:: +relativeWorktrees::: If enabled, indicates at least one worktree has been linked with relative paths. Automatically set if a worktree has been created or repaired with either the `--relative-paths` option or with the `worktree.useRelativePaths` config set to `true`. -worktreeConfig:: +worktreeConfig::: If enabled, then worktrees will load config settings from the `$GIT_DIR/config.worktree` file in addition to the `$GIT_COMMON_DIR/config` file. Note that `$GIT_COMMON_DIR` and @@ -83,11 +82,12 @@ When enabling this extension, you must be careful to move certain values from the common config file to the main working tree's `config.worktree` file, if present: + +-- * `core.worktree` must be moved from `$GIT_COMMON_DIR/config` to `$GIT_COMMON_DIR/config.worktree`. * If `core.bare` is true, then it must be moved from `$GIT_COMMON_DIR/config` to `$GIT_COMMON_DIR/config.worktree`. - +-- + It may also be beneficial to adjust the locations of `core.sparseCheckout` and `core.sparseCheckoutCone` depending on your desire for customizable @@ -100,4 +100,3 @@ details. + For historical reasons, this extension is respected regardless of the `core.repositoryFormatVersion` setting. --- diff --git a/Documentation/pretty-formats.adoc b/Documentation/pretty-formats.adoc index 9ed0417fc811e5..3d7a8885b696f6 100644 --- a/Documentation/pretty-formats.adoc +++ b/Documentation/pretty-formats.adoc @@ -232,7 +232,7 @@ ref names with custom decorations. The `decorate` string may be followed by a colon and zero or more comma-separated options. Option values may contain literal formatting codes. These must be used for commas (`%x2C`) and closing parentheses (`%x29`), due to their role in the option syntax. -+ + ** `prefix=`: Shown before the list of ref names. Defaults to "{nbsp}+(+". ** `suffix=`: Shown after the list of ref names. Defaults to "+)+". ** `separator=`: Shown between ref names. Defaults to "+,+{nbsp}". @@ -241,10 +241,12 @@ parentheses (`%x29`), due to their role in the option syntax. ** `tag=`: Shown before tag names. Defaults to "`tag:`{nbsp}". + +-- For example, to produce decorations with no wrapping or tag annotations, and spaces as separators: -+ + ++%(decorate:prefix=,suffix=,tag=,separator= )++ +-- ++%(describe++`[: