diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 85cfedf5b0e0a4..205325eb33b064 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -460,8 +460,8 @@ jobs: if: needs.ci-config.outputs.enabled == 'yes' env: jobname: StaticAnalysis - CI_JOB_IMAGE: ubuntu-22.04 - runs-on: ubuntu-22.04 + CI_JOB_IMAGE: ubuntu-latest + runs-on: ubuntu-latest concurrency: group: static-analysis-${{ github.ref }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c4d04da9dcd4c..0242283c3c5571 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -227,7 +227,7 @@ test:fuzz-smoke-tests: - ./ci/run-build-and-minimal-fuzzers.sh static-analysis: - image: ubuntu:22.04 + image: ubuntu:latest stage: analyze needs: [ ] variables: diff --git a/.mailmap b/.mailmap index f8ede075ea172f..e3fab1df9dbfa8 100644 --- a/.mailmap +++ b/.mailmap @@ -39,12 +39,13 @@ Chris Shoemaker Chris Wright Christian Ludwig Cord Seele -Christian Couder +Christian Couder Christian Stimming Christopher Díaz Riveros Christopher Diaz Riveros Clemens Buchacher Clemens Buchacher Csaba Henk +D. Ben Knoble Dan Johnson Dana L. How Dana L. How Dana How @@ -65,6 +66,8 @@ Derrick Stolee Deskin Miller Đoàn Trần Công Danh Doan Tran Cong Danh Dirk Süsserott +Elijah Newren +Elijah Newren Emily Shaffer Eric Blake Eric Hanchrow diff --git a/Documentation/Makefile b/Documentation/Makefile index 2699f0b24af192..f8dea4b3953250 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -129,6 +129,7 @@ TECH_DOCS += technical/long-running-process-protocol TECH_DOCS += technical/multi-pack-index TECH_DOCS += technical/packfile-uri TECH_DOCS += technical/pack-heuristics +TECH_DOCS += technical/paint-down-to-common TECH_DOCS += technical/parallel-checkout TECH_DOCS += technical/partial-clone TECH_DOCS += technical/platform-support diff --git a/Documentation/RelNotes/2.56.0.adoc b/Documentation/RelNotes/2.56.0.adoc index 811f74bc7dbcb6..3cf754a0bdfa49 100644 --- a/Documentation/RelNotes/2.56.0.adoc +++ b/Documentation/RelNotes/2.56.0.adoc @@ -56,6 +56,81 @@ UI, Workflows & Features standardized to make them consistent with each other and with other commands. + * 'git log --graph' has been modified to visually distinguish parentless + 'root' commits (and commits that become roots due to history + simplification) by indenting them, preventing them from appearing + falsely related to unrelated commits rendered immediately above them. + + * Userdiff patterns for Swift have been added, with support for + Swift-specific constructs such as attributes, modifiers, failable + initializers, and generics. + + * Configuration file locking has been updated to retry for a short + period, avoiding failures when multiple processes attempt to update + the configuration simultaneously. + + * The 'remote-object-info' command has been added to 'git cat-file + --batch-command', allowing clients to request object metadata + (currently size) from a remote server via protocol v2 without + downloading the entire object. Format placeholders are dynamically + filtered on the client based on server-advertised capabilities, + returning empty strings for inapplicable or unsupported fields. + + * 'git branch -d' has been taught to report when a branch cannot be + deleted because it is being used in an active bisect run. + + * 'git mv' has been updated to check for a missing destination + leading directory during the checking phase, allowing 'git mv -n' + to report the failure. The error message when the rename(2) + syscall fails has also been improved to name both the source and + the destination. + + * 'git add' has been taught a new '--resolved' option to stage + conflict-resolved paths, while leaving unrelated local changes + unstaged. It scans the unmerged paths for leftover conflict + markers and aborts if any are found. + + * The known limitations of the ref format migration in 'git refs' have + been moved to be displayed as a warning admonition directly under the + description of the 'migrate' subcommand, improving visibility. A + reference to 'git-maintenance' has also been corrected to use the + 'linkgit' macro. + + * The 'git bisect' command has been taught a + '--reset-when-found[=]' option that tells the command to + automatically run 'git bisect reset' to jump back to the original + state or to the found culprit. + + * The 'git branch' command has been taught the '--delete-merged' option + to remove local branches that are already merged into their tracked + remote-tracking branches. + + * The 'remote-object-info' command for 'git cat-file --batch-command' + has been extended to support the '%(objecttype)' placeholder. + + * The usage string of 'git fast-import' has been updated to use the + parse_options() API for displaying help, and its SYNOPSIS in the + documentation has been standardized to match. + + * The error message given by 'git send-email' when a message file is + missing a 'Subject:' header has been clarified, and the error string + is now terminated with a newline so that Perl avoids appending its + internal source location data. + + * The '--shallow-file' option of 'git' command requires a value, but the + code did not check the presence of a value and instead segfaulted + without one, which has been corrected. + + * 'git repack' has been taught '--drop-filtered' to delete local + promisor blobs exceeding a limit (currently 'blob:limit=') in partial + clones, reclaiming space. Guards prevent running during other + operations or if referenced by the index. + + * The documentation for 'git format-rev' has been updated to use the + [synopsis] block definition on code blocks to properly highlight + placeholders, and a quoting inconsistency in the running text has + been fixed. + Performance, Internal Implementation, Development Support etc. -------------------------------------------------------------- @@ -206,6 +281,165 @@ Performance, Internal Implementation, Development Support etc. pathspec filtering, which was lost when the streaming walk was refactored. + * The ref subsystem and the worktree API have been refactored to pass a + repository pointer down the call chain, allowing them to drop + references to the global 'the_repository' variable. As part of this, + the handling of the 'core.packedRefsTimeout' configuration has been + moved into the per-repository ref store structure. + + * 'git branch --contains' and 'git for-each-ref --contains' have been + optimized to use the memoized commit traversal previously used only by + 'git tag --contains', significantly speeding up connectivity checks + across many candidate refs with shared history. + + * The passing of push destination specifications in the 'remote-curl' + helper has been simplified by removing the explicit 'count' parameter + and relying on the NULL-termination of the array. + + * The dependency on the global 'the_repository' variable in the + 'refspec.c' API has been removed by passing the hash algorithm + explicitly to refspec-parsing functions and storing it in 'struct + refspec'. + + * The enumeration of untracked and ignored files in 'git status' has + been optimized by avoiding quadratic complexity when inserting into + string lists, reducing the construction cost from O(n^2) to O(n log + n). + + * The copy_file() and copy_file_with_time() functions have been + refactored to take a repository parameter, allowing the removal of the + implicit dependency on the global 'the_repository' variable in + 'copy.c'. + + * The tempfile and lockfile APIs have been refactored to stop depending + on the 'the_repository' global variable, and their callers have been + updated to use the repository-aware variants. + + * The 'trust_executable_bit' (coming from the 'core.filemode' + configuration) has been migrated into 'struct repo_config_values' to + tie it to a specific repository instance. + + * The 'excludes_file' and various other global configuration variables + (including 'editor_program', 'pager_program', 'askpass_program', and + 'push_default') have been migrated into the per-repository structure. + + * The 'git stash push' command has been optimized to avoid unnecessary + sparse index expansion when pathspecs are wholly inside the + sparse-checkout cone. Also, a potential out-of-bounds read in the + sparse-index expansion check helper pathspec_needs_expanded_index() + has been fixed by consistently using the parsed, prefixed path. + + * The logic to write loose objects has been refactored and moved from + 'object-file.c' to the loose backend source file 'odb/source-loose.c', + making the loose backend more self-contained. This is achieved by + first refactoring force_object_loose() to use generic ODB write + interfaces instead of loose-backend internals. + + * Object database housekeeping in 'git gc' and 'git maintenance' has + been refactored to be pluggable. The files-backend-specific logic, + including incremental and geometric repacking as well as object + pruning, has been moved out of the command implementation and into the + files object database source, enabling future alternative object + database backends to implement their own housekeeping services. + + * The image version used by the static-analysis CI job has been bumped + to ubuntu-latest (Ubuntu 24.04), which brings in a newer Coccinelle + version that resolves a severe performance regression. A false + positive warning from the 'CHECK_ASSERTION_SIDE_EFFECTS' build with + GCC 15 in the Bloom filter code has also been silenced to facilitate + the image upgrade. + + * The alias tests in 't/t0014-alias.sh' have been updated to dynamically + query the list of deprecated commands using 'git + --list-cmds=deprecated' to avoid test failures when running with + 'WITH_BREAKING_CHANGES' in a build directory that contains stale + executables of formerly deprecated commands. + + * The code path that deals with relative paths in the diff-lib has + been cleaned up. + + * The get_commit_action() function has been refactored to be a pure + predicate by moving the side-effecting line-level log range folding to + simplify_commit(). This ensures that evaluating a commit's action + before the walk reaches it does not prematurely mutate its tracked + line ranges, making it safer for potential lookahead evaluations. + + * Synopsis and options in the documentation for 'git format-patch', + 'git imap-send', 'git send-email', and 'git request-pull' have been + updated to the modern style. + + * A new test helper commit_body() has been introduced to print the + message body of a commit, and various tests have been updated to use + it instead of spelling out the command pipeline manually and losing + the exit status of the 'git cat-file' command on the upstream of the + pipe. + + * Tests for 'git merge-base --is-ancestor' have been added to cover + exit codes (0 for success, 1 for non-ancestor, 128 for errors) and + to ensure it cannot be combined with '--all'. + + * The 'TRACE2_ANCESTRY' prerequisite in the 't0213' test script has been + refined to avoid failures under user-mode emulation by verifying that + the ancestry collector reports the expected process names rather than + the emulator binary name. + + * Concurrent downloads of packfiles via packfile URIs and dumb HTTP are + safer by avoiding concurrent appends to the staging file. Opening in + read-write mode with separate file offsets prevents corruption and + preserves resumability. 'fetch-pack' now tolerates pre-existing + '.keep' files. + + * The 'ssh-agent' tests in 't7528' have been fixed to work when the + user's login shell is csh-like, by explicitly passing '-s' to + 'ssh-agent' to force Bourne shell syntax. + + * A compatibility wrapper for writev(3p) has been reintroduced, + including fixes for CMake build and 'MAX_IO_SIZE' limits on NonStop. + Calls to write(3p) in send_sideband() and cat_blob() have been + refactored to use writev(3p) wrappers to reduce syscall overhead. + + * The creation of the on-disk data structures for the object database + has been made pluggable, allowing future backends to customize their + setup. As part of this, the initialization of the object database + has been deferred, and the loading of the loose-object map has been + detangled from repository initialization. + + * The 'struct odb_read_stream' and 'struct odb_write_stream' + structures have been consolidated into a single unified 'struct + odb_stream' structure, simplifying object database streaming APIs + and enabling streaming of arbitrary object types. + + * The sequencer has been updated to release the object database before + spawning 'git commit'. This prevents open file handles from + blocking auto-maintenance tasks, such as repacking, on systems like + Windows where open files cannot be easily unlinked. + + * The merge-base computation has been optimized by stopping the walk + early when one side's exclusive commits in the queue are exhausted, + yielding significant speedups for queries with one-sided histories. + + * A handful of code paths have been corrected to check return values + from functions like curl_easy_duphandle(), deflateInit(), lseek(), + dup(), and strbuf_getline_lf(), resolving several Coverity warnings + about unchecked returns. + + * The setting of a now-unused member '.pretty_given' in the sequencer + machinery has been removed. + + * The performance of adding numerous new packfiles has been improved + by introducing a fast path for known-new packfiles to skip an + unnecessary traversal in packfile_list_append(), avoiding a + quadratic complexity regression on load. + + * The unused name parameter in 'struct chdir_notify_entry' has been + removed from chdir_notify_register(), chdir_notify_unregister(), and + related callback signatures across several subsystems, simplifying the + API now that trace output no longer uses it. + + * A heap-use-after-free bug in the object name parsing code when + reporting failures with a relative path to a sparse directory has + been corrected. + Fixes since v2.55 ----------------- @@ -350,3 +584,120 @@ Fixes since v2.55 'git submodule update' command until it was broken in a modernization of the option-parsing code, has been restored. (merge ff1da37f58 dm/submodule-update-i-shorthand later to maint). + + * An accidental use of the '%zu' format specifier in 'git + submodule--helper' has been corrected to use 'PRIuMAX' and cast the + value to 'uintmax_t' to avoid portability issues. + (merge 3279c13c00 jc/submodule-helper-avoid-zu later to maint). + + * The rebase post-rewrite notes-copying logic has been corrected. When + a commit is dropped during rebase (e.g., because its changes are + already upstream), it is no longer recorded as rewritten, preventing + its notes from being copied to an unrelated commit. + (merge 42554b78fd pw/rebase-drop-notes-with-commit later to maint). + + * A few memory problems in the Rust interface to C hash functions have + been corrected. The 'Clone' implementation of 'CryptoHasher' now + properly initializes the context before cloning, and its 'Drop' + implementation now discards the context to prevent leaks. + + * The object ID shortening and linking in the 'commitdiff' view of + 'gitweb' has been corrected to work even when the index line carries + a trailing file mode. + (merge fda513d6fe tl/gitweb-shorten-hashes-with-modes later to maint). + + * When the push remote is specified as a URL, the fetch refspec of a + uniquely matching configured remote is now used to find and update + the remote-tracking branch (e.g., '@{push}'). + + * Traversals with '--exclude-first-parent-only' have been corrected + to properly stop after the first parent even when it has already + been marked as 'SEEN'. + (merge 47382f7398 jc/exclude-first-parent-seen later to maint). + + * A segfault when 'git clone --revision' talks to a server that does not + support protocol v2 (falling back to protocol v0) has been corrected. + (merge 1034ad383f af/clone-revision-v0-segfault-fix later to maint). + + * rewrites_release() in 'remote.c' has been updated to free 'struct + rewrite' instances, their '.instead_of' arrays, and their contents. + (merge dcef3bf041 jc/remote-insteadof-leakfix later to maint). + + * The remote-matching logic for submodules has been corrected to resolve + 'url.*.insteadOf' aliases before comparing the inventoried URL from + '.gitmodules' with the URLs of configured remotes. + + * 'git diff --relative' running with '--cached' has been corrected to + avoid a segfault when encountering unmerged paths outside the + prefix. + (merge 447126ed7d jk/diff-relative-cached-unmerged later to maint). + + * Two bugs in how 'git rebase' handles skipped 'fixup' and 'squash' + commands have been fixed. One bug caused an incorrect commit count to + be shown in the template message when multiple commands were skipped, + and another prevented the editor from opening when the final command + in a chain containing 'fixup -c' was skipped. + + * Git for Windows has been updated to avoid auto-detecting the symlink + type if the target path starts with a slash, preventing NTLM + credential leaks when checking out repositories with crafted + symbolic links pointing to network shares. + + * 'git cat-file --batch-command' that asked for 'contents' without + 'type' segfaults, which has been corrected. + (merge 2abc7f0304 jk/cat-file-batch-wo-type-fix later to maint). + + * A memory leak in 'git merge' when run without arguments (which + triggers the default-to-upstream path) has been fixed. A test has + been added to cover this case. + (merge 68cce04a02 tc/merge-default-to-upstream-leakfix later to maint). + + * A boundary case check in reachability bitmap traversal has been + corrected to properly handle the object at position zero, which was + previously skipped, leading to redundant bitmap loading. + (merge b56b48301e dl/pack-bitmap-position-zero later to maint). + + * A crash in the 'sparse-index' collapse code when encountering an + invalidated cache-tree node (due to an intent-to-add path) has been + fixed by avoiding collapsing such subtrees. + (merge eede1e69fe ds/sparse-index-ita-crash later to maint). + + * Documentation for 'git replay' has been updated to refer to its + configuration variables. + (merge 48c0549f5c kh/doc-replay-config later to maint). + + * Documentation for 'git interpret-trailers' has been updated to explain + the format of trailer keys (alphanumeric characters and hyphens), + replace outdated terminology, define key terms upfront, and document + how comment lines in the input are treated. + (merge 4515c86fd9 kh/doc-trailers later to maint). + + * The 'pack-objects' and delta-encoding code paths have been updated to + use 'size_t' instead of 'unsigned long' for object sizes and offset + limits, avoiding potential truncation issues on 64-bit Windows. + (merge d50ac11724 js/pack-objects-delta-size-t later to maint). + + * A client requesting the promisor-remote capability without a value + caused a null pointer dereference, which has been corrected by + rejecting a request without an argument. + (merge dd6b35ff71 en/serve-promisor-remote-fix later to maint). + + * Various tests in 't7900-maintenance.sh' have been updated to use a + throwaway repository, and auto-detaching of maintenance tasks is now + disabled for these tests to fix flaky races with concurrent background + maintenance jobs. + (merge 2775d8bcd1 ps/t7900-deflake-maintenance later to maint). + + * The help text for the '-l' option of 'git diff' has been updated. + (merge 764243bdf4 en/diff-l-opt-help later to maint). + + * 'git -C diff fi' did not complete 'file', which has + been corrected. + (merge 354d1bf3a0 jc/complete-diff-tracked-paths later to maint). + + * 'git -C checkout fi' did not complete 'file', which has + been corrected. + (merge 05e2ab1f31 jc/complete-checkout later to maint). + + * Other code cleanup, docfix, build fix, etc. + (merge 026636128f ss/submittingpatches-typofix later to maint). diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index c269e474e3f2bf..c60855f7069492 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches @@ -117,7 +117,7 @@ of review. can still continue to further improve them by adding more patches on top, but by the time a topic gets merged to 'next', it is expected that everybody agrees that the scope and the basic direction of the - topic are appropriate, so such an incremental updates are limited to + topic are appropriate, so such incremental updates are limited to small corrections and polishing. After a topic cooks for some time (like 7 calendar days) in 'next' without needing further tweaks on top, it gets merged to the 'master' branch and waits to become part diff --git a/Documentation/config.adoc b/Documentation/config.adoc index 1ef72de62f2ba6..f67dcd2f8e05dd 100644 --- a/Documentation/config.adoc +++ b/Documentation/config.adoc @@ -568,6 +568,8 @@ include::config/remotes.adoc[] include::config/repack.adoc[] +include::config/replay.adoc[] + include::config/rerere.adoc[] include::config/revert.adoc[] diff --git a/Documentation/config/branch.adoc b/Documentation/config/branch.adoc index a4db9fa5c87eab..c2acd89c9936cb 100644 --- a/Documentation/config/branch.adoc +++ b/Documentation/config/branch.adoc @@ -55,6 +55,7 @@ This option defaults to `never`. repository), you would want to set `remote.pushDefault` to specify the remote to push to for all branches, and use this option to override it for a specific branch. + The value may be the name of a configured remote or a repository URL. `branch..merge`:: Defines, together with `branch..remote`, the upstream branch @@ -102,3 +103,10 @@ for details). `git branch --edit-description`. Branch description is automatically added to the `format-patch` cover letter or `request-pull` summary. + +`branch..deleteMerged`:: + If set to `false`, branch __ is exempt from + `git branch --delete-merged`. Useful for a topic branch you + intend to develop further after an initial round has been + merged upstream. Defaults to true. Explicit deletion via + `git branch -d` is unaffected. diff --git a/Documentation/config/core.adoc b/Documentation/config/core.adoc index a0ebf03e2eb050..340329edc38143 100644 --- a/Documentation/config/core.adoc +++ b/Documentation/config/core.adoc @@ -589,6 +589,14 @@ core.packedRefsTimeout:: all; -1 means to try indefinitely. Default is 1000 (i.e., retry for 1 second). +core.configLockTimeout:: + The length of time, in milliseconds, to retry when trying to + lock a configuration file for writing. Value 0 means not to + retry at all; -1 means to try indefinitely. Default is 1000 + (i.e., retry for 1 second). This is read from the configuration + that is already on disk before the lock is taken, so it can be + set persistently like any other option. + core.pager:: Text viewer for use by Git commands (e.g., 'less'). The value is meant to be interpreted by the shell. The order of preference diff --git a/Documentation/config/imap.adoc b/Documentation/config/imap.adoc index cb8f5e2700ae13..6b97776bc3ab47 100644 --- a/Documentation/config/imap.adoc +++ b/Documentation/config/imap.adoc @@ -41,7 +41,7 @@ `imap.authMethod`:: Specify the authentication method for authenticating with the IMAP server. If Git was built with the NO_CURL option, or if your curl version is older - than 7.34.0, or if you're running git-imap-send with the `--no-curl` + than 7.34.0, or if you're running `git-imap-send` with the `--no-curl` option, the only supported methods are `PLAIN`, `CRAM-MD5`, `OAUTHBEARER` and `XOAUTH2`. If this is not set then `git imap-send` uses the basic IMAP plaintext `LOGIN` command. diff --git a/Documentation/config/log.adoc b/Documentation/config/log.adoc index 757a7be196ab38..f7dfce69b5f95e 100644 --- a/Documentation/config/log.adoc +++ b/Documentation/config/log.adoc @@ -59,6 +59,10 @@ This is the same as the `--decorate` option of the `git log`. A list of colors, separated by commas, that can be used to draw history lines in `git log --graph`. +`log.graphIndent`:: + If `true`, indent visual roots when rendering the graphs with `--graph`. + Set true by default. It can be overriden with `--[no-]graph-indent`. + `log.showRoot`:: If true, the initial commit will be shown as a big creation event. This is equivalent to a diff against an empty tree. diff --git a/Documentation/config/replay.adoc b/Documentation/config/replay.adoc index 7d549d2f0e5195..84e17e313a1f07 100644 --- a/Documentation/config/replay.adoc +++ b/Documentation/config/replay.adoc @@ -1,11 +1,18 @@ replay.refAction:: - Specifies the default mode for handling reference updates in - `git replay`. The value can be: + Specifies the default mode for handling reference updates. + The value can be: + -- - * `update`: Update refs directly using an atomic transaction (default behavior). - * `print`: Output update-ref commands for pipeline use. +//// +These use the first sentences from the description list in git-replay(1). +//// +`update`;; (default) Update refs directly using an atomic transaction. +`print`;; Output update-ref commands for pipeline use. -- + -This setting can be overridden with the `--ref-action` command-line option. -When not configured, `git replay` defaults to `update` mode. +ifdef::git-replay[] +See `--ref-action`. +endif::git-replay[] +ifndef::git-replay[] +See `--ref-action` in linkgit:git-replay[1] for details. +endif::git-replay[] diff --git a/Documentation/config/sendemail.adoc b/Documentation/config/sendemail.adoc index 1d700559b4a4c3..5499f91036b3ec 100644 --- a/Documentation/config/sendemail.adoc +++ b/Documentation/config/sendemail.adoc @@ -1,25 +1,25 @@ -sendemail.identity:: +`sendemail.identity`:: A configuration identity. When given, causes values in the `sendemail.` subsection to take precedence over values in the `sendemail` section. The default identity is the value of `sendemail.identity`. -sendemail.smtpEncryption:: +`sendemail.smtpEncryption`:: See linkgit:git-send-email[1] for description. Note that this setting is not subject to the `identity` mechanism. -sendemail.smtpSSLCertPath:: +`sendemail.smtpSSLCertPath`:: Path to ca-certificates (either a directory or a single file). Set it to an empty string to disable certificate verification. -sendemail.smtpSSLClientCert:: +`sendemail.smtpSSLClientCert`:: Path to the client certificate file to present if requested by the server. This is required when the server is set up to verify client certificates. If the corresponding private key is not included in the file, it must be supplied using `sendemail.smtpSSLClientKey` or the `--smtp-ssl-client-key` option. -sendemail.smtpSSLClientKey:: +`sendemail.smtpSSLClientKey`:: Path to the client private key file that corresponds to the client certificate. To avoid misconfiguration, this configuration must be used in conjunction with `sendemail.smtpSSLClientCert` or the @@ -28,45 +28,45 @@ sendemail.smtpSSLClientKey:: the certificate. Visit https://metacpan.org/pod/IO::Socket::SSL for more details. -sendemail..*:: - Identity-specific versions of the `sendemail.*` parameters +`sendemail..`:: + Identity-specific versions of the `sendemail.` parameters found below, taking precedence over those when this identity is selected, through either the command-line or `sendemail.identity`. -sendemail.multiEdit:: +`sendemail.multiEdit`:: If `true` (default), a single editor instance will be spawned to edit files you have to edit (patches when `--annotate` is used, and the summary when `--compose` is used). If `false`, files will be edited one after the other, spawning a new editor each time. -sendemail.confirm:: +`sendemail.confirm`:: Sets the default for whether to confirm before sending. Must be one of `always`, `never`, `cc`, `compose`, or `auto`. See `--confirm` in the linkgit:git-send-email[1] documentation for the meaning of these values. -sendemail.mailmap:: +`sendemail.mailmap`:: If `true`, makes linkgit:git-send-email[1] assume `--mailmap`, otherwise assume `--no-mailmap`. `False` by default. -sendemail.mailmap.file:: +`sendemail.mailmap.file`:: The location of a linkgit:git-send-email[1] specific augmenting mailmap file. The default mailmap and `mailmap.file` are loaded first. Thus, entries in this file take precedence over entries in the default mailmap locations. See linkgit:gitmailmap[5]. -sendemail.mailmap.blob:: +`sendemail.mailmap.blob`:: Like `sendemail.mailmap.file`, but consider the value as a reference to a blob in the repository. Entries in `sendemail.mailmap.file` take precedence over entries here. See linkgit:gitmailmap[5]. -sendemail.aliasesFile:: +`sendemail.aliasesFile`:: To avoid typing long email addresses, point this to one or more email aliases files. You must also supply `sendemail.aliasFileType`. -sendemail.aliasFileType:: - Format of the file(s) specified in sendemail.aliasesFile. Must be +`sendemail.aliasFileType`:: + Format of the file(s) specified in `sendemail.aliasesFile`. Must be one of `mutt`, `mailrc`, `pine`, `elm`, `gnus`, or `sendmail`. + What an alias file in each format looks like can be found in @@ -75,7 +75,7 @@ differences and limitations from the standard formats are described below: + -- -sendmail;; +`sendmail`;; * Quoted aliases and quoted addresses are not supported: lines that contain a `"` symbol are ignored. * Redirection to a file (`/path/name`) or pipe (`|command`) is not @@ -85,54 +85,54 @@ sendmail;; explicitly unsupported constructs, and any other lines that are not recognized by the parser. -- -sendemail.annotate:: -sendemail.bcc:: -sendemail.cc:: -sendemail.ccCmd:: -sendemail.chainReplyTo:: -sendemail.envelopeSender:: -sendemail.from:: -sendemail.headerCmd:: -sendemail.signedOffByCc:: -sendemail.smtpPass:: -sendemail.suppressCc:: -sendemail.suppressFrom:: -sendemail.to:: -sendemail.toCmd:: -sendemail.smtpDomain:: -sendemail.smtpServer:: -sendemail.smtpServerPort:: -sendemail.smtpServerOption:: -sendemail.smtpUser:: -sendemail.imapSentFolder:: -sendemail.useImapOnly:: -sendemail.thread:: -sendemail.transferEncoding:: -sendemail.validate:: -sendemail.xmailer:: +`sendemail.annotate`:: +`sendemail.bcc`:: +`sendemail.cc`:: +`sendemail.ccCmd`:: +`sendemail.chainReplyTo`:: +`sendemail.envelopeSender`:: +`sendemail.from`:: +`sendemail.headerCmd`:: +`sendemail.signedOffByCc`:: +`sendemail.smtpPass`:: +`sendemail.suppressCc`:: +`sendemail.suppressFrom`:: +`sendemail.to`:: +`sendemail.toCmd`:: +`sendemail.smtpDomain`:: +`sendemail.smtpServer`:: +`sendemail.smtpServerPort`:: +`sendemail.smtpServerOption`:: +`sendemail.smtpUser`:: +`sendemail.imapSentFolder`:: +`sendemail.useImapOnly`:: +`sendemail.thread`:: +`sendemail.transferEncoding`:: +`sendemail.validate`:: +`sendemail.xmailer`:: These configuration variables all provide a default for linkgit:git-send-email[1] command-line options. See its documentation for details. -sendemail.outlookidfix:: +`sendemail.outlookidfix`:: If `true`, makes linkgit:git-send-email[1] assume `--outlook-id-fix`, and if `false` assume `--no-outlook-id-fix`. If not specified, it will behave the same way as if `--outlook-id-fix` is not specified. -sendemail.signedOffCc (deprecated):: +`sendemail.signedOffCc` (deprecated):: Deprecated alias for `sendemail.signedOffByCc`. -sendemail.smtpBatchSize:: +`sendemail.smtpBatchSize`:: Number of messages to be sent per connection, after that a relogin will happen. If the value is `0` or undefined, send all messages in one connection. See also the `--batch-size` option of linkgit:git-send-email[1]. -sendemail.smtpReloginDelay:: +`sendemail.smtpReloginDelay`:: Seconds to wait before reconnecting to the smtp server. See also the `--relogin-delay` option of linkgit:git-send-email[1]. -sendemail.forbidSendmailVariables:: +`sendemail.forbidSendmailVariables`:: To avoid common misconfiguration mistakes, linkgit:git-send-email[1] will abort with a warning if any configuration options for `sendmail` exist. Set this variable to bypass the check. diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc index c8242e24627eef..e605d2867801d0 100644 --- a/Documentation/diff-options.adoc +++ b/Documentation/diff-options.adoc @@ -13,8 +13,8 @@ endif::git-diff[] endif::git-format-patch[] ifdef::git-format-patch[] --p:: ---no-stat:: +`-p`:: +`--no-stat`:: Generate plain patches without any diffstats. endif::git-format-patch[] @@ -893,8 +893,8 @@ endif::git-format-patch[] reverted with `--ita-visible-in-index`. Both options are experimental and could be removed in future. ---max-depth=:: - For each pathspec given on command line, descend at most `` +`--max-depth=`:: + For each pathspec given on command line, descend at most __ levels of directories. A value of `-1` means no limit. Cannot be combined with wildcards in the pathspec. Given a tree containing `foo/bar/baz`, the following list shows the diff --git a/Documentation/git-add.adoc b/Documentation/git-add.adoc index 941135dc637d90..16b06e38e185d1 100644 --- a/Documentation/git-add.adoc +++ b/Documentation/git-add.adoc @@ -11,7 +11,7 @@ SYNOPSIS git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] [--edit | -e] [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]] [--sparse] [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize] - [--chmod=(+|-)x] [--pathspec-from-file= [--pathspec-file-nul]] + [--resolved] [--chmod=(+|-)x] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...] DESCRIPTION @@ -195,6 +195,14 @@ for `git add --no-all ...`, i.e. ignored removed files. while a _CRLF_ cleans to _LF_, a _CRCRLF_ sequence is only partially cleaned to _CRLF_. +`--resolved`:: + Update the index for unmerged paths matching __ where + no conflict markers remain in the working tree. Unmerged paths + without conflict markers (including binary files and file + deletions) are staged as resolved, while any path with leftover + conflict markers causes the command to refuse to stage any files. + Cannot be combined with `-u` or `-A`. + `--chmod=(+|-)x`:: Override the executable bit of the added files. The executable bit is only changed in the index, the files on disk are left diff --git a/Documentation/git-bisect.adoc b/Documentation/git-bisect.adoc index d2115b29905f41..aabddd42ca4d31 100644 --- a/Documentation/git-bisect.adoc +++ b/Documentation/git-bisect.adoc @@ -10,7 +10,7 @@ SYNOPSIS -------- [synopsis] git bisect start [--term-(bad|new)= --term-(good|old)=] - [--no-checkout] [--first-parent] [ [...]] [--] [...] + [--no-checkout] [--first-parent] [--reset-when-found[=]] [ [...]] [--] [...] git bisect (bad|new|) [] git bisect (good|old|) [...] git bisect terms [--term-(good|old) | --term-(bad|new)] @@ -20,7 +20,7 @@ git bisect reset [] git bisect (visualize|view) git bisect replay git bisect log -git bisect run [...] +git bisect run [--reset-when-found[=]] [...] git bisect help DESCRIPTION @@ -385,6 +385,16 @@ ignored. This option is particularly useful in avoiding false positives when a merged branch contained broken or non-buildable commits, but the merge itself was OK. +`--reset-when-found[=]`:: + Once the first bad commit is found, report it and clean up the + bisection state. `` may be `original` to return to the commit + checked out before `git bisect start`, or `found` to leave the first + bad commit checked out. If `` is omitted, it defaults to + `original`. ++ +This option may be given to `git bisect start` or to `git bisect run`. It +cannot be used for a bisection started with `--no-checkout`. + EXAMPLES -------- diff --git a/Documentation/git-branch.adoc b/Documentation/git-branch.adoc index c0afddc424d610..bfdf4593298631 100644 --- a/Documentation/git-branch.adoc +++ b/Documentation/git-branch.adoc @@ -13,6 +13,7 @@ git branch [--color[=] | --no-color] [--show-current] [--column[=] | --no-column] [--sort=] [--merged []] [--no-merged []] [--contains []] [--no-contains []] + [(--forked )...] [--points-at ] [--format=] [(-r|--remotes) | (-a|--all)] [--list] [...] @@ -24,6 +25,7 @@ git branch (-m|-M) [] git branch (-c|-C) [] git branch (-d|-D) [-r] ... git branch --edit-description [] +git branch [--dry-run] (--delete-merged )... [...] DESCRIPTION ----------- @@ -51,7 +53,8 @@ merged into the named commit (i.e. the branches whose tip commits are reachable from the named commit) will be listed. With `--no-merged` only branches not merged into the named commit will be listed. If the __ argument is missing it defaults to `HEAD` (i.e. the tip of the current -branch). +branch). With `--forked`, only branches whose configured upstream matches +the given branch or pattern will be listed. The command's second form creates a new branch head named __ which points to the current `HEAD`, or __ if given. As a @@ -199,6 +202,45 @@ This option is only applicable in non-verbose mode. Print the name of the current branch. In detached `HEAD` state, nothing is printed. +`--delete-merged `:: + Delete local branches whose configured upstream matches + __, but only when their tip is reachable from that + upstream. In other words, the work on the branch has already + landed on the upstream it tracks, so the local copy is no longer + needed. __ may name a ref, a remote (using the branch its + `HEAD` points at), or a shell-style glob. The option can be + repeated to widen the upstream match. + Optional __ arguments limit which local branches + are considered, e.g. `git branch --delete-merged 'origin/*' + 'topic-*'`. ++ +A branch is not deleted when: ++ +-- +* its configured upstream ref no longer exists, +* it is checked out in any worktree, +* pushing it to the remote configured by + `branch..remote` would update its upstream, so it cannot be + distinguished from a branch that just looks fully merged right + after a pull; this is determined by the remote's configured push and + fetch refspecs, +* it is the local upstream of a branch that is not being deleted, or +* `branch..deleteMerged` is set to `false`. +-- ++ +When such a local upstream branch has its own upstream deleted by the +same operation, its upstream configuration is cleared. ++ +A branch whose work has not yet been merged into its upstream is +silently skipped. Delete it with `git branch -D` if you want to +remove it anyway. + +`--dry-run`:: + With `--delete-merged`, print which branches would be + deleted and exit without touching any ref. Useful for + sanity-checking a wide pattern like `'origin/*'` before + committing to the deletion. + `-v`:: `-vv`:: `--verbose`:: @@ -311,6 +353,14 @@ superproject's "origin/main", but tracks the submodule's "origin/main". Only list branches whose tips are not reachable from __ (`HEAD` if not specified). Implies `--list`. +`--forked `:: + Only list branches whose configured upstream matches + __. The argument can be a ref (e.g. `origin/main`, + `master`), a remote name like `origin` for the branch its + `origin/HEAD` points at, or a shell-style glob (e.g. + `'origin/*'`). The option can be repeated to widen the + filter. Implies `--list`. + `--points-at `:: Only list branches of __. diff --git a/Documentation/git-cat-file.adoc b/Documentation/git-cat-file.adoc index 86b9181599317e..514bfc00328caf 100644 --- a/Documentation/git-cat-file.adoc +++ b/Documentation/git-cat-file.adoc @@ -169,6 +169,13 @@ info :: Print object info for object reference ``. This corresponds to the output of `--batch-check`. +remote-object-info ...:: + Print object info for object references `` at specified + `` without downloading objects from the remote. + Raise an error when the `object-info` capability is not supported by the remote. + Raise an error when no object references are provided. + This command may be combined with `--buffer`. + flush:: Used with `--buffer` to execute all preceding commands that were issued since the beginning or since the last flush was issued. When `--buffer` @@ -301,7 +308,8 @@ one per line, and print information based on the command given. With `--batch-command`, the `info` command followed by an object will print information about the object the same way `--batch-check` would, and the `contents` command followed by an object prints contents in the same way -`--batch` would. +`--batch` would. The `remote-object-info` command followed by a remote and +object IDs prints object info from the remote without downloading the objects. You can specify the information shown for each object by using a custom ``. The `` is copied literally to stdout for each @@ -340,6 +348,10 @@ newline. The available atoms are: after that first run of whitespace (i.e., the "rest" of the line) are output in place of the `%(rest)` atom. +The command `remote-object-info` only supports the `%(objectname)`, +`%(objectsize)` and `%(objecttype)` placeholders. See `CAVEATS` below for more +information. + If no format is specified, the default format is `%(objectname) %(objecttype) %(objectsize)`. @@ -438,6 +450,10 @@ scripting purposes. CAVEATS ------- +Note that only `%(objectname)`, `%(objectsize)` and `%(objecttype)` are +currently supported by the `remote-object-info` command. Using any other +placeholder in the format string will return an empty string in its position. + Note that the sizes of objects on disk are reported accurately, but care should be taken in drawing conclusions about which refs or objects are responsible for disk usage. The size of a packed non-delta object may be diff --git a/Documentation/git-fast-import.adoc b/Documentation/git-fast-import.adoc index d68bc52b7e9cd7..fd165e11d2d259 100644 --- a/Documentation/git-fast-import.adoc +++ b/Documentation/git-fast-import.adoc @@ -9,7 +9,7 @@ git-fast-import - Backend for fast Git data importers SYNOPSIS -------- [verse] -frontend | 'git fast-import' [] +'git fast-import' [] DESCRIPTION ----------- @@ -65,6 +65,13 @@ Only enable this option if you trust the program generating the fast-import stream! This option is enabled automatically for remote-helpers that use the `import` capability, as they are already trusted to run their own code. ++ +Note that this option has to be spelled in full, and has to appear +before any option whose value is separated from it by a space, for +the unsafe `feature` commands in the stream to be allowed. So +`--allow-unsafe` or `--depth 5 --allow-unsafe-features` still refuse +them, while `--allow-unsafe-features --depth 5` and +`--depth=5 --allow-unsafe-features` allow them. `--signed-tags=`:: Specify how to handle signed tags. Behaves in the same way as diff --git a/Documentation/git-format-patch.adoc b/Documentation/git-format-patch.adoc index f7905c0f7c0322..191f64b77d1758 100644 --- a/Documentation/git-format-patch.adoc +++ b/Documentation/git-format-patch.adoc @@ -8,8 +8,8 @@ git-format-patch - Prepare patches for e-mail submission SYNOPSIS -------- -[verse] -'git format-patch' [-k] [(-o|--output-directory) | --stdout] +[synopsis] +git format-patch [-k] [(-o|--output-directory) | --stdout] [--no-thread | --thread[=