diff --git a/Documentation/RelNotes/2.51.1.adoc b/Documentation/RelNotes/2.51.1.adoc new file mode 100644 index 00000000000000..6a6049810dce73 --- /dev/null +++ b/Documentation/RelNotes/2.51.1.adoc @@ -0,0 +1,46 @@ +Git 2.51.1 Release Notes +======================== + +There shouldn't be anything exciting to see here. This is primarily +to flush the "do you still use it?" improvements that has landed on +the master front, together with a handful of low-hanging low-impact +fixes that should be safe. + + +Fixes since Git 2.51.0 +---------------------- + + * The "do you still use it?" message given by a command that is + deeply deprecated and allow us to suggest alternatives has been + updated. + + * 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. + + * Manual page for "gitk" is updated with the current maintainer's + name. + + * 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`. + + * Clang-format update to let our control macros formatted the way we + had them traditionally, e.g., "for_each_string_list_item()" without + space before the parentheses. + + * A few places where an size_t value was cast to curl_off_t without + checking has been updated to use the existing helper function. + + * 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. + + * Makefile tried to run multiple "cargo build" which would not work + very well; serialize their execution to work it around. + + * Adjust to the way newer versions of cURL selectivel enables tracing + options, so that our tests can continue to work. + +Also contains various documentation updates, code clean-ups and minor fixups. diff --git a/Documentation/RelNotes/2.52.0.adoc b/Documentation/RelNotes/2.52.0.adoc index d7ed65f627e315..67b0ac7c45958f 100644 --- a/Documentation/RelNotes/2.52.0.adoc +++ b/Documentation/RelNotes/2.52.0.adoc @@ -47,6 +47,14 @@ UI, Workflows & Features * "git fast-import" learned that "--signed-commits=" option that corresponds to that of "git fast-export". + * Marking a hunk 'selected' in "git add -p" and then splitting made + all the split pieces 'selected'; this has been changed to make them + all 'undecided', which gives better end-user experience. + + * Configuration variables that take a pathname as a value + (e.g. blame.ignorerevsfile) can be marked as optional by prefixing + ":(optoinal)" before its value. + Performance, Internal Implementation, Development Support etc. -------------------------------------------------------------- @@ -116,6 +124,9 @@ Performance, Internal Implementation, Development Support etc. * Dip our toes a bit to (optionally) use Rust implemented helper called from our C code. + * Documentation for "git log --pretty" options has been updated + to make it easier to translate. + Fixes since v2.51 ----------------- @@ -298,6 +309,26 @@ including security updates, are included in this release. * Handling of an empty subdirectory of .git/refs/ in the ref-files backend has been corrected. + * Our CI script requires "sudo" that can be told to preserve + environment, but Ubuntu replaced with "sudo" with an implementation + that lacks the feature. Work this around by reinstalling the + original version. + (merge fddb484255 ps/ci-avoid-broken-sudo-on-ubuntu later to maint). + + * The reftable backend learned to sanity check its on-disk data more + carefully. + (merge 466a3a1afd kn/reftable-consistency-checks later to maint). + + * A lot of code clean-up of xdiff. + Split out of a larger topic. + (merge 8b9c5d2e3a en/xdiff-cleanup later to maint). + + * "git format-patch --range-diff=... --notes=..." did not drive the + underlying range-diff with correct --notes parameter, ending up + comparing with different set of notes from its main patch output + you would get from "git format-patch --notes=..." for a singleton + patch. + * Other code cleanup, docfix, build fix, etc. (merge 823d537fa7 kh/doc-git-log-markup-fix later to maint). (merge cf7efa4f33 rj/t6137-cygwin-fix later to maint). @@ -326,3 +357,5 @@ including security updates, are included in this release. (merge e1d062e8ba ps/odb-clean-stale-wrappers later to maint). (merge fdd21ba116 mh/doc-credential-url-prefix later to maint). (merge 1c573a3451 en/doc-merge-tree-describe-merge-base later to maint). + (merge 84a6bf7965 ja/doc-markup-attached-paragraph-fix later to maint). + (merge 399694384b kh/doc-patch-id-markup-fix later to maint). diff --git a/Documentation/config.adoc b/Documentation/config.adoc index 05f1ca7293f717..62eebe7c54501c 100644 --- a/Documentation/config.adoc +++ b/Documentation/config.adoc @@ -357,7 +357,9 @@ compiled without runtime prefix support, the compiled-in prefix will be substituted instead. In the unlikely event that a literal path needs to be specified that should _not_ be expanded, it needs to be prefixed by `./`, like so: `./%(prefix)/bin`. - ++ +If prefixed with `:(optional)`, the configuration variable is treated +as if it does not exist, if the named path does not exist. Variables ~~~~~~~~~ diff --git a/Documentation/config/extensions.adoc b/Documentation/config/extensions.adoc index 829f2523fcbca4..532456644b770e 100644 --- a/Documentation/config/extensions.adoc +++ b/Documentation/config/extensions.adoc @@ -3,8 +3,7 @@ extensions.*:: `core.repositoryFormatVersion` is not `1`. See linkgit:gitrepository-layout[5]. + --- -compatObjectFormat:: +compatObjectFormat::: Specify a compatibility hash algorithm to use. The acceptable values are `sha1` and `sha256`. The value specified must be different from the value of `extensions.objectFormat`. This allows client level @@ -19,18 +18,18 @@ Note that the functionality enabled by this extension is incomplete and subject to change. It currently exists only to allow development and testing of the underlying feature and is not designed to be enabled by end users. -noop:: +noop::: This extension does not change git's behavior at all. It is useful only for testing format-1 compatibility. + For historical reasons, this extension is respected regardless of the `core.repositoryFormatVersion` setting. -noop-v1:: +noop-v1::: This extension does not change git's behavior at all. It is useful only for testing format-1 compatibility. -objectFormat:: +objectFormat::: Specify the hash algorithm to use. The acceptable values are `sha1` and `sha256`. If not specified, `sha1` is assumed. + @@ -38,7 +37,7 @@ Note that this setting should only be set by linkgit:git-init[1] or linkgit:git-clone[1]. Trying to change it after initialization will not work and will produce hard-to-diagnose issues. -partialClone:: +partialClone::: When enabled, indicates that the repo was created with a partial clone (or later performed a partial fetch) and that the remote may have omitted sending certain unwanted objects. Such a remote is called a @@ -50,30 +49,31 @@ The value of this key is the name of the promisor remote. For historical reasons, this extension is respected regardless of the `core.repositoryFormatVersion` setting. -preciousObjects:: +preciousObjects::: If enabled, indicates that objects in the repository MUST NOT be deleted (e.g., by `git-prune` or `git repack -d`). + For historical reasons, this extension is respected regardless of the `core.repositoryFormatVersion` setting. -refStorage:: +refStorage::: Specify the ref storage format to use. The acceptable values are: + +-- include::../ref-storage-format.adoc[] - +-- + Note that this setting should only be set by linkgit:git-init[1] or linkgit:git-clone[1]. Trying to change it after initialization will not work and will produce hard-to-diagnose issues. -relativeWorktrees:: +relativeWorktrees::: If enabled, indicates at least one worktree has been linked with relative paths. Automatically set if a worktree has been created or repaired with either the `--relative-paths` option or with the `worktree.useRelativePaths` config set to `true`. -worktreeConfig:: +worktreeConfig::: If enabled, then worktrees will load config settings from the `$GIT_DIR/config.worktree` file in addition to the `$GIT_COMMON_DIR/config` file. Note that `$GIT_COMMON_DIR` and @@ -87,11 +87,12 @@ When enabling this extension, you must be careful to move certain values from the common config file to the main working tree's `config.worktree` file, if present: + +-- * `core.worktree` must be moved from `$GIT_COMMON_DIR/config` to `$GIT_COMMON_DIR/config.worktree`. * If `core.bare` is true, then it must be moved from `$GIT_COMMON_DIR/config` to `$GIT_COMMON_DIR/config.worktree`. - +-- + It may also be beneficial to adjust the locations of `core.sparseCheckout` and `core.sparseCheckoutCone` depending on your desire for customizable @@ -104,4 +105,3 @@ details. + For historical reasons, this extension is respected regardless of the `core.repositoryFormatVersion` setting. --- diff --git a/Documentation/config/stash.adoc b/Documentation/config/stash.adoc index e556105a15bd46..7fc32027f70cd4 100644 --- a/Documentation/config/stash.adoc +++ b/Documentation/config/stash.adoc @@ -1,19 +1,28 @@ -stash.index:: +ifndef::git-stash[] +:see-show: See the description of the 'show' command in linkgit:git-stash[1]. +endif::git-stash[] + +ifdef::git-stash[] +:see-show: +endif::git-stash[] + +`stash.index`:: If this is set to true, `git stash apply` and `git stash pop` will - behave as if `--index` was supplied. Defaults to false. See the - descriptions in linkgit:git-stash[1]. + behave as if `--index` was supplied. Defaults to false. +ifndef::git-stash[] +See the descriptions in linkgit:git-stash[1]. +endif::git-stash[] -stash.showIncludeUntracked:: +`stash.showIncludeUntracked`:: If this is set to true, the `git stash show` command will show - the untracked files of a stash entry. Defaults to false. See - the description of the 'show' command in linkgit:git-stash[1]. + the untracked files of a stash entry. Defaults to false. {see-show} -stash.showPatch:: +`stash.showPatch`:: If this is set to true, the `git stash show` command without an option will show the stash entry in patch form. Defaults to false. - See the description of the 'show' command in linkgit:git-stash[1]. + {see-show} -stash.showStat:: +`stash.showStat`:: If this is set to true, the `git stash show` command without an option will show a diffstat of the stash entry. Defaults to true. - See the description of the 'show' command in linkgit:git-stash[1]. + {see-show} diff --git a/Documentation/config/tag.adoc b/Documentation/config/tag.adoc index 5062a057ffc6f5..d878da98d40b74 100644 --- a/Documentation/config/tag.adoc +++ b/Documentation/config/tag.adoc @@ -1,17 +1,23 @@ -tag.forceSignAnnotated:: +`tag.forceSignAnnotated`:: A boolean to specify whether annotated tags created should be GPG signed. If `--annotate` is specified on the command line, it takes precedence over this option. -tag.sort:: - This variable controls the sort ordering of tags when displayed by - linkgit:git-tag[1]. Without the "--sort=" option provided, the - value of this variable will be used as the default. +`tag.sort`:: +ifdef::git-tag[] +This variable controls the sort ordering of tags when displayed by `git-tag`. +endif::git-tag[] +ifndef::git-tag[] +This variable controls the sort ordering of tags when displayed by +linkgit:git-tag[1]. +endif::git-tag[] +Without the `--sort=` option provided, the value of this variable will +be used as the default. -tag.gpgSign:: +`tag.gpgSign`:: A boolean to specify whether all tags should be GPG signed. Use of this option when running in an automated script can result in a large number of tags being signed. It is therefore - convenient to use an agent to avoid typing your gpg passphrase + convenient to use an agent to avoid typing your GPG passphrase several times. Note that this option doesn't affect tag signing - behavior enabled by "-u " or "--local-user=" options. + behavior enabled by `-u ` or `--local-user=` options. diff --git a/Documentation/config/worktree.adoc b/Documentation/config/worktree.adoc index 9e3f84f748c4aa..a248076ea50bd5 100644 --- a/Documentation/config/worktree.adoc +++ b/Documentation/config/worktree.adoc @@ -1,4 +1,4 @@ -worktree.guessRemote:: +`worktree.guessRemote`:: If no branch is specified and neither `-b` nor `-B` nor `--detach` is used, then `git worktree add` defaults to creating a new branch from HEAD. If `worktree.guessRemote` is @@ -6,14 +6,14 @@ worktree.guessRemote:: branch whose name uniquely matches the new branch name. If such a branch exists, it is checked out and set as "upstream" for the new branch. If no such match can be found, it falls - back to creating a new branch from the current HEAD. + back to creating a new branch from the current `HEAD`. -worktree.useRelativePaths:: - Link worktrees using relative paths (when "true") or absolute - paths (when "false"). This is particularly useful for setups +`worktree.useRelativePaths`:: + Link worktrees using relative paths (when "`true`") or absolute + paths (when "`false`"). This is particularly useful for setups where the repository and worktrees may be moved between - different locations or environments. Defaults to "false". + different locations or environments. Defaults to "`false`". + -Note that setting `worktree.useRelativePaths` to "true" implies enabling the +Note that setting `worktree.useRelativePaths` to "`true`" implies enabling the `extensions.relativeWorktrees` config (see linkgit:git-config[1]), thus making it incompatible with older versions of Git. diff --git a/Documentation/fsck-msgids.adoc b/Documentation/fsck-msgids.adoc index 0ba4f9a27e4c73..81f11ba125a22a 100644 --- a/Documentation/fsck-msgids.adoc +++ b/Documentation/fsck-msgids.adoc @@ -38,6 +38,9 @@ `badReferentName`:: (ERROR) The referent name of a symref is invalid. +`badReftableTableName`:: + (WARN) A reftable table has an invalid name. + `badTagName`:: (INFO) A tag has an invalid format. @@ -104,9 +107,6 @@ `gitmodulesParse`:: (INFO) Could not parse `.gitmodules` blob. -`gitmodulesLarge`; - (ERROR) `.gitmodules` blob is too large to parse. - `gitmodulesPath`:: (ERROR) `.gitmodules` path is invalid. diff --git a/Documentation/git-patch-id.adoc b/Documentation/git-patch-id.adoc index 1d15fa45d5126f..45da0f27acde47 100644 --- a/Documentation/git-patch-id.adoc +++ b/Documentation/git-patch-id.adoc @@ -33,27 +33,30 @@ OPTIONS --verbatim:: Calculate the patch-id of the input as it is given, do not strip any whitespace. - - This is the default if patchid.verbatim is true. ++ +This is the default if patchid.verbatim is true. --stable:: Use a "stable" sum of hashes as the patch ID. With this option: - - Reordering file diffs that make up a patch does not affect the ID. - In particular, two patches produced by comparing the same two trees - with two different settings for "-O" result in the same - patch ID signature, thereby allowing the computed result to be used - as a key to index some meta-information about the change between - the two trees; - - - Result is different from the value produced by git 1.9 and older - or produced when an "unstable" hash (see --unstable below) is - configured - even when used on a diff output taken without any use - of "-O", thereby making existing databases storing such - "unstable" or historical patch-ids unusable. - - - All whitespace within the patch is ignored and does not affect the id. - - This is the default if patchid.stable is set to true. ++ +-- +- Reordering file diffs that make up a patch does not affect the ID. + In particular, two patches produced by comparing the same two trees + with two different settings for "-O" result in the same + patch ID signature, thereby allowing the computed result to be used + as a key to index some meta-information about the change between + the two trees; + +- Result is different from the value produced by git 1.9 and older + or produced when an "unstable" hash (see --unstable below) is + configured - even when used on a diff output taken without any use + of "-O", thereby making existing databases storing such + "unstable" or historical patch-ids unusable. + +- All whitespace within the patch is ignored and does not affect the id. +-- ++ +This is the default if patchid.stable is set to true. --unstable:: Use an "unstable" hash as the patch ID. With this option, @@ -61,8 +64,8 @@ OPTIONS by git 1.9 and older and whitespace is ignored. Users with pre-existing databases storing patch-ids produced by git 1.9 and older (who do not deal with reordered patches) may want to use this option. - - This is the default. ++ +This is the default. GIT --- diff --git a/Documentation/git-push.adoc b/Documentation/git-push.adoc index cc5cadcdfc0d02..864b0d0467579e 100644 --- a/Documentation/git-push.adoc +++ b/Documentation/git-push.adoc @@ -19,30 +19,35 @@ SYNOPSIS DESCRIPTION ----------- -Updates remote refs using local refs, while sending objects -necessary to complete the given refs. +Updates one or more branches, tags, or other references in a remote +repository from your local repository, and sends all necessary data +that isn't already on the remote. -You can make interesting things happen to a repository -every time you push into it, by setting up 'hooks' there. See -documentation for linkgit:git-receive-pack[1]. +The simplest way to push is `git push `. +`git push origin main` will push the local `main` branch to the `main` +branch on the remote named `origin`. + +The `` argument defaults to the upstream for the current branch, +or `origin` if there's no configured upstream. -When the command line does not specify where to push with the -`` argument, `branch.*.remote` configuration for the -current branch is consulted to determine where to push. If the -configuration is missing, it defaults to 'origin'. +To decide which branches, tags, or other refs to push, Git uses +(in order of precedence): -When the command line does not specify what to push with `...` -arguments or `--all`, `--mirror`, `--tags` options, the command finds -the default `` by consulting `remote.*.push` configuration, -and if it is not found, honors `push.default` configuration to decide -what to push (See linkgit:git-config[1] for the meaning of `push.default`). +1. The `` argument(s) (for example `main` in `git push origin main`) + or the `--all`, `--mirror`, or `--tags` options +2. The `remote.*.push` configuration for the repository being pushed to +3. The `push.default` configuration. The default is `push.default=simple`, + which will push to a branch with the same name as the current branch. + See the <> section below for more on `push.default`. -When neither the command-line nor the configuration specifies what to -push, the default behavior is used, which corresponds to the `simple` -value for `push.default`: the current branch is pushed to the -corresponding upstream branch, but as a safety measure, the push is -aborted if the upstream branch does not have the same name as the -local one. +`git push` may fail if you haven't set an upstream for the current branch, +depending on what `push.default` is set to. +See the <> section below for more +on how to set and use upstreams. + +You can make interesting things happen to a repository +every time you push into it, by setting up 'hooks' there. See +documentation for linkgit:git-receive-pack[1]. OPTIONS[[OPTIONS]] @@ -710,6 +715,7 @@ a `git gc` command on the origin repository. include::transfer-data-leaks.adoc[] +[[CONFIGURATION]] CONFIGURATION ------------- diff --git a/Documentation/git-stash.adoc b/Documentation/git-stash.adoc index e2300a19a2c0a3..235d57ddd8f5d1 100644 --- a/Documentation/git-stash.adoc +++ b/Documentation/git-stash.adoc @@ -7,24 +7,24 @@ git-stash - Stash the changes in a dirty working directory away SYNOPSIS -------- -[verse] -'git stash' list [] -'git stash' show [-u | --include-untracked | --only-untracked] [] [] -'git stash' drop [-q | --quiet] [] -'git stash' pop [--index] [-q | --quiet] [] -'git stash' apply [--index] [-q | --quiet] [] -'git stash' branch [] -'git stash' [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] +[synopsis] +git stash list [] +git stash show [-u | --include-untracked | --only-untracked] [] [] +git stash drop [-q | --quiet] [] +git stash pop [--index] [-q | --quiet] [] +git stash apply [--index] [-q | --quiet] [] +git stash branch [] +git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] [-u | --include-untracked] [-a | --all] [(-m | --message) ] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...]] -'git stash' save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] - [-u | --include-untracked] [-a | --all] [] -'git stash' clear -'git stash' create [] -'git stash' store [(-m | --message) ] [-q | --quiet] -'git stash' export (--print | --to-ref ) [...] -'git stash' import +git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] + [-u | --include-untracked] [-a | --all] [] +git stash clear +git stash create [] +git stash store [(-m | --message) ] [-q | --quiet] +git stash export (--print | --to-ref ) [...] +git stash import DESCRIPTION ----------- @@ -38,7 +38,7 @@ The modifications stashed away by this command can be listed with `git stash list`, inspected with `git stash show`, and restored (potentially on top of a different commit) with `git stash apply`. Calling `git stash` without any arguments is equivalent to `git stash push`. -A stash is by default listed as "WIP on 'branchname' ...", but +A stash is by default listed as "WIP on '' ...", but you can give a more descriptive message on the command line when you create one. @@ -47,16 +47,16 @@ stashes are found in the reflog of this reference and can be named using the usual reflog syntax (e.g. `stash@{0}` is the most recently created stash, `stash@{1}` is the one before it, `stash@{2.hours.ago}` is also possible). Stashes may also be referenced by specifying just the -stash index (e.g. the integer `n` is equivalent to `stash@{n}`). +stash index (e.g. the integer `` is equivalent to `stash@{}`). COMMANDS -------- -push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [(-m|--message) ] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...]:: +`push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-u | --include-untracked] [ -a | --all] [-q | --quiet] [(-m|--message) ] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...]`:: Save your local modifications to a new 'stash entry' and roll them - back to HEAD (in the working tree and in the index). - The part is optional and gives + back to `HEAD` (in the working tree and in the index). + The __ part is optional and gives the description along with the stashed state. + For quickly making a snapshot, you can omit "push". In this mode, @@ -65,14 +65,14 @@ subcommand from making an unwanted stash entry. The two exceptions to this are `stash -p` which acts as alias for `stash push -p` and pathspec elements, which are allowed after a double hyphen `--` for disambiguation. -save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] []:: +`save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-u | --include-untracked] [-a | --all] [-q | --quiet] []`:: This option is deprecated in favour of 'git stash push'. It differs from "stash push" in that it cannot take pathspec. Instead, all non-option arguments are concatenated to form the stash message. -list []:: +`list []`:: List the stash entries that you currently have. Each 'stash entry' is listed with its name (e.g. `stash@{0}` is the latest entry, `stash@{1}` is @@ -88,7 +88,7 @@ stash@{1}: On master: 9cc0589... Add git-stash The command takes options applicable to the 'git log' command to control what is shown and how. See linkgit:git-log[1]. -show [-u|--include-untracked|--only-untracked] [] []:: +`show [-u | --include-untracked | --only-untracked] [] []`:: Show the changes recorded in the stash entry as a diff between the stashed contents and the commit back when the stash entry was first @@ -96,12 +96,12 @@ show [-u|--include-untracked|--only-untracked] [] []:: By default, the command shows the diffstat, but it will accept any format known to 'git diff' (e.g., `git stash show -p stash@{1}` to view the second most recent entry in patch form). - If no `` is provided, the default behavior will be given + If no __ is provided, the default behavior will be given by the `stash.showStat`, and `stash.showPatch` config variables. You can also use `stash.showIncludeUntracked` to set whether `--include-untracked` is enabled by default. -pop [--index] [-q|--quiet] []:: +`pop [--index] [-q | --quiet] []`:: Remove a single stashed state from the stash list and apply it on top of the current working tree state, i.e., do the inverse @@ -112,19 +112,19 @@ Applying the state can fail with conflicts; in this case, it is not removed from the stash list. You need to resolve the conflicts by hand and call `git stash drop` manually afterwards. -apply [--index] [-q|--quiet] []:: +`apply [--index] [-q | --quiet] []`:: Like `pop`, but do not remove the state from the stash list. Unlike `pop`, `` may be any commit that looks like a commit created by `stash push` or `stash create`. -branch []:: +`branch []`:: - Creates and checks out a new branch named `` starting from - the commit at which the `` was originally created, applies the - changes recorded in `` to the new working tree and index. - If that succeeds, and `` is a reference of the form - `stash@{}`, it then drops the ``. + Creates and checks out a new branch named __ starting from + the commit at which the __ was originally created, applies the + changes recorded in __ to the new working tree and index. + If that succeeds, and __ is a reference of the form + `stash@{}`, it then drops the __. + This is useful if the branch on which you ran `git stash push` has changed enough that `git stash apply` fails due to conflicts. Since @@ -132,54 +132,51 @@ the stash entry is applied on top of the commit that was HEAD at the time `git stash` was run, it restores the originally stashed state with no conflicts. -clear:: +`clear`:: Remove all the stash entries. Note that those entries will then be subject to pruning, and may be impossible to recover (see - 'Examples' below for a possible strategy). - -drop [-q|--quiet] []:: + 'EXAMPLES' below for a possible strategy). +`drop [-q | --quiet] []`:: Remove a single stash entry from the list of stash entries. -create:: - +`create`:: Create a stash entry (which is a regular commit object) and return its object name, without storing it anywhere in the ref namespace. This is intended to be useful for scripts. It is probably not the command you want to use; see "push" above. -store:: +`store`:: Store a given stash created via 'git stash create' (which is a dangling merge commit) in the stash ref, updating the stash reflog. This is intended to be useful for scripts. It is probably not the command you want to use; see "push" above. -export ( --print | --to-ref ) [...]:: +`export ( --print | --to-ref ) [...]`:: Export the specified stashes, or all of them if none are specified, to a chain of commits which can be transferred using the normal fetch and push mechanisms, then imported using the `import` subcommand. -import :: - +`import `:: Import the specified stashes from the specified commit, which must have been created by `export`, and add them to the list of stashes. To replace the existing stashes, use `clear` first. OPTIONS ------- --a:: ---all:: +`-a`:: +`--all`:: This option is only valid for `push` and `save` commands. + All ignored and untracked files are also stashed and then cleaned up with `git clean`. --u:: ---include-untracked:: ---no-include-untracked:: +`-u`:: +`--include-untracked`:: +`--no-include-untracked`:: When used with the `push` and `save` commands, all untracked files are also stashed and then cleaned up with `git clean`. @@ -187,12 +184,12 @@ up with `git clean`. When used with the `show` command, show the untracked files in the stash entry as part of the diff. ---only-untracked:: +`--only-untracked`:: This option is only valid for the `show` command. + Show only the untracked files in the stash entry as part of the diff. ---index:: +`--index`:: This option is only valid for `pop` and `apply` commands. + Tries to reinstate not only the working tree's changes, but also @@ -200,15 +197,15 @@ the index's ones. However, this can fail, when you have conflicts (which are stored in the index, where you therefore can no longer apply the changes as they were originally). --k:: ---keep-index:: ---no-keep-index:: +`-k`:: +`--keep-index`:: +`--no-keep-index`:: This option is only valid for `push` and `save` commands. + All changes already added to the index are left intact. --p:: ---patch:: +`-p`:: +`--patch`:: This option is only valid for `push` and `save` commands. + Interactively select hunks from the diff between HEAD and the @@ -224,8 +221,8 @@ The `--patch` option implies `--keep-index`. You can use include::diff-context-options.adoc[] --S:: ---staged:: +`-S`:: +`--staged`:: This option is only valid for `push` and `save` commands. + Stash only the changes that are currently staged. This is similar to @@ -234,49 +231,49 @@ of current branch. + The `--patch` option has priority over this one. ---pathspec-from-file=:: +`--pathspec-from-file=`:: This option is only valid for `push` command. + -Pathspec is passed in `` instead of commandline args. If -`` is exactly `-` then standard input is used. Pathspec +Pathspec is passed in __ instead of commandline args. If +__ is exactly `-` then standard input is used. Pathspec elements are separated by LF or CR/LF. Pathspec elements can be quoted as explained for the configuration variable `core.quotePath` (see linkgit:git-config[1]). See also `--pathspec-file-nul` and global `--literal-pathspecs`. ---pathspec-file-nul:: +`--pathspec-file-nul`:: This option is only valid for `push` command. + Only meaningful with `--pathspec-from-file`. Pathspec elements are separated with NUL character and all other characters are taken literally (including newlines and quotes). --q:: ---quiet:: +`-q`:: +`--quiet`:: This option is only valid for `apply`, `drop`, `pop`, `push`, `save`, `store` commands. + Quiet, suppress feedback messages. ---print:: +`--print`:: This option is only valid for the `export` command. + Create the chain of commits representing the exported stashes without storing it anywhere in the ref namespace and print the object ID to standard output. This is designed for scripts. ---to-ref:: +`--to-ref`:: This option is only valid for the `export` command. + Create the chain of commits representing the exported stashes and store it to the specified ref. -\--:: +`--`:: This option is only valid for `push` command. + Separates pathspec from options for disambiguation purposes. -...:: +`...`:: This option is only valid for `push` command. + The new stash entry records the modified states only for the files @@ -286,11 +283,11 @@ too, leaving files that do not match the pathspec intact. + For more details, see the 'pathspec' entry in linkgit:gitglossary[7]. -:: +__:: This option is only valid for `apply`, `branch`, `drop`, `pop`, `show`, and `export` commands. + -A reference of the form `stash@{}`. When no `` is +A reference of the form `stash@{}`. When no __ is given, the latest stash is assumed (that is, `stash@{0}`). DISCUSSION @@ -419,6 +416,7 @@ CONFIGURATION include::includes/cmd-config-section-all.adoc[] +:git-stash: 1 include::config/stash.adoc[] diff --git a/Documentation/git-tag.adoc b/Documentation/git-tag.adoc index a4b1c0ec05a6c9..0f7badc11690af 100644 --- a/Documentation/git-tag.adoc +++ b/Documentation/git-tag.adoc @@ -8,21 +8,21 @@ git-tag - Create, list, delete or verify a tag object signed with GPG SYNOPSIS -------- -[verse] -'git tag' [-a | -s | -u ] [-f] [-m | -F ] [-e] +[synopsis] +git tag [-a | -s | -u ] [-f] [-m | -F ] [-e] [(--trailer [(=|:)])...] [ | ] -'git tag' -d ... -'git tag' [-n[]] -l [--contains ] [--no-contains ] +git tag -d ... +git tag [-n[]] -l [--contains ] [--no-contains ] [--points-at ] [--column[=] | --no-column] [--create-reflog] [--sort=] [--format=] [--merged ] [--no-merged ] [...] -'git tag' -v [--format=] ... +git tag -v [--format=] ... DESCRIPTION ----------- -Add a tag reference in `refs/tags/`, unless `-d/-l/-v` is given +Add a tag reference in `refs/tags/`, unless `-d`/`-l`/`-v` is given to delete, list or verify tags. Unless `-f` is given, the named tag must not yet exist. @@ -58,129 +58,129 @@ lightweight tags by default. OPTIONS ------- --a:: ---annotate:: +`-a`:: +`--annotate`:: Make an unsigned, annotated tag object --s:: ---sign:: +`-s`:: +`--sign`:: Make a GPG-signed tag, using the default e-mail address's key. The default behavior of tag GPG-signing is controlled by `tag.gpgSign` configuration variable if it exists, or disabled otherwise. See linkgit:git-config[1]. ---no-sign:: +`--no-sign`:: Override `tag.gpgSign` configuration variable that is set to force each and every tag to be signed. --u :: ---local-user=:: +`-u `:: +`--local-user=`:: Make a GPG-signed tag, using the given key. --f:: ---force:: +`-f`:: +`--force`:: Replace an existing tag with the given name (instead of failing) --d:: ---delete:: +`-d`:: +`--delete`:: Delete existing tags with the given names. --v:: ---verify:: +`-v`:: +`--verify`:: Verify the GPG signature of the given tag names. --n:: - specifies how many lines from the annotation, if any, - are printed when using -l. Implies `--list`. +`-n`:: + __ specifies how many lines from the annotation, if any, + are printed when using `-l`. Implies `--list`. + The default is not to print any annotation lines. If no number is given to `-n`, only the first line is printed. If the tag is not annotated, the commit message is displayed instead. --l:: ---list:: +`-l`:: +`--list`:: List tags. With optional `...`, e.g. `git tag --list 'v-*'`, list only the tags that match the pattern(s). + -Running "git tag" without arguments also lists all tags. The pattern -is a shell wildcard (i.e., matched using fnmatch(3)). Multiple +Running `git tag` without arguments also lists all tags. The pattern +is a shell wildcard (i.e., matched using `fnmatch`(3)). Multiple patterns may be given; if any of them matches, the tag is shown. + This option is implicitly supplied if any other list-like option such as `--contains` is provided. See the documentation for each of those options for details. ---sort=:: +`--sort=`:: Sort based on the key given. Prefix `-` to sort in - descending order of the value. You may use the --sort= option - multiple times, in which case the last key becomes the primary - key. Also supports "version:refname" or "v:refname" (tag - names are treated as versions). The "version:refname" sort - order can also be affected by the "versionsort.suffix" + descending order of the value. You may use the `--sort=` option + multiple times, in which case the last __ becomes the primary + key. Also supports "`version:refname`" or "`v:refname`" (tag + names are treated as versions). The "`version:refname`" sort + order can also be affected by the "`versionsort.suffix`" configuration variable. The keys supported are the same as those in `git for-each-ref`. Sort order defaults to the value configured for the `tag.sort` variable if it exists, or lexicographic order otherwise. See linkgit:git-config[1]. ---color[=]:: +`--color[=]`:: Respect any colors specified in the `--format` option. The - `` field must be one of `always`, `never`, or `auto` (if - `` is absent, behave as if `always` was given). + __ field must be one of `always`, `never`, or `auto` (if + __ is absent, behave as if `always` was given). --i:: ---ignore-case:: +`-i`:: +`--ignore-case`:: Sorting and filtering tags are case insensitive. ---omit-empty:: +`--omit-empty`:: Do not print a newline after formatted refs where the format expands to the empty string. ---column[=]:: ---no-column:: +`--column[=]`:: +`--no-column`:: Display tag listing in columns. See configuration variable `column.tag` for option syntax. `--column` and `--no-column` - without options are equivalent to 'always' and 'never' respectively. + without options are equivalent to `always` and `never` respectively. + This option is only applicable when listing tags without annotation lines. ---contains []:: - Only list tags which contain the specified commit (HEAD if not +`--contains []`:: + Only list tags which contain __ (`HEAD` if not specified). Implies `--list`. ---no-contains []:: - Only list tags which don't contain the specified commit (HEAD if +`--no-contains []`:: + Only list tags which don't contain __ (`HEAD` if not specified). Implies `--list`. ---merged []:: - Only list tags whose commits are reachable from the specified - commit (`HEAD` if not specified). +`--merged []`:: + Only list tags whose commits are reachable from + __ (`HEAD` if not specified). ---no-merged []:: - Only list tags whose commits are not reachable from the specified - commit (`HEAD` if not specified). +`--no-merged []`:: + Only list tags whose commits are not reachable from + __ (`HEAD` if not specified). ---points-at :: - Only list tags of the given object (HEAD if not +`--points-at []`:: + Only list tags of __ (`HEAD` if not specified). Implies `--list`. --m :: ---message=:: - Use the given tag message (instead of prompting). +`-m `:: +`--message=`:: + Use __ (instead of prompting). If multiple `-m` options are given, their values are concatenated as separate paragraphs. Implies `-a` if none of `-a`, `-s`, or `-u ` is given. --F :: ---file=:: - Take the tag message from the given file. Use '-' to +`-F `:: +`--file=`:: + Take the tag message from __. Use `-` to read the message from the standard input. Implies `-a` if none of `-a`, `-s`, or `-u ` is given. ---trailer [(=|:)]:: - Specify a (, ) pair that should be applied as a +`--trailer [(=|:)]`:: + Specify a (__, __) pair that should be applied as a trailer. (e.g. `git tag --trailer "Custom-Key: value"` will add a "Custom-Key" trailer to the tag message.) The `trailer.*` configuration variables @@ -190,46 +190,45 @@ This option is only applicable when listing tags without annotation lines. The trailers can be extracted in `git tag --list`, using `--format="%(trailers)"` placeholder. --e:: ---edit:: - The message taken from file with `-F` and command line with - `-m` are usually used as the tag message unmodified. - This option lets you further edit the message taken from these sources. +`-e`:: +`--edit`:: + Let further edit the message taken from file with `-F` and command line with + `-m`. ---cleanup=:: - This option sets how the tag message is cleaned up. - The '' can be one of 'verbatim', 'whitespace' and 'strip'. The - 'strip' mode is default. The 'verbatim' mode does not change message at - all, 'whitespace' removes just leading/trailing whitespace lines and - 'strip' removes both whitespace and commentary. +`--cleanup=`:: + Set how the tag message is cleaned up. + The __ can be one of `verbatim`, `whitespace` and `strip`. The + `strip` mode is default. The `verbatim` mode does not change message at + all, `whitespace` removes just leading/trailing whitespace lines and + `strip` removes both whitespace and commentary. ---create-reflog:: +`--create-reflog`:: Create a reflog for the tag. To globally enable reflogs for tags, see `core.logAllRefUpdates` in linkgit:git-config[1]. The negated form `--no-create-reflog` only overrides an earlier `--create-reflog`, but currently does not negate the setting of `core.logAllRefUpdates`. ---format=:: +`--format=`:: A string that interpolates `%(fieldname)` from a tag ref being shown and the object it points at. The format is the same as that of linkgit:git-for-each-ref[1]. When unspecified, defaults to `%(refname:strip=2)`. -:: +__:: The name of the tag to create, delete, or describe. The new tag name must pass all checks defined by linkgit:git-check-ref-format[1]. Some of these checks may restrict the characters allowed in a tag name. -:: -:: +__:: +__:: The object that the new tag will refer to, usually a commit. - Defaults to HEAD. + Defaults to `HEAD`. CONFIGURATION ------------- -By default, 'git tag' in sign-with-default mode (-s) will use your +By default, `git tag` in sign-with-default mode (`-s`) will use your committer identity (of the form `Your Name `) to find a key. If you want to use a different default key, you can specify it in the repository configuration as follows: @@ -252,7 +251,7 @@ On Re-tagging What should you do when you tag a wrong commit and you would want to re-tag? -If you never pushed anything out, just re-tag it. Use "-f" to +If you never pushed anything out, just re-tag it. Use `-f` to replace the old one. And you're done. But if you have pushed things out (or others could just read @@ -268,12 +267,12 @@ the old tag. In that case you can do one of two things: . The insane thing. You really want to call the new version "X" too, 'even though' - others have already seen the old one. So just use 'git tag -f' + others have already seen the old one. So just use `git tag -f` again, as if you hadn't already published the old one. However, Git does *not* (and it should not) change tags behind users back. So if somebody already got the old tag, doing a -'git pull' on your tree shouldn't just make them overwrite the old +`git pull` on your tree shouldn't just make them overwrite the old one. If somebody got a release tag from you, you cannot just change @@ -325,7 +324,7 @@ private anchor point tags from the other person. Often, "please pull" messages on the mailing list just provide two pieces of information: a repo URL and a branch name; this -is designed to be easily cut&pasted at the end of a 'git fetch' +is designed to be easily cut&pasted at the end of a `git fetch` command line: ------------ @@ -403,6 +402,14 @@ FILES user in an editor session will be available in this file, but may be overwritten by the next invocation of `git tag`. +CONFIGURATION +------------- + +include::includes/cmd-config-section-all.adoc[] + +:git-tag: 1 +include::config/tag.adoc[] + NOTES ----- diff --git a/Documentation/git-worktree.adoc b/Documentation/git-worktree.adoc index 389e669ac044de..f272f797837f45 100644 --- a/Documentation/git-worktree.adoc +++ b/Documentation/git-worktree.adoc @@ -8,16 +8,16 @@ git-worktree - Manage multiple working trees SYNOPSIS -------- -[verse] -'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason ]] - [--orphan] [(-b | -B) ] [] -'git worktree list' [-v | --porcelain [-z]] -'git worktree lock' [--reason ] -'git worktree move' -'git worktree prune' [-n] [-v] [--expire ] -'git worktree remove' [-f] -'git worktree repair' [...] -'git worktree unlock' +[synopsis] +git worktree add [-f] [--detach] [--checkout] [--lock [--reason ]] + [--orphan] [(-b | -B) ] [] +git worktree list [-v | --porcelain [-z]] +git worktree lock [--reason ] +git worktree move +git worktree prune [-n] [-v] [--expire ] +git worktree remove [-f] +git worktree repair [...] +git worktree unlock DESCRIPTION ----------- @@ -37,7 +37,7 @@ zero or more linked worktrees. When you are done with a linked worktree, remove it with `git worktree remove`. In its simplest form, `git worktree add ` automatically creates a -new branch whose name is the final component of ``, which is +new branch whose name is the final component of __, which is convenient if you plan to work on a new topic. For instance, `git worktree add ../hotfix` creates new branch `hotfix` and checks it out at path `../hotfix`. To instead work on an existing branch in a new worktree, @@ -63,16 +63,16 @@ locked. COMMANDS -------- -add []:: +`add []`:: -Create a worktree at `` and checkout `` into it. The new worktree +Create a worktree at __ and checkout __ into it. The new worktree is linked to the current repository, sharing everything except per-worktree -files such as `HEAD`, `index`, etc. As a convenience, `` may +files such as `HEAD`, `index`, etc. As a convenience, __ may be a bare "`-`", which is synonymous with `@{-1}`. + -If `` is a branch name (call it ``) and is not found, +If __ is a branch name (call it __) and is not found, and neither `-b` nor `-B` nor `--detach` are used, but there does -exist a tracking branch in exactly one remote (call it ``) +exist a tracking branch in exactly one remote (call it __) with a matching name, treat as equivalent to: + ------------ @@ -81,32 +81,32 @@ $ git worktree add --track -b / + If the branch exists in multiple remotes and one of them is named by the `checkout.defaultRemote` configuration variable, we'll use that -one for the purposes of disambiguation, even if the `` isn't +one for the purposes of disambiguation, even if the __ isn't unique across all remotes. Set it to e.g. `checkout.defaultRemote=origin` to always checkout remote -branches from there if `` is ambiguous but exists on the +branches from there if __ is ambiguous but exists on the `origin` remote. See also `checkout.defaultRemote` in linkgit:git-config[1]. + -If `` is omitted and neither `-b` nor `-B` nor `--detach` used, +If __ is omitted and neither `-b` nor `-B` nor `--detach` used, then, as a convenience, the new worktree is associated with a branch (call -it ``) named after `$(basename )`. If `` doesn't +it __) named after `$(basename )`. If __ doesn't exist, a new branch based on `HEAD` is automatically created as if -`-b ` was given. If `` does exist, it will be checked out +`-b ` was given. If __ does exist, it will be checked out in the new worktree, if it's not checked out anywhere else, otherwise the command will refuse to create the worktree (unless `--force` is used). + -If `` is omitted, neither `--detach`, or `--orphan` is +If __ is omitted, neither `--detach`, or `--orphan` is used, and there are no valid local branches (or remote branches if `--guess-remote` is specified) then, as a convenience, the new worktree is -associated with a new unborn branch named `` (after +associated with a new unborn branch named __ (after `$(basename )` if neither `-b` or `-B` is used) as if `--orphan` was passed to the command. In the event the repository has a remote and `--guess-remote` is used, but no remote or local branches exist, then the command fails with a warning reminding the user to fetch from their remote first (or override by using `-f/--force`). -list:: +`list`:: List details of each worktree. The main worktree is listed first, followed by each of the linked worktrees. The output details include @@ -115,32 +115,32 @@ branch currently checked out (or "detached HEAD" if none), "locked" if the worktree is locked, "prunable" if the worktree can be pruned by the `prune` command. -lock:: +`lock`:: If a worktree is on a portable device or network share which is not always mounted, lock it to prevent its administrative files from being pruned automatically. This also prevents it from being moved or deleted. Optionally, specify a reason for the lock with `--reason`. -move:: +`move`:: Move a worktree to a new location. Note that the main worktree or linked worktrees containing submodules cannot be moved with this command. (The `git worktree repair` command, however, can reestablish the connection with linked worktrees if you move the main worktree manually.) -prune:: +`prune`:: Prune worktree information in `$GIT_DIR/worktrees`. -remove:: +`remove`:: Remove a worktree. Only clean worktrees (no untracked files and no modification in tracked files) can be removed. Unclean worktrees or ones with submodules can be removed with `--force`. The main worktree cannot be removed. -repair [...]:: +`repair [...]`:: Repair worktree administrative files, if possible, if they have become corrupted or outdated due to external factors. @@ -154,72 +154,72 @@ Similarly, if the working tree for a linked worktree is moved without using `git worktree move`, the main worktree (or bare repository) will be unable to locate it. Running `repair` within the recently-moved worktree will reestablish the connection. If multiple linked worktrees are moved, -running `repair` from any worktree with each tree's new `` as an +running `repair` from any worktree with each tree's new __ as an argument, will reestablish the connection to all the specified paths. + If both the main worktree and linked worktrees have been moved or copied manually, -then running `repair` in the main worktree and specifying the new `` +then running `repair` in the main worktree and specifying the new __ of each linked worktree will reestablish all connections in both directions. -unlock:: +`unlock`:: Unlock a worktree, allowing it to be pruned, moved or deleted. OPTIONS ------- --f:: ---force:: +`-f`:: +`--force`:: By default, `add` refuses to create a new worktree when - `` is a branch name and is already checked out by - another worktree, or if `` is already assigned to some - worktree but is missing (for instance, if `` was deleted + __ is a branch name and is already checked out by + another worktree, or if __ is already assigned to some + worktree but is missing (for instance, if __ was deleted manually). This option overrides these safeguards. To add a missing but locked worktree path, specify `--force` twice. + `move` refuses to move a locked worktree unless `--force` is specified twice. If the destination is already assigned to some other worktree but is -missing (for instance, if `` was deleted manually), then `--force` +missing (for instance, if __ was deleted manually), then `--force` allows the move to proceed; use `--force` twice if the destination is locked. + `remove` refuses to remove an unclean worktree unless `--force` is used. To remove a locked worktree, specify `--force` twice. --b :: --B :: - With `add`, create a new branch named `` starting at - ``, and check out `` into the new worktree. - If `` is omitted, it defaults to `HEAD`. +`-b `:: +`-B `:: + With `add`, create a new branch named __ starting at + __, and check out __ into the new worktree. + If __ is omitted, it defaults to `HEAD`. By default, `-b` refuses to create a new branch if it already - exists. `-B` overrides this safeguard, resetting `` to - ``. + exists. `-B` overrides this safeguard, resetting __ to + __. --d:: ---detach:: +`-d`:: +`--detach`:: With `add`, detach `HEAD` in the new worktree. See "DETACHED HEAD" in linkgit:git-checkout[1]. ---checkout:: ---no-checkout:: - By default, `add` checks out ``, however, `--no-checkout` can +`--checkout`:: +`--no-checkout`:: + By default, `add` checks out __, however, `--no-checkout` can be used to suppress checkout in order to make customizations, such as configuring sparse-checkout. See "Sparse checkout" in linkgit:git-read-tree[1]. ---guess-remote:: ---no-guess-remote:: - With `worktree add `, without ``, instead +`--guess-remote`:: +`--no-guess-remote`:: + With `worktree add `, without __, instead of creating a new branch from `HEAD`, if there exists a tracking - branch in exactly one remote matching the basename of ``, + branch in exactly one remote matching the basename of __, base the new branch on the remote-tracking branch, and mark the remote-tracking branch as "upstream" from the new branch. + This can also be set up as the default behaviour by using the `worktree.guessRemote` config option. ---relative-paths:: ---no-relative-paths:: +`--relative-paths`:: +`--no-relative-paths`:: Link worktrees using relative paths or absolute paths (default). Overrides the `worktree.useRelativePaths` config option, see linkgit:git-config[1]. @@ -227,60 +227,60 @@ This can also be set up as the default behaviour by using the With `repair`, the linking files will be updated if there's an absolute/relative mismatch, even if the links are correct. ---track:: ---no-track:: - When creating a new branch, if `` is a branch, +`--track`:: +`--no-track`:: + When creating a new branch, if __ is a branch, mark it as "upstream" from the new branch. This is the - default if `` is a remote-tracking branch. See + default if __ is a remote-tracking branch. See `--track` in linkgit:git-branch[1] for details. ---lock:: +`--lock`:: Keep the worktree locked after creation. This is the equivalent of `git worktree lock` after `git worktree add`, but without a race condition. --n:: ---dry-run:: +`-n`:: +`--dry-run`:: With `prune`, do not remove anything; just report what it would remove. ---orphan:: +`--orphan`:: With `add`, make the new worktree and index empty, associating - the worktree with a new unborn branch named ``. + the worktree with a new unborn branch named __. ---porcelain:: +`--porcelain`:: With `list`, output in an easy-to-parse format for scripts. This format will remain stable across Git versions and regardless of user configuration. It is recommended to combine this with `-z`. See below for details. --z:: - Terminate each line with a NUL rather than a newline when +`-z`:: + Terminate each line with a _NUL_ rather than a newline when `--porcelain` is specified with `list`. This makes it possible to parse the output when a worktree path contains a newline character. --q:: ---quiet:: +`-q`:: +`--quiet`:: With `add`, suppress feedback messages. --v:: ---verbose:: +`-v`:: +`--verbose`:: With `prune`, report all removals. + With `list`, output additional information about worktrees (see below). ---expire