aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
AgeCommit message (Collapse)AuthorFilesLines
2025-09-18Merge branch 'kh/doc-fast-import-markup-fix'Junio C Hamano1-4/+4
Doc mark-up fix. * kh/doc-fast-import-markup-fix: doc: fast-import: replace literal block with paragraph
2025-09-17BreakingChanges: remove claim about whatchanged reportsKristoffer Haugsbakk1-1/+1
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 <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-17whatchanged: remove not-even-shorter clauseKristoffer Haugsbakk1-1/+1
The closest equivalent is `git log --raw --no-merges`. Also change to “defaults” (implicit plural). Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-17whatchanged: hint about git-log(1) and aliasingKristoffer Haugsbakk1-1/+5
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 <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-17git: allow alias-shadowing deprecated builtinsKristoffer Haugsbakk1-1/+2
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 <peff@peff.net> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-17git: add `deprecated` category to --list-cmdsKristoffer Haugsbakk1-1/+2
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 <ps@pks.im> Helped-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-17fast-import: add '--signed-commits=<mode>' optionChristian Couder1-0/+5
A '--signed-commits=<mode>' option is already available when using `git fast-export` to decide what should be done at export time about commit signatures. At import time though, there is no option, or other way, in `git fast-import` to decide about commit signatures. To remediate that, let's add a '--signed-commits=<mode>' option to `git fast-import` too. For now the supported <mode>s are the same as those supported by `git fast-export`. The code responsible for consuming a signature is refactored into the import_one_signature() and discard_one_signature() functions, which makes it easier to follow the logic and add new modes in the future. In the 'strip' and 'warn-strip' modes, we deliberately use discard_one_signature() to discard the signature without parsing it. This ensures that even malformed signatures, which would cause the parser to fail, can be successfully stripped from a commit. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-15sparse-checkout: add --verbose option to 'clean'Derrick Stolee1-0/+5
The 'git sparse-checkout clean' subcommand is focused on directories, deleting any tracked sparse directories to clean up the worktree and make the sparse index feature work optimally. However, this directory-focused approach can leave users wondering why those directories exist at all. In my experience, these files are left over due to ignore or exclude patterns, Windows file handles, or possibly merge conflict resolutions. Add a new '--verbose' option for users to see all the files that are being deleted (with '--force') or would be deleted (with '--dry-run'). Based on usage, users may request further context on this list of files for states such as tracked/untracked, unstaged/staged/conflicted, etc. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-15The ninth batchJunio C Hamano1-0/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-15Merge branch 'mm/worktree-doc-typofix'Junio C Hamano1-1/+1
Docfix. * mm/worktree-doc-typofix: docs: fix typo in worktree.adoc 'extension'
2025-09-15Merge branch 'lo/repo-info-step-2'Junio C Hamano1-2/+7
"repo info" learns a short-hand option "-z" that is the same as "--format=nul", and learns to report the objects format used in the repository. * lo/repo-info-step-2: repo: add the field objects.format repo: add the flag -z as an alias for --format=nul
2025-09-12The eighth batchJunio C Hamano1-0/+18
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-12Merge branch 'kh/doc-markup-fixes'Junio C Hamano3-3/+3
Doc markup fixes. * kh/doc-markup-fixes: doc: remove extra backtick for inline-verbatim doc: add missing backtick for inline-verbatim
2025-09-12Merge branch 'km/alias-doc-markup-fix'Junio C Hamano1-1/+1
Docfix. * km/alias-doc-markup-fix: doc: fix formatting of function-wrap shell alias
2025-09-12Merge branch 'ms/refs-exists'Junio C Hamano1-0/+7
"git refs exists" that works like "git show-ref --exists" has been added. * ms/refs-exists: t: add test for git refs exists subcommand t1422: refactor tests to be shareable t1403: split 'show-ref --exists' tests into a separate file builtin/refs: add 'exists' subcommand
2025-09-12Merge branch 'je/doc-add'Junio C Hamano1-18/+16
Documentation for "git add" has been updated. * je/doc-add: doc: rephrase the purpose of the staging area doc: git-add: simplify discussion of ignored files doc: git-add: clarify intro & add an example
2025-09-12sparse-checkout: match some 'clean' behaviorDerrick Stolee1-0/+9
The 'git sparse-checkout clean' subcommand is somewhat similar to 'git clean' in that it will delete files that should not be in the worktree. The big difference is that it focuses on the directories that should not be in the worktree due to cone-mode sparse-checkout. It also does not discriminate in the kinds of files and focuses on deleting entire directories. However, there are some restrictions that would be good to bring over from 'git clean', specifically how it refuses to do anything without the '-f'/'--force' or '-n'/'--dry-run' arguments. The 'clean.requireForce' config can be set to 'false' to imply '--force'. Add this behavior to avoid accidental deletion of files that cannot be recovered from Git. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-12sparse-checkout: add basics of 'clean' commandDerrick Stolee1-1/+18
When users change their sparse-checkout definitions to add new directories and remove old ones, there may be a few reasons why directories no longer in scope remain (ignored or excluded files still exist, Windows handles are still open, etc.). When these files still exist, the sparse index feature notices that a tracked, but sparse, directory still exists on disk and thus the index expands. This causes a performance hit _and_ the advice printed isn't very helpful. Using 'git clean' isn't enough (generally '-dfx' may be needed) but also this may not be sufficient. Add a new subcommand to 'git sparse-checkout' that removes these tracked-but-sparse directories. The implementation details provide a clear definition of what is happening, but it is difficult to describe this without including the internal implementation details. The core operation converts the index to a sparse index (in memory if not already on disk) and then deletes any directories in the worktree that correspond with a sparse directory entry in that sparse index. In the most common case, this means that a file will be removed if it is contained within a directory that is both tracked and outside of the sparse-checkout definition. However, there can be exceptions depending on the current state of the index: * If the worktree has a modification to a tracked, sparse file, then that file's parent directories will be expanded instead of represented as sparse directories. Siblings of those parent directories may be considered sparse. * If the user staged a sparse file with "git add --sparse", then that file loses the SKIP_WORKTREE bit until the sparse-checkout is reapplied. Until then, that file's parent directories are not represented as sparse directory entries and thus will not be removed. Siblings of those parent directories may be considered sparse. (There may be other reasons why the SKIP_WORKTREE bit was removed for a file and this impact on the sparse directories will apply to those as well.) * If the user has a merge conflict outside of the sparse-checkout definition, then those conflict entries prevent the parent directories from being represented as sparse directory entries and thus are not removed. * The cases above present reasons why certain _file conditions_ will impact which _directories_ are considered sparse. The list of tracked directories that are outside of the sparse-checkout definition but not represented as a sparse directory further reduces the list of files that will be removed. For these complicated reasons, the documentation details a potential list of files that will be "considered for removal" instead of defining the list concretely. The special cases can be handled by resolving conflicts, committing staged changes, and running 'git sparse-checkout reapply' to update the SKIP_WORKTREE bits as expected by the sparse-checkout definition. It is important to make clear that this operation will remove ignored and excluded files which would normally be ignored even by 'git clean -f' unless the '-x' or '-X' option is provided. This is the most extreme method for doing this, but it works when the sparse-checkout is in cone mode and is expected to rescope based on directories, not files. The current implementation always deletes these sparse directories without warning. This is unacceptable for a released version, but those features will be added in changes coming immediately after this one. Note that this will not remove an untracked directory (or any of its contents) if its parent is a tracked directory within the sparse-checkout definition. This is required to prevent removing data created by tools that perform caching operations for editors or build tools. Thus, 'git sparse-checkout clean' is both more aggressive and more careful than 'git clean -fx': * It is more aggressive because it will remove _tracked_ files within the sparse directories. * It is less aggressive because it will leave _untracked_ files that are not contained in sparse directories. These special cases will be handled more explicitly in a future change that expands tests for the 'git sparse-checkout clean' command. We handle some of the modified, staged, and committed states including some impact on 'git status' after cleaning. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-11meson: introduce a "docs" alias to compile documentation onlyPatrick Steinhardt3-8/+8
Meson does not currently provide a target to compile documentation, only. Instead, users needs to compile the whole project, which may be way more than they really intend to do. Introduce a new "docs" alias to plug this gap. This alias can be invoked e.g. with `meson compile docs`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10doc: fast-import: replace literal block with paragraphKristoffer Haugsbakk1-4/+4
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 <code@khaugsbakk.name> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10doc: git-checkout: clarify restoring files sectionJulia Evans1-11/+18
From user feedback on this section: 3 users don't know what "tree-ish" means and 3 users don't know what "pathspec" means. One user also says that the section is very confusing and that they don't understand what the "index" is. From conversations on Mastodon, several users said that their impression is that "the index" means the same thing as "HEAD". It would be good to give those users (and other users who do not know what "index" means) a hint as to its meaning. Make this section more accessible to users who don't know what the terms "pathspec", "tree-ish", and "index" mean by using more familiar language, adding examples, and using simpler sentence structures. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10doc: git-checkout: split up restoring files sectionJulia Evans1-10/+13
From user feedback: one user mentioned that "When the <tree-ish> (most often a commit) is not given" is confusing since it starts with a negative. Restructuring so that `git checkout main file.txt` and `git checkout file.txt` are separate items will help us simplify the sentence structure a lot. As a bonus, it appears that `-f` actually only applies to one of those forms, so we can include fewer options, and now the structure of the DESCRIPTION matches the SYNOPSIS. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10doc: git-checkout: deduplicate --detach explanationJulia Evans1-10/+3
From user feedback: several users say they don't understand the use case for `--detach`. It's probably not realistic to explain the use case for detached HEAD state here, but we can improve the situation. Explain how `git checkout --detach` is different from `git checkout <branch>` instead of copying over the description from `git checkout <branch>`, since `git checkout <branch>` will be a familiar command to many readers. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10doc: git-checkout: clarify `-b` and `-B`Julia Evans1-26/+18
From user feedback: several users reported having trouble understanding the difference between `-b` and `-B` ("I think it's because my brain expects it to contrast with `-b`, but instead it starts off explaining how they're the same"). Also, in `-B`, 2 users can't tell what the branch is reset *to*. Simplify the sentence structure in the explanations of `-b` and `-B` and add a little extra information (what `<start-point>` is, what the branch is reset to). Splitting up `-b` and `-B` into separate items helps simplify the sentence structure since there's less "In this case...". Replace the long "the branch is not reset/created unless "git checkout" is successful..." with just "will fail", since we should generally assume that Git will fail operations in a clean way and not leave operations half-finished, and that cases where it does not fail cleanly are the exceptions that the documentation should flag. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10doc: git-checkout: clarify `git checkout <branch>`Julia Evans1-9/+7
From user feedback: several users commented that "Local modifications to the files in the working tree are kept, so that they can be committed to the <branch>." didn't seem accurate to them, since `git checkout <branch>` will often fail. One user also thought that "... and by pointing HEAD at the branch" was something that _they_ had to do somehow ("How do I point HEAD at a branch?") rather than a description of what the `git checkout` operation is doing for them. Explain when `git checkout <branch>` will fail and clarify that "pointing HEAD at the branch" is part of what the command does. 6 users commented that the "You could omit <branch>..." section is extremely confusing. Explain this in a much more direct way. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10doc: git-checkout: clarify ARGUMENT DISAMBIGUATIONJulia Evans1-8/+14
There's no need to use the terms "pathspec" or "tree-ish" in the ARGUMENT DISAMBIGUATION section, which are terms that (from user feedback on this page) many users do not understand. "tree-ish" is actually not accurate here: `git checkout` in this case takes a commit-ish, not a tree-ish. So we can say "branch or commit" instead of "tree-ish" which is both more accurate and uses more familiar terms. And now that the intro to the man pages mentions that `git checkout` has "two main modes", it makes sense to refer to this disambiguation section to understand how Git decides which one to use when there's an overlap in syntax. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10doc: git-checkout: clarify intro sentenceJulia Evans1-4/+6
From user feedback: in the first paragraph, 5 users reported not understanding the terms "pathspec" and 1 user reported not understanding the term "HEAD". Of the users who said they didn't know what "pathspec" means, 3 said they couldn't understand what the paragraph was trying to communicate as a result. One user also commented that "If no pathspec was given..." makes `git checkout <branch>` sounds like a special edge case, instead of being one of the most common ways to use this core Git command. It looks like the goal of this paragraph is to communicate that `git checkout` has two different modes: one where you switch branches and one where you just update your working directory files/index. So say that directly, and use more familiar language (including examples) to say it. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-10breaking-changes: switch default branch to mainPhillip Wood2-3/+15
Since 1296cbe4b46 (init: document `init.defaultBranch` better, 2020-12-11) "git-init.adoc" has advertised that the default name of the initial branch may change in the future. The name "main" is chosen to match the default used by the big Git forge web sites. The advice printed when init.defaultBranch is not set is updated to say that the default will change to "main" in Git 3.0. Building with WITH_BREAKING_CHANGES enabled removes the advice and changes the default branch name to "main". The code in guess_remote_head() that looks for "refs/heads/master" is left unchanged as that is only called when the remote server does not support the symref capability in the v0 protocol or the symref extension to the ls-refs list in the v2 protocol. Such an old server is more likely to be using "master" as the default branch name. With the exception of the "git-init.adoc" the documentation is left unchanged. I had hoped to parameterize the name of the default branch by using an asciidoc attribute. Unfortunately attribute expansion is inhibited by backticks and we use backticks to mark up ref names so that idea does not work. As the changes to git-init.adoc show inserting ifdef's around each instance of the branch name "master" is cumbersome and makes the documentation sources harder to read. Apart from "git-init.adoc" there are some other files where "master" is used as the name of the initial branch rather than as an example of a branch name such as "user-manual.adoc" and "gitcore-tutorial.adoc". The name appears a lot in those so updating it with ifdef's is not really practical. We can update that document in the 3.0 release cycle. The other documentation where master is used as an example branch name can be gradually converted over time. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-08The seventh batchJunio C Hamano1-0/+21
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-08Merge branch 'tc/last-modified'Junio C Hamano2-0/+55
A new command "git last-modified" has been added to show the closest ancestor commit that touched each path. * tc/last-modified: last-modified: use Bloom filters when available t/perf: add last-modified perf script last-modified: new subcommand to show when files were last modified
2025-09-08promisor-remote: allow a client to check fieldsChristian Couder1-0/+39
A previous commit allowed a server to pass additional fields through the "promisor-remote" protocol capability after the "name" and "url" fields, specifically the "partialCloneFilter" and "token" fields. Let's make it possible for a client to check if these fields match what it expects before accepting a promisor remote. We allow this by introducing a new "promisor.checkFields" configuration variable. It should contain a comma or space separated list of fields that will be checked. By limiting the protocol to specific well-defined fields, we ensure both server and client have a shared understanding of field semantics and usage. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-08promisor-remote: allow a server to advertise more fieldsChristian Couder2-16/+70
For now the "promisor-remote" protocol capability can only pass "name" and "url" information from a server to a client in the form "name=<remote_name>,url=<remote_url>". To allow clients to make more informed decisions about which promisor remotes they accept, let's make it possible to pass more information by introducing a new "promisor.sendFields" configuration variable. On the server side, information about a remote `foo` is stored in configuration variables named `remote.foo.<variable-name>`. To make it clearer and simpler, we use `field` and `field name` like this: * `field name` refers to the <variable-name> part of such a configuration variable, and * `field` refers to both the `field name` and the value of such a configuration variable. The "promisor.sendFields" configuration variable should contain a comma or space separated list of field names that will be looked up in the configuration of the remote on the server to find the values that will be passed to the client. Only a set of predefined field names are allowed. The only field names in this set are "partialCloneFilter" and "token". The "partialCloneFilter" field name specifies the filter definition used by the promisor remote, and the "token" field name can provide an authentication credential for accessing it. For example, if "promisor.sendFields" is set to "partialCloneFilter", and the server has the "remote.foo.partialCloneFilter" config variable set to a value, then that value will be passed in the "partialCloneFilter" field in the form "partialCloneFilter=<value>" after the "name" and "url" fields. A following commit will allow the client to use the information to decide if it accepts the remote or not. For now the client doesn't do anything with the additional information it receives. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-04repo: add the field objects.formatLucas Seiki Oshiro1-0/+3
The flag `--show-object-format` from git-rev-parse is used for retrieving the object storage format. This way, it is used for querying repository metadata, fitting in the purpose of git-repo-info. Add a new field `objects.format` to the git-repo-info subcommand containing that information. Mentored-by: Karthik Nayak <karthik.188@gmail.com> Mentored-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-04repo: add the flag -z as an alias for --format=nulLucas Seiki Oshiro1-2/+4
Other Git commands that have nul-terminated output (e.g. git-config, git-status, git-ls-files) have a flag `-z` for using the null character as the record separator. Add the `-z` flag to git-repo-info as an alias for `--format=nul`, making it consistent with the behavior of the other commands. Mentored-by: Karthik Nayak <karthik.188@gmail.com> Mentored-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-03docs: fix typo in worktree.adoc 'extension'Mikhail Malinouski1-1/+1
The documentation incorrectly referred to the extension without an 's'. This fixes the typo for clarity. Signed-off-by: Mikhail Malinouski <m.l.malinouski@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-02doc: remove extra backtick for inline-verbatimKristoffer Haugsbakk1-1/+1
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-02doc: add missing backtick for inline-verbatimKristoffer Haugsbakk2-2/+2
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-02builtin/refs: add 'exists' subcommandMeet Soni1-0/+7
As part of the ongoing effort to consolidate reference handling, introduce a new `exists` subcommand. This command provides the same functionality and exit-code behavior as `git show-ref --exists`, serving as its modern replacement. The logic for `show-ref --exists` is minimal. Rather than creating a shared helper function which would be overkill for ~20 lines of code, its implementation is intentionally duplicated here. This contrasts with `git refs list`, where sharing the larger implementation of `for-each-ref` was necessary. Documentation for the new subcommand is also added to the `git-refs(1)` man page. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: shejialuo <shejialuo@gmail.com> Signed-off-by: Meet Soni <meetsoni3017@gmail.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-02doc: fix formatting of function-wrap shell aliasKyle E. Mitchell1-1/+1
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 <kyle@kemitchell.com> Acked-by: Jean-Noël AVILA <avila.jn@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-02The sixth batchJunio C Hamano1-0/+9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-02Merge branch 'ds/doc-ggg-pr-fork-clarify'Junio C Hamano1-4/+7
Update the instruction to use of GGG in the MyFirstContribution document to say that a GitHub PR could be made against `git/git` instead of `gitgitgadget/git`. * ds/doc-ggg-pr-fork-clarify: doc: clarify which remotes can be used with GitGitGadget
2025-09-02Merge branch 'js/doc-sending-patch-via-thunderbird'Junio C Hamano1-3/+9
Doc update. * js/doc-sending-patch-via-thunderbird: doc/format-patch: adjust Thunderbird MUA hint to new add-on
2025-09-02Merge branch 'kh/doc-config-typofix'Junio C Hamano1-1/+1
Documentation typofix. * kh/doc-config-typofix: doc: config: replace backtick with apostrophe for possessive
2025-09-02Merge branch 'kh/doc-interpret-trailers-markup-fix'Junio C Hamano1-4/+4
Fix missing single-quote pairs in a documentation page. * kh/doc-interpret-trailers-markup-fix: doc: interpret-trailers: close all pairs of single quotes
2025-09-02Merge branch 'ja/asciidoc-doctor-verbatim-fixes'Junio C Hamano1-2/+2
Doc mark-up fix. * ja/asciidoc-doctor-verbatim-fixes: doc: fix asciidoc format compatibility in pretty-formats.adoc
2025-08-29doc: rephrase the purpose of the staging areaJulia Evans1-2/+2
Git does not really "store the contents of the next commit" anywhere; rather, you the user use the index to prepare it. Signed-off-by: Julia Evans <julia@jvns.ca> [jc; made the change relative to what is already in 'next'] Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-29The fifth batchJunio C Hamano1-0/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-29Merge branch 'js/doc-gitk-history'Junio C Hamano1-4/+4
Manual page for "gitk" is updated with the current maintainer's name. * js/doc-gitk-history: doc/gitk: update reference to the external project
2025-08-29Merge branch 'ds/doc-community-discord'Junio C Hamano1-0/+9
Discord has been added to the first contribution documentation as another way to ask for help. * ds/doc-community-discord: doc: add discord to ways of getting help
2025-08-28last-modified: new subcommand to show when files were last modifiedToon Claes2-0/+55
Similar to git-blame(1), introduce a new subcommand git-last-modified(1). This command shows the most recent modification to paths in a tree. It does so by expanding the tree at a given commit, taking note of the current state of each path, and then walking backwards through history looking for commits where each path changed into its final commit ID. Based-on-patch-by: Jeff King <peff@peff.net> Improved-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-28The fourth batchJunio C Hamano1-0/+24
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-28Merge branch 'bc/doc-compat-object-format-not-working'Junio C Hamano1-0/+4
The compatObjectFormat extension is used to hide an incomplete feature that is not yet usable for any purpose other than developing the feature further. Document it as such to discourage its use by mere mortals. * bc/doc-compat-object-format-not-working: docs: note that extensions.compatobjectformat is incomplete
2025-08-28Merge branch 'js/progress-delay-fix'Junio C Hamano1-1/+1
The start_delayed_progress() function in the progress eye-candy API did not clear its internal state, making an initial delay value larger than 1 second ineffective, which has been corrected. * js/progress-delay-fix: progress: pay attention to (customized) delay time
2025-08-28Merge branch 'je/doc-rebase'Junio C Hamano1-91/+58
Documentation for "git rebase" has been updated. * je/doc-rebase: doc: git-rebase: update discussion of internals doc: git-rebase: move --onto explanation down doc: git rebase: clarify arguments syntax doc: git rebase: dedup merge conflict discussion doc: git-rebase: start with an example
2025-08-26Documentation: note styling for bit fieldsKarthik Nayak1-0/+6
Our codebase uses a lot of bit field variables, generally to mark boolean type variables. While there is a formatting rule in the '.clang-format', there is no guideline specified in the 'CodingGuidelines'. Since the '.clang-format' is not yet enforced, let's also add a guideline with the same rule as mentioned in the '.clang-format', which is to not use any spaces around the colon, like so: unsigned my_field:1; unsigned other_field:1; unsigned field_with_longer_name:1; This would allow us not to modify the clang-format file, and more importantly, discourage people from doing ugly alignment with spaces, i.e. unsigned my_field : 1; unsigned other_field : 1; unsigned field_with_longer_name : 1; Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-26docs: update sendmail docs to use more secure SMTP server for GmailAditya Garg1-4/+4
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 <gargaditya08@live.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-26breaking-changes: deprecate support for core.commentString=autoPhillip Wood2-2/+23
When "core.commentString" is set to "auto" then "git commit" will automatically select the comment character ensuring that it is not the first character on any of the lines in the commit message. This was introduced by commit 84c9dc2c5a2 (commit: allow core.commentChar=auto for character auto selection, 2014-05-17). The motivation seems to be to avoid commenting out lines from the existing message when amending a commit that was created with a message from a file. Unfortunately this feature does not work with: * commit message templates that contain comments. * prepare-commit-msg hooks that introduce comments. * "git commit --cleanup=strip --edit -F <file>" which means that it is incompatible with - the "fixup" and "squash" commands of "git rebase -i" as the comments added by those commands are then treated as part of the commit message. - the conflict comments added to the commit message by "git cherry-pick", "git rebase" etc. as these comments are then treated as part of the commit message. It is also ignored by "git notes" when amending a note. The issues with comments coming from a template, hook or file are a consequence of the design of this feature and are therefore hard to fix. As the costs of this feature outweigh the benefits, deprecate it and remove it in Git 3.0. If someone comes up with some patches that fix all the issues in a maintainable way then I'd be happy to see this change reverted. The next commits will add a warning and some advice for users on how they can update their config settings. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-26docs: note that extensions.compatobjectformat is incompletebrian m. carlson1-0/+4
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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-25progress: pay attention to (customized) delay timeJohannes Sixt1-1/+1
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 <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-25The third batchJunio C Hamano1-0/+15
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-25Merge branch 'lo/repo-info'Junio C Hamano2-0/+85
A new subcommand "git repo" gives users a way to grab various repository characteristics. * lo/repo-info: repo: add the --format flag repo: add the field layout.shallow repo: add the field layout.bare repo: add the field references.format repo: declare the repo command
2025-08-25Merge branch 'ds/doc-count-objects-fix'Junio C Hamano1-0/+2
Docfix. * ds/doc-count-objects-fix: count-objects: document count-objects pack
2025-08-25Merge branch 'ja/doc-lint-sections-and-synopsis'Junio C Hamano57-233/+446
Doc lint updates to encourage the newer and easier-to-use `synopsis` format, with fixes to a handful of existing uses. * ja/doc-lint-sections-and-synopsis: doc lint: check that synopsis manpages have synopsis inlines doc:git-for-each-ref: fix styling and typos doc: check for absence of the form --[no-]parameter doc: check for absence of multiple terms in each entry of desc list doc: check well-formedness of delimited sections doc: test linkgit macros for well-formedness
2025-08-25Merge branch 'tc/diff-tree-max-depth'Junio C Hamano1-0/+28
"git diff-tree" learned "--max-depth" option. * tc/diff-tree-max-depth: diff: teach tree-diff a max-depth parameter within_depth: fix return for empty path combine-diff: zero memory used for callback filepairs
2025-08-25doc: config: replace backtick with apostrophe for possessiveKristoffer Haugsbakk1-1/+1
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 <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-25doc/format-patch: adjust Thunderbird MUA hint to new add-onJohannes Sixt1-3/+9
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 <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-25doc: clarify which remotes can be used with GitGitGadgetDaniele Sassoli1-4/+7
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 <danielesassoli@gmail.com> Acked-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-23doc: git-rebase: update discussion of internalsJulia Evans1-43/+18
- make it clearer that we're talking about a multistep process - give a more technically accurate description how rebase works with the merge backend. - condense the explanation of how git rebase skips commits with the same textual changes into a single bullet point and remove the explanatory diagram. Lots of things which are more complicated are already being explained without a diagram. - remove the explanation of how exactly `--fork-point` and `--root` work since that information is in the OPTIONS section - put all discussion of `ORIG_HEAD` inside the note Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-23doc: git-rebase: move --onto explanation downJulia Evans1-0/+5
There's a very clear explanation with examples of using --onto which is currently buried in the very long DESCRIPTION section. This moves it to its own section, so that we can reference the explanation from the `--onto` option by name. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-23doc: git rebase: clarify arguments syntaxJulia Evans1-5/+1
Remove duplicate explanation of `git rebase <upstream> <branch>` which is already explained above. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-23doc: git rebase: dedup merge conflict discussionJulia Evans1-29/+20
Previously there were two explanations, this combines them both into a single explanation. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-23doc: git-rebase: start with an exampleJulia Evans1-26/+26
- Start with an example that mirrors the example in the `git-merge` man page, to make it easier for folks to understand the difference between a rebase and a merge. - Mention that rebase can combine or reorder commits Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-22The second batchJunio C Hamano1-0/+23
2025-08-22Merge branch 'kr/clone-synopsis-fix'Junio C Hamano1-1/+1
Doc fix. * kr/clone-synopsis-fix: docs: remove stray bracket from git-clone synopsis
2025-08-22Merge branch 'ms/refs-list'Junio C Hamano3-88/+105
The "list" subcommand of "git refs" acts as a front-end for "git for-each-ref". * ms/refs-list: t: add test for git refs list subcommand t6300: refactor tests to be shareable builtin/refs: add list subcommand builtin/for-each-ref: factor out core logic into a helper builtin/for-each-ref: align usage string with the man page doc: factor out common option
2025-08-22doc: interpret-trailers: close all pairs of single quotesKristoffer Haugsbakk1-4/+4
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-21Start 2.52 cycle, the first batchJunio C Hamano1-0/+58
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-21Merge branch 'kh/doc-git-log-markup-fix'Junio C Hamano1-2/+2
Doc update. * kh/doc-git-log-markup-fix: doc: git-log: fix description list
2025-08-21Merge branch 'ps/reflog-migrate-fixes'Junio C Hamano1-44/+52
"git refs migrate" to migrate the reflog entries from a refs backend to another had a handful of bugs squashed. * ps/reflog-migrate-fixes: refs: fix invalid old object IDs when migrating reflogs refs: stop unsetting REF_HAVE_OLD for log-only updates refs/files: detect race when generating reflog entry for HEAD refs: fix identity for migrated reflogs ident: fix type of string length parameter builtin/reflog: implement subcommand to write new entries refs: export `ref_transaction_update_reflog()` builtin/reflog: improve grouping of subcommands Documentation/git-reflog: convert to use synopsis type
2025-08-21config: document includeIf conditions consistentlyJunio C Hamano1-5/+4
When 399b1984 (config: include file if remote URL matches a glob, 2022-01-18) added the 'hasconfig:remote.*.url:<URL>' condition to be used in the "includeIf.<condition>.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 <gitster@pobox.com>
2025-08-20Merge branch 'lo/repo-info' into lo/repo-info-step-2Junio C Hamano2-0/+85
* lo/repo-info: repo: add the --format flag repo: add the field layout.shallow repo: add the field layout.bare repo: add the field references.format repo: declare the repo command
2025-08-20doc: fix asciidoc format compatibility in pretty-formats.adocJean-Noël Avila1-2/+2
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 <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-20doc: add discord to ways of getting helpDaniele Sassoli1-0/+9
Discord is a great way of receiving help for members of the community that are not on the mailing list or not familiar with Libera. Adding it to the official documentation will aid discoverability of it. The link is the same as the one at https://git-scm.com/community. Signed-off-by: Daniele Sassoli <danielesassoli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-20doc/gitk: update reference to the external projectJohannes Sixt1-4/+4
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 <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-19doc: git-add: simplify discussion of ignored filesJulia Evans1-6/+4
- Mention the --force option earlier - Remove the explanation of shell globbing vs git's internal glob system, since users are confused by it and there's a clearer discussion in the EXAMPLES section. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-19doc: git-add: clarify intro & add an exampleJulia Evans1-12/+12
- Add a basic example of how "git add" is normally used - It's not technically true that you *must* use the `add` command to add changes before running `git commit`, because `git commit -a` exists. Instead say that you *can* use the `add` command. - Mention early on that "index" is another word for "staging area", since Git very rarely uses the word "index" in its output (`git status`) uses the term "staged", and many Git users are unfamiliar with the term "index" - Remove "It typically adds" (it's not clear what "typically" means), and instead mention that `git add -p` can be used to add partial contents - Currently the introduction is somewhat repetitive ("to prepare the content staged for the next commit" ... "this snapshot that is taken as the contents of the next commit."), replace with a single sentence ("The "index" [...] is where Git stores the contents of the next commit.") Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-17repo: add the --format flagLucas Seiki Oshiro1-7/+33
Add the --format flag to git-repo-info. By using this flag, the users can choose the format for obtaining the data they requested. Given that this command can be used for generating input for other applications and for being read by end users, it requires at least two formats: one for being read by humans and other for being read by machines. Some other Git commands also have two output formats, notably git-config which was the inspiration for the two formats that were chosen here: - keyvalue, where the retrieved data is printed one per line, using = for delimiting the key and the value. This is the default format, targeted for end users. - nul, where the retrieved data is separated by NUL characters, using the newline character for delimiting the key and the value. This format is targeted for being read by machines. Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Justin Tobler <jltobler@gmail.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Mentored-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-17repo: add the field layout.shallowLucas Seiki Oshiro1-0/+3
This commit is part of the series that introduces the new subcommand git-repo-info. The flag `--is-shallow-repository` from git-rev-parse is used for retrieving whether the repository is shallow. This way, it is used for querying repository metadata, fitting in the purpose of git-repo-info. Then, add a new field `layout.shallow` to the git-repo-info subcommand containing that information. Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Justin Tobler <jltobler@gmail.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Mentored-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-17repo: add the field layout.bareLucas Seiki Oshiro1-0/+3
This commit is part of the series that introduces the new subcommand git-repo-info. The flag --is-bare-repository from git-rev-parse is used for retrieving whether the current repository is bare. This way, it is used for querying repository metadata, fitting in the purpose of git-repo-info. Then, add a new field layout.bare to the git-repo-info subcommand containing that information. Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Justin Tobler <jltobler@gmail.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Mentored-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-17repo: add the field references.formatLucas Seiki Oshiro1-0/+20
This commit is part of the series that introduces the new subcommand git-repo-info. The flag `--show-ref-format` from git-rev-parse is used for retrieving the reference format (i.e. `files` or `reftable`). This way, it is used for querying repository metadata, fitting in the purpose of git-repo-info. Add a new field `references.format` to the repo-info subcommand containing that information. Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Justin Tobler <jltobler@gmail.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Mentored-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-17repo: declare the repo commandLucas Seiki Oshiro2-0/+33
Currently, `git rev-parse` covers a wide range of functionality not directly related to parsing revisions, as its name suggests. Over time, many features like parsing datestrings, options, paths, and others were added to it because there wasn't a more appropriate command to place them. Create a new Git command called `repo`. `git repo` will be the main command for obtaining the information about a repository (such as metadata and metrics). Also declare a subcommand for `repo` called `info`. `git repo info` will bring the functionality of retrieving repository-related information currently returned by `rev-parse`. Add the required documentation and build changes to enable usage of this subcommand. Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Justin Tobler <jltobler@gmail.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Mentored-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-14count-objects: document count-objects packDaniele Sassoli1-0/+2
0bdaa12169b (git-count-objects.txt: describe each line in -v output, 2013-02-08) forgot to include `packs`. Signed-off-by: Daniele Sassoli <danielesassoli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-12send-email: enable copying emails to an IMAP folder without actually sending ↵Aditya Garg2-0/+15
them `git imap-send` was built on the idea of copying emails to an IMAP folder like drafts, and sending them later using an email client. Currently the only way to do it is by piping output of `git format-patch` to IMAP send. Add another way to do it by using `git send-email` with the `--use-imap-only` or `sendmail.useImapOnly` option. This allows users to use the advanced features of `git send-email` like tweaking Cc: list programmatically, compose the cover letter, etc. and then send the well formatted emails to an IMAP folder using `git imap-send`. While at it, use `` instead of '' for --smtp-encryption ssl in help section of `git send-email`. Signed-off-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-12send-email: add ability to send a copy of sent emails to an IMAP folderAditya Garg2-0/+13
Some email providers like Apple iCloud Mail do not support sending a copy of sent emails to the "Sent" folder if SMTP server is used. As a workaround, various email clients like Thunderbird which rely on SMTP, use IMAP to send a copy of sent emails to the "Sent" folder. Something similar can be done if sending emails via `git send-email`, by using the `git imap-send` command to send a copy of the sent email to an IMAP folder specified by the user. Add this functionality to `git send-email` by introducing a new configuration variable `sendemail.imapfolder` and command line option `--imap-folder` which specifies the IMAP folder to send a copy of the sent emails to. If specified, a copy of the sent emails will be sent by piping the emails to `git imap-send` command, after all emails are sent via SMTP and the SMTP server has been closed. Signed-off-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-12docs: remove stray bracket from git-clone synopsisKnut Harald Ryager1-1/+1
The synopsis section has an extra closing bracket, like this: [--filter=<filter>] [--also-filter-submodules]] The extra one is not the one at the end of this line; it is the one after "...=<filter>". 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=<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=<filter> [--also-filter-submodules]] Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-11doc lint: check that synopsis manpages have synopsis inlinesJean-Noël Avila3-11/+17
When switching manpages to the synopsis style, the description lists of options need to be switched to inline synopsis for proper formatting. This is done by enclosing the option name in double backticks, e.g. `--option`. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-11doc:git-for-each-ref: fix styling and typosJean-Noël Avila1-132/+132
This commit fixes the synopsis syntax and changes the wording of a few descriptions to be more consistent with the rest of the documentation. It is a prepartion for the next commit that checks that synopsis style is applied consistently across a manual page. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-11doc: check for absence of the form --[no-]parameterJean-Noël Avila36-78/+159
For better searchability, this commit adds a check to ensure that parameters expressed in the form of `--[no-]parameter` are not used in the documentation. In the place of such parameters, the documentation should list two separate parameters: `--parameter` and `--no-parameter`. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-11doc: check for absence of multiple terms in each entry of desc listJean-Noël Avila6-6/+50
For simplifying automated translation of the documentation, it is better to only present one term in each entry of a description list of options. This is because most of these terms can automatically be marked as notranslatable. Also, due to portability issues, the script generate-configlist.sh can no longer insert newlines in the output. However, the result is that it no longer correctly handles multiple terms in a single entry of definition lists. As a result, we now check that these entries do not exist in the documentation. Reviewed-by: Collin Funk <collin.funk1@gmail.com> Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-11doc: check well-formedness of delimited sectionsJean-Noël Avila13-4/+79
Having an empty line before each delimited sections is not required by asciidoc, but it is a safety measure that prevents generating malformed asciidoc when generating translated documentation. When a delimited section appears just after a paragraph, the asciidoc processor checks that the length of the delimited section header is different from the length of the paragraph. If it is not, the asciidoc processor will generate a title. In the original English documentation, this is not a problem because the authors always check the output of the asciidoc processor and fix the length of the delimited section header if it turns out to be the same as the paragraph length. However, this is not the case for translations, where the authors have no way to check the length of the delimited section header or the output of the asciidoc processor. This can lead to a section title that is not intended. Indeed, this test also checks that titles are correctly formed, that is, the length of the underline is equal to the length of the title (otherwise it would not be a title but a section header). Finally, this test checks that the delimited section are terminated within the same file. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-11doc: test linkgit macros for well-formednessJean-Noël Avila2-1/+8
Some readers of man pages have reported that they found malformed linkgit macros in the documentation (absence or bad spelling). Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-08doc: git-log: fix description listKristoffer Haugsbakk1-2/+2
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 <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-07diff: teach tree-diff a max-depth parameterJeff King1-0/+28
When you are doing a tree-diff, there are basically two options: do not recurse into subtrees at all, or recurse indefinitely. While most callers would want to always recurse and see full pathnames, some may want the efficiency of looking only at a particular level of the tree. This is currently easy to do for the top-level (just turn off recursion), but you cannot say "show me what changed in subdir/, but do not recurse". This patch adds a max-depth parameter which is measured from the closest pathspec match, so that you can do: git log --raw --max-depth=1 -- a/b/c and see the raw output for a/b/c/, but not those of a/b/c/d/ (instead of the raw output you would see for a/b/c/d). Co-authored-by: Toon Claes <toon@iotcl.com> Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-07Git 2.51-rc1v2.51.0-rc1Junio C Hamano1-0/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-07Documentation/RelNotes/2.51.0: improve wording for a couple entriesPatrick Steinhardt1-5/+5
Improve wording and fix typos for a couple entries part of the Git 2.51 release notes. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-06builtin/reflog: implement subcommand to write new entriesPatrick Steinhardt1-0/+7
While we provide a couple of subcommands in git-reflog(1) to remove reflog entries, we don't provide any to write new entries. Obviously this is not an operation that really would be needed for many use cases out there, or otherwise people would have complained that such a command does not exist yet. But the introduction of the "reftable" backend changes the picture a bit, as it is now basically impossible to manually append a reflog entry if one wanted to do so due to the binary format. Plug this gap by introducing a simple "write" subcommand. For now, all this command does is to append a single new reflog entry with the given object IDs and message to the reflog. More specifically, it is not yet possible to: - Write multiple reflog entries at once. - Insert reflog entries at arbitrary indices. - Specify the date of the reflog entry. - Insert reflog entries that refer to nonexistent objects. If required, those features can be added at a future point in time. For now though, the new command aims to fulfill the most basic use cases while being as strict as possible when it comes to verifying parameters. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-06builtin/reflog: improve grouping of subcommandsPatrick Steinhardt1-30/+31
The way subcommands of git-reflog(1) are laid out does not make any immediate sense. Reorder them such that read-only subcommands precede writing commands for a bit more structure. Furthermore, move the "expire" subcommand last. This prepares for a subsequent change where we are about to introduce a new "write" command to append reflog entries. Like this, the writing subcommands are ordered such that those affecting a single reflog come before those spanning across all reflogs. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-06Documentation/git-reflog: convert to use synopsis typePatrick Steinhardt1-19/+19
With 974cdca345c (doc: introduce a synopsis typesetting, 2024-09-24) we have introduced a new synopsis type that simplifies the rules for typesetting a command's synopsis. Convert the git-reflog(1) documentation to use it. While at it, convert the list of options to use backticks. This is done to appease an upcoming new linter that mandates the use of backticks when using the synopsis type. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-05A bit more after -rc0Junio C Hamano1-0/+13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-05Merge branch 'kj/renamed-submodule'Junio C Hamano1-0/+7
The case where a new submodule takes a path where used to be a completely different subproject is now dealt a bit better than before. * kj/renamed-submodule: fixup! submodule: skip redundant active entries when pattern covers path fixup! submodule: prevent overwriting .gitmodules on path reuse submodule: skip redundant active entries when pattern covers path submodule: prevent overwriting .gitmodules on path reuse
2025-08-05builtin/refs: add list subcommandMeet Soni1-0/+16
Git's reference management is distributed across multiple commands. As part of an ongoing effort to consolidate and modernize reference handling, introduce a `list` subcommand under the `git refs` umbrella as a replacement for `git for-each-ref`. Implement `cmd_refs_list` by having it call the `for_each_ref_core()` helper function. This helper was factored out of the original `cmd_for_each_ref` in a preceding commit, allowing both commands to share the same core logic as independent peers. Add documentation for the new command. The man page leverages the shared options file, created in a previous commit, by using the AsciiDoc `include::` macro to ensure consistency with git-for-each-ref(1). Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: shejialuo <shejialuo@gmail.com> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Meet Soni <meetsoni3017@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-05doc: factor out common optionMeet Soni2-88/+89
In preparation for adding documentation for `git refs list`, factor out the common options from the `git-for-each-ref` man page into a shareable file `for-each-ref-options.adoc` and update `git-for-each-ref.adoc` to use an `include::` macro. This change is a pure refactoring and results in no change to the final rendered documentation for `for-each-ref`. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: shejialuo <shejialuo@gmail.com> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Meet Soni <meetsoni3017@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-04Git 2.51-rc0v2.51.0-rc0Junio C Hamano1-0/+21
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-04Merge branch 'kh/doc-fast-import-historical'Junio C Hamano1-1/+1
Doc update. * kh/doc-fast-import-historical: doc: fast-import: contextualize the hardware cost
2025-08-04Merge branch 'jc/doc-release-vs-clear'Junio C Hamano1-2/+3
Doc update. * jc/doc-release-vs-clear: CodingGuidelines: clarify that S_release() does not reinitialize
2025-08-04Merge branch 'js/mingw-fixes'Junio C Hamano1-6/+0
Windows fixes. * js/mingw-fixes: mingw: support Windows Server 2016 again mingw_rename: support ReFS on Windows 2022 mingw: drop Windows 7-specific work-around mingw_open_existing: handle directories better
2025-08-04Merge branch 'lm/add-p-context'Junio C Hamano7-0/+22
"git add/etc -p" now honor the diff.context configuration variable, and also they learn to honor the -U<n> command-line option. * lm/add-p-context: add-patch: add diff.context command line overrides add-patch: respect diff.context configuration t: use test_config in t4055 t: use test_grep in t3701 and t4055
2025-08-04Merge branch 'ps/config-wo-the-repository'Junio C Hamano1-1/+1
The config API had a set of convenience wrapper functions that implicitly use the_repository instance; they have been removed and inlined at the calling sites. * ps/config-wo-the-repository: (21 commits) config: fix sign comparison warnings config: move Git config parsing into "environment.c" config: remove unused `the_repository` wrappers config: drop `git_config_set_multivar()` wrapper config: drop `git_config_get_multivar_gently()` wrapper config: drop `git_config_set_multivar_in_file_gently()` wrapper config: drop `git_config_set_in_file_gently()` wrapper config: drop `git_config_set()` wrapper config: drop `git_config_set_gently()` wrapper config: drop `git_config_set_in_file()` wrapper config: drop `git_config_get_bool()` wrapper config: drop `git_config_get_ulong()` wrapper config: drop `git_config_get_int()` wrapper config: drop `git_config_get_string()` wrapper config: drop `git_config_get_string()` wrapper config: drop `git_config_get_string_multi()` wrapper config: drop `git_config_get_value()` wrapper config: drop `git_config_get_value()` wrapper config: drop `git_config_get()` wrapper config: drop `git_config_clear()` wrapper ...
2025-08-04Merge branch 'kn/for-each-ref-skip-updates'Junio C Hamano1-6/+7
Code clean-up. * kn/for-each-ref-skip-updates: ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1' t6302: add test combining '--start-after' with '--exclude' for-each-ref: reword the documentation for '--start-after' for-each-ref: fix documentation argument ordering ref-cache: use 'size_t' instead of int for length
2025-08-04Merge branch 'jt/switch-restore-no-longer-experimental'Junio C Hamano2-4/+0
"git switch" and "git restore" are declared to be no longer experimental. * jt/switch-restore-no-longer-experimental: builtin: unmark git-switch and git-restore as experimental
2025-08-03The seventeenth batch, just before -rc0Junio C Hamano1-0/+17
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-03Merge branch 'kn/for-each-ref-skip'Junio C Hamano1-1/+9
"git for-each-ref" learns "--start-after" option to help applications that want to page its output. * kn/for-each-ref-skip: ref-cache: set prefix_state when seeking for-each-ref: introduce a '--start-after' option ref-filter: remove unnecessary else clause refs: selectively set prefix in the seek functions ref-cache: remove unused function 'find_ref_entry()' refs: expose `ref_iterator` via 'refs.h'
2025-08-03mingw: drop Windows 7-specific work-aroundJohannes Schindelin1-6/+0
In ac33519ddfa8 (mingw: restrict file handle inheritance only on Windows 7 and later, 2019-11-22), I introduced code to safe-guard the defense-in-depth handling that restricts handles' inheritance so that it would work with Windows 7, too. Let's revert this patch: Git for Windows dropped supporting Windows 7 (and Windows 8) directly after Git for Windows v2.46.2. For full details, see https://gitforwindows.org/requirements#windows-version. Actually, on second thought: revert only the part that makes this handle inheritance restriction logic optional and that suggests to open a bug report if it fails, but keep the fall-back to try again without said logic: There have been a few false positives over the past few years (where the warning was triggered e.g. because Defender was still accessing a file that Git wanted to overwrite), and the fall-back logic seems to have helped occasionally in such situations. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01The sixteenth batchJunio C Hamano1-0/+22
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01Merge branch 'ly/pull-autostash'Junio C Hamano1-0/+16
"git pull" learned to pay attention to pull.autostash configuration variable, which overrides rebase/merge.autostash. * ly/pull-autostash: pull: add pull.autoStash config option
2025-08-01Merge branch 'jc/document-test-balloons-in-flight'Junio C Hamano1-0/+8
To help our developers, document what C99 language features are being considered for adoption, in addition to what past experiments have already decided. * jc/document-test-balloons-in-flight: CodingGuidelines: document test balloons in flight
2025-08-01Merge branch 'ag/imap-send-list-folders-doc'Junio C Hamano1-0/+28
Document recently added "git imap-send --list" with an example. * ag/imap-send-list-folders-doc: docs: explain how to use `git imap-send --list` command to get a list of available folders
2025-08-01doc: fast-import: contextualize the hardware costKristoffer Haugsbakk1-1/+1
6e411d20440 (Initial draft of fast-import documentation., 2007-02-05) pointed out how much time a fast-import took on some hardware with a specific cost. Let’s further point out that this experiment was done in 2007. So modern hardware should have no issues with such a repo. Also move the parenthetical to the end now that it contains four words. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01CodingGuidelines: clarify that S_release() does not reinitializeJunio C Hamano1-2/+3
In the section for naming various API functions, the fact that S_release() only releases the resources without preparing the structure for immediate reuse becomes only apparent when you readentries for S_release() and S_clear(). Clarify the description of S_release() a bit to make the entry self sufficient. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-31Merge branch 'ps/config-wo-the-repository' into ↵Junio C Hamano1-1/+1
pw/3.0-commentchar-auto-deprecation * ps/config-wo-the-repository: (21 commits) config: fix sign comparison warnings config: move Git config parsing into "environment.c" config: remove unused `the_repository` wrappers config: drop `git_config_set_multivar()` wrapper config: drop `git_config_get_multivar_gently()` wrapper config: drop `git_config_set_multivar_in_file_gently()` wrapper config: drop `git_config_set_in_file_gently()` wrapper config: drop `git_config_set()` wrapper config: drop `git_config_set_gently()` wrapper config: drop `git_config_set_in_file()` wrapper config: drop `git_config_get_bool()` wrapper config: drop `git_config_get_ulong()` wrapper config: drop `git_config_get_int()` wrapper config: drop `git_config_get_string()` wrapper config: drop `git_config_get_string()` wrapper config: drop `git_config_get_string_multi()` wrapper config: drop `git_config_get_value()` wrapper config: drop `git_config_get_value()` wrapper config: drop `git_config_get()` wrapper config: drop `git_config_clear()` wrapper ...
2025-07-29add-patch: add diff.context command line overridesLeon Michalak7-0/+22
This patch compliments the previous commit, where builtins that use add-patch infrastructure now respect diff.context and diff.interHunkContext file configurations. In particular, this patch helps users who don't want to set persistent context configurations or just want a way to override them on a one-time basis, by allowing the relevant builtins to accept corresponding command line options that override the file configurations. This mimics commands such as diff and log, which allow for both context file configuration and command line overrides. Signed-off-by: Leon Michalak <leonmichalak6@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-28builtin: unmark git-switch and git-restore as experimentalJustin Tobler2-4/+0
In 4e43b7ff (Declare both git-switch and git-restore experimental, 2019-04-25), the newly introduced git-switch(1) and git-restore(1) commands were marked as experimental. This was done to provide time to make breaking changes to the interface. It has now been over six years since these commands were implemented and there hasn't been much change. Consequently, users have grown to rely on how these commands work and it is no longer feasible to make any breaking changes. Let's remove the experimental label for git-switch(1) and git-restore(1). Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-28for-each-ref: reword the documentation for '--start-after'Karthik Nayak1-1/+2
The documentation for '--start-after' states that the flag cannot be used with general pattern matching. This is a bit vague, since there is no clear understanding about what 'general' means here. Rewrite the sentence to be more specific. While here, fix a typo in the 'OPT_STRING'. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-28for-each-ref: fix documentation argument orderingKarthik Nayak1-5/+5
Improve the 'git-for-each-ref(1)' documentation with two corrections: 1. Add parentheses around `--exclude=<pattern>` to indicate this option can be repeated as a complete unit. 2. Move `--stdin | <pattern> ...` to the end, after all flags, since `<pattern>` is a positional argument that should appear last in the argument list. While here, change to using the synopsis block which will automatically format placeholders in italics and keywords in monospace. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-28The fifteenth batchJunio C Hamano1-0/+9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-24The fourteenth batchJunio C Hamano1-0/+18
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-24Merge branch 'bc/contribution-under-non-real-names'Junio C Hamano1-2/+9
Document that we do not require "real" name when signing your patches off. * bc/contribution-under-non-real-names: SubmittingPatches: allow non-real name contributions
2025-07-24Merge branch 'pw/adopt-c99-bool-officially'Junio C Hamano1-0/+3
Declare weather-balloon we raised for "bool" type 18 months ago a success and officially allow using the type in our codebase. * pw/adopt-c99-bool-officially: strbuf: convert predicates to return bool git-compat-util: convert string predicates to return bool CodingGuidelines: allow the use of bool
2025-07-24submodule: prevent overwriting .gitmodules on path reuseK Jayatheerth1-0/+7
Adding a submodule at a path that previously hosted another submodule (e.g., 'child') reuses the submodule name derived from the path. If the original submodule was only moved (e.g., to 'child_old') and not renamed, this silently overwrites its configuration in .gitmodules. This behavior loses user configuration and causes confusion when the original submodule is expected to remain intact. It assumes that the path-derived name is always safe to reuse, even though the name might still be in use elsewhere in the repository. Teach module_add() to check if the computed submodule name already exists in the repository's submodule config, and if so, refuse the operation unless the user explicitly renames the submodule or uses the --force option, which will automatically generate a unique name by appending a number (e.g., child1). Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-24CodingGuidelines: document test balloons in flightJunio C Hamano1-0/+8
Due to portability concerns, we do not blindly say "It is in [[this standard]], so we will make liberal use of it" for many features, and use of C99 language features follow this same principle. When we contemplate adopting a language feature that we haven't used in our codebase, we typically first raise a test balloon, which - is a piece of code that exercises the language feature we are trying to see if it is OK to adopt - is in a small section of code that we know everybody who cares about having a working Git must be compiling - is in a fairly stable part of the code, to allow reverting it easily if some platforms do not understand it yet. After a few years, with no breakage report from the community, we'd declare that the feature is now safe to use in our codebase. Before that, we forbid the use of the language construct except for the designated test balloon code site. The CodingGuidelines document lists these selected features that we already have determined that they are safe, and also those features that we know some platforms had trouble with. Let's also start listing ongoing test balloons and expected timeline for adoption. Recently phillip proposed to adopt the syntax to spell a structure literally (i.e. compound literal) with a new test balloon, which Patrick made redundant by pointing out an existing one we had already.but without documenting it. Start the new section with an entry for that test balloon. Helped-by: Patrick Steinhardt <ps@pks.im> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-23The thirteenth batchJunio C Hamano1-0/+13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-23Merge branch 'cc/fast-import-export-signature-names'Junio C Hamano2-6/+49
Clean up the way how signature on commit objects are exported to and imported from fast-import stream. * cc/fast-import-export-signature-names: fast-(import|export): improve on commit signature output format
2025-07-23config: drop `git_config()` wrapperPatrick Steinhardt1-1/+1
In 036876a1067 (config: hide functions using `the_repository` by default, 2024-08-13) we have moved around a bunch of functions in the config subsystem that depend on `the_repository`. Those function have been converted into mere wrappers around their equivalent function that takes in a repository as parameter, and the intent was that we'll eventually remove those wrappers to make the dependency on the global repository variable explicit at the callsite. Follow through with that intent and remove `git_config()`. All callsites are adjusted so that they use `repo_config(the_repository, ...)` instead. While some callsites might already have a repository available, this mechanical conversion is the exact same as the current situation and thus cannot cause any regression. Those sites should eventually be cleaned up in a later patch series. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-22docs: explain how to use `git imap-send --list` command to get a list of ↵Aditya Garg1-0/+28
available folders The output `git imap-send --list` command can be a bit confusing for new users since the IMAP LIST command output is very verbose. Help such users to analyse the same by using an example output. Signed-off-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-21pull: add pull.autoStash config optionLidong Yan1-0/+16
Git uses `rebase.autostash` or `merge.autostash` to determine whether a dirty worktree is allowed during pull. However, this behavior is not clearly documented, making it difficult for users to discover how to enable autostash, or causing them to unknowingly enable it. Add new config option `pull.autostash` along with its documentation and test cases. `pull.autostash` provides the same functionality as `rebase.autostash` and `merge.autostash`, but overrides them when set. If `pull.autostash` is not set, it falls back to `rebase.autostash` or `merge.autostash`, depending on the value of `pull.rebase`. Signed-off-by: Lidong Yan <yldhome2d2@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-21The twelfth batchJunio C Hamano1-0/+19
2025-07-21Merge branch 'jb/gpg-program-variable-is-a-pathname'Junio C Hamano1-1/+1
The gpg.program configuration variable, which names a pathname to the (custom) GPG compatible program, can now be spelled with ~tilde expansion. * jb/gpg-program-variable-is-a-pathname: gpg-interface: expand gpg.program as a path
2025-07-21Merge branch 'ja/doc-git-log-markup'Junio C Hamano11-472/+493
Doc mark-up updates. * ja/doc-git-log-markup: doc: git-log: convert log config to new doc format doc: git-log: convert diff options to new doc format doc: git-log: convert pretty formats to new doc format doc: git-log: convert pretty options to new doc format doc: git-log: convert rev list options to new doc format doc: git-log: convert line range format to new doc format doc: git-log: convert line range options to new doc format doc: git-log convert rev-list-description to new doc format doc: convert git-log to new documentation format
2025-07-21Merge branch 'rh/doc-glob-pathspec-fix'Junio C Hamano1-3/+2
Docfix. * rh/doc-glob-pathspec-fix: doc: correct doc for glob pathspec
2025-07-21Merge branch 'ps/meson-cleanups'Junio C Hamano1-3/+2
Meson-based build update. * ps/meson-cleanups: ci: use Meson's new `--slice` option meson: update subproject wrappers meson: fix lookup of shell on MINGW64 meson: clean up unnecessary variables meson: improve summary of auto-detected features meson: stop printing 'https' option twice in our summaries meson: stop discovering native version of Python
2025-07-21Merge branch 'tb/midx-avoid-cruft-packs'Junio C Hamano2-1/+16
"pack-objects" has been taught to avoid pointing into objects in cruft packs from midx. * tb/midx-avoid-cruft-packs: repack: exclude cruft pack(s) from the MIDX where possible pack-objects: introduce '--stdin-packs=follow' pack-objects: swap 'show_{object,commit}_pack_hint' pack-objects: fix typo in 'show_object_pack_hint()' pack-objects: perform name-hash traversal for unpacked objects pack-objects: declare 'rev_info' for '--stdin-packs' earlier pack-objects: factor out handling '--stdin-packs' pack-objects: limit scope in 'add_object_entry_from_pack()' pack-objects: use standard option incompatibility functions
2025-07-16The eleventh batchJunio C Hamano1-0/+13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-16Merge branch 'ag/doc-send-email'Junio C Hamano2-8/+55
Documentation updates for "git send-email". * ag/doc-send-email: docs: mention possible options for Proton Mail users docs: add a paragraph explaining the `sendmailCmd` option of sendemail docs: add an OAuth2.0 credential helper for AOL accounts docs: add outlookidfix config option to sendemail documentation docs: link OpenSSL's verify(1) manual page to know about -CAfile and -CApath options
2025-07-16Merge branch 'ps/doc-pack-refs-auto-with-files-backend-fix'Junio C Hamano1-1/+4
Doc update. * ps/doc-pack-refs-auto-with-files-backend-fix: docs/git-pack-refs: document heuristic used for packing loose refs
2025-07-16CodingGuidelines: allow the use of boolPhillip Wood1-0/+3
We have had a test balloon for C99's bool type since 8277dbe987 (git-compat-util: convert skip_{prefix,suffix}{,_mem} to bool, 2023-12-16). As we've had it over 18 months without any complaints let's declare it a success. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-16SubmittingPatches: allow non-real name contributionsbrian m. carlson1-2/+9
Our submission guidelines require people to use their real name, but this is not always suitable for various reasons. For people who are transgender or non-binary and are transitioning or who think they might want to transition, it can be a major obstacle and cause major discomfort to require the use of their real name. This is made worse by the fact that Git provides no way to change names built into history, so the use of a deadname is forever. Our code of conduct states that we "pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community," and changing this policy is one way we can improve things for contributors. In addition, there are some developers who are so widely known pseudonymously that they have a Wikipedia page with their handle and no real name. It would seem silly to reject patches from people who are known and respected in their open-source community just because they don't wish to share a real name. There are also other good reasons why people might operate pseudonymously: because they or their family members are well known and they wish to protect their privacy, because of current or past harassment or retaliation or fear of that happening in the future, or because of concerns about unwanted attention from government officials or other authority figures. As much as possible, we want to welcome contributions from anyone who is willing to participate positively in our community without having them worry about their safety or privacy. In all of these cases, we should allow people to proceed using a preferred name or pseudonymously if, in their best judgment, that's the right thing to do. State that it is common to use a real name but explicitly mention that contributors who are not comfortable doing so or prefer to operate pseudonymously or under a preferred name can proceed otherwise, provided the name is distinctive, identifying, and not misleading. For instance, using U+2060 (WORD JOINER) as one's ID would likely be distinctive but not identifying, since most people would have trouble reading it due to its zero-width nature. We prohibit identities which are misleading, since our goal is to create a community which works together with a common goal, and misleading or deceiving others is not conducive to good community or compatible with our code of conduct, nor is it compatible with making a legal assertion about the provenance of one's code. Explicitly prohibit anonymous contributions to ensure that we have some line of provenance to a known (if pseudonymous) author who might be able to respond to questions about it. Explain that this is the reason we have this policy to help contributors understand the rationale better. Use "some form of your real name" since some current contributors use shortened forms of their name or use initials, which have always been considered acceptable. This helps guide people who would be fine using their real name but have misconfigured `user.name` thinking it is intended to be a username or is used for authentication (despite our documentation to the contrary), but also allows for a variety of circumstances where the contributor would feel more comfortable not doing so. Note that this policy is the same as that of the Linux kernel[0] and the CNCF[1], as well as many smaller projects. The Linux kernel patch was Acked-by one of the Linux Foundation's lawyers, Michael Dolan, so it appears these changes have had legal review. Additionally, retain the section header ID for ease of linking across versions. [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4563201f33a022fc0353033d9dfeb1606a88330 [1] https://github.com/cncf/foundation/blob/659fd32c86dc/dco-guidelines.md Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-15The tenth batchJunio C Hamano1-0/+5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-15Merge branch 'ps/object-store'Junio C Hamano1-2/+2
Code clean-up around object access API. * ps/object-store: odb: rename `read_object_with_reference()` odb: rename `pretend_object_file()` odb: rename `has_object()` odb: rename `repo_read_object_file()` odb: rename `oid_object_info()` odb: trivial refactorings to get rid of `the_repository` odb: get rid of `the_repository` when handling submodule sources odb: get rid of `the_repository` when handling the primary source odb: get rid of `the_repository` in `for_each()` functions odb: get rid of `the_repository` when handling alternates odb: get rid of `the_repository` in `odb_mkstemp()` odb: get rid of `the_repository` in `assert_oid_type()` odb: get rid of `the_repository` in `find_odb()` odb: introduce parent pointers object-store: rename files to "odb.{c,h}" object-store: rename `object_directory` to `odb_source` object-store: rename `raw_object_store` to `object_database`
2025-07-15for-each-ref: introduce a '--start-after' optionKarthik Nayak1-1/+9
The `git-for-each-ref(1)` command is used to iterate over references present in a repository. In large repositories with millions of references, it would be optimal to paginate this output such that we can start iteration from a given reference. This would avoid having to iterate over all references from the beginning each time when paginating through results. The previous commit added 'seek' functionality to the reference backends. Utilize this and expose a '--start-after' option in 'git-for-each-ref(1)'. When used, the reference iteration seeks to the lexicographically next reference and iterates from there onward. This enables efficient pagination workflows, where the calling script can remember the last provided reference and use that as the starting point for the next set of references: git for-each-ref --count=100 git for-each-ref --count=100 --start-after=refs/heads/branch-100 git for-each-ref --count=100 --start-after=refs/heads/branch-200 Since the reference iterators only allow seeking to a specified marker via the `ref_iterator_seek()`, we introduce a helper function `start_ref_iterator_after()`, which seeks to next reference by simply adding (char) 1 to the marker. We must note that pagination always continues from the provided marker, as such any concurrent reference updates lexicographically behind the marker will not be output. Document the same. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-14The ninth batchJunio C Hamano1-2/+49
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-14Merge branch 'rp/apply-intent-to-add-fix'Junio C Hamano1-4/+5
"git apply -N" should start from the current index and register only new files, but it instead started from an empty index, which has been corrected. * rp/apply-intent-to-add-fix: apply docs: clarify wording for --intent-to-add t4140: test apply --intent-to-add interactions apply: only write intents to add for new files apply: read in the index in --intent-to-add mode
2025-07-14Merge branch 'ts/merge-orig-head-doc-fix'Junio C Hamano1-5/+5
Doc fix. * ts/merge-orig-head-doc-fix: docs: correct ORIG_HEAD example in "git merge" documentation
2025-07-14Merge branch 'kh/doc-config-subcommands'Junio C Hamano1-7/+21
Documentation updates. * kh/doc-config-subcommands: config: mention --url in the synopsis config: use --value instead of value-pattern config: document --[no-]value config: use --value=<pattern> consistently config: document --[no-]show-names
2025-07-14Merge branch 'ps/use-reftable-as-default-in-3.0'Junio C Hamano2-0/+53
The reftable ref backend has matured enough; Git 3.0 will make it the default format in a newly created repositories by default. * ps/use-reftable-as-default-in-3.0: setup: use "reftable" format when experimental features are enabled BreakingChanges: announce switch to "reftable" format
2025-07-14Merge branch 'bs/remote-helpers-doc-markup-fix'Junio C Hamano1-1/+1
Docfix. * bs/remote-helpers-doc-markup-fix: gitremote-helpers.adoc: fix formatting
2025-07-14gpg-interface: expand gpg.program as a pathJonas Brandstötter1-1/+1
This allows using a custom gpg program under the user's home directory by specifying a path starting with '~' [gpg] program = "~/.local/bin/mygpg" Signed-off-by: Jonas Brandstötter <jonas.brandstoetter@gmx.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-11doc: correct doc for glob pathspecRussell Hanneken1-3/+2
gitglossary documents Git pathspecs. One type of pathspec is the "glob" pathspec, prefixed with the magic word "glob". Regarding glob pathspecs, gitglossary says, '"**/foo" matches file or directory "foo" anywhere, the same as pattern "foo".' That last phrase ('the same as pattern "foo") is incorrect. "**/foo" and "foo" are not equivalent. "**/foo" matches foo anywhere, but "foo" does not. This change removes the incorrect phrase from the glob pathspec doc. Signed-off-by: Russell Hanneken <rhanneken@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-09fast-(import|export): improve on commit signature output formatChristian Couder2-6/+49
A recent commit, d9cb0e6ff8 (fast-export, fast-import: add support for signed-commits, 2025-03-10), added support for signed commits to fast-export and fast-import. When a signed commit is processed, fast-export can output either "gpgsig sha1" or "gpgsig sha256" depending on whether the signed commit uses the SHA-1 or SHA-256 Git object format. However, this implementation has a number of limitations: - the output format was not properly described in the documentation, - the output format is not very informative as it doesn't even say if the signature is an OpenPGP, an SSH, or an X509 signature, - the implementation doesn't support having both one signature on the SHA-1 object and one on the SHA-256 object. Let's improve on these limitations by improving fast-export and fast-import so that: - all the signatures are exported, - at most one signature on the SHA-1 object and one on the SHA-256 are imported, - if there is more than one signature on the SHA-1 object or on the SHA-256 object, fast-import emits a warning for each additional signature, - the output format is "gpgsig <git-hash-algo> <signature-format>", where <git-hash-algo> is the Git object format as before, and <signature-format> is the signature type ("openpgp", "x509", "ssh" or "unknown"), - the output is properly documented. About the output format: - <git-hash-algo> allows to know which representation of the commit was signed (the SHA-1 or the SHA-256 version) which helps with both signature verification and interoperability between repos with different hash functions, - <signature-format> helps tools that process the fast-export stream, so they don't have to parse the ASCII armor to identify the signature type. It could be even better to be able to import more than one signature on the SHA-1 object and on the SHA-256 object, but other parts of Git don't handle that well for now, so this is left for future improvements. Helped-by: brian m. carlson <sandals@crustytoothpaste.net> Helped-by: Elijah Newren <newren@gmail.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-09meson: clean up unnecessary variablesPatrick Steinhardt1-3/+2
The `manpage_target` variable isn't used at all, and the `manpage_path` variable is only used in a single location. Remove the former variable and inline the latter. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-08The eighth batchJunio C Hamano1-0/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-08docs/git-pack-refs: document heuristic used for packing loose refsPatrick Steinhardt1-1/+4
The `git pack-refs --auto` flag asks the ref backend to decide for itself whether or not references need to be repacked. This is done to ensure that we don't repack in cases where the backend is already in a good-enough state, which is typically the case for the "reftable" backend that performs auto-compaction on writes. As such, we initially only had heuristics in place for the "reftable" backend. The "files" backend didn't have any heuristics, so we'd repack loose references every time `git pack-refs --auto` was executed. This caused excessive repacking with that backend though, which is why we eventually implemented a heuristic via c3459ae9ef2 (refs/files: use heuristic to decide whether to repack with `--auto`, 2024-09-04). The documentation for the `--auto` flag hasn't been updated accordingly and still claims that we don't have any metrics for the "files" backend. Update it to reflect the new reality. Reported-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-08Documentation/RelNotes: use .adoc extension for new security releasesTaylor Blau7-0/+0
When preparing the latest round of security fixes, we wrote release notes in v2.43.7, and then successively merged those up through to the various 'maint' branches. However, the 2.49 release series is the first to have commit 1f010d6bdf (doc: use .adoc extension for AsciiDoc files, 2025-01-20). This means that we should have renamed the new-but-historical release notes from *.txt to *.adoc during the merge into the 'maint-2.49' branch, but neglected to do so. Rename them accordingly to match the convention introduced by 1f010d6bdf. Since the release materials in question here were prepared before v2.50.0 was tagged, the 'maint' track for that release series is OK as is. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07Sync with Git 2.50.1Junio C Hamano8-0/+130
2025-07-07The seventh batchJunio C Hamano1-0/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07Merge branch 'jj/doc-branch-markup-fix'Junio C Hamano1-2/+2
Doc markup fix. * jj/doc-branch-markup-fix: doc: improve formatting in branch section
2025-07-07doc: git-log: convert log config to new doc formatJean-Noël Avila1-22/+34
- Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. - Explain possible options in description list instead of in a paragraph. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07doc: git-log: convert diff options to new doc formatJean-Noël Avila1-17/+23
- Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. - In description lists, put each option on its own line, to make them more searchable and enable automatic translation of the options. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07doc: git-log: convert pretty formats to new doc formatJean-Noël Avila1-140/+143
- Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. For all the formats in the form of %(foo), the formatting needs to be heavier because we not want the parentheses to be rendered as syntax elements,but as keywords, i.e. we need to circumvent the syntax highlighting of synopsis. In this particular case, this requires the heavy escaping of the parts that contain parentheses with ++. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07doc: git-log: convert pretty options to new doc formatJean-Noël Avila1-35/+36
- Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07doc: git-log: convert rev list options to new doc formatJean-Noël Avila3-198/+198
- Fix some malformed synopis of options - Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. - Add the '%' sign to the characters of keywords. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07doc: git-log: convert line range format to new doc formatJean-Noël Avila1-13/+13
- Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07doc: git-log: convert line range options to new doc formatJean-Noël Avila1-5/+5
format placeholders in italics and keywords in monospace - Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07doc: git-log convert rev-list-description to new doc formatJean-Noël Avila1-3/+3
Use `backticks` for commit ranges. The new rendering engine will apply synopsis rules to these spans. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07doc: convert git-log to new documentation formatJean-Noël Avila1-40/+46
- Switch the synopsis to a synopsis block which will automatically format placeholders in italics and keywords in monospace - Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. We also transform inline descriptions of possible values of option --decorate into a list, which is more readable and extensible. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07docs: correct ORIG_HEAD example in "git merge" documentationTimur Sultanaev1-5/+5
Documentation for git-merge incorrectly notes that tip of the current branch on ascii diagram is C, while it is actually G (current branch is master, HEAD on diagram is G). Additionally diagrams on the page are adjusted to use spaces instead of tabs, so that they align regardless of tab size. This is in line with diagrams on other git documentation pages. Signed-off-by: Timur Sultanaev <str.write@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07apply docs: clarify wording for --intent-to-addRaymond E. Pasco1-4/+5
Avoid using a double negative, and keep in mind that --index and --cached are distinct modes of operation. Signed-off-by: Raymond E. Pasco <ray@ameretat.dev> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07setup: use "reftable" format when experimental features are enabledPatrick Steinhardt1-0/+6
With the preceding commit we have announced the switch to the "reftable" format in Git 3.0 for newly created repositories. The format is being battle tested by GitLab and a couple of other developers, and except for a small handful of issues exposed early after it has been merged it has been rock solid. Regardless of that though the test user base is still comparatively small, which increases the risk that we miss critical bugs. Address this by enabling the reftable format when experimental features are enabled. This should increase the test user base by some margin and thus give us more input before making the format the default. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-07BreakingChanges: announce switch to "reftable" formatPatrick Steinhardt1-0/+47
The "reftable" format has come a long way and has matured nicely since it has been merged into git via 57db2a094d5 (refs: introduce reftable backend, 2024-02-07). It fixes longstanding issues that cannot be fixed with the "files" format in a backwards-compatible way and performs significantly better in many use cases. Announce that we will switch to the "reftable" format in Git 3.0 for newly created repositories and wire up the change, hidden behind the WITH_BREAKING_CHANGES preprocessor define. This switch is dependent on support in the larger Git ecosystem. Most importantly, libraries like JGit, libgit2 and Gitoxide should support the reftable backend so that we don't break all applications and tools built on top of those libraries. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-02The sixth batchJunio C Hamano1-0/+7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-02Merge branch 'ag/imap-send-resurrection'Junio C Hamano2-13/+66
"git imap-send" has been broken for a long time, which has been resurrected and then taught to talk OAuth2.0 etc. * ag/imap-send-resurrection: imap-send: fix minor mistakes in the logs imap-send: display the destination mailbox when sending a message imap-send: display port alongwith host when git credential is invoked imap-send: add ability to list the available folders imap-send: enable specifying the folder using the command line imap-send: add PLAIN authentication method to OpenSSL imap-send: add support for OAuth2.0 authentication imap-send: gracefully fail if CRAM-MD5 authentication is requested without OpenSSL imap-send: fix memory leak in case auth_cram_md5 fails imap-send: fix bug causing cfg->folder being set to NULL
2025-07-02gitremote-helpers.adoc: fix formattingBrett A C Sheffield1-1/+1
Add missing colon to fix formatting. Signed-off-by: Brett A C Sheffield <bacs@librecast.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-01odb: rename `read_object_with_reference()`Patrick Steinhardt1-2/+2
Rename `read_object_with_reference()` to `odb_read_object_peeled()` to match other functions related to the object database and our modern coding guidelines. Furthermore though, the old name didn't really describe very well what this function actually does, which is to walk down any commit and tag objects until an object of the required type has been found. This is generally referred to as "peeling", so the new name should be way more descriptive. No compatibility wrapper is introduced as the function is not used a lot throughout our codebase. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-01config: mention --url in the synopsisKristoffer Haugsbakk1-1/+1
4e513890008 (builtin/config: introduce "get" subcommand, 2024-05-06) introduced `get` and `--url` but didn’t add `--url` to the synopsis. Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-01config: use --value instead of value-patternKristoffer Haugsbakk1-4/+4
This option was introduced in a series of commits from fe3ccc7aab (Merge branch 'ps/config-subcommands', 2024-05-15) and deprecated `value-pattern`. But `value-pattern` is still used throughout the doc. The deprecated modes have been quarantined in the “Deprecated Modes” section. So let’s only use `--value=<pattern>` in the rest of the doc. Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-01config: document --[no-]valueKristoffer Haugsbakk1-0/+8
These options were introduced in a series of commits from fe3ccc7aab (Merge branch 'ps/config-subcommands', 2024-05-15).[1] But they were not documented here. Document this option and the negated form according to the current convention.[2] [1]: `--value` is a replacement for the `value-pattern` positional argument [2]: https://lore.kernel.org/git/xmqqcyct1mtq.fsf@gitster.g/ Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-01config: use --value=<pattern> consistentlyKristoffer Haugsbakk1-3/+3
This option was introduced in a series of commits from fe3ccc7aab (Merge branch 'ps/config-subcommands', 2024-05-15). But two styles were used for the value provided to the option: 1. Synopsis: `--value=<value>` 2. Deprecated Modes: `--value=<pattern>` (2) is also used in the synopsis on the command. Use (2) consistently throughout since it’s a pattern in the general case (`value` sounds more generic). Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-01config: document --[no-]show-namesKristoffer Haugsbakk1-0/+6
These options were introduced in 4e513890008 (builtin/config: introduce "get" subcommand, 2024-05-06) but not documented here. Use the description from the source code. Document this option and the negated form according to the current convention.[1] `--show-names` is also the default when `--get-regexp` is given. But don’t mention it here since all the deprecated modes are quarantined in the “Deprecated Modes” section. [1]: https://lore.kernel.org/git/xmqqcyct1mtq.fsf@gitster.g/ Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-30The fifth batchJunio C Hamano1-0/+15
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-30Merge branch 'jc/merge-compact-summary'Junio C Hamano3-3/+16
"git merge/pull" has been taught the "--compact-summary" option to use the compact-summary format, intead of diffstat, when showing the summary of the incoming changes. * jc/merge-compact-summary: merge/pull: extend merge.stat configuration variable to cover --compact-summary merge/pull: add the "--compact-summary" option
2025-06-30Merge branch 'bc/stash-export-import'Junio C Hamano1-1/+28
An interchange format for stash entries is defined, and subcommand of "git stash" to import/export has been added. * bc/stash-export-import: builtin/stash: provide a way to import stashes from a ref builtin/stash: provide a way to export stashes to a ref builtin/stash: factor out revision parsing into a function object-name: make get_oid quietly return an error