From: Junio C Hamano Date: Fri, 21 Mar 2014 19:49:08 +0000 (-0700) Subject: Merge branch 'nd/upload-pack-shallow' X-Git-Tag: v2.0.0-rc0~76 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1ddb4d7?hp=b790e0f67cd97f29b72cb9007632b0329e5eebec Merge branch 'nd/upload-pack-shallow' Serving objects from a shallow repository needs to write a temporary file to be used, but the serving upload-pack may not have write access to the repository which is meant to be read-only. Instead feed these temporary shallow bounds from the standard input of pack-objects so that we do not have to use a temporary file. * nd/upload-pack-shallow: upload-pack: send shallow info over stdin to pack-objects --- diff --git a/.gitignore b/.gitignore index b5f9defed3..dc600f9b36 100644 --- a/.gitignore +++ b/.gitignore @@ -182,6 +182,7 @@ /test-dump-cache-tree /test-scrap-cache-tree /test-genrandom +/test-hashmap /test-index-version /test-line-buffer /test-match-trees diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index ef67b53f72..ed432a80ca 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -126,6 +126,17 @@ For C programs: "char * string". This makes it easier to understand code like "char *string, c;". + - Use whitespace around operators and keywords, but not inside + parentheses and not around functions. So: + + while (condition) + func(bar + 1); + + and not: + + while( condition ) + func (bar+1); + - We avoid using braces unnecessarily. I.e. if (bla) { diff --git a/Documentation/RelNotes/1.9.1.txt b/Documentation/RelNotes/1.9.1.txt new file mode 100644 index 0000000000..5b0602053c --- /dev/null +++ b/Documentation/RelNotes/1.9.1.txt @@ -0,0 +1,59 @@ +Git v1.9.1 Release Notes +======================== + +Fixes since v1.9.0 +------------------ + + * "git clean -d pathspec" did not use the given pathspec correctly + and ended up cleaning too much. + + * "git difftool" misbehaved when the repository is bound to the + working tree with the ".git file" mechanism, where a textual file + ".git" tells us where it is. + + * "git push" did not pay attention to branch.*.pushremote if it is + defined earlier than remote.pushdefault; the order of these two + variables in the configuration file should not matter, but it did + by mistake. + + * Codepaths that parse timestamps in commit objects have been + tightened. + + * "git diff --external-diff" incorrectly fed the submodule directory + in the working tree to the external diff driver when it knew it is + the same as one of the versions being compared. + + * "git reset" needs to refresh the index when working in a working + tree (it can also be used to match the index to the HEAD in an + otherwise bare repository), but it failed to set up the working + tree properly, causing GIT_WORK_TREE to be ignored. + + * "git check-attr" when working on a repository with a working tree + did not work well when the working tree was specified via the + --work-tree (and obviously with --git-dir) option. + + * "merge-recursive" was broken in 1.7.7 era and stopped working in + an empty (temporary) working tree, when there are renames + involved. This has been corrected. + + * "git rev-parse" was loose in rejecting command line arguments + that do not make sense, e.g. "--default" without the required + value for that option. + + * include.path variable (or any variable that expects a path that + can use ~username expansion) in the configuration file is not a + boolean, but the code failed to check it. + + * "git diff --quiet -- pathspec1 pathspec2" sometimes did not return + correct status value. + + * Attempting to deepen a shallow repository by fetching over smart + HTTP transport failed in the protocol exchange, when no-done + extension was used. The fetching side waited for the list of + shallow boundary commits after the sending end stopped talking to + it. + + * Allow "git cmd path/", when the 'path' is where a submodule is + bound to the top-level working tree, to match 'path', despite the + extra and unnecessary trailing slash (such a slash is often + given by command line completion). diff --git a/Documentation/RelNotes/2.0.0.txt b/Documentation/RelNotes/2.0.0.txt new file mode 100644 index 0000000000..b0bf974af5 --- /dev/null +++ b/Documentation/RelNotes/2.0.0.txt @@ -0,0 +1,218 @@ +Git v2.0 Release Notes +====================== + +Backward compatibility notes +---------------------------- + +When "git push [$there]" does not say what to push, we have used the +traditional "matching" semantics so far (all your branches were sent +to the remote as long as there already are branches of the same name +over there). In Git 2.0, the default is now the "simple" semantics, +which pushes: + + - only the current branch to the branch with the same name, and only + when the current branch is set to integrate with that remote + branch, if you are pushing to the same remote as you fetch from; or + + - only the current branch to the branch with the same name, if you + are pushing to a remote that is not where you usually fetch from. + +You can use the configuration variable "push.default" to change +this. If you are an old-timer who wants to keep using the +"matching" semantics, you can set the variable to "matching", for +example. Read the documentation for other possibilities. + +When "git add -u" and "git add -A" are run inside a subdirectory +without specifying which paths to add on the command line, they +operate on the entire tree for consistency with "git commit -a" and +other commands (these commands used to operate only on the current +subdirectory). Say "git add -u ." or "git add -A ." if you want to +limit the operation to the current directory. + +"git add " is the same as "git add -A " now, so that +"git add dir/" will notice paths you removed from the directory and +record the removal. In older versions of Git, "git add " used +to ignore removals. You can say "git add --ignore-removal " to +add only added or modified paths in , if you really want to. + +The "-q" option to "git diff-files", which does *NOT* mean "quiet", +has been removed (it told Git to ignore deletion, which you can do +with "git diff-files --diff-filter=d"). + + +Updates since v1.9 series +------------------------- + +Foreign interfaces, subsystems and ports. + + +UI, Workflows & Features + + * "git grep" learned to behave in a way similar to native grep when + "-h" (no header) and "-c" (count) options are given. + + * transport-helper, fast-import and fast-export have been updated to + allow the ref mapping and ref deletion in a way similar to the + natively supported transports. + + * The "simple" mode is the default for "git push". + + * "git add -u" and "git add -A", when run without any pathspec, is a + tree-wide operation even when run inside a subdirectory of a + working tree. + + * "git add is the same as "git add -A " now. + + * "core.statinfo" configuration variable, which is a + never-advertised synonym to "core.checkstat", has been removed. + + * The "-q" option to "git diff-files", which does *NOT* mean + "quiet", has been removed (it told Git to ignore deletion, which + you can do with "git diff-files --diff-filter=d"). + + * Server operators can loosen the "tips of refs only" restriction for + the remote archive service with the uploadarchive.allowUnreachable + configuration option. + + * The progress indicators from various time-consuming commands have + been marked for i18n/l10n. + + * "git notes -C " diagnoses an attempt to use an object that + is not a blob as an error. + + * "git config" learned to read from the standard input when "-" is + given as the value to its "--file" parameter (attempting an + operation to update the configuration in the standard input of + course is rejected). + + * Trailing whitespaces in .gitignore files, unless they are quoted + for fnmatch(3), e.g. "path\ ", are warned and ignored. Strictly + speaking, this is a backward incompatible change, but very unlikely + to bite any sane user and adjusting should be obvious and easy. + + * Many commands that create commits, e.g. "pull", "rebase", + learned to take the --gpg-sign option on the command line. + + * "git commit" can be told to always GPG sign the resulting commit + by setting "commit.gpgsign" configuration variable to true (the + command line option --no-gpg-sign should override it). + + * "git pull" can be told to only accept fast-forward by setting the + new "pull.ff" configuration. + + * "git reset" learned "-N" option, which does not reset the index + fully for paths the index knows about but the tree-ish the command + resets to does not (these paths are kept as intend-to-add entries). + + * Newly cloned submodule repositories by "git submodule update", + when the "checkout" update mode is used, will be on a local + branch instead of on a detached HEAD, just like submodules added + with "git submodule add". + + +Performance, Internal Implementation, etc. + + * We started using wildmatch() in place of fnmatch(3) a few releases + ago; complete the process and stop using fnmatch(3). + + * Uses of curl's "multi" interface and "easy" interface do not mix + well when we attempt to reuse outgoing connections. Teach the RPC + over http code, used in the smart HTTP transport, not to use the + "easy" interface. + + * The bitmap-index feature from JGit has been ported, which should + significantly improve performance when serving objects form a + repository that uses it. + + * The way "git log --cc" shows a combined diff against multiple + parents have been optimized. + + * The prefixcmp() and suffixcmp() functions are gone. Use + starts_with() and ends_with(), and also consider if skip_prefix() + suits your needs better when using the former. + + +Also contains various documentation updates and code clean-ups. Many +of them came from flurry of activities as GSoC candidate microproject +exercises. + + +Fixes since v1.9 series +----------------------- + +Unless otherwise noted, all the fixes since v1.9 in the maintenance +track are contained in this release (see the maintenance releases' +notes for details). + + * "git clean -d pathspec" did not use the given pathspec correctly + and ended up cleaning too much. + (merge 1f2e108 jk/clean-d-pathspec later to maint). + + * "git difftool" misbehaved when the repository is bound to the + working tree with the ".git file" mechanism, where a textual file + ".git" tells us where it is. + (merge fcfec8b da/difftool-git-files later to maint). + + * "git push" did not pay attention to branch.*.pushremote if it is + defined earlier than remote.pushdefault; the order of these two + variables in the configuration file should not matter, but it did + by mistake. + (merge 98b406f jk/remote-pushremote-config-reading later to maint). + + * Codepaths that parse timestamps in commit objects have been + tightened. + (merge 3f419d4 jk/commit-dates-parsing-fix later to maint). + + * "git diff --external-diff" incorrectly fed the submodule directory + in the working tree to the external diff driver when it knew it is + the same as one of the versions being compared. + (merge aba4727 tr/diff-submodule-no-reuse-worktree later to maint). + + * "git reset" needs to refresh the index when working in a working + tree (it can also be used to match the index to the HEAD in an + otherwise bare repository), but it failed to set up the working + tree properly, causing GIT_WORK_TREE to be ignored. + (merge b7756d4 nd/reset-setup-worktree later to maint). + + * "git check-attr" when working on a repository with a working tree + did not work well when the working tree was specified via the + --work-tree (and obviously with --git-dir) option. + (merge cdbf623 jc/check-attr-honor-working-tree later to maint). + + * "merge-recursive" was broken in 1.7.7 era and stopped working in + an empty (temporary) working tree, when there are renames + involved. This has been corrected. + (merge 6e2068a bk/refresh-missing-ok-in-merge-recursive later to maint.) + + * "git rev-parse" was loose in rejecting command line arguments + that do not make sense, e.g. "--default" without the required + value for that option. + (merge a43219f ds/rev-parse-required-args later to maint.) + + * include.path variable (or any variable that expects a path that + can use ~username expansion) in the configuration file is not a + boolean, but the code failed to check it. + (merge 67beb60 jk/config-path-include-fix later to maint.) + + * Commands that take pathspecs on the command line misbehaved when + the pathspec is given as an absolute pathname (which is a + practice not particularly encouraged) that points at a symbolic + link in the working tree. + (merge later 655ee9e mw/symlinks to maint.) + + * "git diff --quiet -- pathspec1 pathspec2" sometimes did not return + correct status value. + (merge f34b205 nd/diff-quiet-stat-dirty later to maint.) + + * Attempting to deepen a shallow repository by fetching over smart + HTTP transport failed in the protocol exchange, when no-done + extension was used. The fetching side waited for the list of + shallow boundary commits after the sending end stopped talking to + it. + (merge 0232852 nd/http-fetch-shallow-fix later to maint.) + + * Allow "git cmd path/", when the 'path' is where a submodule is + bound to the top-level working tree, to match 'path', despite the + extra and unnecessary trailing slash (such a slash is often + given by command line completion). + (merge 2e70c01 nd/submodule-pathspec-ending-with-slash later to maint.) diff --git a/Documentation/config.txt b/Documentation/config.txt index 5f4d7939ed..73c8973aae 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -142,19 +142,13 @@ advice.*:: -- pushUpdateRejected:: Set this variable to 'false' if you want to disable - 'pushNonFFCurrent', 'pushNonFFDefault', + 'pushNonFFCurrent', 'pushNonFFMatching', 'pushAlreadyExists', 'pushFetchFirst', and 'pushNeedsForce' simultaneously. pushNonFFCurrent:: Advice shown when linkgit:git-push[1] fails due to a non-fast-forward update to the current branch. - pushNonFFDefault:: - Advice to set 'push.default' to 'upstream' or 'current' - when you ran linkgit:git-push[1] and pushed 'matching - refs' by default (i.e. you did not provide an explicit - refspec, and no 'push.default' configuration was set) - and it resulted in a non-fast-forward error. pushNonFFMatching:: Advice shown when you ran linkgit:git-push[1] and pushed 'matching refs' explicitly (i.e. you used ':', or @@ -992,6 +986,14 @@ commit.cleanup:: have to remove the help lines that begin with `#` in the commit log template yourself, if you do this). +commit.gpgsign:: + + A boolean to specify whether all commits should be GPG signed. + Use of this option when doing operations such as rebase can + result in a large number of commits being signed. It may be + convenient to use an agent to avoid typing your GPG passphrase + several times. + commit.status:: A boolean to enable/disable inclusion of status information in the commit message template when using an editor to prepare the commit @@ -1167,6 +1169,10 @@ gc.autopacklimit:: --auto` consolidates them into one larger pack. The default value is 50. Setting this to 0 disables it. +gc.autodetach:: + Make `git gc --auto` return immediately andrun in background + if the system supports it. Default is true. + gc.packrefs:: Running `git pack-refs` in a repository renders it unclonable by Git versions prior to 1.5.1.2 over dumb @@ -1601,6 +1607,10 @@ imap:: The configuration variables in the 'imap' section are described in linkgit:git-imap-send[1]. +index.version:: + Specify the version with which new index files should be + initialized. This does not affect existing repositories. + init.templatedir:: Specify the directory from which templates will be copied. (See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].) @@ -1633,7 +1643,7 @@ interactive.singlekey:: linkgit:git-add[1], linkgit:git-checkout[1], linkgit:git-commit[1], linkgit:git-reset[1], and linkgit:git-stash[1]. Note that this setting is silently ignored if portable keystroke input - is not available. + is not available; requires the Perl module Term::ReadKey. log.abbrevCommit:: If true, makes linkgit:git-log[1], linkgit:git-show[1], and @@ -1862,6 +1872,31 @@ pack.packSizeLimit:: Common unit suffixes of 'k', 'm', or 'g' are supported. +pack.useBitmaps:: + When true, git will use pack bitmaps (if available) when packing + to stdout (e.g., during the server side of a fetch). Defaults to + true. You should not generally need to turn this off unless + you are debugging pack bitmaps. + +pack.writebitmaps:: + When true, git will write a bitmap index when packing all + objects to disk (e.g., when `git repack -a` is run). This + index can speed up the "counting objects" phase of subsequent + packs created for clones and fetches, at the cost of some disk + space and extra time spent on the initial repack. Defaults to + false. + +pack.writeBitmapHashCache:: + When true, git will include a "hash cache" section in the bitmap + index (if one is written). This cache can be used to feed git's + delta heuristics, potentially leading to better deltas between + bitmapped and non-bitmapped objects (e.g., when serving a fetch + between an older, bitmapped pack and objects that have been + pushed since the last gc). The downside is that it consumes 4 + bytes per object of disk space, and that JGit's bitmap + implementation does not understand it, causing it to complain if + Git and JGit are used on the same repository. Defaults to false. + pager.:: If the value is boolean, turns on or off pagination of the output of a particular Git subcommand when writing to a tty. @@ -1881,6 +1916,16 @@ pretty.:: Note that an alias with the same name as a built-in format will be silently ignored. +pull.ff:: + By default, Git does not create an extra merge commit when merging + a commit that is a descendant of the current commit. Instead, the + tip of the current branch is fast-forwarded. When set to `false`, + this variable tells Git to create an extra merge commit in such + a case (equivalent to giving the `--no-ff` option from the command + line). When set to `only`, only such fast-forward merges are + allowed (equivalent to giving the `--ff-only` option from the + command line). + pull.rebase:: When true, rebase branches on top of the fetched branch, instead of merging the default branch from the default remote when "git @@ -1933,7 +1978,7 @@ When pushing to a remote that is different from the remote you normally pull from, work as `current`. This is the safest option and is suited for beginners. + -This mode will become the default in Git 2.0. +This mode has become the default in Git 2.0. * `matching` - push all branches having the same name on both ends. This makes the repository you are pushing to remember the set of @@ -1952,8 +1997,8 @@ suitable for pushing into a shared central repository, as other people may add new branches there, or update the tip of existing branches outside your control. + -This is currently the default, but Git 2.0 will change the default -to `simple`. +This used to be the default, but not since Git 2.0 (`simple` is the +new default). -- @@ -2111,6 +2156,13 @@ repack.usedeltabaseoffset:: "false" and repack. Access from old Git versions over the native protocol are unaffected by this option. +repack.packKeptObjects:: + If set to true, makes `git repack` act as if + `--pack-kept-objects` was passed. See linkgit:git-repack[1] for + details. Defaults to `false` normally, but `true` if a bitmap + index is being written (either via `--write-bitmap-index` or + `pack.writeBitmaps`). + rerere.autoupdate:: When set to true, `git-rerere` updates the index with the resulting contents after it cleanly resolves conflicts using @@ -2291,6 +2343,13 @@ transfer.unpackLimit:: not set, the value of this variable is used instead. The default value is 100. +uploadarchive.allowUnreachable:: + If true, allow clients to use `git archive --remote` to request + any tree, whether reachable from the ref tips or not. See the + discussion in the `SECURITY` section of + linkgit:git-upload-archive[1] for more details. Defaults to + `false`. + uploadpack.hiderefs:: String(s) `upload-pack` uses to decide which refs to omit from its initial advertisement. Use more than one diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 48754cbc67..895922e27c 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -53,8 +53,14 @@ OPTIONS Files to add content from. Fileglobs (e.g. `*.c`) can be given to add all matching files. Also a leading directory name (e.g. `dir` to add `dir/file1` - and `dir/file2`) can be given to add all files in the - directory, recursively. + and `dir/file2`) can be given to update the index to + match the current state of the directory as a whole (e.g. + specifying `dir` will record not just a file `dir/file1` + modified in the working tree, a file `dir/file2` added to + the working tree, but also a file `dir/file3` removed from + the working tree. Note that older versions of Git used + to ignore removed files; use `--no-all` option if you want + to add modified or new files but ignore removed ones. -n:: --dry-run:: @@ -104,10 +110,10 @@ apply to the index. See EDITING PATCHES below. . This removes as well as modifies index entries to match the working tree, but adds no new files. + -If no is given, the current version of Git defaults to -"."; in other words, update all tracked files in the current directory -and its subdirectories. This default will change in a future version -of Git, hence the form without should not be used. +If no is given when `-u` option is used, all +tracked files in the entire working tree are updated (old versions +of Git used to limit the update to the current directory and its +subdirectories). -A:: --all:: @@ -117,10 +123,10 @@ of Git, hence the form without should not be used. entry. This adds, modifies, and removes index entries to match the working tree. + -If no is given, the current version of Git defaults to -"."; in other words, update all files in the current directory -and its subdirectories. This default will change in a future version -of Git, hence the form without should not be used. +If no is given when `-A` option is used, all +files in the entire working tree are updated (old versions +of Git used to limit the update to the current directory and its +subdirectories). --no-all:: --ignore-removal:: @@ -129,11 +135,9 @@ of Git, hence the form without should not be used. files that have been removed from the working tree. This option is a no-op when no is used. + -This option is primarily to help the current users of Git, whose -"git add ..." ignores removed files. In future versions -of Git, "git add ..." will be a synonym to "git add -A -..." and "git add --ignore-removal ..." will behave like -today's "git add ...", ignoring removed files. +This option is primarily to help users who are used to older +versions of Git, whose "git add ..." was a synonym +for "git add --no-all ...", i.e. ignored removed files. -N:: --intent-to-add:: diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index 54d8461d61..a2b97582fe 100644 --- a/Documentation/git-am.txt +++ b/Documentation/git-am.txt @@ -14,7 +14,7 @@ SYNOPSIS [--ignore-date] [--ignore-space-change | --ignore-whitespace] [--whitespace=