diff --git a/.cirrus.yml b/.cirrus.yml index 1fbdc2652b3e59..fef04a38402fee 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -5,11 +5,13 @@ freebsd_task: env: GIT_PROVE_OPTS: "--timer --jobs 10" GIT_TEST_OPTS: "--no-chain-lint --no-bin-wrappers" - MAKEFLAGS: "-j4" + GIT_SKIP_TESTS: t7815.12 + MAKEFLAGS: -j4 DEFAULT_TEST_TARGET: prove + DEFAULT_UNIT_TEST_TARGET: unit-tests-prove DEVELOPER: 1 freebsd_instance: - image_family: freebsd-13-4 + image_family: freebsd-14-3 memory: 2G install_script: pkg install -y gettext gmake perl5 @@ -19,4 +21,4 @@ freebsd_task: build_script: - su git -c gmake test_script: - - su git -c 'gmake DEFAULT_UNIT_TEST_TARGET=unit-tests-prove test unit-tests' + - su git -c 'gmake test unit-tests' diff --git a/.clang-format b/.clang-format index 9547fe1b77cac0..dcfd0aad60c31e 100644 --- a/.clang-format +++ b/.clang-format @@ -12,7 +12,15 @@ UseTab: Always TabWidth: 8 IndentWidth: 8 ContinuationIndentWidth: 8 -ColumnLimit: 80 + +# While we do want to enforce a character limit of 80 characters, we often +# allow lines to overflow that limit to prioritize readability. Setting a +# character limit here with penalties has been finicky and creates too many +# false positives. +# +# NEEDSWORK: It would be nice if we can find optimal settings to ensure we +# can re-enable the limit here. +ColumnLimit: 0 # C Language specifics Language: Cpp @@ -210,16 +218,11 @@ MaxEmptyLinesToKeep: 1 # No empty line at the start of a block. KeepEmptyLinesAtTheStartOfBlocks: false -# Penalties -# This decides what order things should be done if a line is too long -PenaltyBreakAssignment: 5 -PenaltyBreakBeforeFirstCallParameter: 5 -PenaltyBreakComment: 5 -PenaltyBreakFirstLessLess: 0 -PenaltyBreakOpenParenthesis: 300 -PenaltyBreakString: 5 -PenaltyExcessCharacter: 10 -PenaltyReturnTypeOnItsOwnLine: 300 - # Don't sort #include's SortIncludes: false + +# Remove optional braces of control statements (if, else, for, and while) +# according to the LLVM coding style. This avoids braces on simple +# single-statement bodies of statements but keeps braces if one side of +# if/else if/.../else cascade has multi-statement body. +RemoveBracesLLVM: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 14e598bac16818..a92872ee7509ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -301,7 +301,7 @@ jobs: path: build - name: Test shell: pwsh - run: meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % 10 } | Where-Object Name -EQ ${{ matrix.nr }} | ForEach-Object { meson test -C build --no-rebuild --print-errorlogs $_.Group } + run: meson test -C build --no-rebuild --print-errorlogs --slice "$(1+${{ matrix.nr }})/10" regular: name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}}) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb6d5b976cdc36..af10ebb59a3ada 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -178,7 +178,7 @@ test:msvc-meson: - job: "build:msvc-meson" artifacts: true script: - - meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % $Env:CI_NODE_TOTAL + 1 } | Where-Object Name -EQ $Env:CI_NODE_INDEX | ForEach-Object { meson test -C build --no-rebuild --print-errorlogs $_.Group; if (!$?) { exit $LASTEXITCODE } } + - meson test -C build --no-rebuild --print-errorlogs --slice $Env:CI_NODE_INDEX/$Env:CI_NODE_TOTAL parallel: 10 test:fuzz-smoke-tests: diff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc index 61bdd586b9edb2..f8d2eba061c82a 100644 --- a/Documentation/BreakingChanges.adoc +++ b/Documentation/BreakingChanges.adoc @@ -118,6 +118,53 @@ Cf. <2f5de416-04ba-c23d-1e0b-83bb655829a7@zombino.com>, <20170223155046.e7nxivfwqqoprsqj@LykOS.localdomain>, . +* The default storage format for references in newly created repositories will + be changed from "files" to "reftable". The "reftable" format provides + multiple advantages over the "files" format: ++ + ** It is impossible to store two references that only differ in casing on + case-insensitive filesystems with the "files" format. This issue is common + on Windows and macOS platforms. As the "reftable" backend does not use + filesystem paths to encode reference names this problem goes away. + ** Similarly, macOS normalizes path names that contain unicode characters, + which has the consequence that you cannot store two names with unicode + characters that are encoded differently with the "files" backend. Again, + this is not an issue with the "reftable" backend. + ** Deleting references with the "files" backend requires Git to rewrite the + complete "packed-refs" file. In large repositories with many references + this file can easily be dozens of megabytes in size, in extreme cases it + may be gigabytes. The "reftable" backend uses tombstone markers for + deleted references and thus does not have to rewrite all of its data. + ** Repository housekeeping with the "files" backend typically performs + all-into-one repacks of references. This can be quite expensive, and + consequently housekeeping is a tradeoff between the number of loose + references that accumulate and slow down operations that read references, + and compressing those loose references into the "packed-refs" file. The + "reftable" backend uses geometric compaction after every write, which + amortizes costs and ensures that the backend is always in a + well-maintained state. + ** Operations that write multiple references at once are not atomic with the + "files" backend. Consequently, Git may see in-between states when it reads + references while a reference transaction is in the process of being + committed to disk. + ** Writing many references at once is slow with the "files" backend because + every reference is created as a separate file. The "reftable" backend + significantly outperforms the "files" backend by multiple orders of + magnitude. + ** The reftable backend uses a binary format with prefix compression for + reference names. As a result, the format uses less space compared to the + "packed-refs" file. ++ +Users that get immediate benefit from the "reftable" backend could continue to +opt-in to the "reftable" format manually by setting the "init.defaultRefFormat" +config. But defaults matter, and we think that overall users will have a better +experience with less platform-specific quirks when they use the new backend by +default. ++ +A prerequisite for this change is that the ecosystem is ready to support the +"reftable" format. Most importantly, alternative implementations of Git like +JGit, libgit2 and Gitoxide need to support it. + === Removals * Support for grafting commits has long been superseded by git-replace(1). @@ -183,6 +230,14 @@ These features will be removed. timeframe, in preference to its synonym "--annotate-stdin". Git 3.0 removes the support for "--stdin" altogether. +* The git-whatchanged(1) command has outlived its usefulness more than + 10 years ago, and takes more keystrokes to type than its rough + equivalent `git log --raw`. We have nominated the command for + removal, have changed the command to refuse to work unless the + `--i-still-use-this` option is given, and asked the users to report + when they do so. So far there hasn't been a single complaint. ++ +The command will be removed. == Superseded features that will not be deprecated diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index c1046abfb7d10b..224f0978a86116 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -298,6 +298,17 @@ For C programs: . since late 2021 with 44ba10d6, we have had variables declared in the for loop "for (int i = 0; i < 10; i++)". + . since late 2023 with 8277dbe987 we have been using the bool type + from . + + C99 features we have test balloons for: + + . since late 2024 with v2.48.0-rc0~20, we have test balloons for + compound literal syntax, e.g., (struct foo){ .member = value }; + our hope is that no platforms we care about have trouble using + them, and officially adopt its wider use in mid 2026. Do not add + more use of the syntax until that happens. + New C99 features that we cannot use yet: . %z and %zu as a printf() argument for a size_t (the %z being for @@ -315,6 +326,9 @@ For C programs: encouraged to have a blank line between the end of the declarations and the first statement in the block. + - Do not explicitly initialize global variables to 0 or NULL; + instead, let BSS take care of the zero initialization. + - NULL pointers shall be written as NULL, not as 0. - When declaring pointers, the star sides with the variable @@ -610,8 +624,9 @@ For C programs: - `S_init()` initializes a structure without allocating the structure itself. - - `S_release()` releases a structure's contents without freeing the - structure. + - `S_release()` releases a structure's contents without reinitializing + the structure for immediate reuse, and without freeing the structure + itself. - `S_clear()` is equivalent to `S_release()` followed by `S_init()` such that the structure is directly usable after clearing it. When @@ -877,6 +892,17 @@ Characters are also surrounded by underscores: As a side effect, backquoted placeholders are correctly typeset, but this style is not recommended. + When documenting multiple related `git config` variables, place them on + a separate line instead of separating them by commas. For example, do + not write this: + `core.var1`, `core.var2`:: + Description common to `core.var1` and `core.var2`. + +Instead write this: + `core.var1`:: + `core.var2`:: + Description common to `core.var1` and `core.var2`. + Synopsis Syntax The synopsis (a paragraph with [synopsis] attribute) is automatically diff --git a/Documentation/Makefile b/Documentation/Makefile index b109d25e9c804d..df2ce187eb84cf 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -510,7 +510,12 @@ lint-docs-meson: awk "/^manpages = {$$/ {flag=1 ; next } /^}$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047 : [157],\$$/, \"\"); print }" meson.build | \ grep -v -e '#' -e '^$$' | \ sort >tmp-meson-diff/meson.adoc && \ - ls git*.adoc scalar.adoc | grep -v -e git-bisect-lk2009.adoc -e git-pack-redundant.adoc -e git-tools.adoc >tmp-meson-diff/actual.adoc && \ + ls git*.adoc scalar.adoc | \ + grep -v -e git-bisect-lk2009.adoc \ + -e git-pack-redundant.adoc \ + -e git-tools.adoc \ + -e git-whatchanged.adoc \ + >tmp-meson-diff/actual.adoc && \ if ! cmp tmp-meson-diff/meson.adoc tmp-meson-diff/actual.adoc; then \ echo "Meson man pages differ from actual man pages:"; \ diff -u tmp-meson-diff/meson.adoc tmp-meson-diff/actual.adoc; \ diff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc index bfe8f5f5611209..413a9fdb05c56e 100644 --- a/Documentation/MyFirstObjectWalk.adoc +++ b/Documentation/MyFirstObjectWalk.adoc @@ -43,7 +43,7 @@ Open up a new file `builtin/walken.c` and set up the command handler: #include "builtin.h" #include "trace.h" -int cmd_walken(int argc, const char **argv, const char *prefix) +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo) { trace_printf(_("cmd_walken incoming...\n")); return 0; @@ -83,23 +83,36 @@ int cmd_walken(int argc, const char **argv, const char *prefix) } ---- -Also add the relevant line in `builtin.h` near `cmd_whatchanged()`: +Also add the relevant line in `builtin.h` near `cmd_version()`: ---- -int cmd_walken(int argc, const char **argv, const char *prefix); +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo); ---- -Include the command in `git.c` in `commands[]` near the entry for `whatchanged`, +Include the command in `git.c` in `commands[]` near the entry for `version`, maintaining alphabetical ordering: ---- { "walken", cmd_walken, RUN_SETUP }, ---- -Add it to the `Makefile` near the line for `builtin/worktree.o`: +Add an entry for the new command in the both the Make and Meson build system, +before the entry for `worktree`: +- In the `Makefile`: ---- +... BUILTIN_OBJS += builtin/walken.o +... +---- + +- In the `meson.build` file: +---- +builtin_sources = [ + ... + 'builtin/walken.c', + ... +] ---- Build and test out your command, without forgetting to ensure the `DEVELOPER` @@ -193,7 +206,7 @@ initialization functions. Next, we should have a look at any relevant configuration settings (i.e., settings readable and settable from `git config`). This is done by providing a -callback to `git_config()`; within that callback, you can also invoke methods +callback to `repo_config()`; within that callback, you can also invoke methods from other components you may need that need to intercept these options. Your callback will be invoked once per each configuration value which Git knows about (global, local, worktree, etc.). @@ -221,14 +234,14 @@ static int git_walken_config(const char *var, const char *value, } ---- -Make sure to invoke `git_config()` with it in your `cmd_walken()`: +Make sure to invoke `repo_config()` with it in your `cmd_walken()`: ---- -int cmd_walken(int argc, const char **argv, const char *prefix) +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo) { ... - git_config(git_walken_config, NULL); + repo_config(repo, git_walken_config, NULL); ... } @@ -250,14 +263,14 @@ We'll also need to include the `revision.h` header: ... -int cmd_walken(int argc, const char **argv, const char *prefix) +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo) { /* This can go wherever you like in your declarations.*/ struct rev_info rev; ... - /* This should go after the git_config() call. */ - repo_init_revisions(the_repository, &rev, prefix); + /* This should go after the repo_config() call. */ + repo_init_revisions(repo, &rev, prefix); ... } @@ -305,7 +318,7 @@ Then let's invoke `final_rev_info_setup()` after the call to `repo_init_revisions()`: ---- -int cmd_walken(int argc, const char **argv, const char *prefix) +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo) { ... diff --git a/Documentation/RelNotes/2.51.0.adoc b/Documentation/RelNotes/2.51.0.adoc new file mode 100644 index 00000000000000..a89d459d2e2db0 --- /dev/null +++ b/Documentation/RelNotes/2.51.0.adoc @@ -0,0 +1,322 @@ +Git v2.51 Release Notes +======================= + +UI, Workflows & Features +------------------------ + + * Userdiff patterns for the R language have been added. + + * Documentation for "git send-email" has been updated with a bit more + credential helper and OAuth information. + + * "git cat-file --batch" learns to understand %(objectmode) atom to + allow the caller to tell missing objects (due to repository + corruption) and submodules (whose commit objects are OK to be + missing) apart. + + * "git diff --no-index dirA dirB" can limit the comparison with + pathspec at the end of the command line, just like normal "git + diff". + + * "git subtree" (in contrib/) learned to grok GPG signing its commits. + + * "git whatchanged" that is longer to type than "git log --raw" + which is its modern rough equivalent has outlived its usefulness + more than 10 years ago. Plan to deprecate and remove it. + + * An interchange format for stash entries is defined, and subcommand + of "git stash" to import/export has been added. + + * "git merge/pull" has been taught the "--compact-summary" option to + use the compact-summary format, intead of diffstat, when showing + the summary of the incoming changes. + + * "git imap-send" has been broken for a long time, which has been + resurrected and then taught to talk OAuth2.0 etc. + + * Some error messages from "git imap-send" has been updated. + + * When "git daemon" sees a signal while attempting to accept() a new + client, instead of retrying, it skipped it by mistake, which has + been corrected. + + * The reftable ref backend has matured enough; Git 3.0 will make it + the default format in a newly created repositories by default. + + * "netrc" credential helper has been improved to understand textual + service names (like smtp) in addition to the numeric port numbers + (like 25). + + * Lift the limitation to use changed-path filter in "git log" so that + it can be used for a pathspec with multiple literal paths. + + * Clean up the way how signature on commit objects are exported to + and imported from fast-import stream. + + * Remove unsupported, unused, and unsupportable old option from "git + log". + + * Document recently added "git imap-send --list" with an example. + + * "git pull" learned to pay attention to pull.autostash configuration + variable, which overrides rebase/merge.autostash. + + * "git for-each-ref" learns "--start-after" option to help + applications that want to page its output. + + * "git switch" and "git restore" are declared to be no longer + experimental. + + +Performance, Internal Implementation, Development Support etc. +-------------------------------------------------------------- + + * "git pack-objects" learned to find delta bases from blobs at the + same path, using the --path-walk API. + + * CodingGuidelines update. + + * Add settings for Solaris 10 & 11. + + * Meson-based build/test framework now understands TAP output + generated by our tests. + + * "Do not explicitly initialize to zero" rule has been clarified in + the CodingGuidelines document. + + * A test helper "test_seq" function learned the "-f " option, + which allowed us to simplify a lot of test scripts. + + * A lot of stale stuff has been removed from the contrib/ hierarchy. + + * "git push" and "git fetch" are taught to update refs in batches to + gain performance. + + * Some code paths in the "git prune" used to ignore passed in + repository object and used the_repository singleton instance + instead, which has been corrected. + + * Update ".clang-format" and ".editorconfig" to match our style guide + a bit better. + + * "make coccicheck" succeeds even when spatch made suggestions, which + has been updated to fail in such a case. + + * Code clean-up around object access API. + + * Define .precision to more canned parse-options type to avoid bugs + coming from using a variable with a wrong type to capture the + parsed values. + + * Flipping the default hash function to SHA-256 at Git 3.0 boundary + is planned. + + * Declare weather-balloon we raised for "bool" type 18 months ago a + success and officially allow using the type in our codebase. + + * GIT_TEST_INSTALLED was not honored in the recent topic related to + SHA256 hashes, which has been corrected. + + * The pop_most_recent_commit() function can have quite expensive + worst case performance characteristics, which has been optimized by + using prio-queue data structure. + + * Move structure definition from unrelated header file to where it + belongs. + + * To help our developers, document what C99 language features are + being considered for adoption, in addition to what past experiments + have already decided. + + * The reftable unit tests are now ported to the "clar" unit testing + framework. + + * Redefine where the multi-pack-index sits in the object subsystem, + which recently was restructured to allow multiple backends that + support a single object source that belongs to one repository. A + midx does span mulitple "object sources". + + +Fixes since v2.50 +----------------- + +Unless otherwise noted, all the changes in 2.50.X maintenance track, +including security updates, are included in this release. + + * A memory-leak in an error code path has been plugged. + (merge 7082da85cb ly/commit-graph-graph-write-leakfix later to maint). + + * A memory-leak in an error code path has been plugged. + (merge aedebdb6b9 ly/fetch-pack-leakfix later to maint). + + * Some leftover references to documentation source files that no + longer exist, due to recent ".txt" -> ".adoc" renaming, have been + corrected. + (merge 3717a5775a jw/doc-txt-to-adoc-refs later to maint). + + * "git stash -p " improvements. + (merge 468817bab2 pw/stash-p-pathspec-fixes later to maint). + + * "git send-email" incremented its internal message counter when a + message was edited, which made logic that treats the first message + specially misbehave, which has been corrected. + (merge 2cc27b3501 ag/send-email-edit-threading-fix later to maint). + + * "git stash" recorded a wrong branch name when submodules are + present in the current checkout, which has been corrected. + (merge ffb36c64f2 kj/stash-onbranch-submodule-fix later to maint). + + * When asking to apply mailmap to both author and committer field + while showing a commit object, the field that appears later was not + correctly parsed and replaced, which has been corrected. + (merge abf94a283f sa/multi-mailmap-fix later to maint). + + * "git maintenance" lacked the care "git gc" had to avoid holding + onto the repository lock for too long during packing refs, which + has been remedied. + (merge 1b5074e614 ps/maintenance-ref-lock later to maint). + + * Avoid regexp_constraint and instead use comparison_constraint when + listing functions to exclude from application of coccinelle rules, + as spatch can be built with different regexp engine X-<. + (merge f2ad545813 jc/cocci-avoid-regexp-constraint later to maint). + + * Updating submodules from the upstream did not work well when + submodule's HEAD is detached, which has been improved. + (merge ca62f524c1 jk/submodule-remote-lookup-cleanup later to maint). + + * Remove unnecessary check from "git daemon" code. + (merge 0c856224d2 cb/daemon-fd-check-fix later to maint). + + * Use of sysctl() system call to learn the total RAM size used on + BSDs has been corrected. + (merge 781c1cf571 cb/total-ram-bsd-fix later to maint). + + * Drop FreeBSD 4 support and declare that we support only FreeBSD 12 + or later, which has memmem() supported. + (merge 0392f976a7 bs/config-mak-freebsd later to maint). + + * A diff-filter with negative-only specification like "git log + --diff-filter=d" did not trigger correctly, which has been fixed. + (merge 375ac087c5 jk/all-negative-diff-filter-fix later to maint). + + * A failure to open the index file for writing due to conflicting + access did not state what went wrong, which has been corrected. + (merge 9455397a5c hy/read-cache-lock-error-fix later to maint). + + * Tempfile removal fix in the codepath to sign commits with SSH keys. + (merge 4498127b04 re/ssh-sign-buffer-fix later to maint). + + * Code and test clean-up around string-list API. + (merge 6e5b26c3ff sj/string-list later to maint). + + * "git apply -N" should start from the current index and register + only new files, but it instead started from an empty index, which + has been corrected. + (merge 2b49d97fcb rp/apply-intent-to-add-fix later to maint). + + * Leakfix with a new and a bit invasive test on pack-bitmap files. + (merge bfd5522e98 ly/load-bitmap-leakfix later to maint). + + * "git fetch --prune" used to be O(n^2) expensive when there are many + refs, which has been corrected. + (merge 87d8d8c5d0 ph/fetch-prune-optim later to maint). + + * When a ref creation at refs/heads/foo/bar fails, the files backend + now removes refs/heads/foo/ if the directory is otherwise not used. + (merge a3a7f20516 ps/refs-files-remove-empty-parent later to maint). + + * "pack-objects" has been taught to avoid pointing into objects in + cruft packs from midx. + + * "git remote" now detects remote names that overlap with each other + (e.g., remote nickname "outer" and "outer/inner" are used at the + same time), as it will lead to overlapping remote-tracking + branches. + (merge a5a727c448 jk/remote-avoid-overlapping-names later to maint). + + * The gpg.program configuration variable, which names a pathname to + the (custom) GPG compatible program, can now be spelled with ~tilde + expansion. + (merge 7d275cd5c0 jb/gpg-program-variable-is-a-pathname later to maint). + + * Our header file relied on that the system-supplied + header is not later included, which would override our + macro definitions, but "amazon linux" broke this assumption. Fix + this by preemptively including near the beginning of + ourselves. + (merge 9d3b33125f ps/sane-ctype-workaround later to maint). + + * Clean-up compat/bswap.h mess. + (merge f4ac32c03a ss/compat-bswap-revamp later to maint). + + * Meson-based build did not handle libexecdir setting correctly, + which has been corrected. + (merge 056dbe8612 rj/meson-libexecdir-fix later to maint). + + * Document that we do not require "real" name when signing your + patches off. + (merge 1f0fed312a bc/contribution-under-non-real-names later to maint). + + * "git commit" that concludes a conflicted merge failed to notice and remove + existing comment added automatically (like "# Conflicts:") when the + core.commentstring is set to 'auto'. + (merge 92b7c7c9f5 ac/auto-comment-char-fix later to maint). + + * "git rebase -i" with bogus rebase.instructionFormat configuration + failed to produce the todo file after recording the state files, + leading to confused "git status"; this has been corrected. + (merge ade14bffd7 ow/rebase-verify-insn-fmt-before-initializing-state later to maint). + + * A few file descriptors left unclosed upon program completion in a + few test helper programs are now closed. + (merge 0f1b33815b hl/test-helper-fd-close later to maint). + + * Interactive prompt code did not correctly strip CRLF from the end + of line on Windows. + (merge 711a20827b js/prompt-crlf-fix later to maint). + + * The config API had a set of convenience wrapper functions that + implicitly use the_repository instance; they have been removed and + inlined at the calling sites. + + * "git add/etc -p" now honor the diff.context configuration variable, + and also they learn to honor the -U command-line option. + (merge 2b3ae04011 lm/add-p-context later to maint). + + * Other code cleanup, docfix, build fix, etc. + (merge b257adb571 lo/my-first-ow-doc-update later to maint). + (merge 8b34b6a220 ly/sequencer-update-squash-is-fixup-only later to maint). + (merge 5dceb8bd05 ly/do-not-localize-bug-messages later to maint). + (merge 61372dd613 ly/commit-buffer-reencode-leakfix later to maint). + (merge 81cd1eef7d ly/pack-bitmap-root-leakfix later to maint). + (merge bfc9f9cc64 ly/submodule-update-failure-leakfix later to maint). + (merge 65dff89c6b ma/doc-diff-cc-headers later to maint). + (merge efb61591ee jm/bundle-uri-debug-output-to-fp later to maint). + (merge a3d278bb64 ly/prepare-show-merge-leakfix later to maint). + (merge 1fde1c5daf ac/preload-index-wo-the-repository later to maint). + (merge 855cfc65ae rm/t2400-modernize later to maint). + (merge 2939494284 ly/run-builtin-use-passed-in-repo later to maint). + (merge ff73f375bb jg/mailinfo-leakfix later to maint). + (merge 996f14c02b jj/doc-branch-markup-fix later to maint). + (merge 1e77de1864 cb/ci-freebsd-update-to-14.3 later to maint). + (merge b0e9d25865 jk/fix-leak-send-pack later to maint). + (merge f3a9558c8c bs/remote-helpers-doc-markup-fix later to maint). + (merge c4e9775c60 kh/doc-config-subcommands later to maint). + (merge de404249ab ps/perlless-test-fixes later to maint). + (merge 953049eed8 ts/merge-orig-head-doc-fix later to maint). + (merge 0c83bbc704 rj/freebsd-sysinfo-build-fix later to maint). + (merge ad7780b38f ps/doc-pack-refs-auto-with-files-backend-fix later to maint). + (merge f4fa8a3687 rh/doc-glob-pathspec-fix later to maint). + (merge b27be108c8 ja/doc-git-log-markup later to maint). + (merge 14d7583beb pw/config-kvi-remove-path later to maint). + (merge f31abb421d jc/do-not-scan-argv-without-parsing later to maint). + (merge 26552cb62a jk/unleak-reflog-expire-entry later to maint). + (merge 339d95fda9 jc/ci-print-test-failures-fix later to maint). + (merge 8c3add51a8 cb/meson-avoid-broken-macos-pcre2 later to maint). + (merge 5247da07b8 ps/meson-clar-decls-fix later to maint). + (merge f3ef347bb2 ch/t7450-recursive-clone-test-fix later to maint). + (merge 4ac3302a1a jc/doc-release-vs-clear later to maint). + (merge 3bdd897413 ms/meson-with-ancient-git-wo-ls-files-dedup later to maint). + (merge cca758d324 kh/doc-fast-import-historical later to maint). + (merge 9b0781196a jc/test-hashmap-is-still-here later to maint). diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 958e3cc3d54741..86ca7f6a78a9b6 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches @@ -408,8 +408,15 @@ your patch differs from project to project, so it may be different from that of the project you are accustomed to. [[real-name]] -Also notice that a real name is used in the `Signed-off-by` trailer. Please -don't hide your real name. +Please use a known identity in the `Signed-off-by` trailer, since we cannot +accept anonymous contributions. It is common, but not required, to use some form +of your real name. We realize that some contributors are not comfortable doing +so or prefer to contribute under a pseudonym or preferred name and we can accept +your patch either way, as long as the name and email you use are distinctive, +identifying, and not misleading. + +The goal of this policy is to allow us to have sufficient information to contact +you if questions arise about your contribution. [[commit-trailers]] If you like, you can put extra trailers at the end: diff --git a/Documentation/asciidoc.conf.in b/Documentation/asciidoc.conf.in index 9d9139306e6f75..ff9ea0a2944511 100644 --- a/Documentation/asciidoc.conf.in +++ b/Documentation/asciidoc.conf.in @@ -43,7 +43,7 @@ ifdef::doctype-book[] endif::doctype-book[] [literal-inlinemacro] -{eval:re.sub(r'(<[-a-zA-Z0-9.]+>)', r'\1', re.sub(r'([\[\s|()>]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@\\\*\/_^\$]+\.?)+|,)',r'\1\2', re.sub(r'(\.\.\.?)([^\]$.])', r'\1\2', macros.passthroughs[int(attrs['passtext'][1:-1])] if attrs['passtext'][1:-1].isnumeric() else attrs['passtext'][1:-1])))} +{eval:re.sub(r'(<[-a-zA-Z0-9.]+>)', r'\1', re.sub(r'([\[\s|()>]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@\\\*\/_^\$%]+\.?)+|,)',r'\1\2', re.sub(r'(\.\.\.?)([^\]$.])', r'\1\2', macros.passthroughs[int(attrs['passtext'][1:-1])] if attrs['passtext'][1:-1].isnumeric() else attrs['passtext'][1:-1])))} endif::backend-docbook[] diff --git a/Documentation/asciidoctor-extensions.rb.in b/Documentation/asciidoctor-extensions.rb.in index 8b7b1613496748..fe64a62d9683be 100644 --- a/Documentation/asciidoctor-extensions.rb.in +++ b/Documentation/asciidoctor-extensions.rb.in @@ -73,7 +73,7 @@ module Git elsif type == :monospaced node.text.gsub(/(\.\.\.?)([^\]$\.])/, '\1\2') .gsub(/^\.\.\.?$/, '\0') - .gsub(%r{([\[\s|()>.]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@/_^\$\\\*]+\.{0,2})+|,)}, '\1\2') + .gsub(%r{([\[\s|()>.]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@/_^\$\\\*%]+\.{0,2})+|,)}, '\1\2') .gsub(/(<[-a-zA-Z0-9.]+>)/, '\1') else open, close, supports_phrase = QUOTE_TAGS[type] @@ -102,7 +102,7 @@ module Git if node.type == :monospaced node.text.gsub(/(\.\.\.?)([^\]$.])/, '\1\2') .gsub(/^\.\.\.?$/, '\0') - .gsub(%r{([\[\s|()>.]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@,/_^\$\\\*]+\.{0,2})+)}, '\1\2') + .gsub(%r{([\[\s|()>.]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@,/_^\$\\\*%]+\.{0,2})+)}, '\1\2') .gsub(/(<[-a-zA-Z0-9.]+>)/, '\1') else diff --git a/Documentation/config/branch.adoc b/Documentation/config/branch.adoc index e35ea7ac640d64..a4db9fa5c87eab 100644 --- a/Documentation/config/branch.adoc +++ b/Documentation/config/branch.adoc @@ -69,9 +69,9 @@ This option defaults to `never`. `git fetch`) to lookup the default branch for merging. Without this option, `git pull` defaults to merge the first refspec fetched. Specify multiple values to get an octopus merge. - If you wish to setup `git pull` so that it merges into from + If you wish to setup `git pull` so that it merges into __ from another branch in the local repository, you can point - branch..merge to the desired branch, and use the relative path + `branch..merge` to the desired branch, and use the relative path setting `.` (a period) for `branch..remote`. `branch..mergeOptions`:: diff --git a/Documentation/config/feature.adoc b/Documentation/config/feature.adoc index cb49ff2604a632..924f5ff4e3caaa 100644 --- a/Documentation/config/feature.adoc +++ b/Documentation/config/feature.adoc @@ -24,6 +24,12 @@ reusing objects from multiple packs instead of just one. * `pack.usePathWalk` may speed up packfile creation and make the packfiles be significantly smaller in the presence of certain filename collisions with Git's default name-hash. ++ +* `init.defaultRefFormat=reftable` causes newly initialized repositories to use +the reftable format for storing references. This new format solves issues with +case-insensitive filesystems, compresses better and performs significantly +better with many use cases. Refer to Documentation/technical/reftable.adoc for +more information on this new storage format. feature.manyFiles:: Enable config options that optimize for repos with many files in the diff --git a/Documentation/config/format.adoc b/Documentation/config/format.adoc index 7410e930e530fd..ab0710e86a3e2c 100644 --- a/Documentation/config/format.adoc +++ b/Documentation/config/format.adoc @@ -68,9 +68,15 @@ format.encodeEmailHeaders:: Defaults to true. format.pretty:: +ifndef::with-breaking-changes[] The default pretty format for log/show/whatchanged command. See linkgit:git-log[1], linkgit:git-show[1], linkgit:git-whatchanged[1]. +endif::with-breaking-changes[] +ifdef::with-breaking-changes[] + The default pretty format for log/show command. + See linkgit:git-log[1], linkgit:git-show[1]. +endif::with-breaking-changes[] format.thread:: The default threading style for 'git format-patch'. Can be diff --git a/Documentation/config/gpg.adoc b/Documentation/config/gpg.adoc index 5cf32b179dc8bd..240e46c050545c 100644 --- a/Documentation/config/gpg.adoc +++ b/Documentation/config/gpg.adoc @@ -1,5 +1,5 @@ gpg.program:: - Use this custom program instead of "`gpg`" found on `$PATH` when + Pathname of the program to use instead of "`gpg`" when making or verifying a PGP signature. The program must support the same command-line interface as GPG, namely, to verify a detached signature, "`gpg --verify $signature - <$file`" is run, and the diff --git a/Documentation/config/imap.adoc b/Documentation/config/imap.adoc index 3d28f7264374e6..4682a6bd039755 100644 --- a/Documentation/config/imap.adoc +++ b/Documentation/config/imap.adoc @@ -1,7 +1,9 @@ imap.folder:: The folder to drop the mails into, which is typically the Drafts - folder. For example: "INBOX.Drafts", "INBOX/Drafts" or - "[Gmail]/Drafts". Required. + folder. For example: `INBOX.Drafts`, `INBOX/Drafts` or + `[Gmail]/Drafts`. The IMAP folder to interact with MUST be specified; + the value of this configuration variable is used as the fallback + default value when the `--folder` option is not given. imap.tunnel:: Command used to set up a tunnel to the IMAP server through which @@ -40,5 +42,6 @@ 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` - option, the only supported method is 'CRAM-MD5'. If this is not set - then 'git imap-send' uses the basic IMAP plaintext LOGIN command. + 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 9003a8219143ab..16e00e8d296aa1 100644 --- a/Documentation/config/log.adoc +++ b/Documentation/config/log.adoc @@ -1,64 +1,76 @@ -log.abbrevCommit:: - If true, makes linkgit:git-log[1], linkgit:git-show[1], and - linkgit:git-whatchanged[1] assume `--abbrev-commit`. You may +`log.abbrevCommit`:: + If `true`, make +ifndef::with-breaking-changes[] + linkgit:git-log[1], linkgit:git-show[1], and + linkgit:git-whatchanged[1] +endif::with-breaking-changes[] +ifdef::with-breaking-changes[] + linkgit:git-log[1] and linkgit:git-show[1] +endif::with-breaking-changes[] + assume `--abbrev-commit`. You may override this option with `--no-abbrev-commit`. -log.date:: - Set the default date-time mode for the 'log' command. - Setting a value for log.date is similar to using 'git log''s +`log.date`:: + Set the default date-time mode for the `log` command. + Setting a value for log.date is similar to using `git log`'s `--date` option. See linkgit:git-log[1] for details. + If the format is set to "auto:foo" and the pager is in use, format "foo" will be used for the date format. Otherwise, "default" will be used. -log.decorate:: +`log.decorate`:: Print out the ref names of any commits that are shown by the log - command. If 'short' is specified, the ref name prefixes 'refs/heads/', - 'refs/tags/' and 'refs/remotes/' will not be printed. If 'full' is - specified, the full ref name (including prefix) will be printed. - If 'auto' is specified, then if the output is going to a terminal, - the ref names are shown as if 'short' were given, otherwise no ref - names are shown. This is the same as the `--decorate` option - of the `git log`. + command. Possible values are: ++ +---- +`short`;; the ref name prefixes `refs/heads/`, `refs/tags/` and + `refs/remotes/` are not printed. +`full`;; the full ref name (including prefix) are printed. +`auto`;; if the output is going to a terminal, + the ref names are shown as if `short` were given, otherwise no ref + names are shown. +---- ++ +This is the same as the `--decorate` option of the `git log`. -log.initialDecorationSet:: +`log.initialDecorationSet`:: By default, `git log` only shows decorations for certain known ref namespaces. If 'all' is specified, then show all refs as decorations. -log.excludeDecoration:: +`log.excludeDecoration`:: Exclude the specified patterns from the log decorations. This is similar to the `--decorate-refs-exclude` command-line option, but the config option can be overridden by the `--decorate-refs` option. -log.diffMerges:: +`log.diffMerges`:: Set diff format to be used when `--diff-merges=on` is specified, see `--diff-merges` in linkgit:git-log[1] for details. Defaults to `separate`. -log.follow:: +`log.follow`:: If `true`, `git log` will act as if the `--follow` option was used when a single is given. This has the same limitations as `--follow`, i.e. it cannot be used to follow multiple files and does not work well on non-linear history. -log.graphColors:: +`log.graphColors`:: A list of colors, separated by commas, that can be used to draw history lines in `git log --graph`. -log.showRoot:: +`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. Tools like linkgit:git-log[1] or linkgit:git-whatchanged[1], which normally hide the root commit will now show it. True by default. -log.showSignature:: +`log.showSignature`:: If true, makes linkgit:git-log[1], linkgit:git-show[1], and linkgit:git-whatchanged[1] assume `--show-signature`. -log.mailmap:: +`log.mailmap`:: If true, makes linkgit:git-log[1], linkgit:git-show[1], and linkgit:git-whatchanged[1] assume `--use-mailmap`, otherwise assume `--no-use-mailmap`. True by default. diff --git a/Documentation/config/merge.adoc b/Documentation/config/merge.adoc index 86359f6dd2d904..15a4c14c38aade 100644 --- a/Documentation/config/merge.adoc +++ b/Documentation/config/merge.adoc @@ -81,8 +81,18 @@ as `false`. Defaults to `conflict`. attributes" in linkgit:gitattributes[5]. `merge.stat`:: - Whether to print the diffstat between `ORIG_HEAD` and the merge result - at the end of the merge. True by default. + What, if anything, to print between `ORIG_HEAD` and the merge result + at the end of the merge. Possible values are: ++ +-- +`false`;; Show nothing. +`true`;; Show `git diff --diffstat --summary ORIG_HEAD`. +`compact`;; Show `git diff --compact-summary ORIG_HEAD`. +-- ++ +but any unrecognised value (e.g., a value added by a future version of +Git) is taken as `true` instead of triggering an error. Defaults to +`true`. `merge.autoStash`:: When set to `true`, automatically create a temporary stash entry diff --git a/Documentation/config/pull.adoc b/Documentation/config/pull.adoc index 9349e09261b25c..125c930f72c8db 100644 --- a/Documentation/config/pull.adoc +++ b/Documentation/config/pull.adoc @@ -29,5 +29,21 @@ pull.octopus:: The default merge strategy to use when pulling multiple branches at once. +pull.autoStash:: + When set to true, automatically create a temporary stash entry + to record the local changes before the operation begins, and + restore them after the operation completes. When your "git + pull" rebases (instead of merges), this may be convenient, since + unlike merging pull that tolerates local changes that do not + interfere with the merge, rebasing pull refuses to work with any + local changes. ++ +If `pull.autostash` is set (either to true or false), +`merge.autostash` and `rebase.autostash` are ignored. If +`pull.autostash` is not set at all, depending on the value of +`pull.rebase`, `merge.autostash` or `rebase.autostash` is used +instead. Can be overridden by the `--[no-]autostash` command line +option. + pull.twohead:: The default merge strategy to use when pulling a single branch. diff --git a/Documentation/config/repack.adoc b/Documentation/config/repack.adoc index c79af6d7b8b5d7..e9e78dcb198292 100644 --- a/Documentation/config/repack.adoc +++ b/Documentation/config/repack.adoc @@ -39,3 +39,10 @@ repack.cruftThreads:: a cruft pack and the respective parameters are not given over the command line. See similarly named `pack.*` configuration variables for defaults and meaning. + +repack.midxMustContainCruft:: + When set to true, linkgit:git-repack[1] will unconditionally include + cruft pack(s), if any, in the multi-pack index when invoked with + `--write-midx`. When false, cruft packs are only included in the MIDX + when necessary (e.g., because they might be required to form a + reachability closure with MIDX bitmaps). Defaults to true. diff --git a/Documentation/config/sendemail.adoc b/Documentation/config/sendemail.adoc index 5ffcfc9f2a76f7..47223346579727 100644 --- a/Documentation/config/sendemail.adoc +++ b/Documentation/config/sendemail.adoc @@ -1,38 +1,38 @@ 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 + `sendemail.` subsection to take precedence over + values in the `sendemail` section. The default identity is the value of `sendemail.identity`. sendemail.smtpEncryption:: See linkgit:git-send-email[1] for description. Note that this - setting is not subject to the 'identity' mechanism. + setting is not subject to the `identity` mechanism. sendemail.smtpSSLCertPath:: Path to ca-certificates (either a directory or a single file). Set it to an empty string to disable certificate verification. sendemail..*:: - Identity-specific versions of the 'sendemail.*' parameters + 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:: - If true (default), a single editor instance will be spawned to edit + 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 + summary when `--compose` is used). If `false`, files will be edited one after the other, spawning a new editor each time. sendemail.confirm:: Sets the default for whether to confirm before sending. Must be - one of 'always', 'never', 'cc', 'compose', or 'auto'. See `--confirm` + 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:: - If true, makes linkgit:git-send-email[1] assume `--mailmap`, - otherwise assume `--no-mailmap`. False by default. + If `true`, makes linkgit:git-send-email[1] assume `--mailmap`, + otherwise assume `--no-mailmap`. `False` by default. sendemail.mailmap.file:: The location of a linkgit:git-send-email[1] specific augmenting @@ -51,7 +51,7 @@ sendemail.aliasesFile:: sendemail.aliasFileType:: Format of the file(s) specified in sendemail.aliasesFile. Must be - one of 'mutt', 'mailrc', 'pine', 'elm', 'gnus', or 'sendmail'. + one of `mutt`, `mailrc`, `pine`, `elm`, `gnus`, or `sendmail`. + What an alias file in each format looks like can be found in the documentation of the email program of the same name. The @@ -96,12 +96,17 @@ sendemail.xmailer:: linkgit:git-send-email[1] command-line options. See its documentation for details. +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):: Deprecated alias for `sendemail.signedOffByCc`. 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 + 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]. @@ -111,5 +116,5 @@ sendemail.smtpReloginDelay:: sendemail.forbidSendmailVariables:: To avoid common misconfiguration mistakes, linkgit:git-send-email[1] - will abort with a warning if any configuration options for "sendmail" + will abort with a warning if any configuration options for `sendmail` exist. Set this variable to bypass the check. diff --git a/Documentation/diff-context-options.adoc b/Documentation/diff-context-options.adoc new file mode 100644 index 00000000000000..e161260358fff5 --- /dev/null +++ b/Documentation/diff-context-options.adoc @@ -0,0 +1,10 @@ +`-U`:: +`--unified=`:: + Generate diffs with __ lines of context. Defaults to `diff.context` + or 3 if the config option is unset. + +`--inter-hunk-context=`:: + Show the context between diff hunks, up to the specified __ + of lines, thereby fusing hunks that are close to each other. + Defaults to `diff.interHunkContext` or 0 if the config option + is unset. diff --git a/Documentation/diff-generate-patch.adoc b/Documentation/diff-generate-patch.adoc index e5c813c96f3ac4..7b6cdd198012b0 100644 --- a/Documentation/diff-generate-patch.adoc +++ b/Documentation/diff-generate-patch.adoc @@ -138,7 +138,7 @@ or like this (when the `--cc` option is used): + [synopsis] index ,.. -mode ,`..` +mode ,.. new file mode deleted file mode , + diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc index 640eb6e7db58a5..f3a35d81411f1e 100644 --- a/Documentation/diff-options.adoc +++ b/Documentation/diff-options.adoc @@ -37,32 +37,32 @@ endif::git-diff[] endif::git-format-patch[] ifdef::git-log[] --m:: +`-m`:: Show diffs for merge commits in the default format. This is similar to `--diff-merges=on`, except `-m` will produce no output unless `-p` is given as well. --c:: +`-c`:: Produce combined diff output for merge commits. Shortcut for `--diff-merges=combined -p`. ---cc:: +`--cc`:: Produce dense combined diff output for merge commits. Shortcut for `--diff-merges=dense-combined -p`. ---dd:: +`--dd`:: Produce diff with respect to first parent for both merge and regular commits. Shortcut for `--diff-merges=first-parent -p`. ---remerge-diff:: +`--remerge-diff`:: Produce remerge-diff output for merge commits. Shortcut for `--diff-merges=remerge -p`. ---no-diff-merges:: +`--no-diff-merges`:: Synonym for `--diff-merges=off`. ---diff-merges=:: +`--diff-merges=`:: Specify diff format to be used for merge commits. Default is {diff-merges-default} unless `--first-parent` is in use, in which case `first-parent` is the default. @@ -70,48 +70,54 @@ ifdef::git-log[] The following formats are supported: + -- -off, none:: +`off`:: +`none`:: Disable output of diffs for merge commits. Useful to override implied value. -on, m:: +`on`:: +`m`:: Make diff output for merge commits to be shown in the default format. The default format can be changed using `log.diffMerges` configuration variable, whose default value is `separate`. -first-parent, 1:: +`first-parent`:: +`1`:: Show full diff with respect to first parent. This is the same format as `--patch` produces for non-merge commits. -separate:: +`separate`:: Show full diff with respect to each of parents. Separate log entry and diff is generated for each parent. -combined, c:: +`combined`:: +`c`:: Show differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time. Furthermore, it lists only files which were modified from all parents. -dense-combined, cc:: +`dense-combined`:: +`cc`:: Further compress output produced by `--diff-merges=combined` by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification. -remerge, r:: - Remerge two-parent merge commits to create a temporary tree +`remerge`:: +`r`:: Remerge two-parent merge commits to create a temporary tree object--potentially containing files with conflict markers and such. A diff is then shown between that temporary tree and the actual merge commit. +-- + The output emitted when this option is used is subject to change, and so is its interaction with other options (unless explicitly documented). --- ---combined-all-paths:: + +`--combined-all-paths`:: Cause combined diffs (used for merge commits) to list the name of the file from all parents. It thus only has effect when `--diff-merges=[dense-]combined` is in use, and diff --git a/Documentation/git-add.adoc b/Documentation/git-add.adoc index eba0b419ce508f..b7a735824d6ce0 100644 --- a/Documentation/git-add.adoc +++ b/Documentation/git-add.adoc @@ -104,6 +104,8 @@ This effectively runs `add --interactive`, but bypasses the initial command menu and directly jumps to the `patch` subcommand. See ``Interactive mode'' for details. +include::diff-context-options.adoc[] + `-e`:: `--edit`:: Open the diff vs. the index in an editor and let the user diff --git a/Documentation/git-apply.adoc b/Documentation/git-apply.adoc index 952518b8af6fc0..6c71ee69da977d 100644 --- a/Documentation/git-apply.adoc +++ b/Documentation/git-apply.adoc @@ -75,13 +75,14 @@ OPTIONS tree. If `--check` is in effect, merely check that it would apply cleanly to the index entry. +-N:: --intent-to-add:: When applying the patch only to the working tree, mark new files to be added to the index later (see `--intent-to-add` - option in linkgit:git-add[1]). This option is ignored unless - running in a Git repository and `--index` is not specified. - Note that `--index` could be implied by other options such - as `--cached` or `--3way`. + option in linkgit:git-add[1]). This option is ignored if + `--index` or `--cached` are used, and has no effect outside a Git + repository. Note that `--index` could be implied by other options + such as `--3way`. -3:: --3way:: diff --git a/Documentation/git-cat-file.adoc b/Documentation/git-cat-file.adoc index cde79ad242bb77..180d1ad363fdf8 100644 --- a/Documentation/git-cat-file.adoc +++ b/Documentation/git-cat-file.adoc @@ -307,6 +307,11 @@ newline. The available atoms are: `objecttype`:: The type of the object (the same as `cat-file -t` reports). +`objectmode`:: + If the specified object has mode information (such as a tree or + index entry), the mode expressed as an octal integer. Otherwise, + empty string. + `objectsize`:: The size, in bytes, of the object (the same as `cat-file -s` reports). @@ -368,6 +373,14 @@ If a name is specified that might refer to more than one object (an ambiguous sh SP ambiguous LF ------------ +If a name is specified that refers to a submodule entry in a tree and the +target object does not exist in the repository, then `cat-file` will ignore +any custom format and print (with the object ID of the submodule): + +------------ + SP submodule LF +------------ + If `--follow-symlinks` is used, and a symlink in the repository points outside the repository, then `cat-file` will ignore any custom format and print: diff --git a/Documentation/git-checkout.adoc b/Documentation/git-checkout.adoc index ee83b6d9ba9a9b..40e02cfd6562ae 100644 --- a/Documentation/git-checkout.adoc +++ b/Documentation/git-checkout.adoc @@ -289,6 +289,8 @@ section of linkgit:git-add[1] to learn how to operate the `--patch` mode. Note that this option uses the no overlay mode by default (see also `--overlay`), and currently doesn't support overlay mode. +include::diff-context-options.adoc[] + `--ignore-other-worktrees`:: `git checkout` refuses when the wanted branch is already checked out or otherwise in use by another worktree. This option makes diff --git a/Documentation/git-commit.adoc b/Documentation/git-commit.adoc index dc219025f1eb0b..ae988a883b5b86 100644 --- a/Documentation/git-commit.adoc +++ b/Documentation/git-commit.adoc @@ -76,6 +76,8 @@ OPTIONS which changes to commit. See linkgit:git-add[1] for details. +include::diff-context-options.adoc[] + `-C `:: `--reuse-message=`:: Take an existing __ object, and reuse the log message diff --git a/Documentation/git-config.adoc b/Documentation/git-config.adoc index 936e0c5130fe7d..511b2e26bfb00f 100644 --- a/Documentation/git-config.adoc +++ b/Documentation/git-config.adoc @@ -10,9 +10,9 @@ SYNOPSIS -------- [verse] 'git config list' [] [] [--includes] -'git config get' [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] -'git config set' [] [--type=] [--all] [--value=] [--fixed-value] -'git config unset' [] [--all] [--value=] [--fixed-value] +'git config get' [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=] [--url=] +'git config set' [] [--type=] [--all] [--value=] [--fixed-value] +'git config unset' [] [--all] [--value=] [--fixed-value] 'git config rename-section' [] 'git config remove-section' [] 'git config edit' [] @@ -26,7 +26,7 @@ escaped. Multiple lines can be added to an option by using the `--append` option. If you want to update or unset an option which can occur on multiple -lines, a `value-pattern` (which is an extended regular expression, +lines, `--value=` (which is an extended regular expression, unless the `--fixed-value` option is given) needs to be given. Only the existing values that match the pattern are updated or unset. If you want to handle the lines that do *not* match the pattern, just @@ -109,7 +109,7 @@ OPTIONS --replace-all:: Default behavior is to replace at most one line. This replaces - all lines matching the key (and optionally the `value-pattern`). + all lines matching the key (and optionally `--value=`). --append:: Adds a new line to the option without altering any existing @@ -200,11 +200,19 @@ See also <>. section in linkgit:gitrevisions[7] for a more complete list of ways to spell blob names. +`--value=`:: +`--no-value`:: + With `get`, `set`, and `unset`, match only against + __. The pattern is an extended regular expression unless + `--fixed-value` is given. ++ +Use `--no-value` to unset __. + --fixed-value:: - When used with the `value-pattern` argument, treat `value-pattern` as + When used with `--value=`, treat __ as an exact string instead of a regular expression. This will restrict the name/value pairs that are matched to only those where the value - is exactly equal to the `value-pattern`. + is exactly equal to __. --type :: 'git config' will ensure that any input or output is valid under the given @@ -259,6 +267,12 @@ Valid ``'s include: Output only the names of config variables for `list` or `get`. +`--show-names`:: +`--no-show-names`:: + With `get`, show config keys in addition to their values. The + default is `--no-show-names` unless `--url` is given and there + are no subsections in __. + --show-origin:: Augment the output of all queried config options with the origin type (file, standard input, blob, command line) and diff --git a/Documentation/git-diff.adoc b/Documentation/git-diff.adoc index dec173a345179e..272331afbaec73 100644 --- a/Documentation/git-diff.adoc +++ b/Documentation/git-diff.adoc @@ -14,7 +14,7 @@ git diff [] --cached [--merge-base] [] [--] [...] git diff [] [--merge-base] [...] [--] [...] git diff [] ... [--] [...] git diff [] -git diff [] --no-index [--] +git diff [] --no-index [--] [...] DESCRIPTION ----------- @@ -31,14 +31,18 @@ files on disk. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. -`git diff [] --no-index [--] `:: +`git diff [] --no-index [--] [...]`:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when running the command in a working tree controlled by Git and at least one of the paths points outside the working tree, or when running the command outside a working tree - controlled by Git. This form implies `--exit-code`. + controlled by Git. This form implies `--exit-code`. If both + paths point to directories, additional pathspecs may be + provided. These will limit the files included in the + difference. All such pathspecs must be relative as they + apply to both sides of the diff. `git diff [] --cached [--merge-base] [] [--] [...]`:: diff --git a/Documentation/git-fast-export.adoc b/Documentation/git-fast-export.adoc index 43bbb4f63ca6bf..297b57bb2efdc2 100644 --- a/Documentation/git-fast-export.adoc +++ b/Documentation/git-fast-export.adoc @@ -50,6 +50,23 @@ resulting tag will have an invalid signature. is the same as how earlier versions of this command without this option behaved. + +When exported, a signature starts with: ++ +gpgsig ++ +where is the Git object hash so either "sha1" or +"sha256", and is the signature type, so "openpgp", +"x509", "ssh" or "unknown". ++ +For example, an OpenPGP signature on a SHA-1 commit starts with +`gpgsig sha1 openpgp`, while an SSH signature on a SHA-256 commit +starts with `gpgsig sha256 ssh`. ++ +While all the signatures of a commit are exported, an importer may +choose to accept only some of them. For example +linkgit:git-fast-import[1] currently stores at most one signature per +Git hash algorithm in each commit. ++ NOTE: This is highly experimental and the format of the data stream may change in the future without compatibility guarantees. diff --git a/Documentation/git-fast-import.adoc b/Documentation/git-fast-import.adoc index 250d8666521781..6f9763c11b3cfd 100644 --- a/Documentation/git-fast-import.adoc +++ b/Documentation/git-fast-import.adoc @@ -182,7 +182,7 @@ amount of memory usage and processing time. Assuming the frontend is able to keep up with fast-import and feed it a constant stream of data, import times for projects holding 10+ years of history and containing 100,000+ individual commits are generally completed in just 1-2 -hours on quite modest (~$2,000 USD) hardware. +hours on quite modest hardware (~$2,000 USD in 2007). Most bottlenecks appear to be in foreign source data access (the source just cannot extract revisions fast enough) or disk IO (fast-import @@ -445,7 +445,7 @@ one). original-oid? ('author' (SP )? SP LT GT SP LF)? 'committer' (SP )? SP LT GT SP LF - ('gpgsig' SP LF data)? + ('gpgsig' SP SP LF data)? ('encoding' SP LF)? data ('from' SP LF)? @@ -518,13 +518,39 @@ their syntax. ^^^^^^^^ The optional `gpgsig` command is used to include a PGP/GPG signature -that signs the commit data. +or other cryptographic signature that signs the commit data. -Here specifies which hashing algorithm is used for this -signature, either `sha1` or `sha256`. +.... + 'gpgsig' SP SP LF data +.... + +The `gpgsig` command takes two arguments: + +* `` specifies which Git object format this signature + applies to, either `sha1` or `sha256`. This allows to know which + representation of the commit was signed (the SHA-1 or the SHA-256 + version) which helps with both signature verification and + interoperability between repos with different hash functions. + +* `` specifies the type of signature, such as + `openpgp`, `x509`, `ssh`, or `unknown`. This is a convenience for + tools that process the stream, so they don't have to parse the ASCII + armor to identify the signature type. + +A commit may have at most one signature for the SHA-1 object format +(stored in the "gpgsig" header) and one for the SHA-256 object format +(stored in the "gpgsig-sha256" header). + +See below for a detailed description of the `data` command which +contains the raw signature data. + +Signatures are not yet checked in the current implementation +though. (Already setting the `extensions.compatObjectFormat` +configuration option might help with verifying both SHA-1 and SHA-256 +object format signatures when it will be implemented.) -NOTE: This is highly experimental and the format of the data stream may -change in the future without compatibility guarantees. +NOTE: This is highly experimental and the format of the `gpgsig` +command may change in the future without compatibility guarantees. `encoding` ^^^^^^^^^^ diff --git a/Documentation/git-for-each-ref.adoc b/Documentation/git-for-each-ref.adoc index 5ef89fc0fe3c9d..060940904da21c 100644 --- a/Documentation/git-for-each-ref.adoc +++ b/Documentation/git-for-each-ref.adoc @@ -7,14 +7,14 @@ git-for-each-ref - Output information on each ref SYNOPSIS -------- -[verse] -'git for-each-ref' [--count=] [--shell|--perl|--python|--tcl] +[synopsis] +git for-each-ref [--count=] [--shell|--perl|--python|--tcl] [(--sort=)...] [--format=] - [--include-root-refs] [ --stdin | ... ] - [--points-at=] + [--include-root-refs] [--points-at=] [--merged[=]] [--no-merged[=]] [--contains[=]] [--no-contains[=]] - [--exclude= ...] + [(--exclude=)...] [--start-after=] + [ --stdin | ... ] DESCRIPTION ----------- @@ -108,6 +108,15 @@ TAB %(refname)`. --include-root-refs:: List root refs (HEAD and pseudorefs) apart from regular refs. +--start-after=:: + Allows paginating the output by skipping references up to and including the + specified marker. When paging, it should be noted that references may be + deleted, modified or added between invocations. Output will only yield those + references which follow the marker lexicographically. Output begins from the + first reference that would come after the marker alphabetically. Cannot be + used with `--sort=` or `--stdin` options, or the __ argument(s) + to limit the refs. + FIELD NAMES ----------- diff --git a/Documentation/git-imap-send.adoc b/Documentation/git-imap-send.adoc index 26ccf4e433b44f..278e5ccd36b9fa 100644 --- a/Documentation/git-imap-send.adoc +++ b/Documentation/git-imap-send.adoc @@ -9,21 +9,24 @@ git-imap-send - Send a collection of patches from stdin to an IMAP folder SYNOPSIS -------- [verse] -'git imap-send' [-v] [-q] [--[no-]curl] +'git imap-send' [-v] [-q] [--[no-]curl] [(--folder|-f) ] +'git imap-send' --list DESCRIPTION ----------- -This command uploads a mailbox generated with 'git format-patch' +This command uploads a mailbox generated with `git format-patch` into an IMAP drafts folder. This allows patches to be sent as other email is when using mail clients that cannot read mailbox files directly. The command also works with any general mailbox -in which emails have the fields "From", "Date", and "Subject" in +in which emails have the fields `From`, `Date`, and `Subject` in that order. Typical usage is something like: -git format-patch --signoff --stdout --attach origin | git imap-send +------ +$ git format-patch --signoff --stdout --attach origin | git imap-send +------ OPTIONS @@ -37,6 +40,11 @@ OPTIONS --quiet:: Be quiet. +-f :: +--folder=:: + Specify the folder in which the emails have to saved. + For example: `--folder=[Gmail]/Drafts` or `-f INBOX/Drafts`. + --curl:: Use libcurl to communicate with the IMAP server, unless tunneling into it. Ignored if Git was built without the USE_CURL_FOR_IMAP_SEND @@ -47,6 +55,8 @@ OPTIONS using libcurl. Ignored if Git was built with the NO_OPENSSL option set. +--list:: + Run the IMAP LIST command to output a list of all the folders present. CONFIGURATION ------------- @@ -58,6 +68,34 @@ include::includes/cmd-config-section-rest.adoc[] include::config/imap.adoc[] +GETTING A LIST OF AVAILABLE FOLDERS +----------------------------------- + +In order to send an email to a specific folder, you need to know the correct name of +intended folder in your mailbox. The names like "Junk", "Trash" etc. displayed by +various email clients need not be the actual names of the folders stored in the mail +server of your email provider. + +In order to get the correct folder name to be used with `git imap-send`, you can run +`git imap-send --list`. This will display a list of valid folder names. An example +of such an output when run on a Gmail account is: + +......................... +* LIST (\HasNoChildren) "/" "INBOX" +* LIST (\HasChildren \Noselect) "/" "[Gmail]" +* LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail" +* LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts" +* LIST (\HasNoChildren \Important) "/" "[Gmail]/Important" +* LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail" +* LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam" +* LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred" +* LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash" +......................... + +Here, you can observe that the correct name for the "Junk" folder is `[Gmail]/Spam` +and for the "Trash" folder is `[Gmail]/Trash`. Similar logic can be used to determine +other folders as well. + EXAMPLES -------- Using tunnel mode: @@ -102,20 +140,56 @@ Using Gmail's IMAP interface: --------- [imap] - folder = "[Gmail]/Drafts" - host = imaps://imap.gmail.com - user = user@gmail.com - port = 993 + folder = "[Gmail]/Drafts" + host = imaps://imap.gmail.com + user = user@gmail.com + port = 993 --------- +Gmail does not allow using your regular password for `git imap-send`. +If you have multi-factor authentication set up on your Gmail account, you +can generate an app-specific password for use with `git imap-send`. +Visit https://security.google.com/settings/security/apppasswords to create +it. Alternatively, use OAuth2.0 authentication as described below. + [NOTE] You might need to instead use: `folder = "[Google Mail]/Drafts"` if you get an error -that the "Folder doesn't exist". +that the "Folder doesn't exist". You can also run `git imap-send --list` to get a +list of available folders. [NOTE] If your Gmail account is set to another language than English, the name of the "Drafts" folder will be localized. +If you want to use OAuth2.0 based authentication, you can specify +`OAUTHBEARER` or `XOAUTH2` mechanism in your config. It is more secure +than using app-specific passwords, and also does not enforce the need of +having multi-factor authentication. You will have to use an OAuth2.0 +access token in place of your password when using this authentication. + +--------- +[imap] + folder = "[Gmail]/Drafts" + host = imaps://imap.gmail.com + user = user@gmail.com + port = 993 + authmethod = OAUTHBEARER +--------- + +Using Outlook's IMAP interface: + +Unlike Gmail, Outlook only supports OAuth2.0 based authentication. Also, it +supports only `XOAUTH2` as the mechanism. + +--------- +[imap] + folder = "Drafts" + host = imaps://outlook.office365.com + user = user@outlook.com + port = 993 + authmethod = XOAUTH2 +--------- + Once the commits are ready to be sent, run the following command: $ git format-patch --cover-letter -M --stdout origin/master | git imap-send @@ -124,6 +198,10 @@ Just make sure to disable line wrapping in the email client (Gmail's web interface will wrap lines no matter what, so you need to use a real IMAP client). +In case you are using OAuth2.0 authentication, it is easier to use credential +helpers to generate tokens. Credential helpers suggested in +linkgit:git-send-email[1] can be used for `git imap-send` as well. + CAUTION ------- It is still your responsibility to make sure that the email message diff --git a/Documentation/git-log.adoc b/Documentation/git-log.adoc index ae8a7e2d638949..b6f3d92c435f56 100644 --- a/Documentation/git-log.adoc +++ b/Documentation/git-log.adoc @@ -8,8 +8,8 @@ git-log - Show commit logs SYNOPSIS -------- -[verse] -'git log' [] [] [[--] ...] +[synopsis] +git log [] [] [[--] ...] DESCRIPTION ----------- @@ -27,28 +27,34 @@ each commit introduces are shown. OPTIONS ------- ---follow:: +`--follow`:: Continue listing the history of a file beyond renames (works only for a single file). ---no-decorate:: ---decorate[=short|full|auto|no]:: - Print out the ref names of any commits that are shown. If 'short' is - specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and - 'refs/remotes/' will not be printed. If 'full' is specified, the - full ref name (including prefix) will be printed. If 'auto' is - specified, then if the output is going to a terminal, the ref names - are shown as if 'short' were given, otherwise no ref names are - shown. The option `--decorate` is short-hand for `--decorate=short`. - Default to configuration value of `log.decorate` if configured, - otherwise, `auto`. - ---decorate-refs=:: ---decorate-refs-exclude=:: +`--no-decorate`:: +`--decorate[=(short|full|auto|no)]`:: + Print out the ref names of any commits that are shown. Possible values + are: ++ +---- +`short`;; the ref name prefixes `refs/heads/`, `refs/tags/` and + `refs/remotes/` are not printed. +`full`;; the full ref name (including prefix) is printed. +`auto`:: if the output is going to a terminal, the ref names + are shown as if `short` were given, otherwise no ref names are + shown. +---- ++ +The option `--decorate` is short-hand for `--decorate=short`. Default to +configuration value of `log.decorate` if configured, otherwise, `auto`. + +`--decorate-refs=`:: +`--decorate-refs-exclude=`:: For each candidate reference, do not use it for decoration if it - matches any patterns given to `--decorate-refs-exclude` or if it - doesn't match any of the patterns given to `--decorate-refs`. The - `log.excludeDecoration` config option allows excluding refs from + matches any of the __ parameters given to + `--decorate-refs-exclude` or if it doesn't match any of the + __ parameters given to `--decorate-refs`. + The `log.excludeDecoration` config option allows excluding refs from the decorations, but an explicit `--decorate-refs` pattern will override a match in `log.excludeDecoration`. + @@ -56,51 +62,51 @@ If none of these options or config settings are given, then references are used as decoration if they match `HEAD`, `refs/heads/`, `refs/remotes/`, `refs/stash/`, or `refs/tags/`. ---clear-decorations:: +`--clear-decorations`:: When specified, this option clears all previous `--decorate-refs` or `--decorate-refs-exclude` options and relaxes the default decoration filter to include all references. This option is assumed if the config value `log.initialDecorationSet` is set to `all`. ---source:: +`--source`:: Print out the ref name given on the command line by which each commit was reached. ---[no-]mailmap:: ---[no-]use-mailmap:: +`--[no-]mailmap`:: +`--[no-]use-mailmap`:: Use mailmap file to map author and committer names and email addresses to canonical real names and email addresses. See linkgit:git-shortlog[1]. ---full-diff:: +`--full-diff`:: Without this flag, `git log -p ...` shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch - the specified paths; this means that "..." limits only + the specified paths; this means that "`...`" limits only commits, and doesn't limit diff for those commits. + Note that this affects all diff-based output types, e.g. those produced by `--stat`, etc. ---log-size:: - Include a line ``log size '' in the output for each commit, - where is the length of that commit's message in bytes. +`--log-size`:: + Include a line `log size ` in the output for each commit, + where __ is the length of that commit's message in bytes. Intended to speed up tools that read log messages from `git log` output by allowing them to allocate space in advance. include::line-range-options.adoc[] -:: +__:: Show only commits in the specified revision range. When no - is specified, it defaults to `HEAD` (i.e. the + __ is specified, it defaults to `HEAD` (i.e. the whole history leading to the current commit). `origin..HEAD` specifies all the commits reachable from the current commit (i.e. `HEAD`), but not from `origin`. For a complete list of - ways to spell , see the 'Specifying Ranges' + ways to spell __, see the 'Specifying Ranges' section of linkgit:gitrevisions[7]. -[--] ...:: +`[--] ...`:: Show only commits that are enough to explain how the files that match the specified paths came to be. See 'History Simplification' below for details and other simplification @@ -145,14 +151,14 @@ EXAMPLES `git log --since="2 weeks ago" -- gitk`:: - Show the changes during the last two weeks to the file 'gitk'. + Show the changes during the last two weeks to the file `gitk`. The `--` is necessary to avoid confusion with the *branch* named - 'gitk' + `gitk` `git log --name-status release..test`:: - Show the commits that are in the "test" branch but not yet - in the "release" branch, along with the list of paths + Show the commits that are in the "`test`" branch but not yet + in the "`release`" branch, along with the list of paths each commit modifies. `git log --follow builtin/rev-list.c`:: @@ -164,7 +170,7 @@ EXAMPLES `git log --branches --not --remotes=origin`:: Shows all commits that are in any of local branches but not in - any of remote-tracking branches for 'origin' (what you have that + any of remote-tracking branches for `origin` (what you have that origin doesn't). `git log master --not --remotes=*/master`:: @@ -200,11 +206,11 @@ CONFIGURATION See linkgit:git-config[1] for core variables and linkgit:git-diff[1] for settings related to diff generation. -format.pretty:: +`format.pretty`:: Default for the `--format` option. (See 'Pretty Formats' above.) Defaults to `medium`. -i18n.logOutputEncoding:: +`i18n.logOutputEncoding`:: Encoding to use when displaying logs. (See 'Discussion' above.) Defaults to the value of `i18n.commitEncoding` if set, and UTF-8 otherwise. diff --git a/Documentation/git-merge.adoc b/Documentation/git-merge.adoc index 12aa859d16def9..a055384ad6956c 100644 --- a/Documentation/git-merge.adoc +++ b/Documentation/git-merge.adoc @@ -9,7 +9,7 @@ git-merge - Join two or more development histories together SYNOPSIS -------- [synopsis] -git merge [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] +git merge [-n] [--stat] [--compact-summary] [--no-commit] [--squash] [--[no-]edit] [--no-verify] [-s ] [-X ] [-S[]] [--[no-]allow-unrelated-histories] [--[no-]rerere-autoupdate] [-m ] [-F ] @@ -28,8 +28,8 @@ Assume the following history exists and the current branch is `master`: ------------ - A---B---C topic - / + A---B---C topic + / D---E---F---G master ------------ @@ -38,11 +38,11 @@ Then `git merge topic` will replay the changes made on the its current commit (`C`) on top of `master`, and record the result in a new commit along with the names of the two parent commits and a log message from the user describing the changes. Before the operation, -`ORIG_HEAD` is set to the tip of the current branch (`C`). +`ORIG_HEAD` is set to the tip of the current branch (`G`). ------------ - A---B---C topic - / \ + A---B---C topic + / \ D---E---F---G---H master ------------ diff --git a/Documentation/git-pack-objects.adoc b/Documentation/git-pack-objects.adoc index b1c5aa27da4d55..eba014c40615eb 100644 --- a/Documentation/git-pack-objects.adoc +++ b/Documentation/git-pack-objects.adoc @@ -87,13 +87,21 @@ base-name:: reference was included in the resulting packfile. This can be useful to send new tags to native Git clients. ---stdin-packs:: +--stdin-packs[=]:: Read the basenames of packfiles (e.g., `pack-1234abcd.pack`) from the standard input, instead of object names or revision arguments. The resulting pack contains all objects listed in the included packs (those not beginning with `^`), excluding any objects listed in the excluded packs (beginning with `^`). + +When `mode` is "follow", objects from packs not listed on stdin receive +special treatment. Objects within unlisted packs will be included if +those objects are (1) reachable from the included packs, and (2) not +found in any excluded packs. This mode is useful, for example, to +resurrect once-unreachable objects found in cruft packs to generate +packs which are closed under reachability up to the boundary set by the +excluded packs. ++ Incompatible with `--revs`, or options that imply `--revs` (such as `--all`), with the exception of `--unpacked`, which is compatible. diff --git a/Documentation/git-pack-refs.adoc b/Documentation/git-pack-refs.adoc index 652c5497715a0f..42b90051e695a5 100644 --- a/Documentation/git-pack-refs.adoc +++ b/Documentation/git-pack-refs.adoc @@ -66,7 +66,10 @@ Pack refs as needed depending on the current state of the ref database. The behavior depends on the ref format used by the repository and may change in the future. + - - "files": No special handling for `--auto` has been implemented. + - "files": Loose references are packed into the `packed-refs` file + based on the ratio of loose references to the size of the + `packed-refs` file. The bigger the `packed-refs` file, the more loose + references need to exist before we repack. + - "reftable": Tables are compacted such that they form a geometric sequence. For two tables N and N+1, where N+1 is newer, this diff --git a/Documentation/git-reset.adoc b/Documentation/git-reset.adoc index e5c96128d78f93..4bbf1e306b40ce 100644 --- a/Documentation/git-reset.adoc +++ b/Documentation/git-reset.adoc @@ -126,6 +126,8 @@ OPTIONS separated with _NUL_ character and all other characters are taken literally (including newlines and quotes). +include::diff-context-options.adoc[] + `--`:: Do not interpret any more arguments as options. diff --git a/Documentation/git-restore.adoc b/Documentation/git-restore.adoc index 877b7772e66735..961eef01373938 100644 --- a/Documentation/git-restore.adoc +++ b/Documentation/git-restore.adoc @@ -28,8 +28,6 @@ otherwise from the index. Use `--source` to restore from a different commit. See "Reset, restore and revert" in linkgit:git[1] for the differences between the three commands. -THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE. - OPTIONS ------- `-s `:: @@ -52,6 +50,8 @@ leave out at most one of ___ and __, in which case it defaults to Mode" section of linkgit:git-add[1] to learn how to operate the `--patch` mode. +include::diff-context-options.adoc[] + `-W`:: `--worktree`:: `-S`:: diff --git a/Documentation/git-send-email.adoc b/Documentation/git-send-email.adoc index 26fda63c2fc1ff..5335502d68fc7b 100644 --- a/Documentation/git-send-email.adoc +++ b/Documentation/git-send-email.adoc @@ -21,7 +21,7 @@ Takes the patches given on the command line and emails them out. Patches can be specified as files, directories (which will send all files in the directory), or directly as a revision list. In the last case, any format accepted by linkgit:git-format-patch[1] can -be passed to git send-email, as well as options understood by +be passed to `git send-email`, as well as options understood by linkgit:git-format-patch[1]. The header of the email is configurable via command-line options. If not @@ -35,11 +35,11 @@ There are two formats accepted for patch files: This is what linkgit:git-format-patch[1] generates. Most headers and MIME formatting are ignored. -2. The original format used by Greg Kroah-Hartman's 'send_lots_of_email.pl' +2. The original format used by Greg Kroah-Hartman's `send_lots_of_email.pl` script + -This format expects the first line of the file to contain the "Cc:" value -and the "Subject:" of the message as the second line. +This format expects the first line of the file to contain the `Cc:` value +and the `Subject:` of the message as the second line. OPTIONS @@ -54,13 +54,13 @@ Composing `sendemail.multiEdit`. --bcc=
,...:: - Specify a "Bcc:" value for each email. Default is the value of + Specify a `Bcc:` value for each email. Default is the value of `sendemail.bcc`. + This option may be specified multiple times. --cc=
,...:: - Specify a starting "Cc:" value for each email. + Specify a starting `Cc:` value for each email. Default is the value of `sendemail.cc`. + This option may be specified multiple times. @@ -69,14 +69,14 @@ This option may be specified multiple times. Invoke a text editor (see GIT_EDITOR in linkgit:git-var[1]) to edit an introductory message for the patch series. + -When `--compose` is used, git send-email will use the From, To, Cc, Bcc, -Subject, Reply-To, and In-Reply-To headers specified in the message. If -the body of the message (what you type after the headers and a blank -line) only contains blank (or Git: prefixed) lines, the summary won't be +When `--compose` is used, `git send-email` will use the `From`, `To`, `Cc`, +`Bcc`, `Subject`, `Reply-To`, and `In-Reply-To` headers specified in the +message. If the body of the message (what you type after the headers and a +blank line) only contains blank (or `Git:` prefixed) lines, the summary won't be sent, but the headers mentioned above will be used unless they are removed. + -Missing From or In-Reply-To headers will be prompted for. +Missing `From` or `In-Reply-To` headers will be prompted for. + See the CONFIGURATION section for `sendemail.multiEdit`. @@ -85,13 +85,13 @@ See the CONFIGURATION section for `sendemail.multiEdit`. the value of the `sendemail.from` configuration option is used. If neither the command-line option nor `sendemail.from` are set, then the user will be prompted for the value. The default for the prompt will be - the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if that is not - set, as returned by "git var -l". + the value of `GIT_AUTHOR_IDENT`, or `GIT_COMMITTER_IDENT` if that is not + set, as returned by `git var -l`. --reply-to=
:: Specify the address where replies from recipients should go to. Use this if replies to messages should go to another address than what - is specified with the --from parameter. + is specified with the `--from` parameter. --in-reply-to=:: Make the first mail (or all the mails with `--no-thread`) appear as a @@ -112,14 +112,14 @@ illustration below where `[PATCH v2 0/3]` is in reply to `[PATCH 0/2]`: [PATCH v2 2/3] New tests [PATCH v2 3/3] Implementation + -Only necessary if --compose is also set. If --compose +Only necessary if `--compose` is also set. If `--compose` is not set, this will be prompted for. --[no-]outlook-id-fix:: Microsoft Outlook SMTP servers discard the Message-ID sent via email and assign a new random Message-ID, thus breaking threads. + -With `--outlook-id-fix`, 'git send-email' uses a mechanism specific to +With `--outlook-id-fix`, `git send-email` uses a mechanism specific to Outlook servers to learn the Message-ID the server assigned to fix the threading. Use it only when you know that the server reports the rewritten Message-ID the same way as Outlook servers do. @@ -130,14 +130,14 @@ to 'smtp.office365.com' or 'smtp-mail.outlook.com'. Use --subject=:: Specify the initial subject of the email thread. - Only necessary if --compose is also set. If --compose + Only necessary if `--compose` is also set. If `--compose` is not set, this will be prompted for. --to=
,...:: Specify the primary recipient of the emails generated. Generally, this will be the upstream maintainer of the project involved. Default is the value of the `sendemail.to` configuration value; if that is unspecified, - and --to-cmd is not specified, this will be prompted for. + and `--to-cmd` is not specified, this will be prompted for. + This option may be specified multiple times. @@ -145,30 +145,30 @@ This option may be specified multiple times. When encountering a non-ASCII message or subject that does not declare its encoding, add headers/quoting to indicate it is encoded in . Default is the value of the - 'sendemail.assume8bitEncoding'; if that is unspecified, this + `sendemail.assume8bitEncoding`; if that is unspecified, this will be prompted for if any non-ASCII files are encountered. + Note that no attempts whatsoever are made to validate the encoding. --compose-encoding=:: Specify encoding of compose message. Default is the value of the - 'sendemail.composeEncoding'; if that is unspecified, UTF-8 is assumed. + `sendemail.composeEncoding`; if that is unspecified, UTF-8 is assumed. --transfer-encoding=(7bit|8bit|quoted-printable|base64|auto):: Specify the transfer encoding to be used to send the message over SMTP. - 7bit will fail upon encountering a non-ASCII message. quoted-printable + `7bit` will fail upon encountering a non-ASCII message. `quoted-printable` can be useful when the repository contains files that contain carriage - returns, but makes the raw patch email file (as saved from a MUA) much - harder to inspect manually. base64 is even more fool proof, but also - even more opaque. auto will use 8bit when possible, and quoted-printable - otherwise. + returns, but makes the raw patch email file (as saved from an MUA) much + harder to inspect manually. `base64` is even more fool proof, but also + even more opaque. `auto` will use `8bit` when possible, and + `quoted-printable` otherwise. + Default is the value of the `sendemail.transferEncoding` configuration value; if that is unspecified, default to `auto`. --xmailer:: --no-xmailer:: - Add (or prevent adding) the "X-Mailer:" header. By default, + Add (or prevent adding) the `X-Mailer:` header. By default, the header is added, but it can be turned off by setting the `sendemail.xmailer` configuration variable to `false`. @@ -178,9 +178,9 @@ Sending --envelope-sender=
:: Specify the envelope sender used to send the emails. This is useful if your default address is not the address that is - subscribed to a list. In order to use the 'From' address, set the - value to "auto". If you use the sendmail binary, you must have - suitable privileges for the -f parameter. Default is the value of the + subscribed to a list. In order to use the `From` address, set the + value to `auto`. If you use the `sendmail` binary, you must have + suitable privileges for the `-f` parameter. Default is the value of the `sendemail.envelopeSender` configuration variable; if that is unspecified, choosing the envelope sender is left to your MTA. @@ -189,27 +189,27 @@ Sending be sendmail-like; specifically, it must support the `-i` option. The command will be executed in the shell if necessary. Default is the value of `sendemail.sendmailCmd`. If unspecified, and if - --smtp-server is also unspecified, git-send-email will search - for `sendmail` in `/usr/sbin`, `/usr/lib` and $PATH. + `--smtp-server` is also unspecified, `git send-email` will search + for `sendmail` in `/usr/sbin`, `/usr/lib` and `$PATH`. --smtp-encryption=:: Specify in what way encrypting begins for the SMTP connection. - Valid values are 'ssl' and 'tls'. Any other value reverts to plain + Valid values are `ssl` and `tls`. Any other value reverts to plain (unencrypted) SMTP, which defaults to port 25. Despite the names, both values will use the same newer version of TLS, - but for historic reasons have these names. 'ssl' refers to "implicit" + but for historic reasons have these names. `ssl` refers to "implicit" encryption (sometimes called SMTPS), that uses port 465 by default. - 'tls' refers to "explicit" encryption (often known as STARTTLS), + `tls` refers to "explicit" encryption (often known as STARTTLS), that uses port 25 by default. Other ports might be used by the SMTP server, which are not the default. Commonly found alternative port for - 'tls' and unencrypted is 587. You need to check your provider's + `tls` and unencrypted is 587. You need to check your provider's documentation or your server configuration to make sure for your own case. Default is the value of `sendemail.smtpEncryption`. --smtp-domain=:: Specifies the Fully Qualified Domain Name (FQDN) used in the HELO/EHLO command to the SMTP server. Some servers require the - FQDN to match your IP address. If not set, git send-email attempts + FQDN to match your IP address. If not set, `git send-email` attempts to determine your FQDN automatically. Default is the value of `sendemail.smtpDomain`. @@ -223,10 +223,10 @@ $ git send-email --smtp-auth="PLAIN LOGIN GSSAPI" ... + If at least one of the specified mechanisms matches the ones advertised by the SMTP server and if it is supported by the utilized SASL library, the mechanism -is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth` +is used for authentication. If neither `sendemail.smtpAuth` nor `--smtp-auth` is specified, all mechanisms supported by the SASL library can be used. The -special value 'none' maybe specified to completely disable authentication -independently of `--smtp-user` +special value `none` maybe specified to completely disable authentication +independently of `--smtp-user`. --smtp-pass[=]:: Password for SMTP-AUTH. The argument is optional: If no @@ -238,16 +238,16 @@ Furthermore, passwords need not be specified in configuration files or on the command line. If a username has been specified (with `--smtp-user` or a `sendemail.smtpUser`), but no password has been specified (with `--smtp-pass` or `sendemail.smtpPass`), then -a password is obtained using 'git-credential'. +a password is obtained using linkgit:git-credential[1]. --no-smtp-auth:: - Disable SMTP authentication. Short hand for `--smtp-auth=none` + Disable SMTP authentication. Short hand for `--smtp-auth=none`. --smtp-server=:: If set, specifies the outgoing SMTP server to use (e.g. `smtp.example.com` or a raw IP address). If unspecified, and if `--sendmail-cmd` is also unspecified, the default is to search - for `sendmail` in `/usr/sbin`, `/usr/lib` and $PATH if such a + for `sendmail` in `/usr/sbin`, `/usr/lib` and `$PATH` if such a program is available, falling back to `localhost` otherwise. + For backward compatibility, this option can also specify a full pathname @@ -260,7 +260,7 @@ instead. Specifies a port different from the default port (SMTP servers typically listen to smtp port 25, but may also listen to submission port 587, or the common SSL smtp port 465); - symbolic port names (e.g. "submission" instead of 587) + symbolic port names (e.g. `submission` instead of 587) are also accepted. The port can also be set with the `sendemail.smtpServerPort` configuration variable. @@ -269,23 +269,25 @@ instead. Default value can be specified by the `sendemail.smtpServerOption` configuration option. + -The --smtp-server-option option must be repeated for each option you want +The `--smtp-server-option` option must be repeated for each option you want to pass to the server. Likewise, different lines in the configuration files must be used for each option. --smtp-ssl:: - Legacy alias for '--smtp-encryption ssl'. + Legacy alias for `--smtp-encryption ssl`. --smtp-ssl-cert-path:: Path to a store of trusted CA certificates for SMTP SSL/TLS certificate validation (either a directory that has been processed - by 'c_rehash', or a single file containing one or more PEM format - certificates concatenated together: see verify(1) -CAfile and - -CApath for more information on these). Set it to an empty string - to disable certificate verification. Defaults to the value of the - `sendemail.smtpSSLCertPath` configuration variable, if set, or the - backing SSL library's compiled-in default otherwise (which should - be the best choice on most platforms). + by `c_rehash`, or a single file containing one or more PEM format + certificates concatenated together: see the description of the + `-CAfile` __ and the `-CApath` __ options of + https://docs.openssl.org/master/man1/openssl-verify/ + [OpenSSL's verify(1) manual page] for more information on these). + Set it to an empty string to disable certificate verification. + Defaults to the value of the `sendemail.smtpSSLCertPath` configuration + variable, if set, or the backing SSL library's compiled-in default + otherwise (which should be the best choice on most platforms). --smtp-user=:: Username for SMTP-AUTH. Default is the value of `sendemail.smtpUser`; @@ -298,18 +300,18 @@ must be used for each option. connection and authentication problems. --batch-size=:: - Some email servers (e.g. smtp.163.com) limit the number emails to be + Some email servers (e.g. 'smtp.163.com') limit the number of emails to be sent per session (connection) and this will lead to a failure when sending many messages. With this option, send-email will disconnect after - sending $ messages and wait for a few seconds (see --relogin-delay) - and reconnect, to work around such a limit. You may want to - use some form of credential helper to avoid having to retype - your password every time this happens. Defaults to the + sending __ messages and wait for a few seconds + (see `--relogin-delay`) and reconnect, to work around such a limit. + You may want to use some form of credential helper to avoid having to + retype your password every time this happens. Defaults to the `sendemail.smtpBatchSize` configuration variable. --relogin-delay=:: - Waiting $ seconds before reconnecting to SMTP server. Used together - with --batch-size option. Defaults to the `sendemail.smtpReloginDelay` + Waiting __ seconds before reconnecting to SMTP server. Used together + with `--batch-size` option. Defaults to the `sendemail.smtpReloginDelay` configuration variable. Automating @@ -318,7 +320,7 @@ Automating --no-to:: --no-cc:: --no-bcc:: - Clears any list of "To:", "Cc:", "Bcc:" addresses previously + Clears any list of `To:`, `Cc:`, `Bcc:` addresses previously set via config. --no-identity:: @@ -327,13 +329,13 @@ Automating --to-cmd=:: Specify a command to execute once per patch file which - should generate patch file specific "To:" entries. + should generate patch file specific `To:` entries. Output of this command must be single email address per line. - Default is the value of 'sendemail.toCmd' configuration value. + Default is the value of `sendemail.toCmd` configuration value. --cc-cmd=:: Specify a command to execute once per patch file which - should generate patch file specific "Cc:" entries. + should generate patch file specific `Cc:` entries. Output of this command must be single email address per line. Default is the value of `sendemail.ccCmd` configuration value. @@ -341,7 +343,7 @@ Automating Specify a command that is executed once per outgoing message and output RFC 2822 style header lines to be inserted into them. When the `sendemail.headerCmd` configuration variable is - set, its value is always used. When --header-cmd is provided + set, its value is always used. When `--header-cmd` is provided at the command line, its value takes precedence over the `sendemail.headerCmd` configuration variable. @@ -350,7 +352,7 @@ Automating --[no-]chain-reply-to:: If this is set, each email will be sent as a reply to the previous - email sent. If disabled with "--no-chain-reply-to", all emails after + email sent. If disabled with `--no-chain-reply-to`, all emails after the first will be sent as replies to the first email sent. When using this, it is recommended that the first file given be an overview of the entire patch series. Disabled by default, but the `sendemail.chainReplyTo` @@ -358,79 +360,80 @@ Automating --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 + `sendemail.` subsection to take precedence over + values in the `sendemail` section. The default identity is the value of `sendemail.identity`. --[no-]signed-off-by-cc:: - If this is set, add emails found in the `Signed-off-by` trailer or Cc: lines to the - cc list. Default is the value of `sendemail.signedOffByCc` configuration - value; if that is unspecified, default to --signed-off-by-cc. + If this is set, add emails found in the `Signed-off-by` trailer or `Cc:` + lines to the cc list. Default is the value of `sendemail.signedOffByCc` + configuration value; if that is unspecified, default to + `--signed-off-by-cc`. --[no-]cc-cover:: - If this is set, emails found in Cc: headers in the first patch of + If this is set, emails found in `Cc:` headers in the first patch of the series (typically the cover letter) are added to the cc list - for each email set. Default is the value of 'sendemail.ccCover' - configuration value; if that is unspecified, default to --no-cc-cover. + for each email set. Default is the value of `sendemail.ccCover` + configuration value; if that is unspecified, default to `--no-cc-cover`. --[no-]to-cover:: - If this is set, emails found in To: headers in the first patch of + If this is set, emails found in `To:` headers in the first patch of the series (typically the cover letter) are added to the to list - for each email set. Default is the value of 'sendemail.toCover' - configuration value; if that is unspecified, default to --no-to-cover. + for each email set. Default is the value of `sendemail.toCover` + configuration value; if that is unspecified, default to `--no-to-cover`. --suppress-cc=:: Specify an additional category of recipients to suppress the auto-cc of: + -- -- 'author' will avoid including the patch author. -- 'self' will avoid including the sender. -- 'cc' will avoid including anyone mentioned in Cc lines in the patch header - except for self (use 'self' for that). -- 'bodycc' will avoid including anyone mentioned in Cc lines in the - patch body (commit message) except for self (use 'self' for that). -- 'sob' will avoid including anyone mentioned in the Signed-off-by trailers except - for self (use 'self' for that). -- 'misc-by' will avoid including anyone mentioned in Acked-by, +- `author` will avoid including the patch author. +- `self` will avoid including the sender. +- `cc` will avoid including anyone mentioned in Cc lines in the patch header + except for self (use `self` for that). +- `bodycc` will avoid including anyone mentioned in Cc lines in the + patch body (commit message) except for self (use `self` for that). +- `sob` will avoid including anyone mentioned in the Signed-off-by trailers except + for self (use `self` for that). +- `misc-by` will avoid including anyone mentioned in Acked-by, Reviewed-by, Tested-by and other "-by" lines in the patch body, - except Signed-off-by (use 'sob' for that). -- 'cccmd' will avoid running the --cc-cmd. -- 'body' is equivalent to 'sob' + 'bodycc' + 'misc-by'. -- 'all' will suppress all auto cc values. + except Signed-off-by (use `sob` for that). +- `cccmd` will avoid running the --cc-cmd. +- `body` is equivalent to `sob` + `bodycc` + `misc-by`. +- `all` will suppress all auto cc values. -- + Default is the value of `sendemail.suppressCc` configuration value; if -that is unspecified, default to 'self' if --suppress-from is -specified, as well as 'body' if --no-signed-off-cc is specified. +that is unspecified, default to `self` if `--suppress-from` is +specified, as well as `body` if `--no-signed-off-cc` is specified. --[no-]suppress-from:: - If this is set, do not add the From: address to the cc: list. + If this is set, do not add the `From:` address to the `Cc:` list. Default is the value of `sendemail.suppressFrom` configuration - value; if that is unspecified, default to --no-suppress-from. + value; if that is unspecified, default to `--no-suppress-from`. --[no-]thread:: - If this is set, the In-Reply-To and References headers will be + If this is set, the `In-Reply-To` and `References` headers will be added to each email sent. Whether each mail refers to the - previous email (`deep` threading per 'git format-patch' + previous email (`deep` threading per `git format-patch` wording) or to the first email (`shallow` threading) is - governed by "--[no-]chain-reply-to". + governed by `--[no-]chain-reply-to`. + -If disabled with "--no-thread", those headers will not be added -(unless specified with --in-reply-to). Default is the value of the +If disabled with `--no-thread`, those headers will not be added +(unless specified with `--in-reply-to`). Default is the value of the `sendemail.thread` configuration value; if that is unspecified, -default to --thread. +default to `--thread`. + It is up to the user to ensure that no In-Reply-To header already -exists when 'git send-email' is asked to add it (especially note that -'git format-patch' can be configured to do the threading itself). +exists when `git send-email` is asked to add it (especially note that +`git format-patch` can be configured to do the threading itself). Failure to do so may not produce the expected result in the recipient's MUA. --[no-]mailmap:: Use the mailmap file (see linkgit:gitmailmap[5]) to map all addresses to their canonical real name and email address. Additional - mailmap data specific to git-send-email may be provided using the + mailmap data specific to `git send-email` may be provided using the `sendemail.mailmap.file` or `sendemail.mailmap.blob` configuration values. Defaults to `sendemail.mailmap`. @@ -441,17 +444,17 @@ Administering Confirm just before sending: + -- -- 'always' will always confirm before sending -- 'never' will never confirm before sending -- 'cc' will confirm before sending when send-email has automatically - added addresses from the patch to the Cc list -- 'compose' will confirm before sending the first message when using --compose. -- 'auto' is equivalent to 'cc' + 'compose' +- `always` will always confirm before sending. +- `never` will never confirm before sending. +- `cc` will confirm before sending when send-email has automatically + added addresses from the patch to the Cc list. +- `compose` will confirm before sending the first message when using --compose. +- `auto` is equivalent to `cc` + `compose`. -- + Default is the value of `sendemail.confirm` configuration value; if that -is unspecified, default to 'auto' unless any of the suppress options -have been specified, in which case default to 'compose'. +is unspecified, default to `auto` unless any of the suppress options +have been specified, in which case default to `compose`. --dry-run:: Do everything except actually send the emails. @@ -460,10 +463,10 @@ have been specified, in which case default to 'compose'. When an argument may be understood either as a reference or as a file name, choose to understand it as a format-patch argument (`--format-patch`) or as a file name (`--no-format-patch`). By default, when such a conflict - occurs, git send-email will fail. + occurs, `git send-email` will fail. --quiet:: - Make git-send-email less verbose. One line per email should be + Make `git send-email` less verbose. One line per email should be all that is output. --[no-]validate:: @@ -474,7 +477,7 @@ have been specified, in which case default to 'compose'. * Invoke the sendemail-validate hook if present (see linkgit:githooks[5]). * Warn of patches that contain lines longer than 998 characters unless a suitable transfer encoding - ('auto', 'base64', or 'quoted-printable') is used; + (`auto`, `base64`, or `quoted-printable`) is used; this is due to SMTP limits as described by https://www.ietf.org/rfc/rfc5322.txt. -- @@ -493,13 +496,13 @@ Information Instead of the normal operation, dump the shorthand alias names from the configured alias file(s), one per line in alphabetical order. Note that this only includes the alias name and not its expanded email addresses. - See 'sendemail.aliasesFile' for more information about aliases. + See `sendemail.aliasesFile` for more information about aliases. --translate-aliases:: Instead of the normal operation, read from standard input and interpret each line as an email alias. Translate it according to the configured alias file(s). Output each translated name and email - address to standard output, one per line. See 'sendemail.aliasFile' + address to standard output, one per line. See `sendemail.aliasFile` for more information about aliases. CONFIGURATION @@ -524,15 +527,18 @@ edit `~/.gitconfig` to specify your account settings: smtpServerPort = 587 ---- +Gmail does not allow using your regular password for `git send-email`. If you have multi-factor authentication set up on your Gmail account, you can -generate an app-specific password for use with 'git send-email'. Visit +generate an app-specific password for use with `git send-email`. Visit https://security.google.com/settings/security/apppasswords to create it. -You can also use OAuth2.0 authentication with Gmail. `OAUTHBEARER` and -`XOAUTH2` are common methods used for this type of authentication. Gmail -supports both of them. As an example, if you want to use `OAUTHBEARER`, edit -your `~/.gitconfig` file and add `smtpAuth = OAUTHBEARER` to your account -settings: +Alternatively, instead of using an app-specific password, you can use +OAuth2.0 authentication with Gmail. OAuth2.0 is more secure than +app-specific passwords, and works regardless of whether you have multi-factor +authentication set up. `OAUTHBEARER` and `XOAUTH2` are common mechanisms used +for this type of authentication. Gmail supports both of them. As an example, +if you want to use `OAUTHBEARER`, edit your `~/.gitconfig` file and add +`smtpAuth = OAUTHBEARER` to your account settings: ---- [sendemail] @@ -543,11 +549,15 @@ settings: smtpAuth = OAUTHBEARER ---- +Another alternative is using a tool developed by Google known as +https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail[sendgmail] +to send emails using `git send-email`. + Use Microsoft Outlook as the SMTP Server ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unlike Gmail, Microsoft Outlook no longer supports app-specific passwords. Therefore, OAuth2.0 authentication must be used for Outlook. Also, it only -supports `XOAUTH2` authentication method. +supports `XOAUTH2` authentication mechanism. Edit `~/.gitconfig` to specify your account settings for Outlook and use its SMTP server with `git send-email`: @@ -579,8 +589,7 @@ next time. If you are using OAuth2.0 authentication, you need to use an access token in place of a password when prompted. Various OAuth2.0 token generators are -available online. Community maintained credential helpers for Gmail and Outlook -are also available: +available online. Community maintained credential helpers are also available: - https://github.com/AdityaGarg8/git-credential-email[git-credential-gmail] (cross platform, dedicated helper for authenticating Gmail accounts) @@ -588,15 +597,65 @@ are also available: - https://github.com/AdityaGarg8/git-credential-email[git-credential-outlook] (cross platform, dedicated helper for authenticating Microsoft Outlook accounts) + - https://github.com/AdityaGarg8/git-credential-email[git-credential-yahoo] + (cross platform, dedicated helper for authenticating Yahoo accounts) + + - https://github.com/AdityaGarg8/git-credential-email[git-credential-aol] + (cross platform, dedicated helper for authenticating AOL accounts) + You can also see linkgit:gitcredentials[7] for more OAuth based authentication helpers. +Proton Mail does not provide an SMTP server to send emails. If you are a paid +customer of Proton Mail, you can use +https://proton.me/mail/bridge[Proton Mail Bridge] +officially provided by Proton Mail to create a local SMTP server for sending +emails. For both free and paid users, community maintained projects like +https://github.com/AdityaGarg8/git-credential-email[git-protonmail] can be +used. + Note: the following core Perl modules that may be installed with your distribution of Perl are required: -MIME::Base64, MIME::QuotedPrint, Net::Domain and Net::SMTP. + +https://metacpan.org/pod/MIME::Base64[MIME::Base64], +https://metacpan.org/pod/MIME::QuotedPrint[MIME::QuotedPrint], +https://metacpan.org/pod/Net::Domain[Net::Domain] and +https://metacpan.org/pod/Net::SMTP[Net::SMTP]. + These additional Perl modules are also required: -Authen::SASL and Mail::Address. +https://metacpan.org/pod/Authen::SASL[Authen::SASL] and +https://metacpan.org/pod/Mail::Address[Mail::Address]. + +Exploiting the `sendmailCmd` option of `git send-email` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Apart from sending emails via an SMTP server, `git send-email` can also send +emails through any application that supports sendmail-like commands. You can +read documentation of `--sendmail-cmd=` above for more information. +This ability can be very useful if you want to use another application as an +SMTP client for `git send-email`, or if your email provider uses proprietary +APIs instead of SMTP to send emails. + +As an example, lets see how to configure https://marlam.de/msmtp/[msmtp], a +popular SMTP client found in many Linux distributions. Edit `~/.gitconfig` +to instruct `git-send-email` to use it for sending emails. + +---- +[sendemail] + sendmailCmd = /usr/bin/msmtp # Change this to the path where msmtp is installed +---- + +Links of a few such community maintained helpers are: + + - https://marlam.de/msmtp/[msmtp] + (popular SMTP client with many features, available for Linux and macOS) + + - https://github.com/AdityaGarg8/git-credential-email[git-protonmail] + (cross platform client that can send emails using the ProtonMail API) + + - https://github.com/AdityaGarg8/git-credential-email[git-msgraph] + (cross platform client that can send emails using the Microsoft Graph API) SEE ALSO -------- diff --git a/Documentation/git-stash.adoc b/Documentation/git-stash.adoc index 1a5177f4986ca4..e2300a19a2c0a3 100644 --- a/Documentation/git-stash.adoc +++ b/Documentation/git-stash.adoc @@ -23,6 +23,8 @@ SYNOPSIS 'git stash' clear 'git stash' create [] 'git stash' store [(-m | --message) ] [-q | --quiet] +'git stash' export (--print | --to-ref ) [...] +'git stash' import DESCRIPTION ----------- @@ -154,6 +156,18 @@ store:: 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 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 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:: @@ -208,6 +222,8 @@ to learn how to operate the `--patch` mode. The `--patch` option implies `--keep-index`. You can use `--no-keep-index` to override this. +include::diff-context-options.adoc[] + -S:: --staged:: This option is only valid for `push` and `save` commands. @@ -242,6 +258,19 @@ literally (including newlines and quotes). + Quiet, suppress feedback messages. +--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:: + 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. + @@ -259,7 +288,7 @@ For more details, see the 'pathspec' entry in linkgit:gitglossary[7]. :: This option is only valid for `apply`, `branch`, `drop`, `pop`, - `show` commands. + `show`, and `export` commands. + A reference of the form `stash@{}`. When no `` is given, the latest stash is assumed (that is, `stash@{0}`). diff --git a/Documentation/git-switch.adoc b/Documentation/git-switch.adoc index 9f62abf9e2b89a..87707e92652064 100644 --- a/Documentation/git-switch.adoc +++ b/Documentation/git-switch.adoc @@ -29,8 +29,6 @@ Switching branches does not require a clean index and working tree however if the operation leads to loss of local changes, unless told otherwise with `--discard-changes` or `--merge`. -THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE. - OPTIONS ------- __:: diff --git a/Documentation/git-whatchanged.adoc b/Documentation/git-whatchanged.adoc index 8e55e0bb1ec8a6..d21484026fe805 100644 --- a/Documentation/git-whatchanged.adoc +++ b/Documentation/git-whatchanged.adoc @@ -8,8 +8,14 @@ git-whatchanged - Show logs with differences each commit introduces SYNOPSIS -------- -[verse] -'git whatchanged'