summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/RelNotes/2.1.0.txt114
-rw-r--r--Documentation/RelNotes/2.1.1.txt44
-rw-r--r--Documentation/RelNotes/2.1.2.txt20
-rw-r--r--Documentation/RelNotes/2.2.0.txt204
-rw-r--r--Documentation/config.txt3
-rw-r--r--Documentation/git-credential-cache--daemon.txt6
-rw-r--r--Documentation/git-fast-export.txt61
-rw-r--r--Documentation/git-imap-send.txt10
-rw-r--r--Documentation/git-init.txt85
-rw-r--r--Documentation/git-push.txt2
-rw-r--r--Documentation/git-rebase.txt9
-rw-r--r--Documentation/git-rev-list.txt2
-rw-r--r--Documentation/git-rev-parse.txt1
-rw-r--r--Documentation/git-send-pack.txt13
-rw-r--r--Documentation/git-svn.txt17
-rw-r--r--Documentation/git-tag.txt2
-rw-r--r--Documentation/git-update-index.txt2
-rw-r--r--Documentation/git.txt12
-rw-r--r--Documentation/gitattributes.txt4
-rw-r--r--Documentation/pretty-formats.txt14
-rw-r--r--Documentation/rev-list-options.txt13
-rw-r--r--Documentation/technical/api-allocation-growing.txt3
-rw-r--r--Documentation/technical/api-config.txt186
-rw-r--r--Documentation/technical/api-run-command.txt8
-rw-r--r--Documentation/technical/api-strbuf.txt14
-rw-r--r--Documentation/technical/pack-protocol.txt2
26 files changed, 705 insertions, 146 deletions
diff --git a/Documentation/RelNotes/2.1.0.txt b/Documentation/RelNotes/2.1.0.txt
index 5cfb0ab..ae47537 100644
--- a/Documentation/RelNotes/2.1.0.txt
+++ b/Documentation/RelNotes/2.1.0.txt
@@ -12,7 +12,7 @@ Backward compatibility notes
$ git config core.pager "less -S"
to restore the traditional behaviour. It is expected that people
- find output from the most subcommands easier to read with the new
+ find output from most subcommands easier to read with the new
default, except for "blame" which tends to produce really long
lines. To override the new default only for "git blame", you can
do this:
@@ -31,7 +31,7 @@ UI, Workflows & Features
default value "FRSX" when we spawn "less" as the pager. "S" (chop
long lines instead of wrapping) has been removed from this default
set of options, because it is more or less a personal taste thing,
- as opposed to others that have good justifications (i.e. "R" is
+ as opposed to the others that have good justifications (i.e. "R" is
very much justified because many kinds of output we produce are
colored and "FX" is justified because output we produce is often
shorter than a page).
@@ -39,47 +39,47 @@ UI, Workflows & Features
* The logic and data used to compute the display width needed for
UTF-8 strings have been updated to match Unicode 7.0 better.
- * HTTP-based transports learned to propagate the error messages from
- the webserver better to the client coming over the HTTP transport.
+ * HTTP-based transports learned to better propagate the error messages from
+ the webserver to the client coming over the HTTP transport.
* The completion script for bash (in contrib/) has been updated to
- handle aliases that define complex sequence of commands better.
+ better handle aliases that define a complex sequence of commands.
- * The "core.preloadindex" configuration variable is by default
- enabled, allowing modern platforms to take advantage of the
- multiple cores they have.
+ * The "core.preloadindex" configuration variable is enabled by default,
+ allowing modern platforms to take advantage of their
+ multiple cores.
* "git clone" applies the "if cloning from a local disk, physically
- copy repository using hardlinks, unless otherwise told not to with
- --no-local" optimization when url.*.insteadOf mechanism rewrites a
- "git clone $URL" that refers to a repository over the network to a
+ copy the repository using hardlinks, unless otherwise told not to with
+ --no-local" optimization when the url.*.insteadOf mechanism rewrites a
+ remote-repository "git clone $URL" into a
clone from a local disk.
- * "git commit --date=<date>" option learned to read from more
+ * "git commit --date=<date>" option learned more
timestamp formats, including "--date=now".
* The `core.commentChar` configuration variable is used to specify a
- custom comment character other than the default "#" to be used in
- the commit log editor. This can be set to `auto` to attempt to
- choose a different character that does not conflict with what
- already starts a line in the message being edited for cases like
+ custom comment character (other than the default "#") for
+ the commit message editor. This can be set to `auto` to attempt to
+ choose a different character that does not conflict with any that
+ already starts a line in the message being edited, for cases like
"git commit --amend".
- * "git format-patch" learned --signature-file=<file> to take the mail
- signature from.
+ * "git format-patch" learned --signature-file=<file> to add the contents
+ of a file as a signature to the mail message it produces.
- * "git grep" learned grep.fullname configuration variable to force
- "--full-name" to be default. This may cause regressions on
- scripted users that do not expect this new behaviour.
+ * "git grep" learned the grep.fullname configuration variable to force
+ "--full-name" to be the default. This may cause regressions for
+ scripted users who do not expect this new behaviour.
* "git imap-send" learned to ask the credential helper for auth
material.
- * "git log" and friends now understand the value "auto" set to the
+ * "git log" and friends now understand the value "auto" for the
"log.decorate" configuration variable to enable the "--decorate"
option automatically when the output is sent to tty.
- * "git merge" without argument, even when there is an upstream
+ * "git merge" without an argument, even when there is an upstream
defined for the current branch, refused to run until
merge.defaultToUpstream is set to true. Flip the default of that
configuration variable to true.
@@ -87,22 +87,20 @@ UI, Workflows & Features
* "git mergetool" learned to drive the vimdiff3 backend.
* mergetool.prompt used to default to 'true', always asking "do you
- really want to run the tool on this path?". Among the two
- purposes this prompt serves, ignore the use case to confirm that
- the user wants to view particular path with the named tool, and
- redefine the meaning of the prompt only to confirm the choice of
- the tool made by the autodetection (for those who configured the
- tool explicitly, the prompt shown for the latter purpose is
- simply annoying).
-
- Strictly speaking, this is a backward incompatible change and the
+ really want to run the tool on this path?". The default has been
+ changed to 'false'. However, the prompt will still appear if
+ mergetool used its autodetection system to guess which tool to use.
+ Users who explicitly specify or configure a tool will no longer see
+ the prompt by default.
+
+ Strictly speaking, this is a backward incompatible change and
users need to explicitly set the variable to 'true' if they want
- to resurrect the now-ignored use case.
+ to be prompted to confirm running the tool on each path.
* "git replace" learned the "--edit" subcommand to create a
replacement by editing an existing object.
- * "git replace" learned a "--graft" option to rewrite parents of a
+ * "git replace" learned a "--graft" option to rewrite the parents of a
commit.
* "git send-email" learned "--to-cover" and "--cc-cover" options, to
@@ -117,10 +115,10 @@ UI, Workflows & Features
being edited as a comment in the editor.
* "git tag" learned to pay attention to "tag.sort" configuration, to
- be used as the default sort order when no --sort=<value> the option
+ be used as the default sort order when no --sort=<value> option
is given.
- * "git verify-commit" command to check GPG signature in signed
+ * A new "git verify-commit" command, to check GPG signatures in signed
commits, in a way similar to "git verify-tag" is used to check
signed tags, was added.
@@ -129,8 +127,8 @@ Performance, Internal Implementation, etc.
* Build procedure for 'subtree' (in contrib/) has been cleaned up.
- * The support for the profile-feedback build, which has been left
- bit-rotten for quite a while, has been updated.
+ * Support for the profile-feedback build, which has
+ bit-rotted for quite a while, has been updated.
* An experimental format to use two files (the base file and
incremental changes relative to it) to represent the index has been
@@ -145,12 +143,6 @@ Performance, Internal Implementation, etc.
* Eradication of "test $condition -a $condition" from our scripts
continues.
- * The leaf function to check validity of a refname format has been
- micro-optimized, using SSE2 instructions when available. A few
- breakages during its development have been caught and fixed already
- but there might remain some more still; please test and report if
- you find any.
-
* The `core.deltabasecachelimit` used to default to 16 MiB , but this
proved to be too small, and has been bumped to 96 MiB.
@@ -158,7 +150,7 @@ Performance, Internal Implementation, etc.
structure that is used to keep track of the work to be done.
* "git diff" that compares 3-or-more trees (e.g. parents and the
- result of a merge) have been optimized.
+ result of a merge) has been optimized.
* The API to update/delete references are being converted to handle
updates to multiple references in a transactional way. As an
@@ -194,8 +186,8 @@ notes for details).
to a tty.
(merge 38de156 mn/sideband-no-ansi later to maint).
- * Mishandling of patterns in .gitignore that has trailing SPs quoted
- with backslashes (e.g. ones that end with "\ ") have been
+ * Mishandling of patterns in .gitignore that have trailing SPs quoted
+ with backslashes (e.g. ones that end with "\ ") has been
corrected.
(merge 97c1364be6b pb/trim-trailing-spaces later to maint).
@@ -232,7 +224,7 @@ notes for details).
and to allow the caller find the length of the object.
(merge 218aa3a jk/commit-buffer-length later to maint).
- * The "mailmap.file" configuration option did not support the tilde
+ * The "mailmap.file" configuration option did not support tilde
expansion (i.e. ~user/path and ~/path).
(merge 9352fd5 ow/config-mailmap-pathname later to maint).
@@ -244,7 +236,7 @@ notes for details).
* The unix-domain socket used by the sample credential cache daemon
tried to unlink an existing stale one at a wrong path, if the path
to the socket was given as an overlong path that does not fit in
- sun_path member of the sockaddr_un structure.
+ the sun_path member of the sockaddr_un structure.
(merge 2869b3e rs/fix-unlink-unix-socket later to maint).
* An ancient rewrite passed a wrong pointer to a curl library
@@ -252,12 +244,12 @@ notes for details).
(merge 479eaa8 ah/fix-http-push later to maint).
* "--ignore-space-change" option of "git apply" ignored the spaces
- at the beginning of line too aggressively, which is inconsistent
- with the option of the same name "diff" and "git diff" have.
+ at the beginning of lines too aggressively, which is inconsistent
+ with the option of the same name that "diff" and "git diff" have.
(merge 14d3bb4 jc/apply-ignore-whitespace later to maint).
- * "git blame" miscounted number of columns needed to show localized
- timestamps, resulting in jaggy left-side-edge of the source code
+ * "git blame" miscounted the number of columns needed to show localized
+ timestamps, resulting in a jaggy left-side-edge for the source code
lines in its output.
(merge dd75553 jx/blame-align-relative-time later to maint).
@@ -271,17 +263,17 @@ notes for details).
because it incorrectly used strstr().
(merge 60a5f5f jc/fix-clone-single-starting-at-a-tag later to maint).
- * "git commit --allow-empty-messag -C $commit" did not work when the
+ * "git commit --allow-empty-message -C $commit" did not work when the
commit did not have any log message.
(merge 076cbd6 jk/commit-C-pick-empty later to maint).
* "git diff --find-copies-harder" sometimes pretended as if the mode
- bits have changed for paths that are marked with assume-unchanged
+ bits have changed for paths that are marked with the assume-unchanged
bit.
(merge 5304810 jk/diff-files-assume-unchanged later to maint).
* "filter-branch" left an empty single-parent commit that results when
- all parents of a merge commit gets mapped to the same commit, even
+ all parents of a merge commit get mapped to the same commit, even
under "--prune-empty".
(merge 79bc4ef cb/filter-branch-prune-empty-degenerate-merges later to maint).
@@ -314,10 +306,10 @@ notes for details).
mergetag that was and was not correctly validated.
(merge 42c55ce mg/fix-log-mergetag-color later to maint).
- * "log --show-signature" did not pay attention to "--graph" option.
+ * "log --show-signature" did not pay attention to the "--graph" option.
(merge cf3983d zk/log-graph-showsig later to maint).
- * "git mailinfo" used to read beyond the end of header string while
+ * "git mailinfo" used to read beyond the ends of header strings while
parsing an incoming e-mail message to extract the patch.
(merge b1a013d rs/mailinfo-header-cmp later to maint).
@@ -337,7 +329,7 @@ notes for details).
(merge fb79947 rs/pack-objects-no-unnecessary-realloc later to maint).
* Recent updates to "git repack" started to duplicate objects that
- are in packfiles marked with .keep flag into the new packfile by
+ are in packfiles marked with the .keep flag into the new packfile by
mistake.
(merge d078d85 jk/repack-pack-keep-objects later to maint).
@@ -375,14 +367,14 @@ notes for details).
* "git status", even though it is a read-only operation, tries to
update the index with refreshed lstat(2) info to optimize future
accesses to the working tree opportunistically, but this could
- race with a "read-write" operation that modify the index while it
+ race with a "read-write" operation that modifies the index while it
is running. Detect such a race and avoid overwriting the index.
(merge 426ddee ym/fix-opportunistic-index-update-race later to maint).
* "git status" (and "git commit") behaved as if changes in a modified
submodule are not there if submodule.*.ignore configuration is set,
which was misleading. The configuration is only to unclutter diff
- output during the course of development, and should not to hide
+ output during the course of development, and not to hide
changes in the "status" output to cause the users forget to commit
them.
(merge c215d3d jl/status-added-submodule-is-never-ignored later to maint).
diff --git a/Documentation/RelNotes/2.1.1.txt b/Documentation/RelNotes/2.1.1.txt
new file mode 100644
index 0000000..830fc3c
--- /dev/null
+++ b/Documentation/RelNotes/2.1.1.txt
@@ -0,0 +1,44 @@
+Git v2.1.1 Release Notes
+========================
+
+ * Git 2.0 had a regression where "git fetch" into a shallowly
+ cloned repository from a repository with bitmap object index
+ enabled did not work correctly. This has been corrected.
+
+ * Git 2.0 had a regression which broke (rarely used) "git diff-tree
+ -t". This has been corrected.
+
+ * "git log --pretty/format=" with an empty format string did not
+ mean the more obvious "No output whatsoever" but "Use default
+ format", which was counterintuitive. Now it means "nothing shown
+ for the log message part".
+
+ * "git -c section.var command" and "git -c section.var= command"
+ should pass the configuration differently (the former should be a
+ boolean true, the latter should be an empty string), but they
+ didn't work that way. Now it does.
+
+ * Applying a patch not generated by Git in a subdirectory used to
+ check the whitespace breakage using the attributes for incorrect
+ paths. Also whitespace checks were performed even for paths
+ excluded via "git apply --exclude=<path>" mechanism.
+
+ * "git bundle create" with date-range specification were meant to
+ exclude tags outside the range, but it did not work correctly.
+
+ * "git add x" where x that used to be a directory has become a
+ symbolic link to a directory misbehaved.
+
+ * The prompt script checked $GIT_DIR/ref/stash file to see if there
+ is a stash, which was a no-no.
+
+ * "git checkout -m" did not switch to another branch while carrying
+ the local changes forward when a path was deleted from the index.
+
+ * With sufficiently long refnames, fast-import could have overflown
+ an on-stack buffer.
+
+ * After "pack-refs --prune" packed refs at the top-level, it failed
+ to prune them.
+
+ * "git gc --auto" triggered from "git fetch --quiet" was not quiet.
diff --git a/Documentation/RelNotes/2.1.2.txt b/Documentation/RelNotes/2.1.2.txt
new file mode 100644
index 0000000..abc3b89
--- /dev/null
+++ b/Documentation/RelNotes/2.1.2.txt
@@ -0,0 +1,20 @@
+Git v2.1.2 Release Notes
+========================
+
+ * "git push" over HTTP transport had an artificial limit on number of
+ refs that can be pushed imposed by the command line length.
+
+ * When receiving an invalid pack stream that records the same object
+ twice, multiple threads got confused due to a race.
+
+ * An attempt to remove the entire tree in the "git fast-import" input
+ stream caused it to misbehave.
+
+ * Reachability check (used in "git prune" and friends) did not add a
+ detached HEAD as a starting point to traverse objects still in use.
+
+ * "git config --add section.var val" used to lose existing
+ section.var whose value was an empty string.
+
+ * "git fsck" failed to report that it found corrupt objects via its
+ exit status in some cases.
diff --git a/Documentation/RelNotes/2.2.0.txt b/Documentation/RelNotes/2.2.0.txt
new file mode 100644
index 0000000..438f92e
--- /dev/null
+++ b/Documentation/RelNotes/2.2.0.txt
@@ -0,0 +1,204 @@
+Git v2.2 Release Notes
+======================
+
+Updates since v2.1
+------------------
+
+Ports
+
+ * Building on older MacOS X systems automatically sets
+ the necessary NO_APPLE_COMMON_CRYPTO build-time option.
+
+
+UI, Workflows & Features
+
+ * "git config --edit --global" starts from a skeletal per-user
+ configuration file contents, instead of a total blank, when the
+ user does not already have any. This immediately reduces the
+ need for a later "Have you forgotten setting core.user?" and we
+ can add more to the template as we gain more experience.
+
+ * "git stash list -p" used to be almost always a no-op because each
+ stash entry is represented as a merge commit. It learned to show
+ the difference between the base commit version and the working tree
+ version, which is in line with what "git show" gives.
+
+ * Sometimes users want to report a bug they experience on their
+ repository, but they are not at liberty to share the contents of
+ the repository. "fast-export" was taught an "--anonymize" option
+ to replace blob contents, names of people and paths and log
+ messages with bland and simple strings to help them.
+
+ * "log --date=iso" uses a slight variant of ISO 8601 format that is
+ made more human readable. A new "--date=iso-strict" option gives
+ datetime output that is more strictly conformant.
+
+ * A broken reimplementation of Git could write an invalid index that
+ records both stage #0 and higher stage entries for the same path.
+ We now notice and reject such an index, as there is no sensible
+ fallback (we do not know if the broken tool wanted to resolve and
+ forgot to remove higher stage entries, or if it wanted to unresolve
+ and forgot to remove the stage#0 entry).
+
+ * The "pre-receive" and "post-receive" hooks are no longer required
+ to consume their input fully (not following this requirement used
+ to result in intermittent errors in "git push").
+
+ * The pretty-format specifier "%d", which expanded to " (tagname)"
+ for a tagged commit, gained a cousin "%D" that just gives the
+ "tagname" without frills.
+
+Performance, Internal Implementation, etc.
+
+ * The API to manipulate the "refs" is currently undergoing a revamp
+ to make it more transactional, with the eventual goal to allow
+ all-or-none atomic updates and migrating the storage to something
+ other than the traditional filesystem based one (e.g. databases).
+
+ * We no longer attempt to keep track of individual dependencies to
+ the header files in the build procedure, relying on automated
+ dependency generation support from modern compilers.
+
+ * In tests, we have been using NOT_{MINGW,CYGWIN} test prerequisites
+ long before negated prerequisites e.g. !MINGW were invented.
+ The former has been converted to the latter to avoid confusion.
+
+ * Looking up remotes configuration in a repository with very many
+ remotes defined has been optimized.
+
+ * There are cases where you lock and open to write a file, close it
+ to show the updated contents to external processes, and then have
+ to update the file again while still holding the lock, but the
+ lockfile API lacked support for such an access pattern.
+
+ * The API to allocate the structure to keep track of commit
+ decoration has been updated to make it less cumbersome to use.
+
+ * An in-core caching layer to let us avoid reading the same
+ configuration files number of times has been added. A few commands
+ have been converted to use this subsystem.
+
+ * Various code paths have been cleaned up and simplified by using
+ "strbuf", "starts_with()", and "skip_prefix()" APIs more.
+
+ * A few codepaths that died when large blobs that would not fit in
+ core are involved in their operation have been taught to punt
+ instead, by e.g. marking too large a blob as not to be diffed.
+
+ * A few more code paths in "commit" and "checkout" have been taught
+ to repopulate the cache-tree in the index, to help speed up later
+ "write-tree" (used in "commit") and "diff-index --cached" (used in
+ "status").
+
+ * A common programming mistake to assign the same short option name
+ to two separate options is detected by parse_options() API to help
+ developers.
+
+ * The code path to write out the packed-refs file has been optimized,
+ which especially matters in a repository with a large number of
+ refs.
+
+ * The check to see if a ref $F can be created by making sure no
+ existing ref has $F/ as its prefix has been optimized, which
+ especially matters in a repository with a large number of existing
+ refs.
+
+ * "git fsck" was taught to check contents of tag objects a bit more.
+
+ * "git hash-object" was taught a "--literally" option to help
+ debugging.
+
+
+Also contains various documentation updates and code clean-ups.
+
+
+Fixes since v2.1
+----------------
+
+Unless otherwise noted, all the fixes since v2.1 in the maintenance
+track are contained in this release (see the maintenance releases'
+notes for details).
+
+ * "git log --pretty/format=" with an empty format string did not
+ mean the more obvious "No output whatsoever" but "Use default
+ format", which was counterintuitive.
+
+ * Implementations of "tar" that do not understand an extended pax
+ header would extract the contents of it in a regular file; make
+ sure the permission bits of this file follows the same tar.umask
+ configuration setting.
+
+ * "git -c section.var command" and "git -c section.var= command"
+ should pass the configuration differently (the former should be a
+ boolean true, the latter should be an empty string).
+
+ * Applying a patch not generated by Git in a subdirectory used to
+ check the whitespace breakage using the attributes for incorrect
+ paths. Also whitespace checks were performed even for paths
+ excluded via "git apply --exclude=<path>" mechanism.
+
+ * "git bundle create" with date-range specification were meant to
+ exclude tags outside the range, but it didn't.
+
+ * "git add x" where x that used to be a directory has become a
+ symbolic link to a directory misbehaved.
+
+ * The prompt script checked $GIT_DIR/ref/stash file to see if there
+ is a stash, which was a no-no.
+
+ * Pack-protocol documentation had a minor typo.
+
+ * "git checkout -m" did not switch to another branch while carrying
+ the local changes forward when a path was deleted from the index.
+
+ * With sufficiently long refnames, "git fast-import" could have
+ overflown an on-stack buffer.
+
+ * After "pack-refs --prune" packed refs at the top-level, it failed
+ to prune them.
+
+ * Progress output from "git gc --auto" was visible in "git fetch -q".
+
+ * We used to pass -1000 to poll(2), expecting it to also mean "no
+ timeout", which should be spelled as -1.
+
+ * "git rebase" documentation was unclear that it is required to
+ specify on what <upstream> the rebase is to be done when telling it
+ to first check out <branch>.
+ (merge 95c6826 so/rebase-doc later to maint).
+
+ * "git push" over HTTP transport had an artificial limit on number of
+ refs that can be pushed imposed by the command line length.
+ (merge 26be19b jk/send-pack-many-refspecs later to maint).
+
+ * When receiving an invalid pack stream that records the same object
+ twice, multiple threads got confused due to a race.
+ (merge ab791dd jk/index-pack-threading-races later to maint).
+
+ * An attempt to remove the entire tree in the "git fast-import" input
+ stream caused it to misbehave.
+ (merge 2668d69 mb/fast-import-delete-root later to maint).
+
+ * Reachability check (used in "git prune" and friends) did not add a
+ detached HEAD as a starting point to traverse objects still in use.
+ (merge c40fdd0 mk/reachable-protect-detached-head later to maint).
+
+ * "git config --add section.var val" used to lose existing
+ section.var whose value was an empty string.
+ (merge c1063be ta/config-add-to-empty-or-true-fix later to maint).
+
+ * "git fsck" failed to report that it found corrupt objects via its
+ exit status in some cases.
+ (merge 30d1038 jk/fsck-exit-code-fix later to maint).
+
+ * Use of "--verbose" option used to break "git branch --merged".
+ (merge 12994dd jk/maint-branch-verbose-merged later to maint).
+
+ * Some MUAs mangled a line in a message that begins with "From " to
+ ">From " when writing to a mailbox file and feeding such an input
+ to "git am" used to lose such a line.
+ (merge 85de86a jk/mbox-from-line later to maint).
+
+ * "rev-parse --verify --quiet $name" is meant to quietly exit with a
+ non-zero status when $name is not a valid object name, but still
+ gave error messages in some cases.
diff --git a/Documentation/config.txt b/Documentation/config.txt
index d73366f..04a1e2f 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -499,7 +499,8 @@ core.bigFileThreshold::
Files larger than this size are stored deflated, without
attempting delta compression. Storing large files without
delta compression avoids excessive memory usage, at the
- slight expense of increased disk usage.
+ slight expense of increased disk usage. Additionally files
+ larger than this size are always treated as binary.
+
Default is 512 MiB on all platforms. This should be reasonable
for most projects as source code and other text files can still
diff --git a/Documentation/git-credential-cache--daemon.txt b/Documentation/git-credential-cache--daemon.txt
index d15db42..7051c6b 100644
--- a/Documentation/git-credential-cache--daemon.txt
+++ b/Documentation/git-credential-cache--daemon.txt
@@ -8,7 +8,7 @@ git-credential-cache--daemon - Temporarily store user credentials in memory
SYNOPSIS
--------
[verse]
-git credential-cache--daemon <socket>
+git credential-cache--daemon [--debug] <socket>
DESCRIPTION
-----------
@@ -21,6 +21,10 @@ for `git-credential-cache` clients. Clients may store and retrieve
credentials. Each credential is held for a timeout specified by the
client; once no credentials are held, the daemon exits.
+If the `--debug` option is specified, the daemon does not close its
+stderr stream, and may output extra diagnostics to it even after it has
+begun listening for clients.
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt
index 221506b..dbe9a46 100644
--- a/Documentation/git-fast-export.txt
+++ b/Documentation/git-fast-export.txt
@@ -105,6 +105,11 @@ marks the same across runs.
in the commit (as opposed to just listing the files which are
different from the commit's first parent).
+--anonymize::
+ Anonymize the contents of the repository while still retaining
+ the shape of the history and stored tree. See the section on
+ `ANONYMIZING` below.
+
--refspec::
Apply the specified refspec to each ref exported. Multiple of them can
be specified.
@@ -141,6 +146,62 @@ referenced by that revision range contains the string
'refs/heads/master'.
+ANONYMIZING
+-----------
+
+If the `--anonymize` option is given, git will attempt to remove all
+identifying information from the repository while still retaining enough
+of the original tree and history patterns to reproduce some bugs. The
+goal is that a git bug which is found on a private repository will
+persist in the anonymized repository, and the latter can be shared with
+git developers to help solve the bug.
+
+With this option, git will replace all refnames, paths, blob contents,
+commit and tag messages, names, and email addresses in the output with
+anonymized data. Two instances of the same string will be replaced
+equivalently (e.g., two commits with the same author will have the same
+anonymized author in the output, but bear no resemblance to the original
+author string). The relationship between commits, branches, and tags is
+retained, as well as the commit timestamps (but the commit messages and
+refnames bear no resemblance to the originals). The relative makeup of
+the tree is retained (e.g., if you have a root tree with 10 files and 3
+trees, so will the output), but their names and the contents of the
+files will be replaced.
+
+If you think you have found a git bug, you can start by exporting an
+anonymized stream of the whole repository:
+
+---------------------------------------------------
+$ git fast-export --anonymize --all >anon-stream
+---------------------------------------------------
+
+Then confirm that the bug persists in a repository created from that
+stream (many bugs will not, as they really do depend on the exact
+repository contents):
+
+---------------------------------------------------
+$ git init anon-repo
+$ cd anon-repo
+$ git fast-import <../anon-stream
+$ ... test your bug ...
+---------------------------------------------------
+
+If the anonymized repository shows the bug, it may be worth sharing
+`anon-stream` along with a regular bug report. Note that the anonymized
+stream compresses very well, so gzipping it is encouraged. If you want
+to examine the stream to see that it does not contain any private data,
+you can peruse it directly before sending. You may also want to try:
+
+---------------------------------------------------
+$ perl -pe 's/\d+/X/g' <anon-stream | sort -u | less
+---------------------------------------------------
+
+which shows all of the unique lines (with numbers converted to "X", to
+collapse "User 0", "User 1", etc into "User X"). This produces a much
+smaller output, and it is usually easy to quickly confirm that there is
+no private data in the stream.
+
+
Limitations
-----------
diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt
index 875d283..7d991d9 100644
--- a/Documentation/git-imap-send.txt
+++ b/Documentation/git-imap-send.txt
@@ -38,18 +38,17 @@ Variables
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 to use imap-send.
+ "[Gmail]/Drafts". Required.
imap.tunnel::
Command used to setup a tunnel to the IMAP server through which
commands will be piped instead of using a direct network connection
- to the server. Required when imap.host is not set to use imap-send.
+ to the server. Required when imap.host is not set.
imap.host::
A URL identifying the server. Use a `imap://` prefix for non-secure
connections and a `imaps://` prefix for secure connections.
- Ignored when imap.tunnel is set, but required to use imap-send
- otherwise.
+ Ignored when imap.tunnel is set, but required otherwise.
imap.user::
The username to use when logging in to the server.
@@ -76,7 +75,8 @@ imap.preformattedHTML::
imap.authMethod::
Specify authenticate method for authentication with IMAP server.
- Current supported method is 'CRAM-MD5' only.
+ Current supported method is 'CRAM-MD5' only. If this is not set
+ then 'git imap-send' uses the basic IMAP plaintext LOGIN command.
Examples
~~~~~~~~
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index afd721e..369f889 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -43,7 +43,7 @@ OPTIONS
-q::
--quiet::
-Only print error and warning messages, all other output will be suppressed.
+Only print error and warning messages; all other output will be suppressed.
--bare::
@@ -57,12 +57,12 @@ DIRECTORY" section below.)
--separate-git-dir=<git dir>::
-Instead of initializing the repository where it is supposed to be,
-place a filesytem-agnostic Git symbolic link there, pointing to the
-specified path, and initialize a Git repository at the path. The
-result is Git repository can be separated from working tree. If this
-is reinitialization, the repository will be moved to the specified
-path.
+Instead of initializing the repository as a directory to either `$GIT_DIR` or
+`./.git/`, create a text file there containing the path to the actual
+repository. This file acts as filesystem-agnostic Git symbolic link to the
+repository.
++
+If this is reinitialization, the repository will be moved to the specified path.
--shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
@@ -72,60 +72,65 @@ repository. When specified, the config variable "core.sharedRepository" is
set so that files and directories under `$GIT_DIR` are created with the
requested permissions. When not specified, Git will use permissions reported
by umask(2).
-
++
The option can have the following values, defaulting to 'group' if no value
is given:
++
+--
+'umask' (or 'false')::
- - 'umask' (or 'false'): Use permissions reported by umask(2). The default,
- when `--shared` is not specified.
+Use permissions reported by umask(2). The default, when `--shared` is not
+specified.
- - 'group' (or 'true'): Make the repository group-writable, (and g+sx, since
- the git group may be not the primary group of all users).
- This is used to loosen the permissions of an otherwise safe umask(2) value.
- Note that the umask still applies to the other permission bits (e.g. if
- umask is '0022', using 'group' will not remove read privileges from other
- (non-group) users). See '0xxx' for how to exactly specify the repository
- permissions.
+'group' (or 'true')::
- - 'all' (or 'world' or 'everybody'): Same as 'group', but make the repository
- readable by all users.
+Make the repository group-writable, (and g+sx, since the git group may be not
+the primary group of all users). This is used to loosen the permissions of an
+otherwise safe umask(2) value. Note that the umask still applies to the other
+permission bits (e.g. if umask is '0022', using 'group' will not remove read
+privileges from other (non-group) users). See '0xxx' for how to exactly specify
+the repository permissions.
- - '0xxx': '0xxx' is an octal number and each file will have mode '0xxx'.
- '0xxx' will override users' umask(2) value (and not only loosen permissions
- as 'group' and 'all' does). '0640' will create a repository which is
- group-readable, but not group-writable or accessible to others. '0660' will
- create a repo that is readable and writable to the current user and group,
- but inaccessible to others.
+'all' (or 'world' or 'everybody')::
-By default, the configuration flag receive.denyNonFastForwards is enabled
+Same as 'group', but make the repository readable by all users.
+
+'0xxx'::
+
+'0xxx' is an octal number and each file will have mode '0xxx'. '0xxx' will
+override users' umask(2) value (and not only loosen permissions as 'group' and
+'all' does). '0640' will create a repository which is group-readable, but not
+group-writable or accessible to others. '0660' will create a repo that is
+readable and writable to the current user and group, but inaccessible to others.
+--
+
+By default, the configuration flag `receive.denyNonFastForwards` is enabled
in shared repositories, so that you cannot force a non fast-forwarding push
into it.
-If you name a (possibly non-existent) directory at the end of the command
-line, the command is run inside the directory (possibly after creating it).
+If you provide a 'directory', the command is run inside it. If this directory
+does not exist, it will be created.
--
-
TEMPLATE DIRECTORY
------------------
The template directory contains files and directories that will be copied to
the `$GIT_DIR` after it is created.
-The template directory used will (in order):
+The template directory will be one of the following (in order):
- - The argument given with the `--template` option.
+ - the argument given with the `--template` option;
- - The contents of the `$GIT_TEMPLATE_DIR` environment variable.
+ - the contents of the `$GIT_TEMPLATE_DIR` environment variable;
- - The `init.templatedir` configuration variable.
+ - the `init.templatedir` configuration variable; or
- - The default template directory: `/usr/share/git-core/templates`.
+ - the default template directory: `/usr/share/git-core/templates`.
-The default template directory includes some directory structure, some
-suggested "exclude patterns", and copies of sample "hook" files.
-The suggested patterns and hook files are all modifiable and extensible.
+The default template directory includes some directory structure, suggested
+"exclude patterns" (see linkgit:gitignore[5]), and sample hook files (see linkgit:githooks[5]).
EXAMPLES
--------
@@ -136,10 +141,12 @@ Start a new Git repository for an existing code base::
$ cd /path/to/my/codebase
$ git init <1>
$ git add . <2>
+$ git commit <3>
----------------
+
-<1> prepare /path/to/my/codebase/.git directory
-<2> add all existing file to the index
+<1> Create a /path/to/my/codebase/.git directory.
+<2> Add all existing files to the index.
+<3> Record the pristine state as the first commit in the history.
GIT
---
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 21b3f29..b17283a 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -34,7 +34,7 @@ When the command line does not specify what to push with `<refspec>...`
arguments or `--all`, `--mirror`, `--tags` options, the command finds
the default `<refspec>` by consulting `remote.*.push` configuration,
and if it is not found, honors `push.default` configuration to decide
-what to push (See gitlink:git-config[1] for the meaning of `push.default`).
+what to push (See linkgit:git-config[1] for the meaning of `push.default`).
OPTIONS[[OPTIONS]]
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 2a93c64..4138554 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
- [<upstream>] [<branch>]
+ [<upstream> [<branch>]]
'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
--root [<branch>]
'git rebase' --continue | --skip | --abort | --edit-todo
@@ -316,11 +316,8 @@ which makes little sense.
-f::
--force-rebase::
- Force the rebase even if the current branch is a descendant
- of the commit you are rebasing onto. Normally non-interactive rebase will
- exit with the message "Current branch is up to date" in such a
- situation.
- Incompatible with the --interactive option.
+ Force a rebase even if the current branch is up-to-date and
+ the command without `--force` would return without doing anything.
+
You may find this (or --no-ff with an interactive rebase) helpful after
reverting a topic branch merge, as this option recreates the topic branch with
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 7a1585d..fd7f8b5 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -45,7 +45,7 @@ SYNOPSIS
[ \--regexp-ignore-case | -i ]
[ \--extended-regexp | -E ]
[ \--fixed-strings | -F ]
- [ \--date=(local|relative|default|iso|rfc|short) ]
+ [ \--date=(local|relative|default|iso|iso-strict|rfc|short) ]
[ [\--objects | \--objects-edge] [ \--unpacked ] ]
[ \--pretty | \--header ]
[ \--bisect ]
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 0b84769..fa4a8c3 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -114,6 +114,7 @@ can be used.
Only meaningful in `--verify` mode. Do not output an error
message if the first argument is not a valid object name;
instead exit with non-zero status silently.
+ SHA-1s for valid object names are printed to stdout on success.
--sq::
Usually the output is made one line per flag and
diff --git a/Documentation/git-send-pack.txt b/Documentation/git-send-pack.txt
index dc3a568..2a0de42 100644
--- a/Documentation/git-send-pack.txt
+++ b/Documentation/git-send-pack.txt
@@ -35,6 +35,16 @@ OPTIONS
Instead of explicitly specifying which refs to update,
update all heads that locally exist.
+--stdin::
+ Take the list of refs from stdin, one per line. If there
+ are refs specified on the command line in addition to this
+ option, then the refs from stdin are processed after those
+ on the command line.
++
+If '--stateless-rpc' is specified together with this option then
+the list of refs must be in packet format (pkt-line). Each ref must
+be in a separate packet, and the list must end with a flush packet.
+
--dry-run::
Do everything except actually send the updates.
@@ -77,7 +87,8 @@ this flag.
Without '--all' and without any '<ref>', the heads that exist
both on the local side and on the remote side are updated.
-When one or more '<ref>' are specified explicitly, it can be either a
+When one or more '<ref>' are specified explicitly (whether on the
+command line or via `--stdin`), it can be either a
single pattern, or a pair of such pattern separated by a colon
":" (this means that a ref name cannot have a colon in it). A
single pattern '<name>' is just a shorthand for '<name>:<name>'.
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 44c970c..ef8ef1c 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -386,11 +386,13 @@ Any other arguments are passed directly to 'git log'
tree-ish to specify which branch should be searched). When given a
tree-ish, returns the corresponding SVN revision number.
+
+-B;;
--before;;
Don't require an exact match if given an SVN revision, instead find
the commit corresponding to the state of the SVN repository (on the
current branch) at the specified revision.
+
+-A;;
--after;;
Don't require an exact match if given an SVN revision; if there is
not an exact match return the closest match searching forward in the
@@ -608,21 +610,6 @@ config key: svn.authorsfile
Make 'git svn' less verbose. Specify a second time to make it
even less verbose.
---repack[=<n>]::
---repack-flags=<flags>::
- These should help keep disk usage sane for large fetches with
- many revisions.
-+
---repack takes an optional argument for the number of revisions
-to fetch before repacking. This defaults to repacking every
-1000 commits fetched if no argument is specified.
-+
---repack-flags are passed directly to 'git repack'.
-+
-[verse]
-config key: svn.repack
-config key: svn.repackflags
-
-m::
--merge::
-s<strategy>::
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index 3209083..e953ba4 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -42,7 +42,7 @@ committer identity for the current user is used to find the
GnuPG key for signing. The configuration variable `gpg.program`
is used to specify custom GnuPG binary.
-Tag objects (created with `-a`, `s`, or `-u`) are called "annotated"
+Tag objects (created with `-a`, `-s`, or `-u`) are called "annotated"
tags; they contain a creation date, the tagger name and e-mail, a
tagging message, and an optional GnuPG signature. Whereas a
"lightweight" tag is simply a name for an object (usually a commit
diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index dfc09d9..82eca6f 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -202,7 +202,7 @@ merging.
To pretend you have a file with mode and sha1 at path, say:
----------------
-$ git update-index --cacheinfo mode sha1 path
+$ git update-index --cacheinfo <mode>,<sha1>,<path>
----------------
'--info-only' is used to register files without placing them in the object
diff --git a/Documentation/git.txt b/Documentation/git.txt
index b1c4f7a..c6175d4 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -43,6 +43,13 @@ 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.1.2/git.html[documentation for release 2.1.2]
+
+* release notes for
+ link:RelNotes/2.1.2.txt[2.1.2],
+ link:RelNotes/2.1.1.txt[2.1.1],
+ link:RelNotes/2.1.0.txt[2.1].
+
* link:v2.0.4/git.html[documentation for release 2.0.4]
* release notes for
@@ -447,6 +454,11 @@ example the following invocations are equivalent:
given will override values from configuration files.
The <name> is expected in the same format as listed by
'git config' (subkeys separated by dots).
++
+Note that omitting the `=` in `git -c foo.bar ...` is allowed and sets
+`foo.bar` to the boolean true value (just like `[foo]bar` would in a
+config file). Including the equals but with an empty value (like `git -c
+foo.bar= ...`) sets `foo.bar` to the empty string.
--exec-path[=<path>]::
Path to wherever your core Git programs are installed.
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 643c1ba..9b45bda 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -440,8 +440,8 @@ Unspecified::
A path to which the `diff` attribute is unspecified
first gets its contents inspected, and if it looks like
- text, it is treated as text. Otherwise it would
- generate `Binary files differ`.
+ text and is smaller than core.bigFileThreshold, it is treated
+ as text. Otherwise it would generate `Binary files differ`.
String::
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index 85d6353..eecc39d 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -115,19 +115,22 @@ The placeholders are:
- '%aD': author date, RFC2822 style
- '%ar': author date, relative
- '%at': author date, UNIX timestamp
-- '%ai': author date, ISO 8601 format
+- '%ai': author date, ISO 8601-like format
+- '%aI': author date, strict ISO 8601 format
- '%cn': committer name
- '%cN': committer name (respecting .mailmap, see
linkgit:git-shortlog[1] or linkgit:git-blame[1])
- '%ce': committer email
- '%cE': committer email (respecting .mailmap, see
linkgit:git-shortlog[1] or linkgit:git-blame[1])
-- '%cd': committer date
+- '%cd': committer date (format respects --date= option)
- '%cD': committer date, RFC2822 style
- '%cr': committer date, relative
- '%ct': committer date, UNIX timestamp
-- '%ci': committer date, ISO 8601 format
+- '%ci': committer date, ISO 8601-like format
+- '%cI': committer date, strict ISO 8601 format
- '%d': ref names, like the --decorate option of linkgit:git-log[1]
+- '%D': ref names without the " (", ")" wrapping.
- '%e': encoding
- '%s': subject
- '%f': sanitized subject line, suitable for a filename
@@ -182,8 +185,9 @@ The placeholders are:
NOTE: Some placeholders may depend on other options given to the
revision traversal engine. For example, the `%g*` reflog options will
insert an empty string unless we are traversing reflog entries (e.g., by
-`git log -g`). The `%d` placeholder will use the "short" decoration
-format if `--decorate` was not already provided on the command line.
+`git log -g`). The `%d` and `%D` placeholders will use the "short"
+decoration format if `--decorate` was not already provided on the command
+line.
If you add a `+` (plus sign) after '%' of a placeholder, a line-feed
is inserted immediately before the expansion if and only if the
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index deb8cca..5d311b8 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -677,7 +677,7 @@ include::pretty-options.txt[]
--relative-date::
Synonym for `--date=relative`.
---date=(relative|local|default|iso|rfc|short|raw)::
+--date=(relative|local|default|iso|iso-strict|rfc|short|raw)::
Only takes effect for dates shown in human-readable format, such
as when using `--pretty`. `log.date` config variable sets a default
value for the log command's `--date` option.
@@ -687,7 +687,16 @@ e.g. ``2 hours ago''.
+
`--date=local` shows timestamps in user's local time zone.
+
-`--date=iso` (or `--date=iso8601`) shows timestamps in ISO 8601 format.
+`--date=iso` (or `--date=iso8601`) shows timestamps in a ISO 8601-like format.
+The differences to the strict ISO 8601 format are:
+
+ - a space instead of the `T` date/time delimiter
+ - a space between time and time zone
+ - no colon between hours and minutes of the time zone
+
++
+`--date=iso-strict` (or `--date=iso8601-strict`) shows timestamps in strict
+ISO 8601 format.
+
`--date=rfc` (or `--date=rfc2822`) shows timestamps in RFC 2822
format, often found in email messages.
diff --git a/Documentation/technical/api-allocation-growing.txt b/Documentation/technical/api-allocation-growing.txt
index 542946b..5a59b54 100644
--- a/Documentation/technical/api-allocation-growing.txt
+++ b/Documentation/technical/api-allocation-growing.txt
@@ -34,3 +34,6 @@ item[nr++] = value you like;
------------
You are responsible for updating the `nr` variable.
+
+If you need to specify the number of elements to allocate explicitly
+then use the macro `REALLOC_ARRAY(item, alloc)` instead of `ALLOC_GROW`.
diff --git a/Documentation/technical/api-config.txt b/Documentation/technical/api-config.txt
index 230b3a0..0d8b99b 100644
--- a/Documentation/technical/api-config.txt
+++ b/Documentation/technical/api-config.txt
@@ -77,6 +77,99 @@ To read a specific file in git-config format, use
`git_config_from_file`. This takes the same callback and data parameters
as `git_config`.
+Querying For Specific Variables
+-------------------------------
+
+For programs wanting to query for specific variables in a non-callback
+manner, the config API provides two functions `git_config_get_value`
+and `git_config_get_value_multi`. They both read values from an internal
+cache generated previously from reading the config files.
+
+`int git_config_get_value(const char *key, const char **value)`::
+
+ Finds the highest-priority value for the configuration variable `key`,
+ stores the pointer to it in `value` and returns 0. When the
+ configuration variable `key` is not found, returns 1 without touching
+ `value`. The caller should not free or modify `value`, as it is owned
+ by the cache.
+
+`const struct string_list *git_config_get_value_multi(const char *key)`::
+
+ Finds and returns the value list, sorted in order of increasing priority
+ for the configuration variable `key`. When the configuration variable
+ `key` is not found, returns NULL. The caller should not free or modify
+ the returned pointer, as it is owned by the cache.
+
+`void git_config_clear(void)`::
+
+ Resets and invalidates the config cache.
+
+The config API also provides type specific API functions which do conversion
+as well as retrieval for the queried variable, including:
+
+`int git_config_get_int(const char *key, int *dest)`::
+
+ Finds and parses the value to an integer for the configuration variable
+ `key`. Dies on error; otherwise, stores the value of the parsed integer in
+ `dest` and returns 0. When the configuration variable `key` is not found,
+ returns 1 without touching `dest`.
+
+`int git_config_get_ulong(const char *key, unsigned long *dest)`::
+
+ Similar to `git_config_get_int` but for unsigned longs.
+
+`int git_config_get_bool(const char *key, int *dest)`::
+
+ Finds and parses the value into a boolean value, for the configuration
+ variable `key` respecting keywords like "true" and "false". Integer
+ values are converted into true/false values (when they are non-zero or
+ zero, respectively). Other values cause a die(). If parsing is successful,
+ stores the value of the parsed result in `dest` and returns 0. When the
+ configuration variable `key` is not found, returns 1 without touching
+ `dest`.
+
+`int git_config_get_bool_or_int(const char *key, int *is_bool, int *dest)`::
+
+ Similar to `git_config_get_bool`, except that integers are copied as-is,
+ and `is_bool` flag is unset.
+
+`int git_config_get_maybe_bool(const char *key, int *dest)`::
+
+ Similar to `git_config_get_bool`, except that it returns -1 on error
+ rather than dying.
+
+`int git_config_get_string_const(const char *key, const char **dest)`::
+
+ Allocates and copies the retrieved string into the `dest` parameter for
+ the configuration variable `key`; if NULL string is given, prints an
+ error message and returns -1. When the configuration variable `key` is
+ not found, returns 1 without touching `dest`.
+
+`int git_config_get_string(const char *key, char **dest)`::
+
+ Similar to `git_config_get_string_const`, except that retrieved value
+ copied into the `dest` parameter is a mutable string.
+
+`int git_config_get_pathname(const char *key, const char **dest)`::
+
+ Similar to `git_config_get_string`, but expands `~` or `~user` into
+ the user's home directory when found at the beginning of the path.
+
+`git_die_config(const char *key, const char *err, ...)`::
+
+ First prints the error message specified by the caller in `err` and then
+ dies printing the line number and the file name of the highest priority
+ value for the configuration variable `key`.
+
+`void git_die_config_linenr(const char *key, const char *filename, int linenr)`::
+
+ Helper function which formats the die error message according to the
+ parameters entered. Used by `git_die_config()`. It can be used by callers
+ handling `git_config_get_value_multi()` to print the correct error message
+ for the desired value.
+
+See test-config.c for usage examples.
+
Value Parsing Helpers
---------------------
@@ -134,7 +227,98 @@ int read_file_with_include(const char *file, config_fn_t fn, void *data)
`git_config` respects includes automatically. The lower-level
`git_config_from_file` does not.
+Custom Configsets
+-----------------
+
+A `config_set` can be used to construct an in-memory cache for
+config-like files that the caller specifies (i.e., files like `.gitmodules`,
+`~/.gitconfig` etc.). For example,
+
+---------------------------------------
+struct config_set gm_config;
+git_configset_init(&gm_config);
+int b;
+/* we add config files to the config_set */
+git_configset_add_file(&gm_config, ".gitmodules");
+git_configset_add_file(&gm_config, ".gitmodules_alt");
+
+if (!git_configset_get_bool(gm_config, "submodule.frotz.ignore", &b)) {
+ /* hack hack hack */
+}
+
+/* when we are done with the configset */
+git_configset_clear(&gm_config);
+----------------------------------------
+
+Configset API provides functions for the above mentioned work flow, including:
+
+`void git_configset_init(struct config_set *cs)`::
+
+ Initializes the config_set `cs`.
+
+`int git_configset_add_file(struct config_set *cs, const char *filename)`::
+
+ Parses the file and adds the variable-value pairs to the `config_set`,
+ dies if there is an error in parsing the file. Returns 0 on success, or
+ -1 if the file does not exist or is inaccessible. The user has to decide
+ if he wants to free the incomplete configset or continue using it when
+ the function returns -1.
+
+`int git_configset_get_value(struct config_set *cs, const char *key, const char **value)`::
+
+ Finds the highest-priority value for the configuration variable `key`
+ and config set `cs`, stores the pointer to it in `value` and returns 0.
+ When the configuration variable `key` is not found, returns 1 without
+ touching `value`. The caller should not free or modify `value`, as it
+ is owned by the cache.
+
+`const struct string_list *git_configset_get_value_multi(struct config_set *cs, const char *key)`::
+
+ Finds and returns the value list, sorted in order of increasing priority
+ for the configuration variable `key` and config set `cs`. When the
+ configuration variable `key` is not found, returns NULL. The caller
+ should not free or modify the returned pointer, as it is owned by the cache.
+
+`void git_configset_clear(struct config_set *cs)`::
+
+ Clears `config_set` structure, removes all saved variable-value pairs.
+
+In addition to above functions, the `config_set` API provides type specific
+functions in the vein of `git_config_get_int` and family but with an extra
+parameter, pointer to struct `config_set`.
+They all behave similarly to the `git_config_get*()` family described in
+"Querying For Specific Variables" above.
+
Writing Config Files
--------------------
-TODO
+Git gives multiple entry points in the Config API to write config values to
+files namely `git_config_set_in_file` and `git_config_set`, which write to
+a specific config file or to `.git/config` respectively. They both take a
+key/value pair as parameter.
+In the end they both call `git_config_set_multivar_in_file` which takes four
+parameters:
+
+- the name of the file, as a string, to which key/value pairs will be written.
+
+- the name of key, as a string. This is in canonical "flat" form: the section,
+ subsection, and variable segments will be separated by dots, and the section
+ and variable segments will be all lowercase.
+ E.g., `core.ignorecase`, `diff.SomeType.textconv`.
+
+- the value of the variable, as a string. If value is equal to NULL, it will
+ remove the matching key from the config file.
+
+- the value regex, as a string. It will disregard key/value pairs where value
+ does not match.
+
+- a multi_replace value, as an int. If value is equal to zero, nothing or only
+ one matching key/value is replaced, else all matching key/values (regardless
+ how many) are removed, before the new pair is written.
+
+It returns 0 on success.
+
+Also, there are functions `git_config_rename_section` and
+`git_config_rename_section_in_file` with parameters `old_name` and `new_name`
+for renaming or removing sections in the config files. If NULL is passed
+through `new_name` parameter, the section will be removed from the config file.
diff --git a/Documentation/technical/api-run-command.txt b/Documentation/technical/api-run-command.txt
index 69510ae..842b838 100644
--- a/Documentation/technical/api-run-command.txt
+++ b/Documentation/technical/api-run-command.txt
@@ -13,6 +13,10 @@ produces in the caller in order to process it.
Functions
---------
+`child_process_init`
+
+ Initialize a struct child_process variable.
+
`start_command`::
Start a sub-process. Takes a pointer to a `struct child_process`
@@ -96,8 +100,8 @@ command to run in a sub-process.
The caller:
-1. allocates and clears (memset(&chld, 0, sizeof(chld));) a
- struct child_process variable;
+1. allocates and clears (using child_process_init() or
+ CHILD_PROCESS_INIT) a struct child_process variable;
2. initializes the members;
3. calls start_command();
4. processes the data;
diff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt
index f9c06a7..cca6543 100644
--- a/Documentation/technical/api-strbuf.txt
+++ b/Documentation/technical/api-strbuf.txt
@@ -160,6 +160,10 @@ then they will free() it.
Add a single character to the buffer.
+`strbuf_addchars`::
+
+ Add a character the specified number of times to the buffer.
+
`strbuf_insert`::
Insert data to the given position of the buffer. The remaining contents
@@ -307,6 +311,16 @@ same behaviour as well.
use it unless you need the correct position in the file
descriptor.
+`strbuf_getcwd`::
+
+ Set the buffer to the path of the current working directory.
+
+`strbuf_add_absolute_path`
+
+ Add a path to a buffer, converting a relative path to an
+ absolute one in the process. Symbolic links are not
+ resolved.
+
`stripspace`::
Strip whitespace from a buffer. The second parameter controls if
diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt
index dda1206..462e206 100644
--- a/Documentation/technical/pack-protocol.txt
+++ b/Documentation/technical/pack-protocol.txt
@@ -467,7 +467,7 @@ references.
----
update-request = *shallow ( command-list | push-cert ) [pack-file]
- shallow = PKT-LINE("shallow" SP obj-id)
+ shallow = PKT-LINE("shallow" SP obj-id LF)
command-list = PKT-LINE(command NUL capability-list LF)
*PKT-LINE(command LF)