aboutsummaryrefslogtreecommitdiff
path: root/Documentation
AgeCommit message (Collapse)Author
2026-03-23format-patch: add preset for --commit-list-formatMirko Faina
"git format-patch --commit-list-format" enables the user to make their own format for the commit list in the cover letter. It would be nice to have a ready to use format to replace shortlog. Teach make_cover_letter() the "modern" format preset. This new format is the same as: "log:[%(count)/%(total)] %s". Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-23docs/pretty-formats: add %(count) and %(total)Mirko Faina
When --commit-list-format was introduced to format-patch, two new placeholders were added to the PRETTY FORMATS code without being documented. Do so now. Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-23format-patch: rename --cover-letter-format optionMirko Faina
To align the name of the configuration variable and the name of the command line option, either one should change name. By changing the name of the option we get the added benefit of having --cover-<TAB> expand to --cover-letter without ambiguity. If the user gives the --cover-letter-format option it would be reasonable to expect that the user wants to generate the cover letter despite not giving --cover-letter. Rename --cover-letter-format to --commit-list-format and make it imply --cover-letter unless --no-cover-letter is given. Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-23The 19th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-19The 18th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-19Merge branch 'jc/doc-wholesale-replace-before-next'Junio C Hamano
Doc update. * jc/doc-wholesale-replace-before-next: SubmittingPatches: spell out "replace fully to pretend to be perfect"
2026-03-19Merge branch 'lc/rebase-trailer'Junio C Hamano
"git rebase" learns "--trailer" command to drive the interpret-trailers machinery. * lc/rebase-trailer: rebase: support --trailer commit, tag: parse --trailer with OPT_STRVEC trailer: append trailers without fork/exec trailer: libify a couple of functions interpret-trailers: refactor create_in_place_tempfile() interpret-trailers: factor trailer rewriting
2026-03-18doc: add missing space on git-config pageGabriel “gabldotink”
Signed-off-by: Gabriel “gabldotink” <gabl@gabl.ink> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-17http: add support for HTTP 429 rate limit retriesVaidas Pilkauskas
Add retry logic for HTTP 429 (Too Many Requests) responses to handle server-side rate limiting gracefully. When Git's HTTP client receives a 429 response, it can now automatically retry the request after an appropriate delay, respecting the server's rate limits. The implementation supports the RFC-compliant Retry-After header in both delay-seconds (integer) and HTTP-date (RFC 2822) formats. If a past date is provided, Git retries immediately without waiting. Retry behavior is controlled by three new configuration options (http.maxRetries, http.retryAfter, and http.maxRetryTime) which are documented in git-config(1). The retry logic implements a fail-fast approach: if any delay (whether from server header or configuration) exceeds maxRetryTime, Git fails immediately with a clear error message rather than capping the delay. This provides better visibility into rate limiting issues. The implementation includes extensive test coverage for basic retry behavior, Retry-After header formats (integer and HTTP-date), configuration combinations, maxRetryTime limits, invalid header handling, environment variable overrides, and edge cases. Signed-off-by: Vaidas Pilkauskas <vaidas.pilkauskas@shopify.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16doc: note that -L supports patch formatting and pickaxe optionsMichael Montalbo
Now that -L output flows through the standard diff pipeline, document that patch formatting options like --word-diff, --color-moved, --no-prefix, whitespace handling (-w, -b), and pickaxe options (-S, -G) are supported. Signed-off-by: Michael Montalbo <mmontalbo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16refs: add 'preparing' phase to the reference-transaction hookEric Ju
The "reference-transaction" hook is invoked multiple times during a ref transaction. Each invocation corresponds to a different phase: - The "prepared" phase indicates that references have been locked. - The "committed" phase indicates that all updates have been written to disk. - The "aborted" phase indicates that the transaction has been aborted and that all changes have been rolled back. This hook can be used to learn about the updates that Git wants to perform. For example, forges use it to coordinate reference updates across multiple nodes. However, the phases are insufficient for some specific use cases. The earliest observable phase in the "reference-transaction" hook is "prepared", at which point Git has already taken exclusive locks on every affected reference. This makes it suitable for last-chance validation, but not for serialization. So by the time a hook sees the "prepared" phase, it has no way to defer locking, and thus it cannot rearrange multiple concurrent ref transactions relative to one another. Introduce a new "preparing" phase that runs before the "prepared" phase, that is before Git acquires any reference lock on disk. This gives callers a well-defined window to perform validation, enable higher-level ordering of concurrent transactions, or reject the transaction entirely, all without interfering with the locking state. This change is strictly speaking not backwards compatible. Existing hook scripts that do not know how to handle unknown phases may treat 'preparing' as an error and return non-zero. But the hook is considered to expose internal implementation details of how Git works, and as such we have been a bit more lenient with changing its exact semantics, like for example in a8ae923f85 (refs: support symrefs in 'reference-transaction' hook, 2024-05-07). An alternative would be to introduce a "reference-transaction-v2" hook that knows about the new phase. This feels like a rather heavy-weight option though, and was thus discarded. Helped-by: Patrick Steinhardt <ps@pks.im> Helped-by: Justin Tobler <jltobler@gmail.com> Helped-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Eric Ju <eric.peijian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16doc: config: convert trailers section to synopsis styleKristoffer Haugsbakk
Convert this part of the configuration documentation to synopsis style so that all of git-interpret-trailers(1) is consistent. See the commit message from two commits ago. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16doc: interpret-trailers: normalize and fill out optionsKristoffer Haugsbakk
Some negated options are missing according to `git interpret-trailers -h`. Also normalize to the “stuck form” (see gitcli(7)) like what was done in 806337c7 (doc: notes: use stuck form throughout, 2025-05-27).[1] Also normalize the order of the regular and negated options according to the current convention.[2] Also note that `--no-trailer` will reset the list. † 1: See also https://lore.kernel.org/git/6f7d027e-088a-4d66-92af-b8d1c32d730c@app.fastmail.com/ † 2: https://lore.kernel.org/git/xmqqcyct1mtq.fsf@gitster.g/ Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16doc: interpret-trailers: convert to synopsis styleKristoffer Haugsbakk
See e.g. 0ae23ab5 (doc: convert git worktree to synopsis style, 2025-10-05) for the markup rules for this style. There aren’t many subtleties to the transformation of this doc since it doesn’t use any advanced constructs. The only thing is that "`:`{nbsp}" is used instead of `': '` to refer to effective inline-verbatim with a space (␠).[1] I also use (_) for emphasis although (') gives the same result. Also prefer linking to Git commands instead of saying e.g. `git format-patch`. But for this command we can type out git-interpret- trailers(1) to avoid a self-reference. Also replace camel case `<keyAlias>` with kebab case `<key-alias>`. And while doing that make sure to replace `trailer.*` with `trailer.<key-alias>`. † 1: Similar to "`tag:`{nbsp}" in `Documentation/pretty-formats.adoc` Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16Merge branch 'mf/format-patch-cover-letter-format' into ↵Junio C Hamano
mf/format-patch-commit-list-format * mf/format-patch-cover-letter-format: docs: add usage for the cover-letter fmt feature format-patch: add commitListFormat config format-patch: add ability to use alt cover format format-patch: move cover letter summary generation pretty.c: add %(count) and %(total) placeholders
2026-03-16The 17th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16Merge branch 'os/doc-git-custom-commands'Junio C Hamano
Doc update. * os/doc-git-custom-commands: doc: make it easier to find custom command information
2026-03-16Merge branch 'jt/repo-structure-extrema'Junio C Hamano
"git repo structure" command learns to report maximum values on various aspects of objects it inspects. * jt/repo-structure-extrema: builtin/repo: find tree with most entries builtin/repo: find commit with most parents builtin/repo: add OID annotations to table output builtin/repo: collect largest inflated objects builtin/repo: add helper for printing keyvalue output builtin/repo: update stats for each object
2026-03-16doc: fix git grep args order in Quick ReferenceGuillaume Jacob
The example provided has its arguments in the wrong order. The revision should follow the pattern, and not the other way around. Signed-off-by: Guillaume Jacob <guillaume@absolut-sensing.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12fast-import: add mode to sign commits with invalid signaturesJustin Tobler
With git-fast-import(1), handling of signed commits is controlled via the `--signed-commits=<mode>` option. When an invalid signature is encountered, a user may want the option to sign the commit again as opposed to just stripping the signature. To facilitate this, introduce a "sign-if-invalid" mode for the `--signed-commits` option. Optionally, a key ID may be explicitly provided in the form `sign-if-invalid[=<keyid>]` to specify which signing key should be used when signing invalid commit signatures. Note that to properly support interoperability mode when signing commit signatures, the commit buffer must be created in both the repository and compatability object formats to generate the appropriate signatures accordingly. As currently implemented, the commit buffer for the compatability object format is not reconstructed and thus signing commits in interoperability mode is not yet supported. Support may be added in the future. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12The 16th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12Merge branch 'hn/status-compare-with-push'Junio C Hamano
"git status" learned to show comparison between the current branch and various other branches listed on status.compareBranches configuration. * hn/status-compare-with-push: status: clarify how status.compareBranches deduplicates status: add status.compareBranches config for multiple branch comparisons refactor format_branch_comparison in preparation
2026-03-12The 15th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12Merge branch 'dt/send-email-client-cert'Junio C Hamano
"git send-email" learns to support use of client-side certificates. * dt/send-email-client-cert: send-email: add client certificate options
2026-03-12Merge branch 'jt/doc-submitting-patches-study-before-sending'Junio C Hamano
Doc update for our contributors. * jt/doc-submitting-patches-study-before-sending: Documentation: extend guidance for submitting patches
2026-03-12Merge branch 'os/doc-custom-subcommand-on-path'Junio C Hamano
The way end-users can add their own "git <cmd>" subcommand by storing "git-<cmd>" in a directory on their $PATH has not been documented clearly, which has been corrected. * os/doc-custom-subcommand-on-path: doc: add information regarding external commands
2026-03-12Merge branch 'lp/doc-gitprotocol-pack-fixes'Junio C Hamano
Doc update. * lp/doc-gitprotocol-pack-fixes: doc: gitprotocol-pack: normalize italic formatting doc: gitprotocol-pack: improve paragraphs structure doc: gitprotocol-pack: fix pronoun-antecedent agreement
2026-03-12Merge branch 'bc/sha1-256-interop-02'Junio C Hamano
The code to maintain mapping between object names in multiple hash functions is being added, written in Rust. * bc/sha1-256-interop-02: object-file-convert: always make sure object ID algo is valid rust: add a small wrapper around the hashfile code rust: add a new binary object map format rust: add functionality to hash an object rust: add a build.rs script for tests rust: fix linking binaries with cargo hash: expose hash context functions to Rust write-or-die: add an fsync component for the object map csum-file: define hashwrite's count as a uint32_t rust: add additional helpers for ObjectID hash: add a function to look up hash algo structs rust: add a hash algorithm abstraction rust: add a ObjectID struct hash: use uint32_t for object_id algorithm conversion: don't crash when no destination algo repository: require Rust support for interoperability
2026-03-10The 14th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10Merge branch 'jh/alias-i18n-fixes'Junio C Hamano
Further update to the i18n alias support to avoid regressions. * jh/alias-i18n-fixes: doc: fix list continuation in alias.adoc git, help: fix memory leaks in alias listing alias: treat empty subsection [alias ""] as plain [alias] doc: fix list continuation in alias subsection example
2026-03-10Merge branch 'ar/config-hooks'Junio C Hamano
Allow hook commands to be defined (possibly centrally) in the configuration files, and run multiple of them for the same hook event. * ar/config-hooks: hook: add -z option to "git hook list" hook: allow out-of-repo 'git hook' invocations hook: allow event = "" to overwrite previous values hook: allow disabling config hooks hook: include hooks from the config hook: add "git hook list" command hook: run a list of hooks to prepare for multihook support hook: add internal state alloc/free callbacks
2026-03-10Merge branch 'kh/format-patch-noprefix-is-boolean'Junio C Hamano
The configuration variable format.noprefix did not behave as a proper boolean variable, which has now been fixed and documented. * kh/format-patch-noprefix-is-boolean: doc: diff-options.adoc: make *.noprefix split translatable doc: diff-options.adoc: show format.noprefix for format-patch format-patch: make format.noprefix a boolean
2026-03-10diff: document -U without <n> as using default contextTian Yuchen
The documentation for '-U<n>' implies that the numeric value '<n>' is mandatory. However, the command line parser has historically accepted '-U' without a number. Strictly requiring a number for '-U' would break existing tests (e.g., in 't4013') and likely disrupt user scripts relying on this undocumented behavior. Hence we retain this fallback behavior for backward compatibility, but document it as such. Signed-off-by: Tian Yuchen <cat@malon.dev> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-09SubmittingPatches: spell out "replace fully to pretend to be perfect"Junio C Hamano
It unfortunately is a recurring theme that new developers tend to pile more "fixup" patches on top of the already reviewed patches, making the topic longer and keeping the history of all wrong turns, which interests nobody in the larger picture. Even picking a narrow search in the list archive for "pretend to be a perfect " substring, we find these: https://lore.kernel.org/git/xmqqk29bsz2o.fsf@gitster.mtv.corp.google.com/ https://lore.kernel.org/git/xmqqd0ds5ysq.fsf@gitster-ct.c.googlers.com/ https://lore.kernel.org/git/xmqqr173faez.fsf@gitster.g/ The SubmittingPatches guide does talk about going incremental once a topic hits the 'next' branch, but it does not say much about how a new iteration of the topic should be prepared before that happens, and it does not mention that the developers are encouraged to seize the opportunity to pretend to be perfect with a full replacement set of patches. Add a new paragraph to stress this point in the section that describes the life-cycle of a patch series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-09The 13th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-09Merge branch 'cs/add-skip-submodule-ignore-all'Junio C Hamano
"git add <submodule>" has been taught to honor submodule.<name>.ignore that is set to "all" (and requires "git add -f" to override it). * cs/add-skip-submodule-ignore-all: Documentation: update add --force option + ignore=all config tests: fix existing tests when add an ignore=all submodule tests: t2206-add-submodule-ignored: ignore=all and add --force tests read-cache: submodule add need --force given ignore=all configuration read-cache: update add_files_to_cache take param ignored_too
2026-03-09Merge branch 'ar/config-hooks' into ar/config-hook-cleanupsJunio C Hamano
* ar/config-hooks: (21 commits) builtin/receive-pack: avoid spinning no-op sideband async threads hook: add -z option to "git hook list" hook: allow out-of-repo 'git hook' invocations hook: allow event = "" to overwrite previous values hook: allow disabling config hooks hook: include hooks from the config hook: add "git hook list" command hook: run a list of hooks to prepare for multihook support hook: add internal state alloc/free callbacks receive-pack: convert receive hooks to hook API receive-pack: convert update hooks to new API run-command: poll child input in addition to output hook: add jobs option reference-transaction: use hook API instead of run-command transport: convert pre-push to hook API hook: allow separate std[out|err] streams hook: convert 'post-rewrite' hook in sequencer.c to hook API hook: provide stdin via callback run-command: add stdin callback for parallelization run-command: add helper for pp child states ...
2026-03-07doc: make it easier to find custom command informationOmri Sarig
Git supports creating additional commands through aliases, and through placement of executables with a "git-" prefix in the PATH. This information was not easy enough to find - users will look for this information around the command description, but the documentation exists in other locations. Update the "GIT COMMANDS" section to reference the relevant sections, making it easier for to find this information. Signed-off-by: Omri Sarig <omri.sarig13@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-06docs: add usage for the cover-letter fmt featureMirko Faina
Document the new "--cover-letter-format" option in format-patch and its related configuration variable "format.commitListFormat". Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-06Documentation: extend guidance for submitting patchesJustin Tobler
Before submitting patches on the mailing list, it is often a good idea to check for previous related discussions or if similar work is already in progress. This enables better coordination amongst contributors and could avoid duplicating work. Additionally, it is often recommended to give reviewers some time to reply to a patch series before sending new versions. This helps collect broader feedback and reduces unnecessary churn from rapid rerolls. Document this guidance in "Documentation/SubmittingPatches" accordingly. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-06rebase: support --trailerLi Chen
Add a new --trailer=<trailer> option to git rebase to append trailer lines to each rewritten commit message (merge backend only). Because the apply backend does not provide a commit-message filter, reject --trailer when --apply is in effect and require the merge backend instead. This option implies --force-rebase so that fast-forwarded commits are also rewritten. Validate trailer arguments early to avoid starting an interactive rebase with invalid input. Add integration tests covering error paths and trailer insertion across non-interactive and interactive rebases. Signed-off-by: Li Chen <me@linux.beauty> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-05The 12th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-04The 11th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-04Merge branch 'ds/config-list-with-type'Junio C Hamano
"git config list" is taught to show the values interpreted for specific type with "--type=<X>" option. * ds/config-list-with-type: config: use an enum for type config: restructure format_config() config: format colors quietly color: add color_parse_quietly() config: format expiry dates quietly config: format paths gently config: format bools or strings in helper config: format bools or ints gently config: format bools gently config: format int64s gently config: make 'git config list --type=<X>' work config: add 'gently' parameter to format_config() config: move show_all_config()
2026-03-04Merge branch 'lo/repo-leftover-bits'Junio C Hamano
Clean-up the code around "git repo info" command. * lo/repo-leftover-bits: Documentation/git-repo: capitalize format descriptions Documentation/git-repo: replace 'NUL' with '_NUL_' t1901: adjust nul format output instead of expected value t1900: rename t1900-repo to t1900-repo-info repo: rename struct field to repo_info_field repo: replace get_value_fn_for_key by get_repo_info_field repo: rename repo_info_fields to repo_info_field CodingGuidelines: instruct to name arrays in singular
2026-03-04Merge branch 'ps/maintenance-geometric-default'Junio C Hamano
"git maintenance" starts using the "geometric" strategy by default. * ps/maintenance-geometric-default: builtin/maintenance: use "geometric" strategy by default t7900: prepare for switch of the default strategy t6500: explicitly use "gc" strategy t5510: explicitly use "gc" strategy t5400: explicitly use "gc" strategy t34xx: don't expire reflogs where it matters t: disable maintenance where we verify object database structure t: fix races caused by background maintenance
2026-03-04Merge branch 'kn/ref-location'Junio C Hamano
Allow the directory in which reference backends store their data to be specified. * kn/ref-location: refs: add GIT_REFERENCE_BACKEND to specify reference backend refs: allow reference location in refstorage config refs: receive and use the reference storage payload refs: move out stub modification to generic layer refs: extract out `refs_create_refdir_stubs()` setup: don't modify repo in `create_reference_database()`
2026-03-04status: clarify how status.compareBranches deduplicatesHarald Nordgren
The order of output when multiple branches are specified on the configuration variable was not clearly spelled out in the documentation. Add a paragraph to describe the order and also how the branches are deduplicated. Update t6040 with additional tests to illustrate how multiple branches are shown and deduplicated. Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com> [jc: made a whole replacement into incremental; wrote log message.] Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-04doc: add information regarding external commandsOmri Sarig
Git supports running external commands in the user's PATH as if they were built-in commands (see execv_dashed_external in git.c). This feature was not fully documented in Git's user-facing documentation. Add a short documentation to describe how PATH is used to find a custom subcommand. Signed-off-by: Omri Sarig <omri.sarig13@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-03builtin/history: implement "split" subcommandPatrick Steinhardt
It is quite a common use case that one wants to split up one commit into multiple commits by moving parts of the changes of the original commit out into a separate commit. This is quite an involved operation though: 1. Identify the commit in question that is to be dropped. 2. Perform an interactive rebase on top of that commit's parent. 3. Modify the instruction sheet to "edit" the commit that is to be split up. 4. Drop the commit via "git reset HEAD~". 5. Stage changes that should go into the first commit and commit it. 6. Stage changes that should go into the second commit and commit it. 7. Finalize the rebase. This is quite complex, and overall I would claim that most people who are not experts in Git would struggle with this flow. Introduce a new "split" subcommand for git-history(1) to make this way easier. All the user needs to do is to say `git history split $COMMIT`. From hereon, Git asks the user which parts of the commit shall be moved out into a separate commit and, once done, asks the user for the commit message. Git then creates that split-out commit and applies the original commit on top of it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>