diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/RelNotes/2.10.2.txt | 66 | ||||
-rw-r--r-- | Documentation/RelNotes/2.11.0.txt | 105 | ||||
-rw-r--r-- | Documentation/config.txt | 2 | ||||
-rw-r--r-- | Documentation/diff-options.txt | 8 | ||||
-rw-r--r-- | Documentation/git-fmt-merge-msg.txt | 4 | ||||
-rw-r--r-- | Documentation/git-interpret-trailers.txt | 14 | ||||
-rw-r--r-- | Documentation/git-stash.txt | 3 | ||||
-rw-r--r-- | Documentation/git.txt | 3 | ||||
-rw-r--r-- | Documentation/gitattributes.txt | 157 |
9 files changed, 322 insertions, 40 deletions
diff --git a/Documentation/RelNotes/2.10.2.txt b/Documentation/RelNotes/2.10.2.txt index ed2de0dc20..c4d4397023 100644 --- a/Documentation/RelNotes/2.10.2.txt +++ b/Documentation/RelNotes/2.10.2.txt @@ -41,5 +41,71 @@ Fixes since v2.10.1 that were detected without dying itself, but under some conditions it didn't and died instead, which has been fixed. + * When "git fetch" tries to find where the history of the repository + it runs in has diverged from what the other side has, it has a + mechanism to avoid digging too deep into irrelevant side branches. + This however did not work well over the "smart-http" transport due + to a design bug, which has been fixed. + + * When we started cURL to talk to imap server when a new enough + version of cURL library is available, we forgot to explicitly add + imap(s):// before the destination. To some folks, that didn't work + and the library tried to make HTTP(s) requests instead. + + * The ./configure script generated from configure.ac was taught how + to detect support of SSL by libcurl better. + + * http.emptyauth configuration is a way to allow an empty username to + pass when attempting to authenticate using mechanisms like + Kerberos. We took an unspecified (NULL) username and sent ":" + (i.e. no username, no password) to CURLOPT_USERPWD, but did not do + the same when the username is explicitly set to an empty string. + + * "git clone" of a local repository can be done at the filesystem + level, but the codepath did not check errors while copying and + adjusting the file that lists alternate object stores. + + * Documentation for "git commit" was updated to clarify that "commit + -p <paths>" adds to the current contents of the index to come up + with what to commit. + + * A stray symbolic link in $GIT_DIR/refs/ directory could make name + resolution loop forever, which has been corrected. + + * The "submodule.<name>.path" stored in .gitmodules is never copied + to .git/config and such a key in .git/config has no meaning, but + the documentation described it and submodule.<name>.url next to + each other as if both belong to .git/config. This has been fixed. + + * Recent git allows submodule.<name>.branch to use a special token + "." instead of the branch name; the documentation has been updated + to describe it. + + * In a worktree connected to a repository elsewhere, created via "git + worktree", "git checkout" attempts to protect users from confusion + by refusing to check out a branch that is already checked out in + another worktree. However, this also prevented checking out a + branch, which is designated as the primary branch of a bare + reopsitory, in a worktree that is connected to the bare + repository. The check has been corrected to allow it. + + * "git rebase" immediately after "git clone" failed to find the fork + point from the upstream. + + * When fetching from a remote that has many tags that are irrelevant + to branches we are following, we used to waste way too many cycles + when checking if the object pointed at by a tag (that we are not + going to fetch!) exists in our repository too carefully. + + * The Travis CI configuration we ship ran the tests with --verbose + option but this risks non-TAP output that happens to be "ok" to be + misinterpreted as TAP signalling a test that passed. This resulted + in unnecessary failure. This has been corrected by introducing a + new mode to run our tests in the test harness to send the verbose + output separately to the log file. + + * Some AsciiDoc formatter mishandles a displayed illustration with + tabs in it. Adjust a few of them in merge-base documentation to + work around them. Also contains minor documentation updates and code clean-ups. diff --git a/Documentation/RelNotes/2.11.0.txt b/Documentation/RelNotes/2.11.0.txt index f23759b0c0..f8e8e3f390 100644 --- a/Documentation/RelNotes/2.11.0.txt +++ b/Documentation/RelNotes/2.11.0.txt @@ -5,8 +5,9 @@ Backward compatibility notes. * An empty string used as a pathspec element has always meant 'everything matches', but it is too easy to write a script that - finds a path to remove in $path and run 'git rm "$paht"', which - ends up removing everything. This release starts warning about the + finds a path to remove in $path and run 'git rm "$paht"' by + mistake (when the user meant to give "$path"), which ends up + removing everything. This release starts warning about the use of an empty string that is used for 'everything matches' and asks users to use a more explicit '.' for that instead. @@ -14,11 +15,16 @@ Backward compatibility notes. eventually the warning can be turned into a hard error, upgrading the deprecation into removal of this (mis)feature. - * The historical argument order "git merge <msg> HEAD <commit>..." has been deprecated for quite some time, and will be removed in the next release (not this one). + * The default abbreviation length, which has historically been 7, now + scales as the repository grows, using the approximate number of + objects in the reopsitory and a bit of math around the birthday + paradox. The logic suggests to use 12 hexdigits for the Linux + kernel, and 9 to 10 for Git itself. + Updates since v2.10 ------------------- @@ -133,6 +139,24 @@ UI, Workflows & Features learned to turn "git describe" output (e.g. v2.9.3-599-g2376d31787) into clickable links in its output. + * When new paths were added by "git add -N" to the index, it was + enough to circumvent the check by "git commit" to refrain from + making an empty commit without "--allow-empty". The same logic + prevented "git status" to show such a path as "new file" in the + "Changes not staged for commit" section. + + * The smudge/clean filter API expect an external process is spawned + to filter the contents for each path that has a filter defined. A + new type of "process" filter API has been added to allow the first + request to run the filter for a path to spawn a single process, and + all filtering need is served by this single process for multiple + paths, reducing the process creation overhead. + + * The user always has to say "stash@{$N}" when naming a single + element in the default location of the stash, i.e. reflogs in + refs/stash. The "git stash" command learned to accept "git stash + apply 4" as a short-hand for "git stash apply stash@{4}". + Performance, Internal Implementation, Development Support etc. @@ -212,6 +236,26 @@ Performance, Internal Implementation, Development Support etc. by reducing use of timestamp-ordered commit-list, which was replaced with a priority queue. + * "git diff --no-index" codepath has been updated not to try to peek + into .git/ directory that happens to be under the current + directory, when we know we are operating outside any repository. + + * Update of the sequencer codebase to make it reusable to reimplement + "rebase -i" continues. + + * Git generally does not explicitly close file descriptors that were + open in the parent process when spawning a child process, but most + of the time the child does not want to access them. As Windows does + not allow removing or renaming a file that has a file descriptor + open, a slow-to-exit child can even break the parent process by + holding onto them. Use O_CLOEXEC flag to open files in various + codepaths. + + * Update "interpret-trailers" machinery and teaches it that people in + real world write all sorts of crufts in the "trailer" that was + originally designed to have the neat-o "Mail-Header: like thing" + and nothing else. + Also contains various documentation updates and code clean-ups. @@ -323,7 +367,6 @@ notes for details). * The pretty-format specifier "%C(auto)" used by the "log" family of commands to enable coloring of the output is taught to also issue a color-reset sequence to the output. - (merge 82b83da8d3 rs/c-auto-resets-attributes later to maint). * A shell script example in check-ref-format documentation has been fixed. @@ -340,7 +383,6 @@ notes for details). beyond the end of the mapped region. This was fixed by introducing a regexec_buf() helper that takes a <ptr,len> pair with REG_STARTEND extension. - (merge 842a516cb0 js/regexec-buf later to maint). * The procedure to build Git on Mac OS X for Travis CI hardcoded the internal directory structure we assumed HomeBrew uses, which was a @@ -365,7 +407,6 @@ notes for details). mechanism to avoid digging too deep into irrelevant side branches. This however did not work well over the "smart-http" transport due to a design bug, which has been fixed. - (merge 06b3d386e0 jt/fetch-pack-in-vain-count-with-stateless later to maint). * In the codepath that comes up with the hostname to be used in an e-mail when the user didn't tell us, we looked at ai_canonname @@ -415,11 +456,9 @@ notes for details). version of cURL library is available, we forgot to explicitly add imap(s):// before the destination. To some folks, that didn't work and the library tried to make HTTP(s) requests instead. - (merge d2d07ab861 ak/curl-imap-send-explicit-scheme later to maint). * The ./configure script generated from configure.ac was taught how to detect support of SSL by libcurl better. - (merge 924b7eb1c9 dp/autoconf-curl-ssl later to maint). * The command-line completion script (in contrib/) learned to complete "git cmd ^mas<HT>" to complete the negative end of @@ -446,27 +485,22 @@ notes for details). Kerberos. We took an unspecified (NULL) username and sent ":" (i.e. no username, no password) to CURLOPT_USERPWD, but did not do the same when the username is explicitly set to an empty string. - (merge 5275c3081c dt/http-empty-auth later to maint). * "git clone" of a local repository can be done at the filesystem level, but the codepath did not check errors while copying and adjusting the file that lists alternate object stores. - (merge 22d3b8de1b jk/clone-copy-alternates-fix later to maint). * Documentation for "git commit" was updated to clarify that "commit -p <paths>" adds to the current contents of the index to come up with what to commit. - (merge 7431596ab1 nd/commit-p-doc later to maint). * A stray symbolic link in $GIT_DIR/refs/ directory could make name resolution loop forever, which has been corrected. - (merge e8c42cb9ce jk/ref-symlink-loop later to maint). * The "submodule.<name>.path" stored in .gitmodules is never copied to .git/config and such a key in .git/config has no meaning, but the documentation described it and submodule.<name>.url next to each other as if both belong to .git/config. This has been fixed. - (merge 72710165c9 sb/submodule-config-doc-drop-path later to maint). * In a worktree connected to a repository elsewhere, created via "git worktree", "git checkout" attempts to protect users from confusion @@ -475,29 +509,23 @@ notes for details). branch, which is designated as the primary branch of a bare reopsitory, in a worktree that is connected to the bare repository. The check has been corrected to allow it. - (merge 171c646f8c dk/worktree-dup-checkout-with-bare-is-ok later to maint). * "git rebase" immediately after "git clone" failed to find the fork point from the upstream. - (merge 4f21454b55 jk/merge-base-fork-point-without-reflog later to maint). * When fetching from a remote that has many tags that are irrelevant to branches we are following, we used to waste way too many cycles when checking if the object pointed at by a tag (that we are not going to fetch!) exists in our repository too carefully. - (merge 5827a03545 jk/fetch-quick-tag-following later to maint). * Protect our code from over-eager compilers. - (merge 0ac52a38e8 jk/tighten-alloc later to maint). * Recent git allows submodule.<name>.branch to use a special token "." instead of the branch name; the documentation has been updated to describe it. - (merge 15ef78008a bw/submodule-branch-dot-doc later to maint). * A hot-fix for a test added by a recent topic that went to both 'master' and 'maint' already. - (merge 76e368c378 tg/add-chmod+x-fix later to maint). * "git send-email" attempts to pick up valid e-mails from the trailers, but people in real world write non-addresses there, like @@ -511,18 +539,39 @@ notes for details). in unnecessary failure. This has been corrected by introducing a new mode to run our tests in the test harness to send the verbose output separately to the log file. - (merge 614fe01521 jk/tap-verbose-fix later to maint). * Some AsciiDoc formatter mishandles a displayed illustration with tabs in it. Adjust a few of them in merge-base documentation to work around them. - (merge 6750f62699 po/fix-doc-merge-base-illustration later to maint). + + * A minor regression fix for "git submodule" that was introduced + when more helper functions were reimplemented in C. + (merge 77b63ac31e sb/submodule-ignore-trailing-slash later to maint). + + * The code that we have used for the past 10+ years to cycle + 4-element ring buffers turns out to be not quite portable in + theoretical world. + (merge bb84735c80 rs/ring-buffer-wraparound later to maint). + + * "git daemon" used fixed-length buffers to turn URL to the + repository the client asked for into the server side directory + path, using snprintf() to avoid overflowing these buffers, but + allowed possibly truncated paths to the directory. This has been + tightened to reject such a request that causes overlong path to be + required to serve. + (merge 6bdb0083be jk/daemon-path-ok-check-truncation later to maint). + + * Recent update to git-sh-setup (a library of shell functions that + are used by our in-tree scripted Porcelain commands) included + another shell library git-sh-i18n without specifying where it is, + relying on the $PATH. This has been fixed to be more explicit by + prefixing $(git --exec-path) output in front. + (merge 1073094f30 ak/sh-setup-dot-source-i18n-fix later to maint). * Other minor doc, test and build updates and code cleanups. - (merge a94bb68397 rs/cocci later to maint). - (merge 641c900b2c js/reset-usage later to maint). - (merge 30cfe72d37 rs/pretty-format-color-doc-fix later to maint). - (merge d709f1fb9d jc/diff-unique-abbrev-comments later to maint). - (merge 13092a916d jc/cocci-xstrdup-or-null later to maint). - (merge 86009f32bb pb/test-parse-options-expect later to maint). - (merge 749a2279a4 yk/git-tag-remove-mention-of-old-layout-in-doc later to maint). + (merge 5c238e29a8 jk/common-main later to maint). + (merge 5a5749e45b ak/pre-receive-hook-template-modefix later to maint). + (merge 6d834ac8f1 jk/rebase-config-insn-fmt-docfix later to maint). + (merge de9f7fa3b0 rs/commit-pptr-simplify later to maint). + (merge 4259d693fc sc/fmt-merge-msg-doc-markup-fix later to maint). + (merge 28fab7b23d nd/test-helpers later to maint). diff --git a/Documentation/config.txt b/Documentation/config.txt index 27069ac032..a0ab66aae7 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -2450,7 +2450,7 @@ rebase.missingCommitsCheck:: command in the todo-list. Defaults to "ignore". -rebase.instructionFormat +rebase.instructionFormat:: A format string, as specified in linkgit:git-log[1], to be used for the instruction list during an interactive rebase. The format will automatically have the long commit hash prepended to the format. diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 29630c2389..e6215c372c 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -572,5 +572,13 @@ endif::git-format-patch[] --line-prefix=<prefix>:: Prepend an additional prefix to every line of output. +--ita-invisible-in-index:: + By default entries added by "git add -N" appear as an existing + empty file in "git diff" and a new file in "git diff --cached". + This option makes the entry appear as a new file in "git diff" + and non-existent in "git diff --cached". This option could be + reverted with `--ita-visible-in-index`. Both options are + experimental and could be removed in future. + For more detailed explanation on these common options, see also linkgit:gitdiffcore[7]. diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt index 6526b178e8..44892c447e 100644 --- a/Documentation/git-fmt-merge-msg.txt +++ b/Documentation/git-fmt-merge-msg.txt @@ -60,10 +60,10 @@ merge.summary:: EXAMPLE ------- --- +--------- $ git fetch origin master $ git fmt-merge-msg --log <$GIT_DIR/FETCH_HEAD --- +--------- Print a log message describing a merge of the "master" branch from the "origin" remote. diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt index 93d1db6528..e99bda6add 100644 --- a/Documentation/git-interpret-trailers.txt +++ b/Documentation/git-interpret-trailers.txt @@ -48,19 +48,21 @@ with only spaces at the end of the commit message part, one blank line will be added before the new trailer. Existing trailers are extracted from the input message by looking for -a group of one or more lines that contain a colon (by default), where -the group is preceded by one or more empty (or whitespace-only) lines. +a group of one or more lines that (i) are all trailers, or (ii) contains at +least one Git-generated trailer and consists of at least 25% trailers. +The group must be preceded by one or more empty (or whitespace-only) lines. The group must either be at the end of the message or be the last non-whitespace lines before a line that starts with '---'. Such three minus signs start the patch part of the message. -When reading trailers, there can be whitespaces before and after the +When reading trailers, there can be whitespaces after the token, the separator and the value. There can also be whitespaces -inside the token and the value. +inside the token and the value. The value may be split over multiple lines with +each subsequent line starting with whitespace, like the "folding" in RFC 822. Note that 'trailers' do not follow and are not intended to follow many -rules for RFC 822 headers. For example they do not follow the line -folding rules, the encoding rules and probably many other rules. +rules for RFC 822 headers. For example they do not follow +the encoding rules and probably many other rules. OPTIONS ------- diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 92df596e5f..2e9cef06e6 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -39,7 +39,8 @@ The latest stash you created is stored in `refs/stash`; older stashes are found in the reflog of this reference and can be named using the usual reflog syntax (e.g. `stash@{0}` is the most recently created stash, `stash@{1}` is the one before it, `stash@{2.hours.ago}` -is also possible). +is also possible). Stashes may also be referenced by specifying just the +stash index (e.g. the integer `n` is equivalent to `stash@{n}`). OPTIONS ------- diff --git a/Documentation/git.txt b/Documentation/git.txt index 2cf7e225f5..ab7215eee2 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -44,9 +44,10 @@ unreleased) version of Git, that is available from the 'master' branch of the `git.git` repository. Documentation for older releases are available here: -* link:v2.10.1/git.html[documentation for release 2.10.1] +* link:v2.10.2/git.html[documentation for release 2.10.2] * release notes for + link:RelNotes/2.10.2.txt[2.10.2], link:RelNotes/2.10.1.txt[2.10.1], link:RelNotes/2.10.0.txt[2.10]. diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 7aff940202..976243a63e 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -293,7 +293,15 @@ checkout, when the `smudge` command is specified, the command is fed the blob object from its standard input, and its standard output is used to update the worktree file. Similarly, the `clean` command is used to convert the contents of worktree file -upon checkin. +upon checkin. By default these commands process only a single +blob and terminate. If a long running `process` filter is used +in place of `clean` and/or `smudge` filters, then Git can process +all blobs with a single filter command invocation for the entire +life of a single Git command, for example `git add --all`. If a +long running `process` filter is configured then it always takes +precedence over a configured single blob filter. See section +below for the description of the protocol used to communicate with +a `process` filter. One use of the content filtering is to massage the content into a shape that is more convenient for the platform, filesystem, and the user to use. @@ -373,6 +381,153 @@ not exist, or may have different contents. So, smudge and clean commands should not try to access the file on disk, but only act as filters on the content provided to them on standard input. +Long Running Filter Process +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If the filter command (a string value) is defined via +`filter.<driver>.process` then Git can process all blobs with a +single filter invocation for the entire life of a single Git +command. This is achieved by using a packet format (pkt-line, +see technical/protocol-common.txt) based protocol over standard +input and standard output as follows. All packets, except for the +"*CONTENT" packets and the "0000" flush packet, are considered +text and therefore are terminated by a LF. + +Git starts the filter when it encounters the first file +that needs to be cleaned or smudged. After the filter started +Git sends a welcome message ("git-filter-client"), a list of supported +protocol version numbers, and a flush packet. Git expects to read a welcome +response message ("git-filter-server"), exactly one protocol version number +from the previously sent list, and a flush packet. All further +communication will be based on the selected version. The remaining +protocol description below documents "version=2". Please note that +"version=42" in the example below does not exist and is only there +to illustrate how the protocol would look like with more than one +version. + +After the version negotiation Git sends a list of all capabilities that +it supports and a flush packet. Git expects to read a list of desired +capabilities, which must be a subset of the supported capabilities list, +and a flush packet as response: +------------------------ +packet: git> git-filter-client +packet: git> version=2 +packet: git> version=42 +packet: git> 0000 +packet: git< git-filter-server +packet: git< version=2 +packet: git< 0000 +packet: git> capability=clean +packet: git> capability=smudge +packet: git> capability=not-yet-invented +packet: git> 0000 +packet: git< capability=clean +packet: git< capability=smudge +packet: git< 0000 +------------------------ +Supported filter capabilities in version 2 are "clean" and +"smudge". + +Afterwards Git sends a list of "key=value" pairs terminated with +a flush packet. The list will contain at least the filter command +(based on the supported capabilities) and the pathname of the file +to filter relative to the repository root. Right after the flush packet +Git sends the content split in zero or more pkt-line packets and a +flush packet to terminate content. Please note, that the filter +must not send any response before it received the content and the +final flush packet. +------------------------ +packet: git> command=smudge +packet: git> pathname=path/testfile.dat +packet: git> 0000 +packet: git> CONTENT +packet: git> 0000 +------------------------ + +The filter is expected to respond with a list of "key=value" pairs +terminated with a flush packet. If the filter does not experience +problems then the list must contain a "success" status. Right after +these packets the filter is expected to send the content in zero +or more pkt-line packets and a flush packet at the end. Finally, a +second list of "key=value" pairs terminated with a flush packet +is expected. The filter can change the status in the second list +or keep the status as is with an empty list. Please note that the +empty list must be terminated with a flush packet regardless. + +------------------------ +packet: git< status=success +packet: git< 0000 +packet: git< SMUDGED_CONTENT +packet: git< 0000 +packet: git< 0000 # empty list, keep "status=success" unchanged! +------------------------ + +If the result content is empty then the filter is expected to respond +with a "success" status and a flush packet to signal the empty content. +------------------------ +packet: git< status=success +packet: git< 0000 +packet: git< 0000 # empty content! +packet: git< 0000 # empty list, keep "status=success" unchanged! +------------------------ + +In case the filter cannot or does not want to process the content, +it is expected to respond with an "error" status. +------------------------ +packet: git< status=error +packet: git< 0000 +------------------------ + +If the filter experiences an error during processing, then it can +send the status "error" after the content was (partially or +completely) sent. +------------------------ +packet: git< status=success +packet: git< 0000 +packet: git< HALF_WRITTEN_ERRONEOUS_CONTENT +packet: git< 0000 +packet: git< status=error +packet: git< 0000 +------------------------ + +In case the filter cannot or does not want to process the content +as well as any future content for the lifetime of the Git process, +then it is expected to respond with an "abort" status at any point +in the protocol. +------------------------ +packet: git< status=abort +packet: git< 0000 +------------------------ + +Git neither stops nor restarts the filter process in case the +"error"/"abort" status is set. However, Git sets its exit code +according to the `filter.<driver>.required` flag, mimicking the +behavior of the `filter.<driver>.clean` / `filter.<driver>.smudge` +mechanism. + +If the filter dies during the communication or does not adhere to +the protocol then Git will stop the filter process and restart it +with the next file that needs to be processed. Depending on the +`filter.<driver>.required` flag Git will interpret that as error. + +After the filter has processed a blob it is expected to wait for +the next "key=value" list containing a command. Git will close +the command pipe on exit. The filter is expected to detect EOF +and exit gracefully on its own. Git will wait until the filter +process has stopped. + +A long running filter demo implementation can be found in +`contrib/long-running-filter/example.pl` located in the Git +core repository. If you develop your own long running filter +process then the `GIT_TRACE_PACKET` environment variables can be +very helpful for debugging (see linkgit:git[1]). + +Please note that you cannot use an existing `filter.<driver>.clean` +or `filter.<driver>.smudge` command with `filter.<driver>.process` +because the former two use a different inter process communication +protocol than the latter one. + + Interaction between checkin/checkout attributes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |