summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/.gitignore2
-rw-r--r--Documentation/CodingGuidelines13
-rw-r--r--Documentation/Makefile31
-rw-r--r--Documentation/MyFirstContribution.txt1132
-rw-r--r--Documentation/RelNotes/2.22.0.txt496
-rw-r--r--Documentation/RelNotes/2.23.0.txt183
-rw-r--r--Documentation/SubmittingPatches6
-rw-r--r--Documentation/asciidoctor-extensions.rb4
-rw-r--r--Documentation/config.txt21
-rw-r--r--Documentation/config/advice.txt2
-rw-r--r--Documentation/config/alias.txt22
-rw-r--r--Documentation/config/branch.txt6
-rw-r--r--Documentation/config/core.txt14
-rw-r--r--Documentation/config/diff.txt4
-rw-r--r--Documentation/config/format.txt15
-rw-r--r--Documentation/config/fsck.txt6
-rw-r--r--Documentation/config/gc.txt40
-rw-r--r--Documentation/config/gpg.txt2
-rw-r--r--Documentation/config/merge.txt19
-rw-r--r--Documentation/config/pack.txt4
-rw-r--r--Documentation/config/pull.txt6
-rw-r--r--Documentation/config/rebase.txt17
-rw-r--r--Documentation/config/repack.txt2
-rw-r--r--Documentation/config/stash.txt15
-rw-r--r--Documentation/config/tag.txt8
-rw-r--r--Documentation/config/trace2.txt56
-rw-r--r--Documentation/diff-options.txt2
-rwxr-xr-xDocumentation/doc-diff86
-rw-r--r--Documentation/fetch-options.txt7
-rw-r--r--Documentation/git-add.txt9
-rw-r--r--Documentation/git-am.txt5
-rw-r--r--Documentation/git-branch.txt50
-rw-r--r--Documentation/git-checkout.txt6
-rw-r--r--Documentation/git-cherry-pick.txt12
-rw-r--r--Documentation/git-clean.txt11
-rw-r--r--Documentation/git-clone.txt17
-rw-r--r--Documentation/git-commit-tree.txt9
-rw-r--r--Documentation/git-config.txt6
-rw-r--r--Documentation/git-daemon.txt2
-rw-r--r--Documentation/git-describe.txt2
-rw-r--r--Documentation/git-diff-tree.txt1
-rw-r--r--Documentation/git-difftool.txt4
-rw-r--r--Documentation/git-fast-export.txt7
-rw-r--r--Documentation/git-fast-import.txt36
-rw-r--r--Documentation/git-filter-branch.txt2
-rw-r--r--Documentation/git-for-each-ref.txt5
-rw-r--r--Documentation/git-format-patch.txt7
-rw-r--r--Documentation/git-fsck.txt14
-rw-r--r--Documentation/git-gc.txt142
-rw-r--r--Documentation/git-grep.txt2
-rw-r--r--Documentation/git-hash-object.txt4
-rw-r--r--Documentation/git-help.txt4
-rw-r--r--Documentation/git-http-backend.txt2
-rw-r--r--Documentation/git-interpret-trailers.txt2
-rw-r--r--Documentation/git-ls-files.txt2
-rw-r--r--Documentation/git-ls-remote.txt2
-rw-r--r--Documentation/git-ls-tree.txt4
-rw-r--r--Documentation/git-merge.txt10
-rw-r--r--Documentation/git-mergetool--lib.txt4
-rw-r--r--Documentation/git-mergetool.txt4
-rw-r--r--Documentation/git-notes.txt2
-rw-r--r--Documentation/git-pull.txt5
-rw-r--r--Documentation/git-read-tree.txt9
-rw-r--r--Documentation/git-rebase.txt35
-rw-r--r--Documentation/git-remote-ext.txt4
-rw-r--r--Documentation/git-remote-fd.txt2
-rw-r--r--Documentation/git-remote-helpers.txto2
-rw-r--r--Documentation/git-remote-testgit.txt30
-rw-r--r--Documentation/git-rerere.txt2
-rw-r--r--Documentation/git-reset.txt4
-rw-r--r--Documentation/git-rev-list.txt1
-rw-r--r--Documentation/git-revert.txt12
-rw-r--r--Documentation/git-send-email.txt16
-rw-r--r--Documentation/git-show-branch.txt2
-rw-r--r--Documentation/git-stash.txt4
-rw-r--r--Documentation/git-status.txt12
-rw-r--r--Documentation/git-submodule.txt16
-rw-r--r--Documentation/git-svn.txt16
-rw-r--r--Documentation/git-tag.txt7
-rw-r--r--Documentation/git-update-server-info.txt11
-rw-r--r--Documentation/git-web--browse.txt4
-rw-r--r--Documentation/git-worktree.txt2
-rw-r--r--Documentation/git.txt52
-rw-r--r--Documentation/gitattributes.txt10
-rw-r--r--Documentation/githooks.txt18
-rw-r--r--Documentation/gitignore.txt74
-rw-r--r--Documentation/gitk.txt8
-rw-r--r--Documentation/gitmodules.txt2
-rw-r--r--Documentation/gitremote-helpers.txt6
-rw-r--r--Documentation/gitrepository-layout.txt2
-rw-r--r--Documentation/gitsubmodules.txt14
-rw-r--r--Documentation/gitweb.conf.txt32
-rw-r--r--Documentation/gitweb.txt38
-rw-r--r--Documentation/glossary-content.txt9
-rw-r--r--Documentation/howto/setup-git-server-over-http.txt4
-rw-r--r--Documentation/merge-options.txt9
-rw-r--r--Documentation/rev-list-options.txt41
-rw-r--r--Documentation/revisions.txt33
-rw-r--r--Documentation/sequencer.txt2
-rw-r--r--Documentation/technical/api-config.txt2
-rw-r--r--Documentation/technical/api-parse-options.txt4
-rw-r--r--Documentation/technical/api-trace2.txt209
-rw-r--r--Documentation/technical/commit-graph.txt17
-rw-r--r--Documentation/technical/directory-rename-detection.txt4
-rw-r--r--Documentation/technical/pack-protocol.txt8
-rw-r--r--Documentation/technical/protocol-v2.txt52
-rw-r--r--Documentation/trace2-target-values.txt10
-rw-r--r--Documentation/urls.txt2
108 files changed, 2879 insertions, 589 deletions
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 3ef54e0..9022d48 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -13,3 +13,5 @@ mergetools-*.txt
manpage-base-url.xsl
SubmittingPatches.txt
tmp-doc-diff/
+GIT-ASCIIDOCFLAGS
+/GIT-EXCLUDED-PROGRAMS
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 8579530..1169ff6 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -412,6 +412,12 @@ For C programs:
must be declared with "extern" in header files. However, function
declarations should not use "extern", as that is already the default.
+ - You can launch gdb around your program using the shorthand GIT_DEBUGGER.
+ Run `GIT_DEBUGGER=1 ./bin-wrappers/git foo` to simply use gdb as is, or
+ run `GIT_DEBUGGER="<debugger> <debugger-args>" ./bin-wrappers/git foo` to
+ use your own debugger and arguments. Example: `GIT_DEBUGGER="ddd --gdb"
+ ./bin-wrappers/git log` (See `wrap-for-bin.sh`.)
+
For Perl programs:
- Most of the C guidelines above apply.
@@ -580,11 +586,14 @@ Writing Documentation:
or commands:
Literal examples (e.g. use of command-line options, command names,
- branch names, configuration and environment variables) must be
- typeset in monospace (i.e. wrapped with backticks):
+ branch names, URLs, pathnames (files and directories), configuration and
+ environment variables) must be typeset in monospace (i.e. wrapped with
+ backticks):
`--pretty=oneline`
`git rev-list`
`remote.pushDefault`
+ `http://git.example.com`
+ `.git/config`
`GIT_DIR`
`HEAD`
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 26a2342..76f2ecf 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -7,12 +7,14 @@ ARTICLES =
SP_ARTICLES =
OBSOLETE_HTML =
+-include GIT-EXCLUDED-PROGRAMS
+
MAN1_TXT += $(filter-out \
+ $(patsubst %,%.txt,$(EXCLUDED_PROGRAMS)) \
$(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
$(wildcard git-*.txt))
MAN1_TXT += git.txt
MAN1_TXT += gitk.txt
-MAN1_TXT += gitremote-helpers.txt
MAN1_TXT += gitweb.txt
MAN5_TXT += gitattributes.txt
@@ -30,6 +32,7 @@ MAN7_TXT += gitdiffcore.txt
MAN7_TXT += giteveryday.txt
MAN7_TXT += gitglossary.txt
MAN7_TXT += gitnamespaces.txt
+MAN7_TXT += gitremote-helpers.txt
MAN7_TXT += gitrevisions.txt
MAN7_TXT += gitsubmodules.txt
MAN7_TXT += gittutorial-2.txt
@@ -73,6 +76,7 @@ SP_ARTICLES += howto/maintain-git
API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt)))
SP_ARTICLES += $(API_DOCS)
+TECH_DOCS += MyFirstContribution
TECH_DOCS += SubmittingPatches
TECH_DOCS += technical/hash-function-transition
TECH_DOCS += technical/http-protocol
@@ -331,6 +335,15 @@ mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
show_tool_names can_merge "* " || :' >mergetools-merge.txt && \
date >$@
+TRACK_ASCIIDOCFLAGS = $(subst ','\'',$(ASCIIDOC_COMMON):$(ASCIIDOC_HTML):$(ASCIIDOC_DOCBOOK))
+
+GIT-ASCIIDOCFLAGS: FORCE
+ @FLAGS='$(TRACK_ASCIIDOCFLAGS)'; \
+ if test x"$$FLAGS" != x"`cat GIT-ASCIIDOCFLAGS 2>/dev/null`" ; then \
+ echo >&2 " * new asciidoc flags"; \
+ echo "$$FLAGS" >GIT-ASCIIDOCFLAGS; \
+ fi
+
clean:
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
@@ -340,13 +353,14 @@ clean:
$(RM) SubmittingPatches.txt
$(RM) $(cmds_txt) $(mergetools_txt) *.made
$(RM) manpage-base-url.xsl
+ $(RM) GIT-ASCIIDOCFLAGS
-$(MAN_HTML): %.html : %.txt asciidoc.conf
+$(MAN_HTML): %.html : %.txt asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_HTML) -d manpage -o $@+ $< && \
mv $@+ $@
-$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
+$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_HTML) -o $@+ $< && \
mv $@+ $@
@@ -354,16 +368,16 @@ $(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
manpage-base-url.xsl: manpage-base-url.xsl.in
$(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
-%.1 %.5 %.7 : %.xml manpage-base-url.xsl
+%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl)
$(QUIET_XMLTO)$(RM) $@ && \
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
-%.xml : %.txt asciidoc.conf
+%.xml : %.txt asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_XML) -d manpage -o $@+ $< && \
mv $@+ $@
-user-manual.xml: user-manual.txt user-manual.conf
+user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_XML) -d book -o $@+ $< && \
mv $@+ $@
@@ -373,7 +387,8 @@ technical/api-index.txt: technical/api-index-skel.txt \
$(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh
technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
-$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
+$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt \
+ asciidoc.conf GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
SubmittingPatches.txt: SubmittingPatches
@@ -430,7 +445,7 @@ $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
WEBDOC_DEST = /pub/software/scm/git/docs
howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
-$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
+$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
sed -e '1,/^$$/d' $< | \
$(TXT_TO_HTML) - >$@+ && \
diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
new file mode 100644
index 0000000..895b7cf
--- /dev/null
+++ b/Documentation/MyFirstContribution.txt
@@ -0,0 +1,1132 @@
+My First Contribution to the Git Project
+========================================
+:sectanchors:
+
+[[summary]]
+== Summary
+
+This is a tutorial demonstrating the end-to-end workflow of creating a change to
+the Git tree, sending it for review, and making changes based on comments.
+
+[[prerequisites]]
+=== Prerequisites
+
+This tutorial assumes you're already fairly familiar with using Git to manage
+source code. The Git workflow steps will largely remain unexplained.
+
+[[related-reading]]
+=== Related Reading
+
+This tutorial aims to summarize the following documents, but the reader may find
+useful additional context:
+
+- `Documentation/SubmittingPatches`
+- `Documentation/howto/new-command.txt`
+
+[[getting-started]]
+== Getting Started
+
+[[cloning]]
+=== Clone the Git Repository
+
+Git is mirrored in a number of locations. Clone the repository from one of them;
+https://git-scm.com/downloads suggests one of the best places to clone from is
+the mirror on GitHub.
+
+----
+$ git clone https://github.com/git/git git
+$ cd git
+----
+
+[[identify-problem]]
+=== Identify Problem to Solve
+
+////
+Use + to indicate fixed-width here; couldn't get ` to work nicely with the
+quotes around "Pony Saying 'Um, Hello'".
+////
+In this tutorial, we will add a new command, +git psuh+, short for ``Pony Saying
+`Um, Hello''' - a feature which has gone unimplemented despite a high frequency
+of invocation during users' typical daily workflow.
+
+(We've seen some other effort in this space with the implementation of popular
+commands such as `sl`.)
+
+[[setup-workspace]]
+=== Set Up Your Workspace
+
+Let's start by making a development branch to work on our changes. Per
+`Documentation/SubmittingPatches`, since a brand new command is a new feature,
+it's fine to base your work on `master`. However, in the future for bugfixes,
+etc., you should check that document and base it on the appropriate branch.
+
+For the purposes of this document, we will base all our work on the `master`
+branch of the upstream project. Create the `psuh` branch you will use for
+development like so:
+
+----
+$ git checkout -b psuh origin/master
+----
+
+We'll make a number of commits here in order to demonstrate how to send a topic
+with multiple patches up for review simultaneously.
+
+[[code-it-up]]
+== Code It Up!
+
+NOTE: A reference implementation can be found at
+https://github.com/nasamuffin/git/tree/psuh.
+
+[[add-new-command]]
+=== Adding a New Command
+
+Lots of the subcommands are written as builtins, which means they are
+implemented in C and compiled into the main `git` executable. Implementing the
+very simple `psuh` command as a built-in will demonstrate the structure of the
+codebase, the internal API, and the process of working together as a contributor
+with the reviewers and maintainer to integrate this change into the system.
+
+Built-in subcommands are typically implemented in a function named "cmd_"
+followed by the name of the subcommand, in a source file named after the
+subcommand and contained within `builtin/`. So it makes sense to implement your
+command in `builtin/psuh.c`. Create that file, and within it, write the entry
+point for your command in a function matching the style and signature:
+
+----
+int cmd_psuh(int argc, const char **argv, const char *prefix)
+----
+
+We'll also need to add the declaration of psuh; open up `builtin.h`, find the
+declaration for `cmd_push`, and add a new line for `psuh` immediately before it,
+in order to keep the declarations sorted:
+
+----
+int cmd_psuh(int argc, const char **argv, const char *prefix);
+----
+
+Be sure to `#include "builtin.h"` in your `psuh.c`.
+
+Go ahead and add some throwaway printf to that function. This is a decent
+starting point as we can now add build rules and register the command.
+
+NOTE: Your throwaway text, as well as much of the text you will be adding over
+the course of this tutorial, is user-facing. That means it needs to be
+localizable. Take a look at `po/README` under "Marking strings for translation".
+Throughout the tutorial, we will mark strings for translation as necessary; you
+should also do so when writing your user-facing commands in the future.
+
+----
+int cmd_psuh(int argc, const char **argv, const char *prefix)
+{
+ printf(_("Pony saying hello goes here.\n"));
+ return 0;
+}
+----
+
+Let's try to build it. Open `Makefile`, find where `builtin/push.o` is added
+to `BUILTIN_OBJS`, and add `builtin/psuh.o` in the same way next to it in
+alphabetical order. Once you've done so, move to the top-level directory and
+build simply with `make`. Also add the `DEVELOPER=1` variable to turn on
+some additional warnings:
+
+----
+$ echo DEVELOPER=1 >config.mak
+$ make
+----
+
+NOTE: When you are developing the Git project, it's preferred that you use the
+`DEVELOPER` flag; if there's some reason it doesn't work for you, you can turn
+it off, but it's a good idea to mention the problem to the mailing list.
+
+NOTE: The Git build is parallelizable. `-j#` is not included above but you can
+use it as you prefer, here and elsewhere.
+
+Great, now your new command builds happily on its own. But nobody invokes it.
+Let's change that.
+
+The list of commands lives in `git.c`. We can register a new command by adding
+a `cmd_struct` to the `commands[]` array. `struct cmd_struct` takes a string
+with the command name, a function pointer to the command implementation, and a
+setup option flag. For now, let's keep mimicking `push`. Find the line where
+`cmd_push` is registered, copy it, and modify it for `cmd_psuh`, placing the new
+line in alphabetical order.
+
+The options are documented in `builtin.h` under "Adding a new built-in." Since
+we hope to print some data about the user's current workspace context later,
+we need a Git directory, so choose `RUN_SETUP` as your only option.
+
+Go ahead and build again. You should see a clean build, so let's kick the tires
+and see if it works. There's a binary you can use to test with in the
+`bin-wrappers` directory.
+
+----
+$ ./bin-wrappers/git psuh
+----
+
+Check it out! You've got a command! Nice work! Let's commit this.
+
+`git status` reveals modified `Makefile`, `builtin.h`, and `git.c` as well as
+untracked `builtin/psuh.c` and `git-psuh`. First, let's take care of the binary,
+which should be ignored. Open `.gitignore` in your editor, find `/git-push`, and
+add an entry for your new command in alphabetical order:
+
+----
+...
+/git-prune-packed
+/git-psuh
+/git-pull
+/git-push
+/git-quiltimport
+/git-range-diff
+...
+----
+
+Checking `git status` again should show that `git-psuh` has been removed from
+the untracked list and `.gitignore` has been added to the modified list. Now we
+can stage and commit:
+
+----
+$ git add Makefile builtin.h builtin/psuh.c git.c .gitignore
+$ git commit -s
+----
+
+You will be presented with your editor in order to write a commit message. Start
+the commit with a 50-column or less subject line, including the name of the
+component you're working on, followed by a blank line (always required) and then
+the body of your commit message, which should provide the bulk of the context.
+Remember to be explicit and provide the "Why" of your change, especially if it
+couldn't easily be understood from your diff. When editing your commit message,
+don't remove the Signed-off-by line which was added by `-s` above.
+
+----
+psuh: add a built-in by popular demand
+
+Internal metrics indicate this is a command many users expect to be
+present. So here's an implementation to help drive customer
+satisfaction and engagement: a pony which doubtfully greets the user,
+or, a Pony Saying "Um, Hello" (PSUH).
+
+This commit message is intentionally formatted to 72 columns per line,
+starts with a single line as "commit message subject" that is written as
+if to command the codebase to do something (add this, teach a command
+that). The body of the message is designed to add information about the
+commit that is not readily deduced from reading the associated diff,
+such as answering the question "why?".
+
+Signed-off-by: A U Thor <author@example.com>
+----
+
+Go ahead and inspect your new commit with `git show`. "psuh:" indicates you
+have modified mainly the `psuh` command. The subject line gives readers an idea
+of what you've changed. The sign-off line (`-s`) indicates that you agree to
+the Developer's Certificate of Origin 1.1 (see the
+`Documentation/SubmittingPatches` +++[[dco]]+++ header).
+
+For the remainder of the tutorial, the subject line only will be listed for the
+sake of brevity. However, fully-fleshed example commit messages are available
+on the reference implementation linked at the top of this document.
+
+[[implementation]]
+=== Implementation
+
+It's probably useful to do at least something besides printing out a string.
+Let's start by having a look at everything we get.
+
+Modify your `cmd_psuh` implementation to dump the args you're passed, keeping
+existing `printf()` calls in place:
+
+----
+ int i;
+
+ ...
+
+ printf(Q_("Your args (there is %d):\n",
+ "Your args (there are %d):\n",
+ argc),
+ argc);
+ for (i = 0; i < argc; i++)
+ printf("%d: %s\n", i, argv[i]);
+
+ printf(_("Your current working directory:\n<top-level>%s%s\n"),
+ prefix ? "/" : "", prefix ? prefix : "");
+
+----
+
+Build and try it. As you may expect, there's pretty much just whatever we give
+on the command line, including the name of our command. (If `prefix` is empty
+for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so
+helpful. So what other context can we get?
+
+Add a line to `#include "config.h"`. Then, add the following bits to the
+function body:
+
+----
+ const char *cfg_name;
+
+...
+
+ git_config(git_default_config, NULL);
+ if (git_config_get_string_const("user.name", &cfg_name) > 0)
+ printf(_("No name is found in config\n"));
+ else
+ printf(_("Your name: %s\n"), cfg_name);
+----
+
+`git_config()` will grab the configuration from config files known to Git and
+apply standard precedence rules. `git_config_get_string_const()` will look up
+a specific key ("user.name") and give you the value. There are a number of
+single-key lookup functions like this one; you can see them all (and more info
+about how to use `git_config()`) in `Documentation/technical/api-config.txt`.
+
+You should see that the name printed matches the one you see when you run:
+
+----
+$ git config --get user.name
+----
+
+Great! Now we know how to check for values in the Git config. Let's commit this
+too, so we don't lose our progress.
+
+----
+$ git add builtin/psuh.c
+$ git commit -sm "psuh: show parameters & config opts"
+----
+
+NOTE: Again, the above is for sake of brevity in this tutorial. In a real change
+you should not use `-m` but instead use the editor to write a meaningful
+message.
+
+Still, it'd be nice to know what the user's working context is like. Let's see
+if we can print the name of the user's current branch. We can mimic the
+`git status` implementation; the printer is located in `wt-status.c` and we can
+see that the branch is held in a `struct wt_status`.
+
+`wt_status_print()` gets invoked by `cmd_status()` in `builtin/commit.c`.
+Looking at that implementation we see the status config being populated like so:
+
+----
+status_init_config(&s, git_status_config);
+----
+
+But as we drill down, we can find that `status_init_config()` wraps a call
+to `git_config()`. Let's modify the code we wrote in the previous commit.
+
+Be sure to include the header to allow you to use `struct wt_status`:
+----
+#include "wt-status.h"
+----
+
+Then modify your `cmd_psuh` implementation to declare your `struct wt_status`,
+prepare it, and print its contents:
+
+----
+ struct wt_status status;
+
+...
+
+ wt_status_prepare(the_repository, &status);
+ git_config(git_default_config, &status);
+
+...
+
+ printf(_("Your current branch: %s\n"), status.branch);
+----
+
+Run it again. Check it out - here's the (verbose) name of your current branch!
+
+Let's commit this as well.
+
+----
+$ git add builtin/psuh.c
+$ git commit -sm "psuh: print the current branch"
+----
+
+Now let's see if we can get some info about a specific commit.
+
+Luckily, there are some helpers for us here. `commit.h` has a function called
+`lookup_commit_reference_by_name` to which we can simply provide a hardcoded
+string; `pretty.h` has an extremely handy `pp_commit_easy()` call which doesn't
+require a full format object to be passed.
+
+Add the following includes:
+
+----
+#include "commit.h"
+#include "pretty.h"
+----
+
+Then, add the following lines within your implementation of `cmd_psuh()` near
+the declarations and the logic, respectively.
+
+----
+ struct commit *c = NULL;
+ struct strbuf commitline = STRBUF_INIT;
+
+...
+
+ c = lookup_commit_reference_by_name("origin/master");
+
+ if (c != NULL) {
+ pp_commit_easy(CMIT_FMT_ONELINE, c, &commitline);
+ printf(_("Current commit: %s\n"), commitline.buf);
+ }
+----
+
+The `struct strbuf` provides some safety belts to your basic `char*`, one of
+which is a length member to prevent buffer overruns. It needs to be initialized
+nicely with `STRBUF_INIT`. Keep it in mind when you need to pass around `char*`.
+
+`lookup_commit_reference_by_name` resolves the name you pass it, so you can play
+with the value there and see what kind of things you can come up with.
+
+`pp_commit_easy` is a convenience wrapper in `pretty.h` that takes a single
+format enum shorthand, rather than an entire format struct. It then
+pretty-prints the commit according to that shorthand. These are similar to the
+formats available with `--pretty=FOO` in many Git commands.
+
+Build it and run, and if you're using the same name in the example, you should
+see the subject line of the most recent commit in `origin/master` that you know
+about. Neat! Let's commit that as well.
+
+----
+$ git add builtin/psuh.c
+$ git commit -sm "psuh: display the top of origin/master"
+----
+
+[[add-documentation]]
+=== Adding Documentation
+
+Awesome! You've got a fantastic new command that you're ready to share with the
+community. But hang on just a minute - this isn't very user-friendly. Run the
+following:
+
+----
+$ ./bin-wrappers/git help psuh
+----
+
+Your new command is undocumented! Let's fix that.
+
+Take a look at `Documentation/git-*.txt`. These are the manpages for the
+subcommands that Git knows about. You can open these up and take a look to get
+acquainted with the format, but then go ahead and make a new file
+`Documentation/git-psuh.txt`. Like with most of the documentation in the Git
+project, help pages are written with AsciiDoc (see CodingGuidelines, "Writing
+Documentation" section). Use the following template to fill out your own
+manpage:
+
+// Surprisingly difficult to embed AsciiDoc source within AsciiDoc.
+[listing]
+....
+git-psuh(1)
+===========
+
+NAME
+----
+git-psuh - Delight users' typo with a shy horse
+
+
+SYNOPSIS
+--------
+[verse]
+'git-psuh'
+
+DESCRIPTION
+-----------
+...
+
+OPTIONS[[OPTIONS]]
+------------------
+...
+
+OUTPUT
+------
+...
+
+GIT
+---
+Part of the linkgit:git[1] suite
+....
+
+The most important pieces of this to note are the file header, underlined by =,
+the NAME section, and the SYNOPSIS, which would normally contain the grammar if
+your command took arguments. Try to use well-established manpage headers so your
+documentation is consistent with other Git and UNIX manpages; this makes life
+easier for your user, who can skip to the section they know contains the
+information they need.
+
+Now that you've written your manpage, you'll need to build it explicitly. We
+convert your AsciiDoc to troff which is man-readable like so:
+
+----
+$ make all doc
+$ man Documentation/git-psuh.1
+----
+
+or
+
+----
+$ make -C Documentation/ git-psuh.1
+$ man Documentation/git-psuh.1
+----
+
+NOTE: You may need to install the package `asciidoc` to get this to work.
+
+While this isn't as satisfying as running through `git help`, you can at least
+check that your help page looks right.
+
+You can also check that the documentation coverage is good (that is, the project
+sees that your command has been implemented as well as documented) by running
+`make check-docs` from the top-level.
+
+Go ahead and commit your new documentation change.
+
+[[add-usage]]
+=== Adding Usage Text
+
+Try and run `./bin-wrappers/git psuh -h`. Your command should crash at the end.
+That's because `-h` is a special case which your command should handle by
+printing usage.
+
+Take a look at `Documentation/technical/api-parse-options.txt`. This is a handy
+tool for pulling out options you need to be able to handle, and it takes a
+usage string.
+
+In order to use it, we'll need to prepare a NULL-terminated usage string and a
+`builtin_psuh_options` array. Add a line to `#include "parse-options.h"`.
+
+At global scope, add your usage:
+
+----
+static const char * const psuh_usage[] = {
+ N_("git psuh"),
+ NULL,
+};
+----
+
+Then, within your `cmd_psuh()` implementation, we can declare and populate our
+`option` struct. Ours is pretty boring but you can add more to it if you want to
+explore `parse_options()` in more detail:
+
+----
+ struct option options[] = {
+ OPT_END()
+ };
+----
+
+Finally, before you print your args and prefix, add the call to
+`parse-options()`:
+
+----
+ argc = parse_options(argc, argv, prefix, options, psuh_usage, 0);
+----
+
+This call will modify your `argv` parameter. It will strip the options you
+specified in `options` from `argv` and the locations pointed to from `options`
+entries will be updated. Be sure to replace your `argc` with the result from
+`parse_options()`, or you will be confused if you try to parse `argv` later.
+
+It's worth noting the special argument `--`. As you may be aware, many Unix
+commands use `--` to indicate "end of named parameters" - all parameters after
+the `--` are interpreted merely as positional arguments. (This can be handy if
+you want to pass as a parameter something which would usually be interpreted as
+a flag.) `parse_options()` will terminate parsing when it reaches `--` and give
+you the rest of the options afterwards, untouched.
+
+Build again. Now, when you run with `-h`, you should see your usage printed and
+your command terminated before anything else interesting happens. Great!
+
+Go ahead and commit this one, too.
+
+[[testing]]
+== Testing
+
+It's important to test your code - even for a little toy command like this one.
+Moreover, your patch won't be accepted into the Git tree without tests. Your
+tests should:
+
+* Illustrate the current behavior of the feature
+* Prove the current behavior matches the expected behavior
+* Ensure the externally-visible behavior isn't broken in later changes
+
+So let's write some tests.
+
+Related reading: `t/README`
+
+[[overview-test-structure]]
+=== Overview of Testing Structure
+
+The tests in Git live in `t/` and are named with a 4-digit decimal number using
+the schema shown in the Naming Tests section of `t/README`.
+
+[[write-new-test]]
+=== Writing Your Test
+
+Since this a toy command, let's go ahead and name the test with t9999. However,
+as many of the family/subcmd combinations are full, best practice seems to be
+to find a command close enough to the one you've added and share its naming
+space.
+
+Create a new file `t/t9999-psuh-tutorial.sh`. Begin with the header as so (see
+"Writing Tests" and "Source 'test-lib.sh'" in `t/README`):
+
+----
+#!/bin/sh
+
+test_description='git-psuh test
+
+This test runs git-psuh and makes sure it does not crash.'
+
+. ./test-lib.sh
+----
+
+Tests are framed inside of a `test_expect_success` in order to output TAP
+formatted results. Let's make sure that `git psuh` doesn't exit poorly and does
+mention the right animal somewhere:
+
+----
+test_expect_success 'runs correctly with no args and good output' '
+ git psuh >actual &&
+ test_i18ngrep Pony actual
+'
+----
+
+Indicate that you've run everything you wanted by adding the following at the
+bottom of your script:
+
+----
+test_done
+----
+
+Make sure you mark your test script executable:
+
+----
+$ chmod +x t/t9999-psuh-tutorial.sh
+----
+
+You can get an idea of whether you created your new test script successfully
+by running `make -C t test-lint`, which will check for things like test number
+uniqueness, executable bit, and so on.
+
+[[local-test]]
+=== Running Locally
+
+Let's try and run locally:
+
+----
+$ make
+$ cd t/ && prove t9999-psuh-tutorial.sh
+----
+
+You can run the full test suite and ensure `git-psuh` didn't break anything:
+
+----
+$ cd t/
+$ prove -j$(nproc) --shuffle t[0-9]*.sh
+----
+
+NOTE: You can also do this with `make test` or use any testing harness which can
+speak TAP. `prove` can run concurrently. `shuffle` randomizes the order the
+tests are run in, which makes them resilient against unwanted inter-test
+dependencies. `prove` also makes the output nicer.
+
+Go ahead and commit this change, as well.
+
+[[ready-to-share]]
+== Getting Ready to Share
+
+You may have noticed already that the Git project performs its code reviews via
+emailed patches, which are then applied by the maintainer when they are ready
+and approved by the community. The Git project does not accept patches from
+pull requests, and the patches emailed for review need to be formatted a
+specific way. At this point the tutorial diverges, in order to demonstrate two
+different methods of formatting your patchset and getting it reviewed.
+
+The first method to be covered is GitGitGadget, which is useful for those
+already familiar with GitHub's common pull request workflow. This method
+requires a GitHub account.
+
+The second method to be covered is `git send-email`, which can give slightly
+more fine-grained control over the emails to be sent. This method requires some
+setup which can change depending on your system and will not be covered in this
+tutorial.
+
+Regardless of which method you choose, your engagement with reviewers will be
+the same; the review process will be covered after the sections on GitGitGadget
+and `git send-email`.
+
+[[howto-ggg]]
+== Sending Patches via GitGitGadget
+
+One option for sending patches is to follow a typical pull request workflow and
+send your patches out via GitGitGadget. GitGitGadget is a tool created by
+Johannes Schindelin to make life as a Git contributor easier for those used to
+the GitHub PR workflow. It allows contributors to open pull requests against its
+mirror of the Git project, and does some magic to turn the PR into a set of
+emails and send them out for you. It also runs the Git continuous integration
+suite for you. It's documented at http://gitgitgadget.github.io.
+
+[[create-fork]]
+=== Forking `git/git` on GitHub
+
+Before you can send your patch off to be reviewed using GitGitGadget, you will
+need to fork the Git project and upload your changes. First thing - make sure
+you have a GitHub account.
+
+Head to the https://github.com/git/git[GitHub mirror] and look for the Fork
+button. Place your fork wherever you deem appropriate and create it.
+
+[[upload-to-fork]]
+=== Uploading to Your Own Fork
+
+To upload your branch to your own fork, you'll need to add the new fork as a
+remote. You can use `git remote -v` to show the remotes you have added already.
+From your new fork's page on GitHub, you can press "Clone or download" to get
+the URL; then you need to run the following to add, replacing your own URL and
+remote name for the examples provided:
+
+----
+$ git remote add remotename git@github.com:remotename/git.git
+----
+
+or to use the HTTPS URL:
+
+----
+$ git remote add remotename https://github.com/remotename/git/.git
+----
+
+Run `git remote -v` again and you should see the new remote showing up.
+`git fetch remotename` (with the real name of your remote replaced) in order to
+get ready to push.
+
+Next, double-check that you've been doing all your development in a new branch
+by running `git branch`. If you didn't, now is a good time to move your new
+commits to their own branch.
+
+As mentioned briefly at the beginning of this document, we are basing our work
+on `master`, so go ahead and update as shown below, or using your preferred
+workflow.
+
+----
+$ git checkout master
+$ git pull -r
+$ git rebase master psuh
+----
+
+Finally, you're ready to push your new topic branch! (Due to our branch and
+command name choices, be careful when you type the command below.)
+
+----
+$ git push remotename psuh
+----
+
+Now you should be able to go and check out your newly created branch on GitHub.
+
+[[send-pr-ggg]]
+=== Sending a PR to GitGitGadget
+
+In order to have your code tested and formatted for review, you need to start by
+opening a Pull Request against `gitgitgadget/git`. Head to
+https://github.com/gitgitgadget/git and open a PR either with the "New pull
+request" button or the convenient "Compare & pull request" button that may
+appear with the name of your newly pushed branch.
+
+Review the PR's title and description, as it's used by GitGitGadget as the cover
+letter for your change. When you're happy, submit your pull request.
+
+[[run-ci-ggg]]
+=== Running CI and Getting Ready to Send
+
+If it's your first time using GitGitGadget (which is likely, as you're using
+this tutorial) then someone will need to give you permission to use the tool.
+As mentioned in the GitGitGadget documentation, you just need someone who
+already uses it to comment on your PR with `/allow <username>`. GitGitGadget
+will automatically run your PRs through the CI even without the permission given
+but you will not be able to `/submit` your changes until someone allows you to
+use the tool.
+
+If the CI fails, you can update your changes with `git rebase -i` and push your
+branch again:
+
+----
+$ git push -f remotename psuh
+----
+
+In fact, you should continue to make changes this way up until the point when
+your patch is accepted into `next`.
+
+////
+TODO https://github.com/gitgitgadget/gitgitgadget/issues/83
+It'd be nice to be able to verify that the patch looks good before sending it
+to everyone on Git mailing list.
+[[check-work-ggg]]
+=== Check Your Work
+////
+
+[[send-mail-ggg]]
+=== Sending Your Patches
+
+Now that your CI is passing and someone has granted you permission to use
+GitGitGadget with the `/allow` command, sending out for review is as simple as
+commenting on your PR with `/submit`.
+
+[[responding-ggg]]
+=== Updating With Comments
+
+Skip ahead to <<reviewing,Responding to Reviews>> for information on how to
+reply to review comments you will receive on the mailing list.
+
+Once you have your branch again in the shape you want following all review
+comments, you can submit again:
+
+----
+$ git push -f remotename psuh
+----
+
+Next, go look at your pull request against GitGitGadget; you should see the CI
+has been kicked off again. Now while the CI is running is a good time for you
+to modify your description at the top of the pull request thread; it will be
+used again as the cover letter. You should use this space to describe what
+has changed since your previous version, so that your reviewers have some idea
+of what they're looking at. When the CI is done running, you can comment once
+more with `/submit` - GitGitGadget will automatically add a v2 mark to your
+changes.
+
+[[howto-git-send-email]]
+== Sending Patches with `git send-email`
+
+If you don't want to use GitGitGadget, you can also use Git itself to mail your
+patches. Some benefits of using Git this way include finer grained control of
+subject line (for example, being able to use the tag [RFC PATCH] in the subject)
+and being able to send a ``dry run'' mail to yourself to ensure it all looks
+good before going out to the list.
+
+[[setup-git-send-email]]
+=== Prerequisite: Setting Up `git send-email`
+
+Configuration for `send-email` can vary based on your operating system and email
+provider, and so will not be covered in this tutorial, beyond stating that in
+many distributions of Linux, `git-send-email` is not packaged alongside the
+typical `git` install. You may need to install this additional package; there
+are a number of resources online to help you do so. You will also need to
+determine the right way to configure it to use your SMTP server; again, as this
+configuration can change significantly based on your system and email setup, it
+is out of scope for the context of this tutorial.
+
+[[format-patch]]
+=== Preparing Initial Patchset
+
+Sending emails with Git is a two-part process; before you can prepare the emails
+themselves, you'll need to prepare the patches. Luckily, this is pretty simple:
+
+----
+$ git format-patch --cover-letter -o psuh/ master..psuh
+----
+
+The `--cover-letter` parameter tells `format-patch` to create a cover letter
+template for you. You will need to fill in the template before you're ready
+to send - but for now, the template will be next to your other patches.
+
+The `-o psuh/` parameter tells `format-patch` to place the patch files into a
+directory. This is useful because `git send-email` can take a directory and
+send out all the patches from there.
+
+`master..psuh` tells `format-patch` to generate patches for the difference
+between `master` and `psuh`. It will make one patch file per commit. After you
+run, you can go have a look at each of the patches with your favorite text
+editor and make sure everything looks alright; however, it's not recommended to
+make code fixups via the patch file. It's a better idea to make the change the
+normal way using `git rebase -i` or by adding a new commit than by modifying a
+patch.
+
+NOTE: Optionally, you can also use the `--rfc` flag to prefix your patch subject
+with ``[RFC PATCH]'' instead of ``[PATCH]''. RFC stands for ``request for
+comments'' and indicates that while your code isn't quite ready for submission,
+you'd like to begin the code review process. This can also be used when your
+patch is a proposal, but you aren't sure whether the community wants to solve
+the problem with that approach or not - to conduct a sort of design review. You
+may also see on the list patches marked ``WIP'' - this means they are incomplete
+but want reviewers to look at what they have so far. You can add this flag with
+`--subject-prefix=WIP`.
+
+Check and make sure that your patches and cover letter template exist in the
+directory you specified - you're nearly ready to send out your review!
+
+[[cover-letter]]
+=== Preparing Email
+
+In addition to an email per patch, the Git community also expects your patches
+to come with a cover letter, typically with a subject line [PATCH 0/x] (where
+x is the number of patches you're sending). Since you invoked `format-patch`
+with `--cover-letter`, you've already got a template ready. Open it up in your
+favorite editor.
+
+You should see a number of headers present already. Check that your `From:`
+header is correct. Then modify your `Subject:` to something which succinctly
+covers the purpose of your entire topic branch, for example:
+
+----
+Subject: [PATCH 0/7] adding the 'psuh' command
+----
+
+Make sure you retain the ``[PATCH 0/X]'' part; that's what indicates to the Git
+community that this email is the beginning of a review, and many reviewers
+filter their email for this type of flag.
+
+You'll need to add some extra parameters when you invoke `git send-email` to add
+the cover letter.
+
+Next you'll have to fill out the body of your cover letter. This is an important
+component of change submission as it explains to the community from a high level
+what you're trying to do, and why, in a way that's more apparent than just
+looking at your diff. Be sure to explain anything your diff doesn't make clear
+on its own.
+
+Here's an example body for `psuh`:
+
+----
+Our internal metrics indicate widespread interest in the command
+git-psuh - that is, many users are trying to use it, but finding it is
+unavailable, using some unknown workaround instead.
+
+The following handful of patches add the psuh command and implement some
+handy features on top of it.
+
+This patchset is part of the MyFirstContribution tutorial and should not
+be merged.
+----
+
+The template created by `git format-patch --cover-letter` includes a diffstat.
+This gives reviewers a summary of what they're in for when reviewing your topic.
+The one generated for `psuh` from the sample implementation looks like this:
+
+----
+ Documentation/git-psuh.txt | 40 +++++++++++++++++++++
+ Makefile | 1 +
+ builtin.h | 1 +
+ builtin/psuh.c | 73 ++++++++++++++++++++++++++++++++++++++
+ git.c | 1 +
+ t/t9999-psuh-tutorial.sh | 12 +++++++
+ 6 files changed, 128 insertions(+)
+ create mode 100644 Documentation/git-psuh.txt
+ create mode 100644 builtin/psuh.c
+ create mode 100755 t/t9999-psuh-tutorial.sh
+----
+
+Finally, the letter will include the version of Git used to generate the
+patches. You can leave that string alone.
+
+[[sending-git-send-email]]
+=== Sending Email
+
+At this point you should have a directory `psuh/` which is filled with your
+patches and a cover letter. Time to mail it out! You can send it like this:
+
+----
+$ git send-email --to=target@example.com psuh/*.patch
+----
+
+NOTE: Check `git help send-email` for some other options which you may find
+valuable, such as changing the Reply-to address or adding more CC and BCC lines.
+
+NOTE: When you are sending a real patch, it will go to git@vger.kernel.org - but
+please don't send your patchset from the tutorial to the real mailing list! For
+now, you can send it to yourself, to make sure you understand how it will look.
+
+After you run the command above, you will be presented with an interactive
+prompt for each patch that's about to go out. This gives you one last chance to
+edit or quit sending something (but again, don't edit code this way). Once you
+press `y` or `a` at these prompts your emails will be sent! Congratulations!
+
+Awesome, now the community will drop everything and review your changes. (Just
+kidding - be patient!)
+
+[[v2-git-send-email]]
+=== Sending v2
+
+Skip ahead to <<reviewing,Responding to Reviews>> for information on how to
+handle comments from reviewers. Continue this section when your topic branch is
+shaped the way you want it to look for your patchset v2.
+
+When you're ready with the next iteration of your patch, the process is fairly
+similar.
+
+First, generate your v2 patches again:
+
+----
+$ git format-patch -v2 --cover-letter -o psuh/ master..psuh
+----
+
+This will add your v2 patches, all named like `v2-000n-my-commit-subject.patch`,
+to the `psuh/` directory. You may notice that they are sitting alongside the v1
+patches; that's fine, but be careful when you are ready to send them.
+
+Edit your cover letter again. Now is a good time to mention what's different
+between your last version and now, if it's something significant. You do not
+need the exact same body in your second cover letter; focus on explaining to
+reviewers the changes you've made that may not be as visible.
+
+You will also need to go and find the Message-Id of your previous cover letter.
+You can either note it when you send the first series, from the output of `git
+send-email`, or you can look it up on the
+https://public-inbox.org/git[mailing list]. Find your cover letter in the
+archives, click on it, then click "permalink" or "raw" to reveal the Message-Id
+header. It should match:
+
+----
+Message-Id: <foo.12345.author@example.com>
+----
+
+Your Message-Id is `<foo.12345.author@example.com>`. This example will be used
+below as well; make sure to replace it with the correct Message-Id for your
+**previous cover letter** - that is, if you're sending v2, use the Message-Id
+from v1; if you're sending v3, use the Message-Id from v2.
+
+While you're looking at the email, you should also note who is CC'd, as it's
+common practice in the mailing list to keep all CCs on a thread. You can add
+these CC lines directly to your cover letter with a line like so in the header
+(before the Subject line):
+
+----
+CC: author@example.com, Othe R <other@example.com>
+----
+
+Now send the emails again, paying close attention to which messages you pass in
+to the command:
+
+----
+$ git send-email --to=target@example.com
+ --in-reply-to="<foo.12345.author@example.com>"
+ psuh/v2*
+----
+
+[[single-patch]]
+=== Bonus Chapter: One-Patch Changes
+
+In some cases, your very small change may consist of only one patch. When that
+happens, you only need to send one email. Your commit message should already be
+meaningful and explain at a high level the purpose (what is happening and why)
+of your patch, but if you need to supply even more context, you can do so below
+the `---` in your patch. Take the example below, which was generated with `git
+format-patch` on a single commit, and then edited to add the content between
+the `---` and the diffstat.
+
+----
+From 1345bbb3f7ac74abde040c12e737204689a72723 Mon Sep 17 00:00:00 2001
+From: A U Thor <author@example.com>
+Date: Thu, 18 Apr 2019 15:11:02 -0700
+Subject: [PATCH] README: change the grammar
+
+I think it looks better this way. This part of the commit message will
+end up in the commit-log.
+
+Signed-off-by: A U Thor <author@example.com>
+---
+Let's have a wild discussion about grammar on the mailing list. This
+part of my email will never end up in the commit log. Here is where I
+can add additional context to the mailing list about my intent, outside
+of the context of the commit log. This section was added after `git
+format-patch` was run, by editing the patch file in a text editor.
+
+ README.md | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/README.md b/README.md
+index 88f126184c..38da593a60 100644
+--- a/README.md
++++ b/README.md
+@@ -3,7 +3,7 @@
+ Git - fast, scalable, distributed revision control system
+ =========================================================
+
+-Git is a fast, scalable, distributed revision control system with an
++Git is a fast, scalable, and distributed revision control system with an
+ unusually rich command set that provides both high-level operations
+ and full access to internals.
+
+--
+2.21.0.392.gf8f6787159e-goog
+----
+
+[[now-what]]
+== My Patch Got Emailed - Now What?
+
+[[reviewing]]
+=== Responding to Reviews
+
+After a few days, you will hopefully receive a reply to your patchset with some
+comments. Woohoo! Now you can get back to work.
+
+It's good manners to reply to each comment, notifying the reviewer that you have
+made the change requested, feel the original is better, or that the comment
+inspired you to do something a new way which is superior to both the original
+and the suggested change. This way reviewers don't need to inspect your v2 to
+figure out whether you implemented their comment or not.
+
+If you are going to push back on a comment, be polite and explain why you feel
+your original is better; be prepared that the reviewer may still disagree with
+you, and the rest of the community may weigh in on one side or the other. As
+with all code reviews, it's important to keep an open mind to doing something a
+different way than you originally planned; other reviewers have a different
+perspective on the project than you do, and may be thinking of a valid side
+effect which had not occurred to you. It is always okay to ask for clarification
+if you aren't sure why a change was suggested, or what the reviewer is asking
+you to do.
+
+Make sure your email client has a plaintext email mode and it is turned on; the
+Git list rejects HTML email. Please also follow the mailing list etiquette
+outlined in the
+https://kernel.googlesource.com/pub/scm/git/git/+/todo/MaintNotes[Maintainer's
+Note], which are similar to etiquette rules in most open source communities
+surrounding bottom-posting and inline replies.
+
+When you're making changes to your code, it is cleanest - that is, the resulting
+commits are easiest to look at - if you use `git rebase -i` (interactive
+rebase). Take a look at this
+https://www.oreilly.com/library/view/git-pocket-guide/9781449327507/ch10.html[overview]
+from O'Reilly. The general idea is to modify each commit which requires changes;
+this way, instead of having a patch A with a mistake, a patch B which was fine
+and required no upstream reviews in v1, and a patch C which fixes patch A for
+v2, you can just ship a v2 with a correct patch A and correct patch B. This is
+changing history, but since it's local history which you haven't shared with
+anyone, that is okay for now! (Later, it may not make sense to do this; take a
+look at the section below this one for some context.)
+
+[[after-approval]]
+=== After Review Approval
+
+The Git project has four integration branches: `pu`, `next`, `master`, and
+`maint`. Your change will be placed into `pu` fairly early on by the maintainer
+while it is still in the review process; from there, when it is ready for wider
+testing, it will be merged into `next`. Plenty of early testers use `next` and
+may report issues. Eventually, changes in `next` will make it to `master`,
+which is typically considered stable. Finally, when a new release is cut,
+`maint` is used to base bugfixes onto. As mentioned at the beginning of this
+document, you can read `Documents/SubmittingPatches` for some more info about
+the use of the various integration branches.
+
+Back to now: your code has been lauded by the upstream reviewers. It is perfect.
+It is ready to be accepted. You don't need to do anything else; the maintainer
+will merge your topic branch to `next` and life is good.
+
+However, if you discover it isn't so perfect after this point, you may need to
+take some special steps depending on where you are in the process.
+
+If the maintainer has announced in the "What's cooking in git.git" email that
+your topic is marked for `next` - that is, that they plan to merge it to `next`
+but have not yet done so - you should send an email asking the maintainer to
+wait a little longer: "I've sent v4 of my series and you marked it for `next`,
+but I need to change this and that - please wait for v5 before you merge it."
+
+If the topic has already been merged to `next`, rather than modifying your
+patches with `git rebase -i`, you should make further changes incrementally -
+that is, with another commit, based on top of the maintainer's topic branch as
+detailed in https://github.com/gitster/git. Your work is still in the same topic
+but is now incremental, rather than a wholesale rewrite of the topic branch.
+
+The topic branches in the maintainer's GitHub are mirrored in GitGitGadget, so
+if you're sending your reviews out that way, you should be sure to open your PR
+against the appropriate GitGitGadget/Git branch.
+
+If you're using `git send-email`, you can use it the same way as before, but you
+should generate your diffs from `<topic>..<mybranch>` and base your work on
+`<topic>` instead of `master`.
diff --git a/Documentation/RelNotes/2.22.0.txt b/Documentation/RelNotes/2.22.0.txt
index 16d3110..91e6ae9 100644
--- a/Documentation/RelNotes/2.22.0.txt
+++ b/Documentation/RelNotes/2.22.0.txt
@@ -4,6 +4,13 @@ Git 2.22 Release Notes
Updates since v2.21
-------------------
+Backward compatibility note
+
+ * The filter specification "--filter=sparse:path=<path>" used to
+ create a lazy/partial clone has been removed. Using a blob that is
+ part of the project as sparse specification is still supported with
+ the "--filter=sparse:oid=<blob>" option.
+
UI, Workflows & Features
* "git checkout --no-overlay" can be used to trigger a new mode of
@@ -31,6 +38,86 @@ UI, Workflows & Features
* The command line completion (in contrib/) has been taught to
complete more subcommand parameters.
+ * The final report from "git bisect" used to show the suspected
+ culprit using a raw "diff-tree", with which there is no output for
+ a merge commit. This has been updated to use a more modern and
+ human readable output that still is concise enough.
+
+ * "git rebase --rebase-merges" replaces its old "--preserve-merges"
+ option; the latter is now marked as deprecated.
+
+ * Error message given while cloning with --recurse-submodules has
+ been updated.
+
+ * The completion helper code now pays attention to repository-local
+ configuration (when available), which allows --list-cmds to honour
+ a repository specific setting of completion.commands, for example.
+
+ * "git mergetool" learned to offer Sublime Merge (smerge) as one of
+ its backends.
+
+ * A new hook "post-index-change" is called when the on-disk index
+ file changes, which can help e.g. a virtualized working tree
+ implementation.
+
+ * "git difftool" can now run outside a repository.
+
+ * "git checkout -m <other>" was about carrying the differences
+ between HEAD and the working-tree files forward while checking out
+ another branch, and ignored the differences between HEAD and the
+ index. The command has been taught to abort when the index and the
+ HEAD are different.
+
+ * A progress indicator has been added to the "index-pack" step, which
+ often makes users wait for completion during "git clone".
+
+ * "git submodule" learns "set-branch" subcommand that allows the
+ submodule.*.branch settings to be modified.
+
+ * "git merge-recursive" backend recently learned a new heuristics to
+ infer file movement based on how other files in the same directory
+ moved. As this is inherently less robust heuristics than the one
+ based on the content similarity of the file itself (rather than
+ based on what its neighbours are doing), it sometimes gives an
+ outcome unexpected by the end users. This has been toned down to
+ leave the renamed paths in higher/conflicted stages in the index so
+ that the user can examine and confirm the result.
+
+ * "git tag" learned to give an advice suggesting it might be a
+ mistake when creating an annotated or signed tag that points at
+ another tag.
+
+ * The "git pack-objects" command learned to report the number of
+ objects it packed via the trace2 mechanism.
+
+ * The list of conflicted paths shown in the editor while concluding a
+ conflicted merge was shown above the scissors line when the
+ clean-up mode is set to "scissors", even though it was commented
+ out just like the list of updated paths and other information to
+ help the user explain the merge better.
+
+ * The trace2 tracing facility learned to auto-generate a filename
+ when told to log to a directory.
+
+ * "git clone" learned a new --server-option option when talking over
+ the protocol version 2.
+
+ * The connectivity bitmaps are created by default in bare
+ repositories now; also the pathname hash-cache is created by
+ default to avoid making crappy deltas when repacking.
+
+ * "git branch new A...B" and "git checkout -b new A...B" have been
+ taught that in their contexts, the notation A...B means "the merge
+ base between these two commits", just like "git checkout A...B"
+ detaches HEAD at that commit.
+
+ * Update "git difftool" and "git mergetool" so that the combinations
+ of {diff,merge}.{tool,guitool} configuration variables serve as
+ fallback settings of each other in a sensible order.
+
+ * The "--dir-diff" mode of "git difftool" is not useful in "--no-index"
+ mode; they are now explicitly marked as mutually incompatible.
+
Performance, Internal Implementation, Development Support etc.
@@ -47,6 +134,90 @@ Performance, Internal Implementation, Development Support etc.
* "git prune" has been taught to take advantage of reachability
bitmap when able.
+ * The command line parser of "git commit-tree" has been rewritten to
+ use the parse-options API.
+
+ * Suggest GitGitGadget instead of submitGit as a way to submit
+ patches based on GitHub PR to us.
+
+ * The test framework has been updated to help developers by making it
+ easier to run most of the tests under different versions of
+ over-the-wire protocols.
+
+ * Dev support update to make it easier to compare two formatted
+ results from our documentation.
+
+ * The scripted "git rebase" implementation has been retired.
+
+ * "git multi-pack-index verify" did not scale well with the number of
+ packfiles, which is being improved.
+
+ * "git stash" has been rewritten in C.
+
+ * The "check-docs" Makefile target to support developers has been
+ updated.
+
+ * The tests have been updated not to rely on the abbreviated option
+ names the parse-options API offers, to protect us from an
+ abbreviated form of an option that used to be unique within the
+ command getting non-unique when a new option that share the same
+ prefix is added.
+
+ * The scripted version of "git rebase -i" wrote and rewrote the todo
+ list many times during a single step of its operation, and the
+ recent C-rewrite made a faithful conversion of the logic to C. The
+ implementation has been updated to carry necessary information
+ around in-core to avoid rewriting the same file over and over
+ unnecessarily.
+
+ * Test framework update to more robustly clean up leftover files and
+ processes after tests are done.
+
+ * Conversion from unsigned char[20] to struct object_id continues.
+
+ * While running "git diff" in a lazy clone, we can upfront know which
+ missing blobs we will need, instead of waiting for the on-demand
+ machinery to discover them one by one. The code learned to aim to
+ achieve better performance by batching the request for these
+ promised blobs.
+
+ * During an initial "git clone --depth=..." partial clone, it is
+ pointless to spend cycles for a large portion of the connectivity
+ check that enumerates and skips promisor objects (which by
+ definition is all objects fetched from the other side). This has
+ been optimized out.
+
+ * Mechanically and systematically drop "extern" from function
+ declaration.
+
+ * The script to aggregate perf result unconditionally depended on
+ libjson-perl even though it did not have to, which has been
+ corrected.
+
+ * The internal implementation of "git rebase -i" has been updated to
+ avoid forking a separate "rebase--interactive" process.
+
+ * Allow DEP and ASLR for Windows build to for security hardening.
+
+ * Performance test framework has been broken and measured the version
+ of Git that happens to be on $PATH, not the specified one to
+ measure, for a while, which has been corrected.
+
+ * Optionally "make coccicheck" can feed multiple source files to
+ spatch, gaining performance while spending more memory.
+
+ * Attempt to use an abbreviated option in "git clone --recurs" is
+ responded by a request to disambiguate between --recursive and
+ --recurse-submodules, which is bad because these two are synonyms.
+ The parse-options API has been extended to define such synonyms
+ more easily and not produce an unnecessary failure.
+
+ * A pair of private functions in http.c that had names similar to
+ fread/fwrite did not return the number of elements, which was found
+ to be confusing.
+
+ * Update collision-detecting SHA-1 code to build properly on HP-UX.
+
Fixes since v2.21
-----------------
@@ -85,6 +256,299 @@ Fixes since v2.21
ETAGS on.
(merge 92b88eba9f js/find-lib-h-with-ls-files-when-possible later to maint).
+ * "git rebase" that was reimplemented in C did not set ORIG_HEAD
+ correctly, which has been corrected.
+ (merge cbd29ead92 js/rebase-orig-head-fix later to maint).
+
+ * Dev support.
+ (merge f545737144 js/stress-test-ui-tweak later to maint).
+
+ * CFLAGS now can be tweaked when invoking Make while using
+ DEVELOPER=YesPlease; this did not work well before.
+ (merge 6d5d4b4e93 ab/makefile-help-devs-more later to maint).
+
+ * "git fsck --connectivity-only" omits computation necessary to sift
+ the objects that are not reachable from any of the refs into
+ unreachable and dangling. This is now enabled when dangling
+ objects are requested (which is done by default, but can be
+ overridden with the "--no-dangling" option).
+ (merge 8d8c2a5aef jk/fsck-doc later to maint).
+
+ * On platforms where "git fetch" is killed with SIGPIPE (e.g. OSX),
+ the upload-pack that runs on the other end that hangs up after
+ detecting an error could cause "git fetch" to die with a signal,
+ which led to a flaky test. "git fetch" now ignores SIGPIPE during
+ the network portion of its operation (this is not a problem as we
+ check the return status from our write(2)s).
+ (merge 143588949c jk/no-sigpipe-during-network-transport later to maint).
+
+ * A recent update broke "is this object available to us?" check for
+ well-known objects like an empty tree (which should yield "yes",
+ even when there is no on-disk object for an empty tree), which has
+ been corrected.
+ (merge f06ab027ef jk/virtual-objects-do-exist later to maint).
+
+ * The setup code has been cleaned up to avoid leaks around the
+ repository_format structure.
+ (merge e8805af1c3 ma/clear-repository-format later to maint).
+
+ * "git config --type=color ..." is meant to replace "git config --get-color"
+ but there is a slight difference that wasn't documented, which is
+ now fixed.
+ (merge cd8e7593b9 jk/config-type-color-ends-with-lf later to maint).
+
+ * When the "clean" filter can reduce the size of a huge file in the
+ working tree down to a small "token" (a la Git LFS), there is no
+ point in allocating a huge scratch area upfront, but the buffer is
+ sized based on the original file size. The convert mechanism now
+ allocates very minimum and reallocates as it receives the output
+ from the clean filter process.
+ (merge 02156ab031 jh/resize-convert-scratch-buffer later to maint).
+
+ * "git rebase" uses the refs/rewritten/ hierarchy to store its
+ intermediate states, which inherently makes the hierarchy per
+ worktree, but it didn't quite work well.
+ (merge b9317d55a3 nd/rewritten-ref-is-per-worktree later to maint).
+
+ * "git log -L<from>,<to>:<path>" with "-s" did not suppress the patch
+ output as it should. This has been corrected.
+ (merge 05314efaea jk/line-log-with-patch later to maint).
+
+ * "git worktree add" used to do a "find an available name with stat
+ and then mkdir", which is race-prone. This has been fixed by using
+ mkdir and reacting to EEXIST in a loop.
+ (merge 7af01f2367 ms/worktree-add-atomic-mkdir later to maint).
+
+ * Build update for SHA-1 with collision detection.
+ (merge 07a20f569b jk/sha1dc later to maint).
+
+ * Build procedure has been fixed around use of asciidoctor instead of
+ asciidoc.
+ (merge 185f9a0ea0 ma/asciidoctor-fixes later to maint).
+
+ * remote-http transport did not anonymize URLs reported in its error
+ messages at places.
+ (merge c1284b21f2 js/anonymize-remote-curl-diag later to maint).
+
+ * Error messages given from the http transport have been updated so
+ that they can be localized.
+ (merge ed8b4132c8 js/remote-curl-i18n later to maint).
+
+ * "git init" forgot to read platform-specific repository
+ configuration, which made Windows port to ignore settings of
+ core.hidedotfiles, for example.
+
+ * A corner-case object name ambiguity while the sequencer machinery
+ is working (e.g. "rebase -i -x") has been fixed.
+
+ * "git format-patch" did not diagnose an error while opening the
+ output file for the cover-letter, which has been corrected.
+ (merge 2fe95f494c jc/format-patch-error-check later to maint).
+
+ * "git checkout -f <branch>" while the index has an unmerged path
+ incorrectly left some paths in an unmerged state, which has been
+ corrected.
+
+ * A corner case bug in the refs API has been corrected.
+ (merge d3322eb28b jk/refs-double-abort later to maint).
+
+ * Unicode update.
+ (merge 584b62c37b bb/unicode-12 later to maint).
+
+ * dumb-http walker has been updated to share more error recovery
+ strategy with the normal codepath.
+
+ * A buglet in configuration parser has been fixed.
+ (merge 19e7fdaa58 nd/include-if-wildmatch later to maint).
+
+ * The documentation for "git read-tree --reset -u" has been updated.
+ (merge b5a0bd694c nd/read-tree-reset-doc later to maint).
+
+ * Code clean-up around a much-less-important-than-it-used-to-be
+ update_server_info() function.
+ (merge b3223761c8 jk/server-info-rabbit-hole later to maint).
+
+ * The message given when "git commit -a <paths>" errors out has been
+ updated.
+ (merge 5a1dbd48bc nd/commit-a-with-paths-msg-update later to maint).
+
+ * "git cherry-pick --options A..B", after giving control back to the
+ user to ask help resolving a conflicted step, did not honor the
+ options it originally received, which has been corrected.
+
+ * Various glitches in "git gc" around reflog handling have been fixed.
+
+ * The code to read from commit-graph file has been cleanup with more
+ careful error checking before using data read from it.
+
+ * Performance fix around "git fetch" that grabs many refs.
+ (merge b764300912 jt/fetch-pack-wanted-refs-optim later to maint).
+
+ * Protocol v2 support in "git fetch-pack" of shallow clones has been
+ corrected.
+
+ * Performance fix around "git blame", especially in a linear history
+ (which is the norm we should optimize for).
+ (merge f892014943 dk/blame-keep-origin-blob later to maint).
+
+ * Performance fix for "rev-list --parents -- pathspec".
+ (merge 8320b1dbe7 jk/revision-rewritten-parents-in-prio-queue later to maint).
+
+ * Updating the display with progress message has been cleaned up to
+ deal better with overlong messages.
+ (merge 545dc345eb sg/overlong-progress-fix later to maint).
+
+ * "git blame -- path" in a non-bare repository starts blaming from
+ the working tree, and the same command in a bare repository errors
+ out because there is no working tree by definition. The command
+ has been taught to instead start blaming from the commit at HEAD,
+ which is more useful.
+ (merge a544fb08f8 sg/blame-in-bare-start-at-head later to maint).
+
+ * An underallocation in the code to read the untracked cache
+ extension has been corrected.
+ (merge 3a7b45a623 js/untracked-cache-allocfix later to maint).
+
+ * The code is updated to check the result of memory allocation before
+ it is used in more places, by using xmalloc and/or xcalloc calls.
+ (merge 999b951b28 jk/xmalloc later to maint).
+
+ * The GETTEXT_POISON test option has been quite broken ever since it
+ was made runtime-tunable, which has been fixed.
+ (merge f88b9cb603 jc/gettext-test-fix later to maint).
+
+ * Test fix on APFS that is incapable of store paths in Latin-1.
+ (merge 3889149619 js/iso8895-test-on-apfs later to maint).
+
+ * "git submodule foreach <command> --quiet" did not pass the option
+ down correctly, which has been corrected.
+ (merge a282f5a906 nd/submodule-foreach-quiet later to maint).
+
+ * "git send-email" has been taught to use quoted-printable when the
+ payload contains carriage-return. The use of the mechanism is in
+ line with the design originally added the codepath that chooses QP
+ when the payload has overly long lines.
+ (merge 74d76a1701 bc/send-email-qp-cr later to maint).
+
+ * The recently added feature to add addresses that are on
+ anything-by: trailers in 'git send-email' was found to be way too
+ eager and considered nonsense strings as if they can be legitimate
+ beginning of *-by: trailer. This has been tightened.
+
+ * Builds with gettext broke on recent macOS w/ Homebrew, which
+ seems to have stopped including from /usr/local/include; this
+ has been corrected.
+ (merge 92a1377a2a js/macos-gettext-build later to maint).
+
+ * Running "git add" on a repository created inside the current
+ repository is an explicit indication that the user wants to add it
+ as a submodule, but when the HEAD of the inner repository is on an
+ unborn branch, it cannot be added as a submodule. Worse, the files
+ in its working tree can be added as if they are a part of the outer
+ repository, which is not what the user wants. These problems are
+ being addressed.
+ (merge f937bc2f86 km/empty-repo-is-still-a-repo later to maint).
+
+ * "git cherry-pick" run with the "-x" or the "--signoff" option used
+ to (and more importantly, ought to) clean up the commit log message
+ with the --cleanup=space option by default, but this has been
+ broken since late 2017. This has been fixed.
+
+ * When given a tag that points at a commit-ish, "git replace --graft"
+ failed to peel the tag before writing a replace ref, which did not
+ make sense because the old graft mechanism the feature wants to
+ mimic only allowed to replace one commit object with another.
+ This has been fixed.
+ (merge ee521ec4cb cc/replace-graft-peel-tags later to maint).
+
+ * Code tightening against a "wrong" object appearing where an object
+ of a different type is expected, instead of blindly assuming that
+ the connection between objects are correctly made.
+ (merge 97dd512af7 tb/unexpected later to maint).
+
+ * An earlier update for MinGW and Cygwin accidentally broke MSVC build,
+ which has been fixed.
+ (merge 22c3634c0f ss/msvc-path-utils-fix later to maint).
+
+ * %(push:track) token used in the --format option to "git
+ for-each-ref" and friends was not showing the right branch, which
+ has been fixed.
+ (merge c646d0934e dr/ref-filter-push-track-fix later to maint).
+
+ * "make check-docs", "git help -a", etc. did not account for cases
+ where a particular build may deliberately omit some subcommands,
+ which has been corrected.
+
+ * The logic to tell if a Git repository has a working tree protects
+ "git branch -D" from removing the branch that is currently checked
+ out by mistake. The implementation of this logic was broken for
+ repositories with unusual name, which unfortunately is the norm for
+ submodules these days. This has been fixed.
+ (merge f3534c98e4 jt/submodule-repo-is-with-worktree later to maint).
+
+ * AIX shared the same build issues with other BSDs around fileno(fp),
+ which has been corrected.
+ (merge ee662bf5c6 cc/aix-has-fileno-as-a-macro later to maint).
+
+ * The autoconf generated configure script failed to use the right
+ gettext() implementations from -libintl by ignoring useless stub
+ implementations shipped in some C library, which has been
+ corrected.
+ (merge b71e56a683 vk/autoconf-gettext later to maint).
+
+ * Fix index-pack perf test so that the repeated invocations always
+ run in an empty repository, which emulates the initial clone
+ situation better.
+ (merge 775c71e16d jk/p5302-avoid-collision-check-cost later to maint).
+
+ * A "ls-files" that emulates "find" to enumerate files in the working
+ tree resulted in duplicated Makefile rules that caused the build to
+ issue an unnecessary warning during a trial build after merge
+ conflicts are resolved in working tree *.h files but before the
+ resolved results are added to the index. This has been corrected.
+
+ * "git cherry-pick" (and "revert" that shares the same runtime engine)
+ that deals with multiple commits got confused when the final step
+ gets stopped with a conflict and the user concluded the sequence
+ with "git commit". Attempt to fix it by cleaning up the state
+ files used by these commands in such a situation.
+ (merge 4a72486de9 pw/clean-sequencer-state-upon-final-commit later to maint).
+
+ * On a filesystem like HFS+, the names of the refs stored as filesystem
+ entities may become different from what the end-user expects, just
+ like files in the working tree get "renamed". Work around the
+ mismatch by paying attention to the core.precomposeUnicode
+ configuration.
+ (merge 8e712ef6fc en/unicode-in-refnames later to maint).
+
+ * The code to generate the multi-pack idx file was not prepared to
+ see too many packfiles and ran out of open file descriptor, which
+ has been corrected.
+
+ * To run tests for Git SVN, our scripts for CI used to install the
+ git-svn package (in the hope that it would bring in the right
+ dependencies). This has been updated to install the more direct
+ dependency, namely, libsvn-perl.
+ (merge db864306cf sg/ci-libsvn-perl later to maint).
+
+ * "git cvsexportcommit" running on msys did not expect cvsnt showed
+ "cvs status" output with CRLF line endings.
+
+ * The fsmonitor interface got out of sync after the in-core index
+ file gets discarded, which has been corrected.
+ (merge 398a3b0899 js/fsmonitor-refresh-after-discarding-index later to maint).
+
+ * "git status" did not know that the "label" instruction in the
+ todo-list "rebase -i -r" uses should not be shown as a hex object
+ name.
+
+ * A prerequisite check in the test suite to see if a working jgit is
+ available was made more robust.
+ (merge abd0f28983 tz/test-lib-check-working-jgit later to maint).
+
+ * The codepath to parse :<path> that obtains the object name for an
+ indexed object has been made more robust.
+
* Code cleanup, docfix, build fix, etc.
(merge 11f470aee7 jc/test-yes-doc later to maint).
(merge 90503a240b js/doc-symref-in-proto-v1 later to maint).
@@ -99,3 +563,35 @@ Fixes since v2.21
(merge 716a5af812 rd/gc-prune-doc-fix later to maint).
(merge 50b206371d js/untravis-windows later to maint).
(merge dbf47215e3 js/rebase-recreate-merge later to maint).
+ (merge 56cb2d30f8 dl/reset-doc-no-wrt-abbrev later to maint).
+ (merge 64eca306a2 ja/dir-rename-doc-markup-fix later to maint).
+ (merge af91b0230c dl/ignore-docs later to maint).
+ (merge 59a06e947b ra/t3600-test-path-funcs later to maint).
+ (merge e041d0781b ar/t4150-remove-cruft later to maint).
+ (merge 8d75a1d183 ma/asciidoctor-fixes-more later to maint).
+ (merge 74cc547b0f mh/pack-protocol-doc-fix later to maint).
+ (merge ed31851fa6 ab/doc-misc-typofixes later to maint).
+ (merge a7256debd4 nd/checkout-m-doc-update later to maint).
+ (merge 3a9e1ad78d jt/t5551-protocol-v2-does-not-have-half-auth later to maint).
+ (merge 0b918b75af sg/t5318-cleanup later to maint).
+ (merge 68ed71b53c cb/doco-mono later to maint).
+ (merge a34dca2451 nd/interpret-trailers-docfix later to maint).
+ (merge cf7b857a77 en/fast-import-parsing-fix later to maint).
+ (merge fe61ccbc35 po/rerere-doc-fmt later to maint).
+ (merge ffea0248bf po/describe-not-necessarily-7 later to maint).
+ (merge 7cb7283adb tg/ls-files-debug-format-fix later to maint).
+ (merge f64a21bd82 tz/doc-apostrophe-no-longer-needed later to maint).
+ (merge dbe7b41019 js/t3301-unbreak-notes-test later to maint).
+ (merge d8083e4180 km/t3000-retitle later to maint).
+ (merge 9e4cbccbd7 tz/git-svn-doc-markup-fix later to maint).
+ (merge da9ca955a7 jk/ls-files-doc-markup-fix later to maint).
+ (merge 6804ba3a58 cw/diff-highlight later to maint).
+ (merge 1a8787144d nd/submodule-helper-incomplete-line-fix later to maint).
+ (merge d9ef573837 jk/apache-lsan later to maint).
+ (merge c871fbee2b js/t6500-use-windows-pid-on-mingw later to maint).
+ (merge ce4c7bfc90 bl/t4253-exit-code-from-format-patch later to maint).
+ (merge 397a46db78 js/t5580-unc-alternate-test later to maint).
+ (merge d4907720a2 cm/notes-comment-fix later to maint).
+ (merge 9dde06de13 cb/http-push-null-in-message-fix later to maint).
+ (merge 4c785c0edc js/rebase-config-bitfix later to maint).
+ (merge 8e9fe16c87 es/doc-gitsubmodules-markup later to maint).
diff --git a/Documentation/RelNotes/2.23.0.txt b/Documentation/RelNotes/2.23.0.txt
new file mode 100644
index 0000000..a6cd592
--- /dev/null
+++ b/Documentation/RelNotes/2.23.0.txt
@@ -0,0 +1,183 @@
+Git 2.23 Release Notes
+======================
+
+Updates since v2.22
+-------------------
+
+Backward compatibility note
+
+ * The "--base" option of "format-patch" computed the patch-ids for
+ prerequisite patches in an unstable way, which has been updated to
+ compute in a way that is compatible with "git patch-id --stable".
+
+
+UI, Workflows & Features
+
+ * The "git fast-export/import" pair has been taught to handle commits
+ with log messages in encoding other than UTF-8 better.
+
+ * In recent versions of Git, per-worktree refs are exposed in
+ refs/worktrees/<wtname>/ hierarchy, which means that worktree names
+ must be a valid refname component. The code now sanitizes the names
+ given to worktrees, to make sure these refs are well-formed.
+
+ * "git merge" learned "--quit" option that cleans up the in-progress
+ merge while leaving the working tree and the index still in a mess.
+
+ * "git format-patch" learns a configuration to set the default for
+ its --notes=<ref> option.
+
+ * The code to show args with potential typo that cannot be
+ interpreted as a commit-ish has been improved.
+
+ * "git clone --recurse-submodules" learned to set up the submodules
+ to ignore commit object names recorded in the superproject gitlink
+ and instead use the commits that happen to be at the tip of the
+ remote-tracking branches from the get-go, by passing the new
+ "--remote-submodules" option.
+
+ * The pattern "git diff/grep" use to extract funcname and words
+ boundary for Matlab has been extend to cover Octave, which is more
+ or less equivalent.
+
+ * "git help git" was hard to discover (well, at least for some
+ people).
+
+ * The pattern "git diff/grep" use to extract funcname and words
+ boundary for Rust has been added.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * Update supporting parts of "git rebase" to remove code that should
+ no longer be used.
+
+ * Developer support to emulate unsatisfied prerequisites in tests to
+ ensure that the remainer of the tests still succeeds when tests
+ with prerequisites are skipped.
+
+ * "git update-server-info" learned not to rewrite the file with the
+ same contents.
+
+ * The way of specifying the path to find dynamic libraries at runtime
+ has been simplified. The old default to pass -R/path/to/dir has been
+ replaced with the new default to pass -Wl,-rpath,/path/to/dir,
+ which is the more recent GCC uses. Those who need to build with an
+ old GCC can still use "CC_LD_DYNPATH=-R"
+
+ * Prepare use of reachability index in topological walker that works
+ on a range (A..B).
+
+ * A new tutorial targetting specifically aspiring git-core
+ developers has been added.
+
+
+
+Fixes since v2.22
+-----------------
+
+ * A relative pathname given to "git init --template=<path> <repo>"
+ ought to be relative to the directory "git init" gets invoked in,
+ but it instead was made relative to the repository, which has been
+ corrected.
+ (merge e1df7fe43f nd/init-relative-template-fix later to maint).
+
+ * "git worktree add" used to fail when another worktree connected to
+ the same repository was corrupt, which has been corrected.
+ (merge 105df73e71 nd/corrupt-worktrees later to maint).
+
+ * The ownership rule for the file descriptor to fast-import remote
+ backend was mixed up, leading to unrelated file descriptor getting
+ closed, which has been fixed.
+ (merge 3203566a71 mh/import-transport-fd-fix later to maint).
+
+ * A "merge -c" instruction during "git rebase --rebase-merges" should
+ give the user a chance to edit the log message, even when there is
+ otherwise no need to create a new merge and replace the existing
+ one (i.e. fast-forward instead), but did not. Which has been
+ corrected.
+
+ * Code cleanup and futureproof.
+ (merge 31f5256c82 ds/object-info-for-prefetch-fix later to maint).
+
+ * More parameter validation.
+ (merge de99eb0c24 es/grep-require-name-when-needed later to maint).
+
+ * "git update-server-info" used to leave stale packfiles in its
+ output, which has been corrected.
+ (merge e941c48d49 ew/server-info-remove-crufts later to maint).
+
+ * The server side support for "git fetch" used to show incorrect
+ value for the HEAD symbolic ref when the namespace feature is in
+ use, which has been corrected.
+ (merge 533e088250 jk/HEAD-symref-in-xfer-namespaces later to maint).
+
+ * "git am -i --resolved" segfaulted after trying to see a commit as
+ if it were a tree, which has been corrected.
+ (merge 7663e438c5 jk/am-i-resolved-fix later to maint).
+
+ * "git bundle verify" needs to see if prerequisite objects exist in
+ the receiving repository, but the command did not check if we are
+ in a repository upfront, which has been corrected.
+ (merge 3bbbe467f2 js/bundle-verify-require-object-store later to maint).
+
+ * "git merge --squash" is designed to update the working tree and the
+ index without creating the commit, and this cannot be countermanded
+ by adding the "--commit" option; the command now refuses to work
+ when both options are given.
+ (merge 1d14d0c994 vv/merge-squash-with-explicit-commit later to maint).
+
+ * The data collected by fsmonitor was not properly written back to
+ the on-disk index file, breaking t7519 tests occasionally, which
+ has been corrected.
+ (merge b5a8169752 js/fsmonitor-unflake later to maint).
+
+ * Update to Unicode 12.1 width table.
+ (merge 5817f9caa3 bb/unicode-12.1-reiwa later to maint).
+
+ * The command line to invoke a "git cat-file" command from inside
+ "git p4" was not properly quoted to protect a caret and running a
+ broken command on Windows, which has been corrected.
+ (merge c3f2358de3 mm/p4-unshelve-windows-fix later to maint).
+
+ * "git request-pull" learned to warn when the ref we ask them to pull
+ from in the local repository and in the published repository are
+ different.
+ (merge 0454220d66 pb/request-pull-verify-remote-ref later to maint).
+
+ * When creating a partial clone, the object filtering criteria is
+ recorded for the origin of the clone, but this incorrectly used a
+ hardcoded name "origin" to name that remote; it has been corrected
+ to honor the "--origin <name>" option.
+ (merge 1c4a9f9114 xl/record-partial-clone-origin later to maint).
+
+ * "git fetch" into a lazy clone forgot to fetch base objects that are
+ necessary to complete delta in a thin packfile, which has been
+ corrected.
+ (merge 810e19322d jt/partial-clone-missing-ref-delta-base later to maint).
+
+ * The filter_data used in the list-objects-filter (which manages a
+ lazily sparse clone repository) did not use the dynamic array API
+ correctly---'nr' is supposed to point at one past the last element
+ of the array in use. This has been corrected.
+ (merge 7140600e2e md/list-objects-filter-memfix later to maint).
+
+ * The description about slashes in gitignore patterns (used to
+ indicate things like "anchored to this level only" and "only
+ matches directories") has been revamped.
+ (merge 1a58bad014 an/ignore-doc-update later to maint).
+
+ * The URL decoding code has been updated to avoid going past the end
+ of the string while parsing %-<hex>-<hex> sequence.
+ (merge d37dc239a4 md/url-parse-harden later to maint).
+
+ * The list of for-each like macros used by clang-format has been
+ updated.
+ (merge fc7e03aace mo/clang-format-for-each-update later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge f547101b26 es/git-debugger-doc later to maint).
+ (merge 7877ac3d7b js/bisect-helper-check-get-oid-return-value later to maint).
+ (merge 0108f47eb3 sw/git-p4-unshelve-branched-files later to maint).
+ (merge 9df8f734fd cm/send-email-document-req-modules later to maint).
+ (merge afc3bf6eb1 ab/hash-object-doc later to maint).
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index ec8b205..6d589e1 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -372,15 +372,15 @@ such as "Thanks-to:", "Based-on-patch-by:", or "Mentored-by:".
Some parts of the system have dedicated maintainers with their own
repositories.
-- 'git-gui/' comes from git-gui project, maintained by Pat Thoyts:
+- `git-gui/` comes from git-gui project, maintained by Pat Thoyts:
git://repo.or.cz/git-gui.git
-- 'gitk-git/' comes from Paul Mackerras's gitk project:
+- `gitk-git/` comes from Paul Mackerras's gitk project:
git://ozlabs.org/~paulus/gitk
-- 'po/' comes from the localization coordinator, Jiang Xin:
+- `po/` comes from the localization coordinator, Jiang Xin:
https://github.com/git-l10n/git-po/
diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb
index ec83b49..0089e0c 100644
--- a/Documentation/asciidoctor-extensions.rb
+++ b/Documentation/asciidoctor-extensions.rb
@@ -11,12 +11,12 @@ module Git
def process(parent, target, attrs)
if parent.document.basebackend? 'html'
prefix = parent.document.attr('git-relative-html-prefix')
- %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>\n)
+ %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>)
elsif parent.document.basebackend? 'docbook'
"<citerefentry>\n" \
"<refentrytitle>#{target}</refentrytitle>" \
"<manvolnum>#{attrs[1]}</manvolnum>\n" \
- "</citerefentry>\n"
+ "</citerefentry>"
end
end
end
diff --git a/Documentation/config.txt b/Documentation/config.txt
index d87846f..e3f5bc3 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -144,6 +144,20 @@ refer to linkgit:gitignore[5] for details. For convenience:
This is the same as `gitdir` except that matching is done
case-insensitively (e.g. on case-insensitive file sytems)
+`onbranch`::
+ The data that follows the keyword `onbranch:` is taken to be a
+ pattern with standard globbing wildcards and two additional
+ ones, `**/` and `/**`, that can match multiple path components.
+ If we are in a worktree where the name of the branch that is
+ currently checked out matches the pattern, the include condition
+ is met.
++
+If the pattern ends with `/`, `**` will be automatically added. For
+example, the pattern `foo/` becomes `foo/**`. In other words, it matches
+all branches that begin with `foo/`. This is useful if your branches are
+organized hierarchically and you would like to apply a configuration to
+all the branches in that hierarchy.
+
A few more notes on matching via `gitdir` and `gitdir/i`:
* Symlinks in `$GIT_DIR` are not resolved before matching.
@@ -206,6 +220,11 @@ Example
[includeIf "gitdir:/path/to/group/"]
path = foo.inc
+ ; include only if we are in a worktree where foo-branch is
+ ; currently checked out
+ [includeIf "onbranch:foo-branch"]
+ path = foo.inc
+
Values
~~~~~~
@@ -422,6 +441,8 @@ include::config/submodule.txt[]
include::config/tag.txt[]
+include::config/trace2.txt[]
+
include::config/transfer.txt[]
include::config/uploadarchive.txt[]
diff --git a/Documentation/config/advice.txt b/Documentation/config/advice.txt
index 239d479..d5fd05c 100644
--- a/Documentation/config/advice.txt
+++ b/Documentation/config/advice.txt
@@ -93,4 +93,6 @@ advice.*::
waitingForEditor::
Print a message to the terminal whenever Git is waiting for
editor input from the user.
+ nestedTag::
+ Advice shown if a user attempts to recursively tag a tag object.
--
diff --git a/Documentation/config/alias.txt b/Documentation/config/alias.txt
index 0b14178..f1ca739 100644
--- a/Documentation/config/alias.txt
+++ b/Documentation/config/alias.txt
@@ -1,18 +1,28 @@
alias.*::
Command aliases for the linkgit:git[1] command wrapper - e.g.
- after defining "alias.last = cat-file commit HEAD", the invocation
- "git last" is equivalent to "git cat-file commit HEAD". To avoid
+ after defining `alias.last = cat-file commit HEAD`, the invocation
+ `git last` is equivalent to `git cat-file commit HEAD`. To avoid
confusion and troubles with script usage, aliases that
hide existing Git commands are ignored. Arguments are split by
spaces, the usual shell quoting and escaping is supported.
A quote pair or a backslash can be used to quote them.
+
+Note that the first word of an alias does not necessarily have to be a
+command. It can be a command-line option that will be passed into the
+invocation of `git`. In particular, this is useful when used with `-c`
+to pass in one-time configurations or `-p` to force pagination. For example,
+`loud-rebase = -c commit.verbose=true rebase` can be defined such that
+running `git loud-rebase` would be equivalent to
+`git -c commit.verbose=true rebase`. Also, `ps = -p status` would be a
+helpful alias since `git ps` would paginate the output of `git status`
+where the original command does not.
++
If the alias expansion is prefixed with an exclamation point,
it will be treated as a shell command. For example, defining
-"alias.new = !gitk --all --not ORIG_HEAD", the invocation
-"git new" is equivalent to running the shell command
-"gitk --all --not ORIG_HEAD". Note that shell commands will be
+`alias.new = !gitk --all --not ORIG_HEAD`, the invocation
+`git new` is equivalent to running the shell command
+`gitk --all --not ORIG_HEAD`. Note that shell commands will be
executed from the top-level directory of a repository, which may
not necessarily be the current directory.
-`GIT_PREFIX` is set as returned by running 'git rev-parse --show-prefix'
+`GIT_PREFIX` is set as returned by running `git rev-parse --show-prefix`
from the original current directory. See linkgit:git-rev-parse[1].
diff --git a/Documentation/config/branch.txt b/Documentation/config/branch.txt
index 8050466..a592d52 100644
--- a/Documentation/config/branch.txt
+++ b/Documentation/config/branch.txt
@@ -85,9 +85,9 @@ When `merges`, pass the `--rebase-merges` option to 'git rebase'
so that the local merge commits are included in the rebase (see
linkgit:git-rebase[1] for details).
+
-When preserve, also pass `--preserve-merges` along to 'git rebase'
-so that locally committed merge commits will not be flattened
-by running 'git pull'.
+When `preserve` (deprecated in favor of `merges`), also pass
+`--preserve-merges` along to 'git rebase' so that locally committed merge
+commits will not be flattened by running 'git pull'.
+
When the value is `interactive`, the rebase is run in interactive mode.
+
diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt
index 7e9b6c8..75538d2 100644
--- a/Documentation/config/core.txt
+++ b/Documentation/config/core.txt
@@ -414,7 +414,7 @@ Common unit suffixes of 'k', 'm', or 'g' are supported.
core.excludesFile::
Specifies the pathname to the file that contains patterns to
describe paths that are not meant to be tracked, in addition
- to '.gitignore' (per-directory) and '.git/info/exclude'.
+ to `.gitignore` (per-directory) and `.git/info/exclude`.
Defaults to `$XDG_CONFIG_HOME/git/ignore`.
If `$XDG_CONFIG_HOME` is either not set or empty, `$HOME/.config/git/ignore`
is used instead. See linkgit:gitignore[5].
@@ -429,8 +429,8 @@ core.askPass::
command-line argument and write the password on its STDOUT.
core.attributesFile::
- In addition to '.gitattributes' (per-directory) and
- '.git/info/attributes', Git looks into this file for attributes
+ In addition to `.gitattributes` (per-directory) and
+ `.git/info/attributes`, Git looks into this file for attributes
(see linkgit:gitattributes[5]). Path expansions are made the same
way as for `core.excludesFile`. Its default value is
`$XDG_CONFIG_HOME/git/attributes`. If `$XDG_CONFIG_HOME` is either not
@@ -438,10 +438,10 @@ core.attributesFile::
core.hooksPath::
By default Git will look for your hooks in the
- '$GIT_DIR/hooks' directory. Set this to different path,
- e.g. '/etc/git/hooks', and Git will try to find your hooks in
- that directory, e.g. '/etc/git/hooks/pre-receive' instead of
- in '$GIT_DIR/hooks/pre-receive'.
+ `$GIT_DIR/hooks` directory. Set this to different path,
+ e.g. `/etc/git/hooks`, and Git will try to find your hooks in
+ that directory, e.g. `/etc/git/hooks/pre-receive` instead of
+ in `$GIT_DIR/hooks/pre-receive`.
+
The path can be either absolute or relative. A relative path is
taken as relative to the directory where the hooks are run (see
diff --git a/Documentation/config/diff.txt b/Documentation/config/diff.txt
index b3b304e..5afb5a2 100644
--- a/Documentation/config/diff.txt
+++ b/Documentation/config/diff.txt
@@ -10,7 +10,7 @@ diff.autoRefreshIndex::
diff.dirstat::
A comma separated list of `--dirstat` parameters specifying the
- default behavior of the `--dirstat` option to linkgit:git-diff[1]`
+ default behavior of the `--dirstat` option to linkgit:git-diff[1]
and friends. The defaults can be overridden on the command line
(using `--dirstat=<param1,param2,...>`). The fallback defaults
(when not changed by `diff.dirstat`) are `changes,noncumulative,3`.
@@ -73,7 +73,7 @@ diff.external::
environment variable. The command is called with parameters
as described under "git Diffs" in linkgit:git[1]. Note: if
you want to use an external diff program only on a subset of
- your files, you might want to use linkgit:gitattributes[5] instead.
+ your files, you might want to use linkgit:gitattributes[5] instead.
diff.ignoreSubmodules::
Sets the default value of --ignore-submodules. Note that this
diff --git a/Documentation/config/format.txt b/Documentation/config/format.txt
index dc77941..414a5a8 100644
--- a/Documentation/config/format.txt
+++ b/Documentation/config/format.txt
@@ -85,3 +85,18 @@ format.outputDirectory::
format.useAutoBase::
A boolean value which lets you enable the `--base=auto` option of
format-patch by default.
+
+format.notes::
+ Provides the default value for the `--notes` option to
+ format-patch. Accepts a boolean value, or a ref which specifies
+ where to get notes. If false, format-patch defaults to
+ `--no-notes`. If true, format-patch defaults to `--notes`. If
+ set to a non-boolean value, format-patch defaults to
+ `--notes=<ref>`, where `ref` is the non-boolean value. Defaults
+ to false.
++
+If one wishes to use the ref `ref/notes/true`, please use that literal
+instead.
++
+This configuration can be specified multiple times in order to allow
+multiple notes refs to be included.
diff --git a/Documentation/config/fsck.txt b/Documentation/config/fsck.txt
index 879c5a2..450e8c3 100644
--- a/Documentation/config/fsck.txt
+++ b/Documentation/config/fsck.txt
@@ -23,9 +23,9 @@ When `fsck.<msg-id>` is set, errors can be switched to warnings and
vice versa by configuring the `fsck.<msg-id>` setting where the
`<msg-id>` is the fsck message ID and the value is one of `error`,
`warn` or `ignore`. For convenience, fsck prefixes the error/warning
-with the message ID, e.g. "missingEmail: invalid author/committer line
-- missing email" means that setting `fsck.missingEmail = ignore` will
-hide that issue.
+with the message ID, e.g. "missingEmail: invalid author/committer
+line - missing email" means that setting `fsck.missingEmail = ignore`
+will hide that issue.
+
In general, it is better to enumerate existing objects with problems
with `fsck.skipList`, instead of listing the kind of breakages these
diff --git a/Documentation/config/gc.txt b/Documentation/config/gc.txt
index c6fbb8a..02b92b1 100644
--- a/Documentation/config/gc.txt
+++ b/Documentation/config/gc.txt
@@ -1,25 +1,42 @@
gc.aggressiveDepth::
The depth parameter used in the delta compression
algorithm used by 'git gc --aggressive'. This defaults
- to 50.
+ to 50, which is the default for the `--depth` option when
+ `--aggressive` isn't in use.
++
+See the documentation for the `--depth` option in
+linkgit:git-repack[1] for more details.
gc.aggressiveWindow::
The window size parameter used in the delta compression
algorithm used by 'git gc --aggressive'. This defaults
- to 250.
+ to 250, which is a much more aggressive window size than
+ the default `--window` of 10.
++
+See the documentation for the `--window` option in
+linkgit:git-repack[1] for more details.
gc.auto::
When there are approximately more than this many loose
objects in the repository, `git gc --auto` will pack them.
Some Porcelain commands use this command to perform a
light-weight garbage collection from time to time. The
- default value is 6700. Setting this to 0 disables it.
+ default value is 6700.
++
+Setting this to 0 disables not only automatic packing based on the
+number of loose objects, but any other heuristic `git gc --auto` will
+otherwise use to determine if there's work to do, such as
+`gc.autoPackLimit`.
gc.autoPackLimit::
When there are more than this many packs that are not
marked with `*.keep` file in the repository, `git gc
--auto` consolidates them into one larger pack. The
- default value is 50. Setting this to 0 disables it.
+ default value is 50. Setting this to 0 disables it.
+ Setting `gc.auto` to 0 will also disable this.
++
+See the `gc.bigPackThreshold` configuration variable below. When in
+use, it'll affect how the auto pack limit works.
gc.autoDetach::
Make `git gc --auto` return immediately and run in background
@@ -36,11 +53,16 @@ Note that if the number of kept packs is more than gc.autoPackLimit,
this configuration variable is ignored, all packs except the base pack
will be repacked. After this the number of packs should go below
gc.autoPackLimit and gc.bigPackThreshold should be respected again.
++
+If the amount of memory estimated for `git repack` to run smoothly is
+not available and `gc.bigPackThreshold` is not set, the largest pack
+will also be excluded (this is the equivalent of running `git gc` with
+`--keep-base-pack`).
gc.writeCommitGraph::
If true, then gc will rewrite the commit-graph file when
- linkgit:git-gc[1] is run. When using linkgit:git-gc[1]
- '--auto' the commit-graph will be updated if housekeeping is
+ linkgit:git-gc[1] is run. When using `git gc --auto`
+ the commit-graph will be updated if housekeeping is
required. Default is false. See linkgit:git-commit-graph[1]
for details.
@@ -94,6 +116,12 @@ gc.<pattern>.reflogExpireUnreachable::
With "<pattern>" (e.g. "refs/stash")
in the middle, the setting applies only to the refs that
match the <pattern>.
++
+These types of entries are generally created as a result of using `git
+commit --amend` or `git rebase` and are the commits prior to the amend
+or rebase occurring. Since these changes are not part of the current
+project most users will want to expire them sooner, which is why the
+default is more aggressive than `gc.reflogExpire`.
gc.rerereResolved::
Records of conflicted merge you resolved earlier are
diff --git a/Documentation/config/gpg.txt b/Documentation/config/gpg.txt
index 590fe0d..f999f8e 100644
--- a/Documentation/config/gpg.txt
+++ b/Documentation/config/gpg.txt
@@ -16,5 +16,5 @@ gpg.format::
gpg.<format>.program::
Use this to customize the program used for the signing format you
chose. (see `gpg.program` and `gpg.format`) `gpg.program` can still
- be used as a legacy synonym for `gpg.openpgp.program`. The default
+ be used as a legacy synonym for `gpg.openpgp.program`. The default
value for `gpg.x509.program` is "gpgsm".
diff --git a/Documentation/config/merge.txt b/Documentation/config/merge.txt
index d389c73..6a31393 100644
--- a/Documentation/config/merge.txt
+++ b/Documentation/config/merge.txt
@@ -39,9 +39,22 @@ merge.renameLimit::
is turned off.
merge.renames::
- Whether and how Git detects renames. If set to "false",
- rename detection is disabled. If set to "true", basic rename
- detection is enabled. Defaults to the value of diff.renames.
+ Whether Git detects renames. If set to "false", rename detection
+ is disabled. If set to "true", basic rename detection is enabled.
+ Defaults to the value of diff.renames.
+
+merge.directoryRenames::
+ Whether Git detects directory renames, affecting what happens at
+ merge time to new files added to a directory on one side of
+ history when that directory was renamed on the other side of
+ history. If merge.directoryRenames is set to "false", directory
+ rename detection is disabled, meaning that such new files will be
+ left behind in the old directory. If set to "true", directory
+ rename detection is enabled, meaning that such new files will be
+ moved into the new directory. If set to "conflict", a conflict
+ will be reported for such paths. If merge.renames is false,
+ merge.directoryRenames is ignored and treated as false. Defaults
+ to "conflict".
merge.renormalize::
Tell Git that canonical representation of files in the
diff --git a/Documentation/config/pack.txt b/Documentation/config/pack.txt
index 425c73a..9cdcfa7 100644
--- a/Documentation/config/pack.txt
+++ b/Documentation/config/pack.txt
@@ -124,6 +124,4 @@ pack.writeBitmapHashCache::
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.
+ bytes per object of disk space. Defaults to true.
diff --git a/Documentation/config/pull.txt b/Documentation/config/pull.txt
index bb23a99..b87cab3 100644
--- a/Documentation/config/pull.txt
+++ b/Documentation/config/pull.txt
@@ -18,9 +18,9 @@ When `merges`, pass the `--rebase-merges` option to 'git rebase'
so that the local merge commits are included in the rebase (see
linkgit:git-rebase[1] for details).
+
-When preserve, also pass `--preserve-merges` along to 'git rebase'
-so that locally committed merge commits will not be flattened
-by running 'git pull'.
+When `preserve` (deprecated in favor of `merges`), also pass
+`--preserve-merges` along to 'git rebase' so that locally committed merge
+commits will not be flattened by running 'git pull'.
+
When the value is `interactive`, the rebase is run in interactive mode.
+
diff --git a/Documentation/config/rebase.txt b/Documentation/config/rebase.txt
index 331d250..d98e32d 100644
--- a/Documentation/config/rebase.txt
+++ b/Documentation/config/rebase.txt
@@ -1,16 +1,9 @@
rebase.useBuiltin::
- Set to `false` to use the legacy shellscript implementation of
- linkgit:git-rebase[1]. Is `true` by default, which means use
- the built-in rewrite of it in C.
-+
-The C rewrite is first included with Git version 2.20. This option
-serves an an escape hatch to re-enable the legacy version in case any
-bugs are found in the rewrite. This option and the shellscript version
-of linkgit:git-rebase[1] will be removed in some future release.
-+
-If you find some reason to set this option to `false` other than
-one-off testing you should report the behavior difference as a bug in
-git.
+ Unused configuration variable. Used in Git versions 2.20 and
+ 2.21 as an escape hatch to enable the legacy shellscript
+ implementation of rebase. Now the built-in rewrite of it in C
+ is always used. Setting this will emit a warning, to alert any
+ remaining users that setting this now does nothing.
rebase.stat::
Whether to show a diffstat of what changed upstream since the last
diff --git a/Documentation/config/repack.txt b/Documentation/config/repack.txt
index a5c3781..9c413e1 100644
--- a/Documentation/config/repack.txt
+++ b/Documentation/config/repack.txt
@@ -24,4 +24,4 @@ repack.writeBitmaps::
packs created for clones and fetches, at the cost of some disk
space and extra time spent on the initial repack. This has
no effect if multiple packfiles are created.
- Defaults to false.
+ Defaults to true on bare repos, false otherwise.
diff --git a/Documentation/config/stash.txt b/Documentation/config/stash.txt
index c583d46..7710758 100644
--- a/Documentation/config/stash.txt
+++ b/Documentation/config/stash.txt
@@ -1,3 +1,18 @@
+stash.useBuiltin::
+ Set to `false` to use the legacy shell script implementation of
+ linkgit:git-stash[1]. Is `true` by default, which means use
+ the built-in rewrite of it in C.
++
+The C rewrite is first included with Git version 2.22 (and Git for Windows
+version 2.19). This option serves an an escape hatch to re-enable the
+legacy version in case any bugs are found in the rewrite. This option and
+the shell script version of linkgit:git-stash[1] will be removed in some
+future release.
++
+If you find some reason to set this option to `false`, other than
+one-off testing, you should report the behavior difference as a bug in
+Git (see https://git-scm.com/community for details).
+
stash.showPatch::
If this is set to true, the `git stash show` command without an
option will show the stash entry in patch form. Defaults to false.
diff --git a/Documentation/config/tag.txt b/Documentation/config/tag.txt
index 663663b..ef5adb3 100644
--- a/Documentation/config/tag.txt
+++ b/Documentation/config/tag.txt
@@ -8,6 +8,14 @@ tag.sort::
linkgit:git-tag[1]. Without the "--sort=<value>" option provided, the
value of this variable will be used as the default.
+tag.gpgSign::
+ A boolean to specify whether all tags should be GPG signed.
+ Use of this option when running in an automated script can
+ result in a large number of tags being signed. It is therefore
+ convenient to use an agent to avoid typing your gpg passphrase
+ several times. Note that this option doesn't affects tag signing
+ behavior enabled by "-u <keyid>" or "--local-user=<keyid>" options.
+
tar.umask::
This variable can be used to restrict the permission bits of
tar archive entries. The default is 0002, which turns off the
diff --git a/Documentation/config/trace2.txt b/Documentation/config/trace2.txt
new file mode 100644
index 0000000..2edbfb0
--- /dev/null
+++ b/Documentation/config/trace2.txt
@@ -0,0 +1,56 @@
+Trace2 config settings are only read from the system and global
+config files; repository local and worktree config files and `-c`
+command line arguments are not respected.
+
+trace2.normalTarget::
+ This variable controls the normal target destination.
+ It may be overridden by the `GIT_TRACE2` environment variable.
+ The following table shows possible values.
+
+trace2.perfTarget::
+ This variable controls the performance target destination.
+ It may be overridden by the `GIT_TRACE2_PERF` environment variable.
+ The following table shows possible values.
+
+trace2.eventTarget::
+ This variable controls the event target destination.
+ It may be overridden by the `GIT_TRACE2_EVENT` environment variable.
+ The following table shows possible values.
++
+include::../trace2-target-values.txt[]
+
+trace2.normalBrief::
+ Boolean. When true `time`, `filename`, and `line` fields are
+ omitted from normal output. May be overridden by the
+ `GIT_TRACE2_BRIEF` environment variable. Defaults to false.
+
+trace2.perfBrief::
+ Boolean. When true `time`, `filename`, and `line` fields are
+ omitted from PERF output. May be overridden by the
+ `GIT_TRACE2_PERF_BRIEF` environment variable. Defaults to false.
+
+trace2.eventBrief::
+ Boolean. When true `time`, `filename`, and `line` fields are
+ omitted from event output. May be overridden by the
+ `GIT_TRACE2_EVENT_BRIEF` environment variable. Defaults to false.
+
+trace2.eventNesting::
+ Integer. Specifies desired depth of nested regions in the
+ event output. Regions deeper than this value will be
+ omitted. May be overridden by the `GIT_TRACE2_EVENT_NESTING`
+ environment variable. Defaults to 2.
+
+trace2.configParams::
+ A comma-separated list of patterns of "important" config
+ settings that should be recorded in the trace2 output.
+ For example, `core.*,remote.*.url` would cause the trace2
+ output to contain events listing each configured remote.
+ May be overridden by the `GIT_TRACE2_CONFIG_PARAMS` environment
+ variable. Unset by default.
+
+trace2.destinationDebug::
+ Boolean. When true Git will print error messages when a
+ trace target destination cannot be opened for writing.
+ By default, these errors are suppressed and tracing is
+ silently disabled. May be overridden by the
+ `GIT_TRACE2_DST_DEBUG` environment variable.
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 5ebc568..09faee3 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -436,7 +436,7 @@ endif::git-format-patch[]
--binary::
In addition to `--full-index`, output a binary diff that
- can be applied with `git-apply`.
+ can be applied with `git-apply`. Implies `--patch`.
--abbrev[=<n>]::
Instead of showing the full 40-byte hexadecimal object
diff --git a/Documentation/doc-diff b/Documentation/doc-diff
index 32c83dd..3355be4 100755
--- a/Documentation/doc-diff
+++ b/Documentation/doc-diff
@@ -12,9 +12,16 @@ OPTIONS_SPEC="\
doc-diff [options] <from> <to> [-- <diff-options>]
doc-diff (-c|--clean)
--
-j=n parallel argument to pass to make
-f force rebuild; do not rely on cached results
-c,clean cleanup temporary working files
+j=n parallel argument to pass to make
+f force rebuild; do not rely on cached results
+c,clean cleanup temporary working files
+from-asciidoc use asciidoc with the 'from'-commit
+from-asciidoctor use asciidoctor with the 'from'-commit
+asciidoc use asciidoc with both commits
+to-asciidoc use asciidoc with the 'to'-commit
+to-asciidoctor use asciidoctor with the 'to'-commit
+asciidoctor use asciidoctor with both commits
+cut-header-footer cut away header and footer
"
SUBDIRECTORY_OK=1
. "$(git --exec-path)/git-sh-setup"
@@ -22,6 +29,9 @@ SUBDIRECTORY_OK=1
parallel=
force=
clean=
+from_program=
+to_program=
+cut_header_footer=
while test $# -gt 0
do
case "$1" in
@@ -31,6 +41,22 @@ do
clean=t ;;
-f)
force=t ;;
+ --from-asciidoctor)
+ from_program=-asciidoctor ;;
+ --to-asciidoctor)
+ to_program=-asciidoctor ;;
+ --asciidoctor)
+ from_program=-asciidoctor
+ to_program=-asciidoctor ;;
+ --from-asciidoc)
+ from_program=-asciidoc ;;
+ --to-asciidoc)
+ to_program=-asciidoc ;;
+ --asciidoc)
+ from_program=-asciidoc
+ to_program=-asciidoc ;;
+ --cut-header-footer)
+ cut_header_footer=-cut-header-footer ;;
--)
shift; break ;;
*)
@@ -79,6 +105,22 @@ then
ln -s "$dots/config.mak" "$tmp/worktree/config.mak"
fi
+construct_makemanflags () {
+ if test "$1" = "-asciidoc"
+ then
+ echo USE_ASCIIDOCTOR=
+ elif test "$1" = "-asciidoctor"
+ then
+ echo USE_ASCIIDOCTOR=YesPlease
+ fi
+}
+
+from_makemanflags=$(construct_makemanflags "$from_program") &&
+to_makemanflags=$(construct_makemanflags "$to_program") &&
+
+from_dir=$from_oid$from_program$cut_header_footer &&
+to_dir=$to_oid$to_program$cut_header_footer &&
+
# generate_render_makefile <srcdir> <dstdir>
generate_render_makefile () {
find "$1" -type f |
@@ -94,7 +136,7 @@ generate_render_makefile () {
done
}
-# render_tree <committish_oid>
+# render_tree <committish_oid> <directory_name> <makemanflags>
render_tree () {
# Skip install-man entirely if we already have an installed directory.
# We can't rely on make here, since "install-man" unconditionally
@@ -102,28 +144,44 @@ render_tree () {
# we then can't rely on during the render step). We use "mv" to make
# sure we don't get confused by a previous run that failed partway
# through.
- if ! test -d "$tmp/installed/$1"
+ oid=$1 &&
+ dname=$2 &&
+ makemanflags=$3 &&
+ if ! test -d "$tmp/installed/$dname"
then
- git -C "$tmp/worktree" checkout --detach "$1" &&
+ git -C "$tmp/worktree" checkout --detach "$oid" &&
make -j$parallel -C "$tmp/worktree" \
+ $makemanflags \
GIT_VERSION=omitted \
SOURCE_DATE_EPOCH=0 \
- DESTDIR="$tmp/installed/$1+" \
+ DESTDIR="$tmp/installed/$dname+" \
install-man &&
- mv "$tmp/installed/$1+" "$tmp/installed/$1"
+ mv "$tmp/installed/$dname+" "$tmp/installed/$dname"
fi &&
# As with "installed" above, we skip the render if it's already been
# done. So using make here is primarily just about running in
# parallel.
- if ! test -d "$tmp/rendered/$1"
+ if ! test -d "$tmp/rendered/$dname"
then
- generate_render_makefile "$tmp/installed/$1" "$tmp/rendered/$1+" |
+ generate_render_makefile "$tmp/installed/$dname" \
+ "$tmp/rendered/$dname+" |
make -j$parallel -f - &&
- mv "$tmp/rendered/$1+" "$tmp/rendered/$1"
+ mv "$tmp/rendered/$dname+" "$tmp/rendered/$dname"
+
+ if test "$cut_header_footer" = "-cut-header-footer"
+ then
+ for f in $(find "$tmp/rendered/$dname" -type f)
+ do
+ tail -n +3 "$f" | head -n -2 |
+ sed -e '1{/^$/d}' -e '${/^$/d}' >"$f+" &&
+ mv "$f+" "$f" ||
+ return 1
+ done
+ fi
fi
}
-render_tree $from_oid &&
-render_tree $to_oid &&
-git -C $tmp/rendered diff --no-index "$@" $from_oid $to_oid
+render_tree $from_oid $from_dir $from_makemanflags &&
+render_tree $to_oid $to_dir $to_makemanflags &&
+git -C $tmp/rendered diff --no-index "$@" $from_dir $to_dir
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index fa0a315..592f391 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -88,6 +88,10 @@ ifndef::git-pull[]
Allow several <repository> and <group> arguments to be
specified. No <refspec>s may be specified.
+--[no-]auto-gc::
+ Run `git gc --auto` at the end to perform garbage collection
+ if needed. This is enabled by default.
+
-p::
--prune::
Before fetching, remove any remote-tracking references that no
@@ -216,7 +220,8 @@ endif::git-pull[]
--server-option=<option>::
Transmit the given string to the server when communicating using
protocol version 2. The given string must not contain a NUL or LF
- character.
+ character. The server's handling of server options, including
+ unknown ones, is server-specific.
When multiple `--server-option=<option>` are given, they are all
sent to the other side in the order listed on the command line.
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 37bcab9..8b0e4c7 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -193,15 +193,6 @@ for "git add --no-all <pathspec>...", i.e. ignored removed files.
for command-line options).
-CONFIGURATION
--------------
-
-The optional configuration variable `core.excludesFile` indicates a path to a
-file containing patterns of file names to exclude from git-add, similar to
-$GIT_DIR/info/exclude. Patterns in the exclude file are used in addition to
-those in info/exclude. See linkgit:gitignore[5].
-
-
EXAMPLES
--------
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 6f6c34b..fc3b993 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -99,6 +99,11 @@ default. You can use `--no-utf8` to override this.
am.threeWay configuration variable. For more information,
see am.threeWay in linkgit:git-config[1].
+--rerere-autoupdate::
+--no-rerere-autoupdate::
+ Allow the rerere mechanism to update the index with the
+ result of auto-conflict resolution if possible.
+
--ignore-space-change::
--ignore-whitespace::
--whitespace=<option>::
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 1e2d89b..135206f 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -8,12 +8,14 @@ git-branch - List, create, or delete branches
SYNOPSIS
--------
[verse]
-'git branch' [--color[=<when>] | --no-color] [-r | -a]
- [--list] [--show-current] [-v [--abbrev=<length> | --no-abbrev]]
+'git branch' [--color[=<when>] | --no-color] [--show-current]
+ [-v [--abbrev=<length> | --no-abbrev]]
[--column[=<options>] | --no-column] [--sort=<key>]
[(--merged | --no-merged) [<commit>]]
[--contains [<commit]] [--no-contains [<commit>]]
- [--points-at <object>] [--format=<format>] [<pattern>...]
+ [--points-at <object>] [--format=<format>]
+ [(-r | --remotes) | (-a | --all)]
+ [--list] [<pattern>...]
'git branch' [--track | --no-track] [-f] <branchname> [<start-point>]
'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
'git branch' --unset-upstream [<branchname>]
@@ -26,13 +28,19 @@ DESCRIPTION
-----------
If `--list` is given, or if there are no non-option arguments, existing
-branches are listed; the current branch will be highlighted with an
-asterisk. Option `-r` causes the remote-tracking branches to be listed,
-and option `-a` shows both local and remote branches. If a `<pattern>`
+branches are listed; the current branch will be highlighted in green and
+marked with an asterisk. Any branches checked out in linked worktrees will
+be highlighted in cyan and marked with a plus sign. Option `-r` causes the
+remote-tracking branches to be listed,
+and option `-a` shows both local and remote branches.
+
+If a `<pattern>`
is given, it is used as a shell wildcard to restrict the output to
matching branches. If multiple patterns are given, a branch is shown if
-it matches any of the patterns. Note that when providing a
-`<pattern>`, you must use `--list`; otherwise the command is interpreted
+it matches any of the patterns.
+
+Note that when providing a
+`<pattern>`, you must use `--list`; otherwise the command may be interpreted
as branch creation.
With `--contains`, shows only the branches that contain the named commit
@@ -45,7 +53,11 @@ argument is missing it defaults to `HEAD` (i.e. the tip of the current
branch).
The command's second form creates a new branch head named <branchname>
-which points to the current `HEAD`, or <start-point> if given.
+which points to the current `HEAD`, or <start-point> if given. As a
+special case, for <start-point>, you may use `"A...B"` as a shortcut for
+the merge base of `A` and `B` if there is exactly one merge base. You
+can leave out at most one of `A` and `B`, in which case it defaults to
+`HEAD`.
Note that this will create the new branch, but it will not switch the
working tree to it; use "git switch <newbranch>" to switch to the
@@ -149,10 +161,12 @@ This option is only applicable in non-verbose mode.
-r::
--remotes::
List or delete (if used with -d) the remote-tracking branches.
+ Combine with `--list` to match the optional pattern(s).
-a::
--all::
List both remote-tracking branches and local branches.
+ Combine with `--list` to match optional pattern(s).
-l::
--list::
@@ -170,8 +184,10 @@ This option is only applicable in non-verbose mode.
When in list mode,
show sha1 and commit subject line for each head, along with
relationship to upstream branch (if any). If given twice, print
- the name of the upstream branch, as well (see also `git remote
- show <remote>`).
+ the path of the linked worktree (if any) and the name of the upstream
+ branch, as well (see also `git remote show <remote>`). Note that the
+ current worktree's HEAD will not have its path printed (it will always
+ be your current directory).
-q::
--quiet::
@@ -318,6 +334,18 @@ $ git branch -D test <2>
<2> Delete the "test" branch even if the "master" branch (or whichever branch
is currently checked out) does not have all commits from the test branch.
+Listing branches from a specific remote::
++
+------------
+$ git branch -r -l '<remote>/<pattern>' <1>
+$ git for-each-ref 'refs/remotes/<remote>/<pattern>' <2>
+------------
++
+<1> Using `-a` would conflate <remote> with any local branches you happen to
+ have been prefixed with the same <remote> pattern.
+<2> `for-each-ref` can take a wide range of options. See linkgit:git-for-each-ref[1]
+
+Patterns will normally need quoting.
NOTES
-----
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index a294652..cf3cac0 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -255,6 +255,8 @@ should result in deletion of the path).
+
When checking out paths from the index, this option lets you recreate
the conflicted merge in the specified paths.
++
+When switching branches with `--merge`, staged changes may be lost.
--conflict=<style>::
The same as `--merge` option above, but changes the way the
@@ -328,6 +330,10 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
<start_point>::
The name of a commit at which to start the new branch; see
linkgit:git-branch[1] for details. Defaults to `HEAD`.
++
+As a special case, you may use `"A...B"` as a shortcut for the
+merge base of `A` and `B` if there is exactly one merge base. You can
+leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
<tree-ish>::
Tree to checkout from (when paths are given). If not specified,
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index b8cfeec..754b16c 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -57,6 +57,13 @@ OPTIONS
With this option, 'git cherry-pick' will let you edit the commit
message prior to committing.
+--cleanup=<mode>::
+ This option determines how the commit message will be cleaned up before
+ being passed on to the commit machinery. See linkgit:git-commit[1] for more
+ details. In particular, if the '<mode>' is given a value of `scissors`,
+ scissors will be appended to `MERGE_MSG` before being passed on in the case
+ of a conflict.
+
-x::
When recording the commit, append a line that says
"(cherry picked from commit ...)" to the original commit
@@ -148,6 +155,11 @@ effect to your index in a row.
Pass the merge strategy-specific option through to the
merge strategy. See linkgit:git-merge[1] for details.
+--rerere-autoupdate::
+--no-rerere-autoupdate::
+ Allow the rerere mechanism to update the index with the
+ result of auto-conflict resolution if possible.
+
SEQUENCER SUBCOMMANDS
---------------------
include::sequencer.txt[]
diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt
index 8a31ccf..0028ff1 100644
--- a/Documentation/git-clean.txt
+++ b/Documentation/git-clean.txt
@@ -55,14 +55,13 @@ OPTIONS
-e <pattern>::
--exclude=<pattern>::
- In addition to those found in .gitignore (per directory) and
- $GIT_DIR/info/exclude, also consider these patterns to be in the
- set of the ignore rules in effect.
+ Use the given exclude pattern in addition to the standard ignore rules
+ (see linkgit:gitignore[5]).
-x::
- Don't use the standard ignore rules read from .gitignore (per
- directory) and $GIT_DIR/info/exclude, but do still use the ignore
- rules given with `-e` options. This allows removing all untracked
+ Don't use the standard ignore rules (see linkgit:gitignore[5]), but
+ still use the ignore rules given with `-e` options from the command
+ line. This allows removing all untracked
files, including build products. This can be used (possibly in
conjunction with 'git restore' or 'git reset') to create a pristine
working directory to test a clean build.
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 2fd1252..5fc97f1 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -15,7 +15,8 @@ SYNOPSIS
[--dissociate] [--separate-git-dir <git dir>]
[--depth <depth>] [--[no-]single-branch] [--no-tags]
[--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
- [--jobs <n>] [--] <repository> [<directory>]
+ [--[no-]remote-submodules] [--jobs <n>] [--] <repository>
+ [<directory>]
DESCRIPTION
-----------
@@ -131,6 +132,14 @@ objects from the source repository into a pack in the cloned repository.
is specified. This flag forces progress status even if the
standard error stream is not directed to a terminal.
+--server-option=<option>::
+ Transmit the given string to the server when communicating using
+ protocol version 2. The given string must not contain a NUL or LF
+ character. The server's handling of server options, including
+ unknown ones, is server-specific.
+ When multiple `--server-option=<option>` are given, they are all
+ sent to the other side in the order listed on the command line.
+
--no-checkout::
-n::
No checkout of HEAD is performed after the clone is complete.
@@ -252,6 +261,12 @@ or `--mirror` is given)
--[no-]shallow-submodules::
All submodules which are cloned will be shallow with a depth of 1.
+--[no-]remote-submodules::
+ All submodules which are cloned will use the status of the submodule’s
+ remote-tracking branch to update the submodule, rather than the
+ superproject’s recorded SHA-1. Equivalent to passing `--remote` to
+ `git submodule update`.
+
--separate-git-dir=<git dir>::
Instead of placing the cloned repository where it is supposed
to be, place the cloned repository at the specified directory,
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index 002dae6..4b90b9c 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -23,6 +23,10 @@ Creates a new commit object based on the provided tree object and
emits the new commit object id on stdout. The log message is read
from the standard input, unless `-m` or `-F` options are given.
+The `-m` and `-F` options can be given any number of times, in any
+order. The commit log message will be composed in the order in which
+the options are given.
+
A commit object may have any number of parents. With exactly one
parent, it is an ordinary commit. Having more than one parent makes
the commit a merge between several lines of history. Initial (root)
@@ -41,7 +45,7 @@ state was.
OPTIONS
-------
<tree>::
- An existing tree object
+ An existing tree object.
-p <parent>::
Each `-p` indicates the id of a parent commit object.
@@ -52,7 +56,8 @@ OPTIONS
-F <file>::
Read the commit log message from the given file. Use `-` to read
- from the standard input.
+ from the standard input. This can be given more than once and the
+ content of each file becomes its own paragraph.
-S[<keyid>]::
--gpg-sign[=<keyid>]::
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 1bfe9f5..ff9310f 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -126,7 +126,7 @@ See also <<FILES>>.
--local::
For writing options: write to the repository `.git/config` file.
- This is the default behavior.
+ This is the default behavior.
+
For reading options: read only from the repository `.git/config` rather than
from all available files.
@@ -240,7 +240,9 @@ Valid `<type>`'s include:
output. The optional `default` parameter is used instead, if
there is no color configured for `name`.
+
-`--type=color [--default=<default>]` is preferred over `--get-color`.
+`--type=color [--default=<default>]` is preferred over `--get-color`
+(but note that `--get-color` will omit the trailing newline printed by
+`--type=color`).
-e::
--edit::
diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt
index 56d54a4..fdc28c0 100644
--- a/Documentation/git-daemon.txt
+++ b/Documentation/git-daemon.txt
@@ -57,7 +57,7 @@ OPTIONS
This is sort of "Git root" - if you run 'git daemon' with
'--base-path=/srv/git' on example.com, then if you later try to pull
'git://example.com/hello.git', 'git daemon' will interpret the path
- as '/srv/git/hello.git'.
+ as `/srv/git/hello.git`.
--base-path-relaxed::
If --base-path is enabled and repo lookup fails, with this option
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index ccdc5f8..a88f6ae 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -139,7 +139,7 @@ at the end.
The number of additional commits is the number
of commits which would be displayed by "git log v1.0.4..parent".
-The hash suffix is "-g" + 7-char abbreviation for the tip commit
+The hash suffix is "-g" + unambiguous abbreviation for the tip commit
of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`).
The "g" prefix stands for "git" and is used to allow describing the version of
a software depending on the SCM the software is managed with. This is useful
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
index 24f32e8..5c8a2a5 100644
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -118,6 +118,7 @@ include::pretty-options.txt[]
include::pretty-formats.txt[]
+
include::diff-format.txt[]
GIT
diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt
index 96c26e6..484c485 100644
--- a/Documentation/git-difftool.txt
+++ b/Documentation/git-difftool.txt
@@ -90,7 +90,9 @@ instead. `--no-symlinks` is the default on Windows.
When 'git-difftool' is invoked with the `-g` or `--gui` option
the default diff tool will be read from the configured
`diff.guitool` variable instead of `diff.tool`. The `--no-gui`
- option can be used to override this setting.
+ option can be used to override this setting. If `diff.guitool`
+ is not set, we will fallback in the order of `merge.guitool`,
+ `diff.tool`, `merge.tool` until a tool is found.
--[no-]trust-exit-code::
'git-difftool' invokes a diff tool individually on each file.
diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt
index 64c01ba..11427ac 100644
--- a/Documentation/git-fast-export.txt
+++ b/Documentation/git-fast-export.txt
@@ -129,6 +129,13 @@ marks the same across runs.
for intermediary filters (e.g. for rewriting commit messages
which refer to older commits, or for stripping blobs by id).
+--reencode=(yes|no|abort)::
+ Specify how to handle `encoding` header in commit objects. When
+ asking to 'abort' (which is the default), this program will die
+ when encountering such a commit object. With 'yes', the commit
+ message will be reencoded into UTF-8. With 'no', the original
+ encoding will be preserved.
+
--refspec::
Apply the specified refspec to each ref exported. Multiple of them can
be specified.
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 43ab3b1..7baf9e4 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -388,6 +388,7 @@ change to the project.
original-oid?
('author' (SP <name>)? SP LT <email> GT SP <when> LF)?
'committer' (SP <name>)? SP LT <email> GT SP <when> LF
+ ('encoding' SP <encoding>)?
data
('from' SP <commit-ish> LF)?
('merge' SP <commit-ish> LF)?
@@ -422,7 +423,12 @@ However it is recommended that a `filedeleteall` command precede
all `filemodify`, `filecopy`, `filerename` and `notemodify` commands in
the same commit, as `filedeleteall` wipes the branch clean (see below).
-The `LF` after the command is optional (it used to be required).
+The `LF` after the command is optional (it used to be required). Note
+that for reasons of backward compatibility, if the commit ends with a
+`data` command (i.e. it has has no `from`, `merge`, `filemodify`,
+`filedelete`, `filecopy`, `filerename`, `filedeleteall` or
+`notemodify` commands) then two `LF` commands may appear at the end of
+the command instead of just one.
`author`
^^^^^^^^
@@ -450,6 +456,12 @@ that was selected by the --date-format=<fmt> command-line option.
See ``Date Formats'' above for the set of supported formats, and
their syntax.
+`encoding`
+^^^^^^^^^^
+The optional `encoding` command indicates the encoding of the commit
+message. Most commits are UTF-8 and the encoding is omitted, but this
+allows importing commit messages into git without first reencoding them.
+
`from`
^^^^^^
The `from` command is used to specify the commit to initialize
@@ -966,10 +978,6 @@ might want to refer to in their commit messages.
'get-mark' SP ':' <idnum> LF
....
-This command can be used anywhere in the stream that comments are
-accepted. In particular, the `get-mark` command can be used in the
-middle of a commit but not in the middle of a `data` command.
-
See ``Responses To Commands'' below for details about how to read
this output safely.
@@ -996,9 +1004,10 @@ Output uses the same format as `git cat-file --batch`:
<contents> LF
====
-This command can be used anywhere in the stream that comments are
-accepted. In particular, the `cat-blob` command can be used in the
-middle of a commit but not in the middle of a `data` command.
+This command can be used where a `filemodify` directive can appear,
+allowing it to be used in the middle of a commit. For a `filemodify`
+using an inline directive, it can also appear right before the `data`
+directive.
See ``Responses To Commands'' below for details about how to read
this output safely.
@@ -1011,8 +1020,8 @@ printing a blob from the active commit (with `cat-blob`) or copying a
blob or tree from a previous commit for use in the current one (with
`filemodify`).
-The `ls` command can be used anywhere in the stream that comments are
-accepted, including the middle of a commit.
+The `ls` command can also be used where a `filemodify` directive can
+appear, allowing it to be used in the middle of a commit.
Reading from the active commit::
This form can only be used in the middle of a `commit`.
@@ -1396,6 +1405,13 @@ deltas are suboptimal (see above) then also adding the `-f` option
to force recomputation of all deltas can significantly reduce the
final packfile size (30-50% smaller can be quite typical).
+Instead of running `git repack` you can also run `git gc
+--aggressive`, which will also optimize other things after an import
+(e.g. pack loose refs). As noted in the "AGGRESSIVE" section in
+linkgit:git-gc[1] the `--aggressive` option will find new deltas with
+the `-f` option to linkgit:git-repack[1]. For the reasons elaborated
+on above using `--aggressive` after a fast-import is one of the few
+cases where it's known to be worthwhile.
MEMORY UTILIZATION
------------------
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index e6f08ab..6b53dd7 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -189,7 +189,7 @@ to other tags will be rewritten to point to the underlying commit.
rewriting. When applying a tree filter, the command needs to
temporarily check out the tree to some directory, which may consume
considerable space in case of large projects. By default it
- does this in the '.git-rewrite/' directory but you can override
+ does this in the `.git-rewrite/` directory but you can override
that choice by this parameter.
-f::
diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
index 774cecc..6dcd39f 100644
--- a/Documentation/git-for-each-ref.txt
+++ b/Documentation/git-for-each-ref.txt
@@ -214,6 +214,11 @@ symref::
`:lstrip` and `:rstrip` options in the same way as `refname`
above.
+worktreepath::
+ The absolute path to the worktree in which the ref is checked
+ out, if it is checked out in any linked worktree. Empty string
+ otherwise.
+
In addition to the above, for commit and tag objects, the header
field names (`tree`, `parent`, `object`, `type`, and `tag`) can
be used to specify the value in the header field.
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 01bfcec..b9b97e6 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -22,7 +22,8 @@ SYNOPSIS
[--rfc] [--subject-prefix=Subject-Prefix]
[(--reroll-count|-v) <n>]
[--to=<email>] [--cc=<email>]
- [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
+ [--[no-]cover-letter] [--quiet]
+ [--no-notes | --notes[=<ref>]]
[--interdiff=<previous>]
[--range-diff=<previous> [--creation-factor=<percent>]]
[--progress]
@@ -263,6 +264,7 @@ material (this may change in the future).
for details.
--notes[=<ref>]::
+--no-notes::
Append the notes (see linkgit:git-notes[1]) for the commit
after the three-dash line.
+
@@ -273,6 +275,9 @@ these explanations after `format-patch` has run but before sending,
keeping them as Git notes allows them to be maintained between versions
of the patch series (but see the discussion of the `notes.rewrite`
configuration options in linkgit:git-notes[1] to use this workflow).
++
+The default is `--no-notes`, unless the `format.notes` configuration is
+set.
--[no-]signature=<signature>::
Add a signature to each message produced. Per RFC 3676 the signature
diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt
index 55950d9..e0eae64 100644
--- a/Documentation/git-fsck.txt
+++ b/Documentation/git-fsck.txt
@@ -62,9 +62,17 @@ index file, all SHA-1 references in `refs` namespace, and all reflogs
with --no-full.
--connectivity-only::
- Check only the connectivity of tags, commits and tree objects. By
- avoiding to unpack blobs, this speeds up the operation, at the
- expense of missing corrupt objects or other problematic issues.
+ Check only the connectivity of reachable objects, making sure
+ that any objects referenced by a reachable tag, commit, or tree
+ is present. This speeds up the operation by avoiding reading
+ blobs entirely (though it does still check that referenced blobs
+ exist). This will detect corruption in commits and trees, but
+ not do any semantic checks (e.g., for format errors). Corruption
+ in blob objects will not be detected at all.
++
+Unreachable tags, commits, and trees will also be accessed to find the
+tips of dangling segments of history. Use `--no-dangling` if you don't
+care about this output and want to speed it up further.
--strict::
Enable more strict checking, namely to catch a file mode
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index a7c1b0f..247f765 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -20,17 +20,16 @@ created from prior invocations of 'git add', packing refs, pruning
reflog, rerere metadata or stale working trees. May also update ancillary
indexes such as the commit-graph.
-Users are encouraged to run this task on a regular basis within
-each repository to maintain good disk space utilization and good
-operating performance.
+When common porcelain operations that create objects are run, they
+will check whether the repository has grown substantially since the
+last maintenance, and if so run `git gc` automatically. See `gc.auto`
+below for how to disable this behavior.
-Some git commands may automatically run 'git gc'; see the `--auto` flag
-below for details. If you know what you're doing and all you want is to
-disable this behavior permanently without further considerations, just do:
-
-----------------------
-$ git config --global gc.auto 0
-----------------------
+Running `git gc` manually should only be needed when adding objects to
+a repository without regularly running such porcelain commands, to do
+a one-off repository optimization, or e.g. to clean up a suboptimal
+mass-import. See the "PACKFILE OPTIMIZATION" section in
+linkgit:git-fast-import[1] for more details on the import case.
OPTIONS
-------
@@ -40,35 +39,17 @@ OPTIONS
space utilization and performance. This option will cause
'git gc' to more aggressively optimize the repository at the expense
of taking much more time. The effects of this optimization are
- persistent, so this option only needs to be used occasionally; every
- few hundred changesets or so.
+ mostly persistent. See the "AGGRESSIVE" section below for details.
--auto::
With this option, 'git gc' checks whether any housekeeping is
required; if not, it exits without performing any work.
- Some git commands run `git gc --auto` after performing
- operations that could create many loose objects. Housekeeping
- is required if there are too many loose objects or too many
- packs in the repository.
-+
-If the number of loose objects exceeds the value of the `gc.auto`
-configuration variable, then all loose objects are combined into a
-single pack using `git repack -d -l`. Setting the value of `gc.auto`
-to 0 disables automatic packing of loose objects.
+
-If the number of packs exceeds the value of `gc.autoPackLimit`,
-then existing packs (except those marked with a `.keep` file
-or over `gc.bigPackThreshold` limit)
-are consolidated into a single pack by using the `-A` option of
-'git repack'.
-If the amount of memory is estimated not enough for `git repack` to
-run smoothly and `gc.bigPackThreshold` is not set, the largest
-pack will also be excluded (this is the equivalent of running `git gc`
-with `--keep-base-pack`).
-Setting `gc.autoPackLimit` to 0 disables automatic consolidation of
-packs.
+See the `gc.auto` option in the "CONFIGURATION" section below for how
+this heuristic works.
+
-If houskeeping is required due to many loose objects or packs, all
+Once housekeeping is triggered by exceeding the limits of
+configuration options such as `gc.auto` and `gc.autoPackLimit`, all
other housekeeping tasks (e.g. rerere, working trees, reflog...) will
be performed as well.
@@ -96,69 +77,39 @@ be performed as well.
`.keep` files are consolidated into a single pack. When this
option is used, `gc.bigPackThreshold` is ignored.
+AGGRESSIVE
+----------
+
+When the `--aggressive` option is supplied, linkgit:git-repack[1] will
+be invoked with the `-f` flag, which in turn will pass
+`--no-reuse-delta` to linkgit:git-pack-objects[1]. This will throw
+away any existing deltas and re-compute them, at the expense of
+spending much more time on the repacking.
+
+The effects of this are mostly persistent, e.g. when packs and loose
+objects are coalesced into one another pack the existing deltas in
+that pack might get re-used, but there are also various cases where we
+might pick a sub-optimal delta from a newer pack instead.
+
+Furthermore, supplying `--aggressive` will tweak the `--depth` and
+`--window` options passed to linkgit:git-repack[1]. See the
+`gc.aggressiveDepth` and `gc.aggressiveWindow` settings below. By
+using a larger window size we're more likely to find more optimal
+deltas.
+
+It's probably not worth it to use this option on a given repository
+without running tailored performance benchmarks on it. It takes a lot
+more time, and the resulting space/delta optimization may or may not
+be worth it. Not using this at all is the right trade-off for most
+users and their repositories.
+
CONFIGURATION
-------------
-The optional configuration variable `gc.reflogExpire` can be
-set to indicate how long historical entries within each branch's
-reflog should remain available in this repository. The setting is
-expressed as a length of time, for example '90 days' or '3 months'.
-It defaults to '90 days'.
-
-The optional configuration variable `gc.reflogExpireUnreachable`
-can be set to indicate how long historical reflog entries which
-are not part of the current branch should remain available in
-this repository. These types of entries are generally created as
-a result of using `git commit --amend` or `git rebase` and are the
-commits prior to the amend or rebase occurring. Since these changes
-are not part of the current project most users will want to expire
-them sooner. This option defaults to '30 days'.
-
-The above two configuration variables can be given to a pattern. For
-example, this sets non-default expiry values only to remote-tracking
-branches:
-
-------------
-[gc "refs/remotes/*"]
- reflogExpire = never
- reflogExpireUnreachable = 3 days
-------------
-
-The optional configuration variable `gc.rerereResolved` indicates
-how long records of conflicted merge you resolved earlier are
-kept. This defaults to 60 days.
-
-The optional configuration variable `gc.rerereUnresolved` indicates
-how long records of conflicted merge you have not resolved are
-kept. This defaults to 15 days.
-
-The optional configuration variable `gc.packRefs` determines if
-'git gc' runs 'git pack-refs'. This can be set to "notbare" to enable
-it within all non-bare repos or it can be set to a boolean value.
-This defaults to true.
-
-The optional configuration variable `gc.writeCommitGraph` determines if
-'git gc' should run 'git commit-graph write'. This can be set to a
-boolean value. This defaults to false.
-
-The optional configuration variable `gc.aggressiveWindow` controls how
-much time is spent optimizing the delta compression of the objects in
-the repository when the --aggressive option is specified. The larger
-the value, the more time is spent optimizing the delta compression. See
-the documentation for the --window option in linkgit:git-repack[1] for
-more details. This defaults to 250.
-
-Similarly, the optional configuration variable `gc.aggressiveDepth`
-controls --depth option in linkgit:git-repack[1]. This defaults to 50.
-
-The optional configuration variable `gc.pruneExpire` controls how old
-the unreferenced loose objects have to be before they are pruned. The
-default is "2 weeks ago".
-
-Optional configuration variable `gc.worktreePruneExpire` controls how
-old a stale working tree should be before `git worktree prune` deletes
-it. Default is "3 months ago".
+The below documentation is the same as what's found in
+linkgit:git-config[1]:
+include::config/gc.txt[]
NOTES
-----
@@ -168,8 +119,8 @@ anywhere in your repository. In
particular, it will keep not only objects referenced by your current set
of branches and tags, but also objects referenced by the index,
remote-tracking branches, refs saved by 'git filter-branch' in
-refs/original/, or reflogs (which may reference commits in branches
-that were later amended or rewound).
+refs/original/, reflogs (which may reference commits in branches
+that were later amended or rewound), and anything else in the refs/* namespace.
If you are expecting some objects to be deleted and they aren't, check
all of those locations and decide whether it makes sense in your case to
remove those references.
@@ -190,8 +141,7 @@ mitigate this problem:
However, these features fall short of a complete solution, so users who
run commands concurrently have to live with some risk of corruption (which
-seems to be low in practice) unless they turn off automatic garbage
-collection with 'git config gc.auto 0'.
+seems to be low in practice).
HOOKS
-----
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 84fe236..2d27969 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -88,7 +88,7 @@ OPTIONS
mechanism. Only useful with `--untracked`.
--exclude-standard::
- Do not pay attention to ignored files specified via the `.gitignore`
+ Do not pay attention to ignored files specified via the `.gitignore`
mechanism. Only useful when searching files in the current directory
with `--no-index`.
diff --git a/Documentation/git-hash-object.txt b/Documentation/git-hash-object.txt
index 814e744..df9e2c5 100644
--- a/Documentation/git-hash-object.txt
+++ b/Documentation/git-hash-object.txt
@@ -18,9 +18,7 @@ Computes the object ID value for an object with specified type
with the contents of the named file (which can be outside of the
work tree), and optionally writes the resulting object into the
object database. Reports its object ID to its standard output.
-This is used by 'git cvsimport' to update the index
-without modifying files in the work tree. When <type> is not
-specified, it defaults to "blob".
+When <type> is not specified, it defaults to "blob".
OPTIONS
-------
diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt
index c318bf8..f71db0d 100644
--- a/Documentation/git-help.txt
+++ b/Documentation/git-help.txt
@@ -171,8 +171,8 @@ variable, we launch 'kfmclient' to try to open the man page on an
already opened konqueror in a new tab if possible.
For consistency, we also try such a trick if 'man.konqueror.path' is
-set to something like 'A_PATH_TO/konqueror'. That means we will try to
-launch 'A_PATH_TO/kfmclient' instead.
+set to something like `A_PATH_TO/konqueror`. That means we will try to
+launch `A_PATH_TO/kfmclient` instead.
If you really want to use 'konqueror', then you can use something like
the following:
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index bb0db19..558966a 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -162,7 +162,7 @@ ScriptAliasMatch ^/git/[^/]*(.*) /usr/libexec/git-core/git-http-backend/storage.
Accelerated static Apache 2.x::
Similar to the above, but Apache can be used to return static
- files that are stored on disk. On many systems this may
+ files that are stored on disk. On many systems this may
be more efficient as Apache can ask the kernel to copy the
file contents from the file system directly to the network:
+
diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt
index a5e8b36..96ec649 100644
--- a/Documentation/git-interpret-trailers.txt
+++ b/Documentation/git-interpret-trailers.txt
@@ -3,7 +3,7 @@ git-interpret-trailers(1)
NAME
----
-git-interpret-trailers - add or parse structured information in commit messages
+git-interpret-trailers - Add or parse structured information in commit messages
SYNOPSIS
--------
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index 5298f1b..8461c0e 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -118,6 +118,7 @@ OPTIONS
linkgit:git-status[1] `--short` or linkgit:git-diff[1]
`--name-status` for more user-friendly alternatives.
+
+--
This option identifies the file status with the following tags (followed by
a space) at the start of each line:
@@ -128,6 +129,7 @@ a space) at the start of each line:
C:: modified/changed
K:: to be killed
?:: other
+--
-v::
Similar to `-t`, but use lowercase letters for files
diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt
index b9fd377..0b057cb 100644
--- a/Documentation/git-ls-remote.txt
+++ b/Documentation/git-ls-remote.txt
@@ -31,7 +31,7 @@ OPTIONS
displayed.
--refs::
- Do not show peeled tags or pseudorefs like HEAD in the output.
+ Do not show peeled tags or pseudorefs like `HEAD` in the output.
-q::
--quiet::
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index 9dee7be..a751571 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -27,9 +27,9 @@ in the current working directory. Note that:
taken as relative to the current working directory. E.g. when you are
in a directory 'sub' that has a directory 'dir', you can run 'git
ls-tree -r HEAD dir' to list the contents of the tree (that is
- 'sub/dir' in `HEAD`). You don't want to give a tree that is not at the
+ `sub/dir` in `HEAD`). You don't want to give a tree that is not at the
root level (e.g. `git ls-tree -r HEAD:sub dir`) in this case, as that
- would result in asking for 'sub/sub/dir' in the `HEAD` commit.
+ would result in asking for `sub/sub/dir` in the `HEAD` commit.
However, the current working directory can be ignored by passing
--full-tree option.
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 6a9163d..01fd52d 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -13,8 +13,7 @@ SYNOPSIS
[-s <strategy>] [-X <strategy-option>] [-S[<keyid>]]
[--[no-]allow-unrelated-histories]
[--[no-]rerere-autoupdate] [-m <msg>] [-F <file>] [<commit>...]
-'git merge' --abort
-'git merge' --continue
+'git merge' (--continue | --abort | --quit)
DESCRIPTION
-----------
@@ -83,7 +82,8 @@ invocations. The automated message can include the branch description.
If `--log` is specified, a shortlog of the commits being merged
will be appended to the specified message.
---[no-]rerere-autoupdate::
+--rerere-autoupdate::
+--no-rerere-autoupdate::
Allow the rerere mechanism to update the index with the
result of auto-conflict resolution if possible.
@@ -104,6 +104,10 @@ commit or stash your changes before running 'git merge'.
'git merge --abort' is equivalent to 'git reset --merge' when
`MERGE_HEAD` is present.
+--quit::
+ Forget about the current merge in progress. Leave the index
+ and the working tree as-is.
+
--continue::
After a 'git merge' stops due to conflicts you can conclude the
merge by running 'git merge --continue' (see "HOW TO RESOLVE
diff --git a/Documentation/git-mergetool--lib.txt b/Documentation/git-mergetool--lib.txt
index 055550b..4da9d24 100644
--- a/Documentation/git-mergetool--lib.txt
+++ b/Documentation/git-mergetool--lib.txt
@@ -28,7 +28,9 @@ to define the operation mode for the functions listed below.
FUNCTIONS
---------
get_merge_tool::
- returns a merge tool.
+ returns a merge tool. the return code is 1 if we returned a guessed
+ merge tool, else 0. '$GIT_MERGETOOL_GUI' may be set to 'true' to
+ search for the appropriate guitool.
get_merge_tool_cmd::
returns the custom command for a merge tool.
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index 0c7975a..6b14702 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -83,7 +83,9 @@ success of the resolution after the custom tool has exited.
--gui::
When 'git-mergetool' is invoked with the `-g` or `--gui` option
the default merge tool will be read from the configured
- `merge.guitool` variable instead of `merge.tool`.
+ `merge.guitool` variable instead of `merge.tool`. If
+ `merge.guitool` is not set, we will fallback to the tool
+ configured under `merge.tool`.
--no-gui::
This overrides a previous `-g` or `--gui` setting and reads the
diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt
index df2b64d..f56a5a9 100644
--- a/Documentation/git-notes.txt
+++ b/Documentation/git-notes.txt
@@ -146,7 +146,7 @@ OPTIONS
-C <object>::
--reuse-message=<object>::
- Take the given blob object (for example, another note) as the
+ Take the given blob object (for example, another note) as the
note message. (Use `git notes copy <object>` instead to
copy notes between objects.)
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 118d9d8..a5e9501 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -112,8 +112,9 @@ When set to `merges`, rebase using `git rebase --rebase-merges` so that
the local merge commits are included in the rebase (see
linkgit:git-rebase[1] for details).
+
-When set to preserve, rebase with the `--preserve-merges` option passed
-to `git rebase` so that locally created merge commits will not be flattened.
+When set to `preserve` (deprecated in favor of `merges`), rebase with the
+`--preserve-merges` option passed to `git rebase` so that locally created
+merge commits will not be flattened.
+
When false, merge the current branch into the upstream branch.
+
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index 5c70bc2..d271842 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -38,8 +38,9 @@ OPTIONS
started.
--reset::
- Same as -m, except that unmerged entries are discarded
- instead of failing.
+ Same as -m, except that unmerged entries are discarded instead
+ of failing. When used with `-u`, updates leading to loss of
+ working tree changes will not abort the operation.
-u::
After a successful merge, update the files in the work
@@ -128,6 +129,10 @@ OPTIONS
Instead of reading tree object(s) into the index, just empty
it.
+-q::
+--quiet::
+ Quiet, suppress feedback messages.
+
<tree-ish#>::
The id of the tree object(s) to be read/merged.
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index c742b73..6156609 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -12,7 +12,7 @@ SYNOPSIS
[<upstream> [<branch>]]
'git rebase' [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>]
--root [<branch>]
-'git rebase' --continue | --skip | --abort | --quit | --edit-todo | --show-current-patch
+'git rebase' (--continue | --skip | --abort | --quit | --edit-todo | --show-current-patch)
DESCRIPTION
-----------
@@ -300,6 +300,11 @@ See also INCOMPATIBLE OPTIONS below.
+
See also INCOMPATIBLE OPTIONS below.
+--rerere-autoupdate::
+--no-rerere-autoupdate::
+ Allow the rerere mechanism to update the index with the
+ result of auto-conflict resolution if possible.
+
-S[<keyid>]::
--gpg-sign[=<keyid>]::
GPG-sign commits. The `keyid` argument is optional and
@@ -415,9 +420,9 @@ i.e. commits that would be excluded by linkgit:git-log[1]'s
the `rebase-cousins` mode is turned on, such commits are instead rebased
onto `<upstream>` (or `<onto>`, if specified).
+
-The `--rebase-merges` mode is similar in spirit to `--preserve-merges`, but
-in contrast to that option works well in interactive rebases: commits can be
-reordered, inserted and dropped at will.
+The `--rebase-merges` mode is similar in spirit to the deprecated
+`--preserve-merges`, but in contrast to that option works well in interactive
+rebases: commits can be reordered, inserted and dropped at will.
+
It is currently only possible to recreate the merge commits using the
`recursive` merge strategy; Different merge strategies can be used only via
@@ -427,9 +432,10 @@ See also REBASING MERGES and INCOMPATIBLE OPTIONS below.
-p::
--preserve-merges::
- Recreate merge commits instead of flattening the history by replaying
- commits a merge commit introduces. Merge conflict resolutions or manual
- amendments to merge commits are not preserved.
+ [DEPRECATED: use `--rebase-merges` instead] Recreate merge commits
+ instead of flattening the history by replaying commits a merge commit
+ introduces. Merge conflict resolutions or manual amendments to merge
+ commits are not preserved.
+
This uses the `--interactive` machinery internally, but combining it
with the `--interactive` option explicitly is generally not a good
@@ -669,7 +675,8 @@ $ git rebase -i HEAD~5
And move the first patch to the end of the list.
-You might want to preserve merges, if you have a history like this:
+You might want to recreate merge commits, e.g. if you have a history
+like this:
------------------
X
@@ -683,7 +690,7 @@ Suppose you want to rebase the side branch starting at "A" to "Q". Make
sure that the current HEAD is "B", and call
-----------------------------
-$ git rebase -i -p --onto Q O
+$ git rebase -i -r --onto Q O
-----------------------------
Reordering and editing commits usually creates untested intermediate
@@ -1020,11 +1027,11 @@ merge cmake
BUGS
----
-The todo list presented by `--preserve-merges --interactive` does not
-represent the topology of the revision graph. Editing commits and
-rewording their commit messages should work fine, but attempts to
-reorder commits tend to produce counterintuitive results. Use
-`--rebase-merges` in such scenarios instead.
+The todo list presented by the deprecated `--preserve-merges --interactive`
+does not represent the topology of the revision graph (use `--rebase-merges`
+instead). Editing commits and rewording their commit messages should work
+fine, but attempts to reorder commits tend to produce counterintuitive results.
+Use `--rebase-merges` in such scenarios instead.
For example, an attempt to rearrange
------------
diff --git a/Documentation/git-remote-ext.txt b/Documentation/git-remote-ext.txt
index 3fc5d94..88ea7e1 100644
--- a/Documentation/git-remote-ext.txt
+++ b/Documentation/git-remote-ext.txt
@@ -104,7 +104,7 @@ begins with `ext::`. Examples:
link-level address).
"ext::git-server-alias foo %G/repo% with% spaces %Vfoo"::
- Represents a repository with path '/repo with spaces' accessed
+ Represents a repository with path `/repo with spaces` accessed
using the helper program "git-server-alias foo". The hostname for
the remote server passed in the protocol stream will be "foo"
(this allows multiple virtual Git servers to share a
@@ -118,7 +118,7 @@ begins with `ext::`. Examples:
SEE ALSO
--------
-linkgit:gitremote-helpers[1]
+linkgit:gitremote-helpers[7]
GIT
---
diff --git a/Documentation/git-remote-fd.txt b/Documentation/git-remote-fd.txt
index 80afca8..0451ceb 100644
--- a/Documentation/git-remote-fd.txt
+++ b/Documentation/git-remote-fd.txt
@@ -52,7 +52,7 @@ EXAMPLES
SEE ALSO
--------
-linkgit:gitremote-helpers[1]
+linkgit:gitremote-helpers[7]
GIT
---
diff --git a/Documentation/git-remote-helpers.txto b/Documentation/git-remote-helpers.txto
index 49233f5..6f353eb 100644
--- a/Documentation/git-remote-helpers.txto
+++ b/Documentation/git-remote-helpers.txto
@@ -1,7 +1,7 @@
git-remote-helpers
==================
-This document has been moved to linkgit:gitremote-helpers[1].
+This document has been moved to linkgit:gitremote-helpers[7].
Please let the owners of the referring site know so that they can update the
link you clicked to get here.
diff --git a/Documentation/git-remote-testgit.txt b/Documentation/git-remote-testgit.txt
deleted file mode 100644
index f791d73..0000000
--- a/Documentation/git-remote-testgit.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-git-remote-testgit(1)
-=====================
-
-NAME
-----
-git-remote-testgit - Example remote-helper
-
-
-SYNOPSIS
---------
-[verse]
-git clone testgit::<source-repo> [<destination>]
-
-DESCRIPTION
------------
-
-This command is a simple remote-helper, that is used both as a
-testcase for the remote-helper functionality, and as an example to
-show remote-helper authors one possible implementation.
-
-The best way to learn more is to read the comments and source code in
-'git-remote-testgit'.
-
-SEE ALSO
---------
-linkgit:gitremote-helpers[1]
-
-GIT
----
-Part of the linkgit:git[1] suite
diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt
index fe4434a..4cfc883 100644
--- a/Documentation/git-rerere.txt
+++ b/Documentation/git-rerere.txt
@@ -24,7 +24,7 @@ on the initial manual merge, and applying previously recorded
hand resolutions to their corresponding automerge results.
[NOTE]
-You need to set the configuration variable rerere.enabled in order to
+You need to set the configuration variable `rerere.enabled` in order to
enable this command.
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 633d71d..97e0544 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -429,8 +429,8 @@ working index HEAD target working index HEAD
`reset --merge` is meant to be used when resetting out of a conflicted
merge. Any mergy operation guarantees that the working tree file that is
-involved in the merge does not have local change wrt the index before
-it starts, and that it writes the result out to the working tree. So if
+involved in the merge does not have a local change with respect to the index
+before it starts, and that it writes the result out to the working tree. So if
we see some difference between the index and the target and also
between the index and the working tree, then it means that we are not
resetting out from a state that a mergy operation left after failing
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 88609ff..9392760 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -48,6 +48,7 @@ SYNOPSIS
[ --date=<format>]
[ [ --objects | --objects-edge | --objects-edge-aggressive ]
[ --unpacked ]
+ [ --object-names | --no-object-names ]
[ --filter=<filter-spec> [ --filter-print-omitted ] ] ]
[ --missing=<missing-action> ]
[ --pretty | --header ]
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 9aadc36..fae4d66 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -69,6 +69,13 @@ more details.
With this option, 'git revert' will not start the commit
message editor.
+--cleanup=<mode>::
+ This option determines how the commit message will be cleaned up before
+ being passed on to the commit machinery. See linkgit:git-commit[1] for more
+ details. In particular, if the '<mode>' is given a value of `scissors`,
+ scissors will be appended to `MERGE_MSG` before being passed on in the case
+ of a conflict.
+
-n::
--no-commit::
Usually the command automatically creates some commits with
@@ -104,6 +111,11 @@ effect to your index in a row.
Pass the merge strategy-specific option through to the
merge strategy. See linkgit:git-merge[1] for details.
+--rerere-autoupdate::
+--no-rerere-autoupdate::
+ Allow the rerere mechanism to update the index with the
+ result of auto-conflict resolution if possible.
+
SEQUENCER SUBCOMMANDS
---------------------
include::sequencer.txt[]
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 1afe9fc..d93e5d0 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -278,6 +278,14 @@ must be used for each option.
Automating
~~~~~~~~~~
+--no-[to|cc|bcc]::
+ Clears any list of "To:", "Cc:", "Bcc:" addresses previously
+ set via config.
+
+--no-identity::
+ Clears the previously read value of `sendemail.identity` set
+ via config, if any.
+
--to-cmd=<command>::
Specify a command to execute once per patch file which
should generate patch file specific "To:" entries.
@@ -500,8 +508,12 @@ app-specific or your regular password as appropriate. If you have credential
helper configured (see linkgit:git-credential[1]), the password will be saved in
the credential store so you won't have to type it the next time.
-Note: the following perl modules are required
- Net::SMTP::SSL, MIME::Base64 and Authen::SASL
+Note: the following core Perl modules that may be installed with your
+distribution of Perl are required:
+MIME::Base64, MIME::QuotedPrint, Net::Domain and Net::SMTP.
+These additional Perl modules are also required:
+Authen::SASL and Mail::Address.
+
SEE ALSO
--------
diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt
index 4a01371..5cc2fce 100644
--- a/Documentation/git-show-branch.txt
+++ b/Documentation/git-show-branch.txt
@@ -167,7 +167,7 @@ $ git show-branch master fixes mhf
------------------------------------------------
These three branches all forked from a common commit, [master],
-whose commit message is "Add {apostrophe}git show-branch{apostrophe}".
+whose commit message is "Add \'git show-branch'".
The "fixes" branch adds one commit "Introduce "reset type" flag to
"git reset"". The "mhf" branch adds many other commits.
The current branch is "master".
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index ebb6282..8fbe12c 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git stash' list [<options>]
-'git stash' show [<stash>]
+'git stash' show [<options>] [<stash>]
'git stash' drop [-q|--quiet] [<stash>]
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
'git stash' branch <branchname> [<stash>]
@@ -106,7 +106,7 @@ stash@{1}: On master: 9cc0589... Add git-stash
The command takes options applicable to the 'git log'
command to control what is shown and how. See linkgit:git-log[1].
-show [<stash>]::
+show [<options>] [<stash>]::
Show the changes recorded in the stash entry as a diff between the
stashed contents and the commit back when the stash entry was first
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 861d821..d4e8f24 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -278,7 +278,8 @@ Header lines start with "#" and are added in response to specific
command line arguments. Parsers should ignore headers they
don't recognize.
-### Branch Headers
+Branch Headers
+^^^^^^^^^^^^^^
If `--branch` is given, a series of header lines are printed with
information about the current branch.
@@ -294,7 +295,8 @@ Line Notes
------------------------------------------------------------
....
-### Changed Tracked Entries
+Changed Tracked Entries
+^^^^^^^^^^^^^^^^^^^^^^^
Following the headers, a series of lines are printed for tracked
entries. One of three different line formats may be used to describe
@@ -365,7 +367,8 @@ Field Meaning
--------------------------------------------------------
....
-### Other Items
+Other Items
+^^^^^^^^^^^
Following the tracked entries (and if requested), a series of
lines will be printed for untracked and then ignored items
@@ -379,7 +382,8 @@ Ignored items have the following format:
! <path>
-### Pathname Format Notes and -z
+Pathname Format Notes and -z
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When the `-z` option is given, pathnames are printed as is and
without any quoting and lines are terminated with a NUL (ASCII 0x00)
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 2794e29..0ed5c24 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -15,6 +15,7 @@ SYNOPSIS
'git submodule' [--quiet] init [--] [<path>...]
'git submodule' [--quiet] deinit [-f|--force] (--all|[--] <path>...)
'git submodule' [--quiet] update [<options>] [--] [<path>...]
+'git submodule' [--quiet] set-branch [<options>] [--] <path>
'git submodule' [--quiet] summary [<options>] [--] [<path>...]
'git submodule' [--quiet] foreach [--recursive] <command>
'git submodule' [--quiet] sync [--recursive] [--] [<path>...]
@@ -42,7 +43,7 @@ This may be either an absolute URL, or (if it begins with ./
or ../), the location relative to the superproject's default remote
repository (Please note that to specify a repository 'foo.git'
which is located right next to a superproject 'bar.git', you'll
-have to use '../foo.git' instead of './foo.git' - as one might expect
+have to use `../foo.git` instead of `./foo.git` - as one might expect
when following the rules for relative URLs - because the evaluation
of relative URLs in Git is identical to that of relative directories).
+
@@ -172,6 +173,12 @@ submodule with the `--init` option.
If `--recursive` is specified, this command will recurse into the
registered submodules, and update any nested submodules within.
--
+set-branch ((-d|--default)|(-b|--branch <branch>)) [--] <path>::
+ Sets the default remote tracking branch for the submodule. The
+ `--branch` option allows the remote branch to be specified. The
+ `--default` option removes the submodule.<name>.branch configuration
+ key, which causes the tracking branch to default to 'master'.
+
summary [--cached|--files] [(-n|--summary-limit) <n>] [commit] [--] [<path>...]::
Show commit summary between the given commit (defaults to HEAD) and
working tree/index. For a submodule in question, a series of commits
@@ -259,13 +266,14 @@ OPTIONS
This option is only valid for the deinit command. Unregister all
submodules in the working tree.
--b::
---branch::
+-b <branch>::
+--branch <branch>::
Branch of repository to add as submodule.
The name of the branch is recorded as `submodule.<name>.branch` in
`.gitmodules` for `update --remote`. A special value of `.` is used to
indicate that the name of the branch in the submodule should be the
- same name as the current branch in the current repository.
+ same name as the current branch in the current repository. If the
+ option is not specified, it defaults to 'master'.
-f::
--force::
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index b990295..3071162 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -126,7 +126,7 @@ your Perl's Getopt::Long is < v2.37).
command-line argument.
+
This automatically updates the rev_map if needed (see
-'$GIT_DIR/svn/\*\*/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
--localtime;;
Store Git commit times in the local time zone instead of UTC. This
@@ -239,7 +239,7 @@ Like 'git rebase'; this requires that the working tree be clean
and have no uncommitted changes.
+
This automatically updates the rev_map if needed (see
-'$GIT_DIR/svn/\*\*/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
-l;;
--local;;
@@ -524,7 +524,7 @@ This will set the property 'svn:keywords' to 'FreeBSD=%H' for the file
way to repair the repo is to use 'reset'.
+
Only the rev_map and refs/remotes/git-svn are changed (see
-'$GIT_DIR/svn/\*\*/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
Follow 'reset' with a 'fetch' and then 'git reset' or 'git rebase' to
move local branches onto the new tree.
@@ -760,7 +760,7 @@ svn-remote.<name>.noMetadata::
+
This option can only be used for one-shot imports as 'git svn'
will not be able to fetch again without metadata. Additionally,
-if you lose your '$GIT_DIR/svn/\*\*/.rev_map.*' files, 'git svn' will not
+if you lose your '$GIT_DIR/svn/\**/.rev_map.*' files, 'git svn' will not
be able to rebuild them.
+
The 'git svn log' command will not work on repositories using
@@ -1100,10 +1100,10 @@ listed below are allowed:
tags = tags/*/project-a:refs/remotes/project-a/tags/*
------------------------------------------------------------------------
-Keep in mind that the '\*' (asterisk) wildcard of the local ref
-(right of the ':') *must* be the farthest right path component;
+Keep in mind that the `*` (asterisk) wildcard of the local ref
+(right of the `:`) *must* be the farthest right path component;
however the remote wildcard may be anywhere as long as it's an
-independent path component (surrounded by '/' or EOL). This
+independent path component (surrounded by `/` or EOL). This
type of configuration is not automatically created by 'init' and
should be manually entered with a text-editor or using 'git config'.
@@ -1154,7 +1154,7 @@ fetching, then $GIT_DIR/svn/.metadata must be manually edited to remove
FILES
-----
-$GIT_DIR/svn/\*\*/.rev_map.*::
+$GIT_DIR/svn/\**/.rev_map.*::
Mapping between Subversion revision numbers and Git commit
names. In a repository where the noMetadata option is not set,
this can be rebuilt from the git-svn-id: lines that are at the
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index a74e7b9..2e5599a 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -64,6 +64,13 @@ OPTIONS
-s::
--sign::
Make a GPG-signed tag, using the default e-mail address's key.
+ The default behavior of tag GPG-signing is controlled by `tag.gpgSign`
+ configuration variable if it exists, or disabled oder otherwise.
+ See linkgit:git-config[1].
+
+--no-sign::
+ Override `tag.gpgSign` configuration variable that is
+ set to force each and every tag to be signed.
-u <keyid>::
--local-user=<keyid>::
diff --git a/Documentation/git-update-server-info.txt b/Documentation/git-update-server-info.txt
index bd0e364..969bb2e 100644
--- a/Documentation/git-update-server-info.txt
+++ b/Documentation/git-update-server-info.txt
@@ -9,7 +9,7 @@ git-update-server-info - Update auxiliary info file to help dumb servers
SYNOPSIS
--------
[verse]
-'git update-server-info' [--force]
+'git update-server-info'
DESCRIPTION
-----------
@@ -19,15 +19,6 @@ $GIT_OBJECT_DIRECTORY/info directories to help clients discover
what references and packs the server has. This command
generates such auxiliary files.
-
-OPTIONS
--------
-
--f::
---force::
- Update the info files from scratch.
-
-
OUTPUT
------
diff --git a/Documentation/git-web--browse.txt b/Documentation/git-web--browse.txt
index fd952a5..8d162b5 100644
--- a/Documentation/git-web--browse.txt
+++ b/Documentation/git-web--browse.txt
@@ -92,8 +92,8 @@ configuration variable, we launch 'kfmclient' to try to open the HTML
man page on an already opened konqueror in a new tab if possible.
For consistency, we also try such a trick if 'browser.konqueror.path' is
-set to something like 'A_PATH_TO/konqueror'. That means we will try to
-launch 'A_PATH_TO/kfmclient' instead.
+set to something like `A_PATH_TO/konqueror`. That means we will try to
+launch `A_PATH_TO/kfmclient` instead.
If you really want to use 'konqueror', then you can use something like
the following:
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index cb86318..85d92c9 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -213,7 +213,7 @@ refs of one working tree from another.
In general, all pseudo refs are per working tree and all refs starting
with "refs/" are shared. Pseudo refs are ones like HEAD which are
-directly under GIT_DIR instead of inside GIT_DIR/refs. There are one
+directly under GIT_DIR instead of inside GIT_DIR/refs. There is one
exception to this: refs inside refs/bisect and refs/worktree is not
shared.
diff --git a/Documentation/git.txt b/Documentation/git.txt
index fbed007..e095514 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -33,7 +33,8 @@ individual Git commands with "git help command". linkgit:gitcli[7]
manual page gives you an overview of the command-line command syntax.
A formatted and hyperlinked copy of the latest Git documentation
-can be viewed at `https://git.github.io/htmldocs/git.html`.
+can be viewed at https://git.github.io/htmldocs/git.html
+or https://git-scm.com/docs.
OPTIONS
@@ -556,7 +557,6 @@ other
The command-line parameters passed to the configured command are
determined by the ssh variant. See `ssh.variant` option in
linkgit:git-config[1] for details.
-
+
`$GIT_SSH_COMMAND` takes precedence over `$GIT_SSH`, and is interpreted
by the shell, which allows additional arguments to be included.
@@ -681,6 +681,54 @@ of clones and fetches.
When a curl trace is enabled (see `GIT_TRACE_CURL` above), do not dump
data (that is, only dump info lines and headers).
+`GIT_TRACE2`::
+ Enables more detailed trace messages from the "trace2" library.
+ Output from `GIT_TRACE2` is a simple text-based format for human
+ readability.
++
+If this variable is set to "1", "2" or "true" (comparison
+is case insensitive), trace messages will be printed to
+stderr.
++
+If the variable is set to an integer value greater than 2
+and lower than 10 (strictly) then Git will interpret this
+value as an open file descriptor and will try to write the
+trace messages into this file descriptor.
++
+Alternatively, if the variable is set to an absolute path
+(starting with a '/' character), Git will interpret this
+as a file path and will try to append the trace messages
+to it. If the path already exists and is a directory, the
+trace messages will be written to files (one per process)
+in that directory, named according to the last component
+of the SID and an optional counter (to avoid filename
+collisions).
++
+In addition, if the variable is set to
+`af_unix:[<socket_type>:]<absolute-pathname>`, Git will try
+to open the path as a Unix Domain Socket. The socket type
+can be either `stream` or `dgram`.
++
+Unsetting the variable, or setting it to empty, "0" or
+"false" (case insensitive) disables trace messages.
++
+See link:technical/api-trace2.html[Trace2 documentation]
+for full details.
+
+
+`GIT_TRACE2_EVENT`::
+ This setting writes a JSON-based format that is suited for machine
+ interpretation.
+ See `GIT_TRACE2` for available trace output options and
+ link:technical/api-trace2.html[Trace2 documentation] for full details.
+
+`GIT_TRACE2_PERF`::
+ In addition to the text-based messages available in `GIT_TRACE2`, this
+ setting writes a column-based format for understanding nesting
+ regions.
+ See `GIT_TRACE2` for available trace output options and
+ link:technical/api-trace2.html[Trace2 documentation] for full details.
+
`GIT_REDACT_COOKIES`::
This can be set to a comma-separated list of strings. When a curl trace
is enabled (see `GIT_TRACE_CURL` above), whenever a "Cookies:" header
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index af16a35..fb1d188 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -18,7 +18,7 @@ A `gitattributes` file is a simple text file that gives
Each line in `gitattributes` file is of form:
- pattern attr1 attr2 ...
+ pattern attr1 attr2 ...
That is, a pattern followed by an attributes list,
separated by whitespaces. Leading and trailing whitespaces are
@@ -315,8 +315,8 @@ stored as UTF-8 internally. A client without `working-tree-encoding`
support will checkout `foo.ps1` as UTF-8 encoded file. This will
typically cause trouble for the users of this file.
+
-If a Git client, that does not support the `working-tree-encoding`
-attribute, adds a new file `bar.ps1`, then `bar.ps1` will be
+If a Git client that does not support the `working-tree-encoding`
+attribute adds a new file `bar.ps1`, then `bar.ps1` will be
stored "as-is" internally (in this example probably as UTF-16).
A client with `working-tree-encoding` support will interpret the
internal contents as UTF-8 and try to convert it to UTF-16 on checkout.
@@ -820,7 +820,7 @@ patterns are available:
- `java` suitable for source code in the Java language.
-- `matlab` suitable for source code in the MATLAB language.
+- `matlab` suitable for source code in the MATLAB and Octave languages.
- `objc` suitable for source code in the Objective-C language.
@@ -834,6 +834,8 @@ patterns are available:
- `ruby` suitable for source code in the Ruby language.
+- `rust` suitable for source code in the Rust language.
+
- `tex` suitable for source code for LaTeX documents.
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 8ff72f0..82cd573 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -498,6 +498,24 @@ This hook is invoked by `git-p4 submit`. It takes no parameters and nothing
from standard input. Exiting with non-zero status from this script prevent
`git-p4 submit` from launching. Run `git-p4 submit --help` for details.
+post-index-change
+~~~~~~~~~~~~~~~~~
+
+This hook is invoked when the index is written in read-cache.c
+do_write_locked_index.
+
+The first parameter passed to the hook is the indicator for the
+working directory being updated. "1" meaning working directory
+was updated or "0" when the working directory was not updated.
+
+The second parameter passed to the hook is the indicator for whether
+or not the index was updated and the skip-worktree bit could have
+changed. "1" meaning skip-worktree bits could have been updated
+and "0" meaning they were not.
+
+Only one parameter should be set to "1" when the hook runs. The hook
+running passing "1", "1" should not be possible.
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index 1c94f08..d47b1ae 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -89,28 +89,28 @@ PATTERN FORMAT
Put a backslash ("`\`") in front of the first "`!`" for patterns
that begin with a literal "`!`", for example, "`\!important!.txt`".
- - If the pattern ends with a slash, it is removed for the
- purpose of the following description, but it would only find
- a match with a directory. In other words, `foo/` will match a
- directory `foo` and paths underneath it, but will not match a
- regular file or a symbolic link `foo` (this is consistent
- with the way how pathspec works in general in Git).
-
- - If the pattern does not contain a slash '/', Git treats it as
- a shell glob pattern and checks for a match against the
- pathname relative to the location of the `.gitignore` file
- (relative to the toplevel of the work tree if not from a
- `.gitignore` file).
-
- - Otherwise, Git treats the pattern as a shell glob: "`*`" matches
- anything except "`/`", "`?`" matches any one character except "`/`"
- and "`[]`" matches one character in a selected range. See
- fnmatch(3) and the FNM_PATHNAME flag for a more detailed
- description.
-
- - A leading slash matches the beginning of the pathname.
- For example, "/{asterisk}.c" matches "cat-file.c" but not
- "mozilla-sha1/sha1.c".
+ - The slash '/' is used as the directory separator. Separators may
+ occur at the beginning, middle or end of the `.gitignore` search pattern.
+
+ - If there is a separator at the beginning or middle (or both) of the
+ pattern, then the pattern is relative to the directory level of the
+ particular `.gitignore` file itself. Otherwise the pattern may also
+ match at any level below the `.gitignore` level.
+
+ - If there is a separator at the end of the pattern then the pattern
+ will only match directories, otherwise the pattern can match both
+ files and directories.
+
+ - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,
+ but not `a/doc/frotz` directory; however `frotz/` matches `frotz`
+ and `a/frotz` that is a directory (all paths are relative from
+ the `.gitignore` file).
+
+ - An asterisk "`*`" matches anything except a slash.
+ The character "`?`" matches any one character except "`/`".
+ The range notation, e.g. `[a-zA-Z]`, can be used to match
+ one of the characters in a range. See fnmatch(3) and the
+ FNM_PATHNAME flag for a more detailed description.
Two consecutive asterisks ("`**`") in patterns matched against
full pathname may have special meaning:
@@ -132,6 +132,14 @@ full pathname may have special meaning:
- Other consecutive asterisks are considered regular asterisks and
will match according to the previous rules.
+CONFIGURATION
+-------------
+
+The optional configuration variable `core.excludesFile` indicates a path to a
+file containing patterns of file names to exclude, similar to
+`$GIT_DIR/info/exclude`. Patterns in the exclude file are used in addition to
+those in `$GIT_DIR/info/exclude`.
+
NOTES
-----
@@ -144,6 +152,28 @@ To stop tracking a file that is currently tracked, use
EXAMPLES
--------
+ - The pattern `hello.*` matches any file or folder
+ whose name begins with `hello`. If one wants to restrict
+ this only to the directory and not in its subdirectories,
+ one can prepend the pattern with a slash, i.e. `/hello.*`;
+ the pattern now matches `hello.txt`, `hello.c` but not
+ `a/hello.java`.
+
+ - The pattern `foo/` will match a directory `foo` and
+ paths underneath it, but will not match a regular file
+ or a symbolic link `foo` (this is consistent with the
+ way how pathspec works in general in Git)
+
+ - The pattern `doc/frotz` and `/doc/frotz` have the same effect
+ in any `.gitignore` file. In other words, a leading slash
+ is not relevant if there is already a middle slash in
+ the pattern.
+
+ - The pattern "foo/*", matches "foo/test.json"
+ (a regular file), "foo/bar" (a directory), but it does not match
+ "foo/bar/hello.c" (a regular file), as the asterisk in the
+ pattern does not match "bar/hello.c" which has a slash in it.
+
--------------------------------------------------------------
$ git status
[...]
diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt
index 244cd01..1eabb0a 100644
--- a/Documentation/gitk.txt
+++ b/Documentation/gitk.txt
@@ -168,12 +168,12 @@ Files
-----
User configuration and preferences are stored at:
-* '$XDG_CONFIG_HOME/git/gitk' if it exists, otherwise
-* '$HOME/.gitk' if it exists
+* `$XDG_CONFIG_HOME/git/gitk` if it exists, otherwise
+* `$HOME/.gitk` if it exists
-If neither of the above exist then '$XDG_CONFIG_HOME/git/gitk' is created and
+If neither of the above exist then `$XDG_CONFIG_HOME/git/gitk` is created and
used by default. If '$XDG_CONFIG_HOME' is not set it defaults to
-'$HOME/.config' in all cases.
+`$HOME/.config` in all cases.
History
-------
diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt
index 312b6f9..a66e95b 100644
--- a/Documentation/gitmodules.txt
+++ b/Documentation/gitmodules.txt
@@ -115,7 +115,7 @@ Consider the following .gitmodules file:
This defines two submodules, `libfoo` and `libbar`. These are expected to
-be checked out in the paths 'include/foo' and 'include/bar', and for both
+be checked out in the paths `include/foo` and `include/bar`, and for both
submodules a URL is specified which can be used for cloning the submodules.
SEE ALSO
diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt
index 9d1459a..43f80c8 100644
--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -1,4 +1,4 @@
-gitremote-helpers(1)
+gitremote-helpers(7)
====================
NAME
@@ -468,7 +468,7 @@ set by Git if the remote helper has the 'option' capability.
'option dry-run' {'true'|'false'}:
If true, pretend the operation completed successfully,
- but don't actually change any repository data. For most
+ but don't actually change any repository data. For most
helpers this only applies to the 'push', if supported.
'option servpath <c-style-quoted-path>'::
@@ -513,8 +513,6 @@ linkgit:git-remote-ext[1]
linkgit:git-remote-fd[1]
-linkgit:git-remote-testgit[1]
-
linkgit:git-fast-import[1]
GIT
diff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt
index 366dee2..216b11e 100644
--- a/Documentation/gitrepository-layout.txt
+++ b/Documentation/gitrepository-layout.txt
@@ -84,7 +84,7 @@ objects/info/alternates::
to the object database, not to the repository!) in your
alternates file, but it will not work if you use absolute
paths unless the absolute path in filesystem and web URL
- is the same. See also 'objects/info/http-alternates'.
+ is the same. See also `objects/info/http-alternates`.
objects/info/http-alternates::
This file records URLs to alternate object stores that
diff --git a/Documentation/gitsubmodules.txt b/Documentation/gitsubmodules.txt
index 57999e9..0a89020 100644
--- a/Documentation/gitsubmodules.txt
+++ b/Documentation/gitsubmodules.txt
@@ -169,15 +169,15 @@ ACTIVE SUBMODULES
A submodule is considered active,
- a. if `submodule.<name>.active` is set to `true`
+ 1. if `submodule.<name>.active` is set to `true`
+
or
- b. if the submodule's path matches the pathspec in `submodule.active`
+ 2. if the submodule's path matches the pathspec in `submodule.active`
+
or
- c. if `submodule.<name>.url` is set.
+ 3. if `submodule.<name>.url` is set.
and these are evaluated in this order.
@@ -193,11 +193,11 @@ For example:
url = https://example.org/baz
In the above config only the submodule 'bar' and 'baz' are active,
-'bar' due to (a) and 'baz' due to (c). 'foo' is inactive because
-(a) takes precedence over (c)
+'bar' due to (1) and 'baz' due to (3). 'foo' is inactive because
+(1) takes precedence over (3)
-Note that (c) is a historical artefact and will be ignored if the
-(a) and (b) specify that the submodule is not active. In other words,
+Note that (3) is a historical artefact and will be ignored if the
+(1) and (2) specify that the submodule is not active. In other words,
if we have a `submodule.<name>.active` set to `false` or if the
submodule's path is excluded in the pathspec in `submodule.active`, the
url doesn't matter whether it is present or not. This is illustrated in
diff --git a/Documentation/gitweb.conf.txt b/Documentation/gitweb.conf.txt
index 92535db..35317e7 100644
--- a/Documentation/gitweb.conf.txt
+++ b/Documentation/gitweb.conf.txt
@@ -50,11 +50,11 @@ following order:
* built-in values (some set during build stage),
* common system-wide configuration file (defaults to
- '/etc/gitweb-common.conf'),
+ `/etc/gitweb-common.conf`),
* either per-instance configuration file (defaults to 'gitweb_config.perl'
in the same directory as the installed gitweb), or if it does not exists
- then fallback system-wide configuration file (defaults to '/etc/gitweb.conf').
+ then fallback system-wide configuration file (defaults to `/etc/gitweb.conf`).
Values obtained in later configuration files override values obtained earlier
in the above sequence.
@@ -82,7 +82,7 @@ You can include other configuration file using read_config_file()
subroutine. For example, one might want to put gitweb configuration
related to access control for viewing repositories via Gitolite (one
of Git repository management tools) in a separate file, e.g. in
-'/etc/gitweb-gitolite.conf'. To include it, put
+`/etc/gitweb-gitolite.conf`. To include it, put
--------------------------------------------------
read_config_file("/etc/gitweb-gitolite.conf");
@@ -142,7 +142,7 @@ and its path_info based equivalent
http://git.example.com/gitweb.cgi/foo/bar.git
------------------------------------------------
+
-will map to the path '/srv/git/foo/bar.git' on the filesystem.
+will map to the path `/srv/git/foo/bar.git` on the filesystem.
$projects_list::
Name of a plain text file listing projects, or a name of directory
@@ -234,9 +234,9 @@ $GIT::
$mimetypes_file::
File to use for (filename extension based) guessing of MIME types before
- trying '/etc/mime.types'. *NOTE* that this path, if relative, is taken
+ trying `/etc/mime.types`. *NOTE* that this path, if relative, is taken
as relative to the current Git repository, not to CGI script. If unset,
- only '/etc/mime.types' is used (if present on filesystem). If no mimetypes
+ only `/etc/mime.types` is used (if present on filesystem). If no mimetypes
file is found, mimetype guessing based on extension of file is disabled.
Unset by default.
@@ -297,8 +297,8 @@ relative to base URI of gitweb.
+
This list should contain the URI of gitweb's standard stylesheet. The default
URI of gitweb stylesheet can be set at build time using the `GITWEB_CSS`
-makefile variable. Its default value is 'static/gitweb.css'
-(or 'static/gitweb.min.css' if the `CSSMIN` variable is defined,
+makefile variable. Its default value is `static/gitweb.css`
+(or `static/gitweb.min.css` if the `CSSMIN` variable is defined,
i.e. if CSS minifier is used during build).
+
*Note*: there is also a legacy `$stylesheet` configuration variable, which was
@@ -311,7 +311,7 @@ $logo::
is displayed in the top right corner of each gitweb page and used as
a logo for the Atom feed. Relative to the base URI of gitweb (as a path).
Can be adjusted when building gitweb using `GITWEB_LOGO` variable
- By default set to 'static/git-logo.png'.
+ By default set to `static/git-logo.png`.
$favicon::
Points to the location where you put 'git-favicon.png' on your web
@@ -320,7 +320,7 @@ $favicon::
may display them in the browser's URL bar and next to the site name in
bookmarks. Relative to the base URI of gitweb. Can be adjusted at
build time using `GITWEB_FAVICON` variable.
- By default set to 'static/git-favicon.png'.
+ By default set to `static/git-favicon.png`.
$javascript::
Points to the location where you put 'gitweb.js' on your web server,
@@ -328,7 +328,7 @@ $javascript::
Relative to the base URI of gitweb. Can be set at build time using
the `GITWEB_JS` build-time configuration variable.
+
-The default value is either 'static/gitweb.js', or 'static/gitweb.min.js' if
+The default value is either `static/gitweb.js`, or `static/gitweb.min.js` if
the `JSMIN` build variable was defined, i.e. if JavaScript minifier was used
at build time. *Note* that this single file is generated from multiple
individual JavaScript "modules".
@@ -444,7 +444,7 @@ $default_blob_plain_mimetype::
doesn't result in some other type; by default "text/plain".
Gitweb guesses mimetype of a file to display based on extension
of its filename, using `$mimetypes_file` (if set and file exists)
- and '/etc/mime.types' files (see *mime.types*(5) manpage; only
+ and `/etc/mime.types` files (see *mime.types*(5) manpage; only
filename extension rules are supported by gitweb).
$default_text_plain_charset::
@@ -486,7 +486,7 @@ affects how "summary" pages look like, or load limiting).
(for example one for `git://` protocol, and one for `http://`
protocol).
+
-Note that per repository configuration can be set in '$GIT_DIR/cloneurl'
+Note that per repository configuration can be set in `$GIT_DIR/cloneurl`
file, or as values of multi-value `gitweb.url` configuration variable in
project config. Per-repository configuration takes precedence over value
composed from `@git_base_url_list` elements and project name.
@@ -520,7 +520,7 @@ $maxload::
If the server load exceeds this value then gitweb will return
"503 Service Unavailable" error. The server load is taken to be 0
if gitweb cannot determine its value. Currently it works only on Linux,
- where it uses '/proc/loadavg'; the load there is the number of active
+ where it uses `/proc/loadavg`; the load there is the number of active
tasks on the system -- processes that are actually running -- averaged
over the last minute.
+
@@ -536,7 +536,7 @@ $omit_owner::
$per_request_config::
If this is set to code reference, it will be run once for each request.
- You can set parts of configuration that change per session this way.
+ You can set parts of configuration that change per session this way.
For example, one might use the following code in a gitweb configuration
file
+
@@ -739,7 +739,7 @@ Currently available providers are *"gravatar"* and *"picon"*.
Only one provider at a time can be selected ('default' is one element list).
If an unknown provider is specified, the feature is disabled.
*Note* that some providers might require extra Perl packages to be
-installed; see 'gitweb/INSTALL' for more details.
+installed; see `gitweb/INSTALL` for more details.
+
This feature can be configured on a per-repository basis via
repository's `gitweb.avatar` configuration variable.
diff --git a/Documentation/gitweb.txt b/Documentation/gitweb.txt
index 8845058..c743609 100644
--- a/Documentation/gitweb.txt
+++ b/Documentation/gitweb.txt
@@ -36,7 +36,7 @@ browsed using gitweb itself.
CONFIGURATION
-------------
Various aspects of gitweb's behavior can be controlled through the configuration
-file 'gitweb_config.perl' or '/etc/gitweb.conf'. See the linkgit:gitweb.conf[5]
+file `gitweb_config.perl` or `/etc/gitweb.conf`. See the linkgit:gitweb.conf[5]
for details.
Repositories
@@ -51,7 +51,7 @@ projects' root" subsection).
our $projectroot = '/path/to/parent/directory';
-----------------------------------------------------------------------
-The default value for `$projectroot` is '/pub/git'. You can change it during
+The default value for `$projectroot` is `/pub/git`. You can change it during
building gitweb via `GITWEB_PROJECTROOT` build configuration variable.
By default all Git repositories under `$projectroot` are visible and available
@@ -231,7 +231,7 @@ Unnamed repository; edit this file to name it for gitweb.
-------------------------------------------------------------------------------
+
from the template during repository creation, usually installed in
-'/usr/share/git-core/templates/'. You can use the `gitweb.description` repo
+`/usr/share/git-core/templates/`. You can use the `gitweb.description` repo
configuration variable, but the file takes precedence.
category (or `gitweb.category`)::
@@ -407,7 +407,7 @@ in the instructions so they can be included in a future release.
Apache as CGI
~~~~~~~~~~~~~
Apache must be configured to support CGI scripts in the directory in
-which gitweb is installed. Let's assume that it is '/var/www/cgi-bin'
+which gitweb is installed. Let's assume that it is `/var/www/cgi-bin`
directory.
-----------------------------------------------------------------------
@@ -431,7 +431,7 @@ You can use mod_perl with gitweb. You must install Apache::Registry
(for mod_perl 1.x) or ModPerl::Registry (for mod_perl 2.x) to enable
this support.
-Assuming that gitweb is installed to '/var/www/perl', the following
+Assuming that gitweb is installed to `/var/www/perl`, the following
Apache configuration (for mod_perl 2.x) is suitable.
-----------------------------------------------------------------------
@@ -456,7 +456,7 @@ Apache with FastCGI
~~~~~~~~~~~~~~~~~~~
Gitweb works with Apache and FastCGI. First you need to rename, copy
or symlink gitweb.cgi to gitweb.fcgi. Let's assume that gitweb is
-installed in '/usr/share/gitweb' directory. The following Apache
+installed in `/usr/share/gitweb` directory. The following Apache
configuration is suitable (UNTESTED!)
-----------------------------------------------------------------------
@@ -503,22 +503,22 @@ repositories, you can configure Apache like this:
-----------------------------------------------------------------------
The above configuration expects your public repositories to live under
-'/pub/git' and will serve them as `http://git.domain.org/dir-under-pub-git`,
+`/pub/git` and will serve them as `http://git.domain.org/dir-under-pub-git`,
both as clonable Git URL and as browseable gitweb interface. If you then
start your linkgit:git-daemon[1] with `--base-path=/pub/git --export-all`
then you can even use the `git://` URL with exactly the same path.
Setting the environment variable `GITWEB_CONFIG` will tell gitweb to use the
-named file (i.e. in this example '/etc/gitweb.conf') as a configuration for
+named file (i.e. in this example `/etc/gitweb.conf`) as a configuration for
gitweb. You don't really need it in above example; it is required only if
your configuration file is in different place than built-in (during
-compiling gitweb) 'gitweb_config.perl' or '/etc/gitweb.conf'. See
+compiling gitweb) 'gitweb_config.perl' or `/etc/gitweb.conf`. See
linkgit:gitweb.conf[5] for details, especially information about precedence
rules.
If you use the rewrite rules from the example you *might* also need
something like the following in your gitweb configuration file
-('/etc/gitweb.conf' following example):
+(`/etc/gitweb.conf` following example):
----------------------------------------------------------------------------
@stylesheets = ("/some/absolute/path/gitweb.css");
$my_uri = "/";
@@ -575,7 +575,7 @@ like this:
Here actual project root is passed to gitweb via `GITWEB_PROJECT_ROOT`
environment variable from a web server, so you need to put the following
-line in gitweb configuration file ('/etc/gitweb.conf' in above example):
+line in gitweb configuration file (`/etc/gitweb.conf` in above example):
--------------------------------------------------------------------------
$projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/pub/git";
--------------------------------------------------------------------------
@@ -585,7 +585,7 @@ referenced by `$per_request_config`;
These configurations enable two things. First, each unix user (`<user>`) of
the server will be able to browse through gitweb Git repositories found in
-'~/public_git/' with the following url:
+`~/public_git/` with the following url:
http://git.example.org/~<user>/
@@ -596,7 +596,7 @@ If you already use `mod_userdir` in your virtual host or you don't want to
use the \'~' as first character, just comment or remove the second rewrite
rule, and uncomment one of the following according to what you want.
-Second, repositories found in '/pub/scm/' and '/var/git/' will be accessible
+Second, repositories found in `/pub/scm/` and `/var/git/` will be accessible
through `http://git.example.org/scm/` and `http://git.example.org/var/`.
You can add as many project roots as you want by adding rewrite rules like
the third and the fourth.
@@ -614,7 +614,7 @@ that it consumes and produces URLs in the form
http://git.example.com/project.git/shortlog/sometag
i.e. without 'gitweb.cgi' part, by using a configuration such as the
-following. This configuration assumes that '/var/www/gitweb' is the
+following. This configuration assumes that `/var/www/gitweb` is the
DocumentRoot of your webserver, contains the gitweb.cgi script and
complementary static files (stylesheet, favicon, JavaScript):
@@ -645,9 +645,9 @@ parameter.
`@stylesheets`, `$my_uri` and `$home_link`, but you lose "dumb client"
access to your project .git dirs (described in "Single URL for gitweb and
for fetching" section). A possible workaround for the latter is the
-following: in your project root dir (e.g. '/pub/git') have the projects
-named *without* a .git extension (e.g. '/pub/git/project' instead of
-'/pub/git/project.git') and configure Apache as follows:
+following: in your project root dir (e.g. `/pub/git`) have the projects
+named *without* a .git extension (e.g. `/pub/git/project` instead of
+`/pub/git/project.git`) and configure Apache as follows:
----------------------------------------------------------------------------
<VirtualHost *:80>
ServerAlias git.example.com
@@ -681,7 +681,7 @@ cloned), while
will provide human-friendly gitweb access.
This solution is not 100% bulletproof, in the sense that if some project has
-a named ref (branch, tag) starting with 'git/', then paths such as
+a named ref (branch, tag) starting with `git/`, then paths such as
http://git.example.com/project/command/abranch..git/abranch
@@ -697,7 +697,7 @@ SEE ALSO
--------
linkgit:gitweb.conf[5], linkgit:git-instaweb[1]
-'gitweb/README', 'gitweb/INSTALL'
+`gitweb/README`, `gitweb/INSTALL`
GIT
---
diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt
index 023ca95..8d38ae6 100644
--- a/Documentation/glossary-content.txt
+++ b/Documentation/glossary-content.txt
@@ -287,6 +287,15 @@ This commit is referred to as a "merge commit", or sometimes just a
origin/name-of-upstream-branch, which you can see using
`git branch -r`.
+[[def_overlay]]overlay::
+ Only update and add files to the working directory, but don't
+ delete them, similar to how 'cp -R' would update the contents
+ in the destination directory. This is the default mode in a
+ <<def_checkout,checkout>> when checking out files from the
+ <<def_index,index>> or a <<def_tree-ish,tree-ish>>. In
+ contrast, no-overlay mode also deletes tracked files not
+ present in the source, similar to 'rsync --delete'.
+
[[def_pack]]pack::
A set of objects which have been compressed into one file (to save space
or to transmit them efficiently).
diff --git a/Documentation/howto/setup-git-server-over-http.txt b/Documentation/howto/setup-git-server-over-http.txt
index f44e5e9..bfe6f9b 100644
--- a/Documentation/howto/setup-git-server-over-http.txt
+++ b/Documentation/howto/setup-git-server-over-http.txt
@@ -244,8 +244,8 @@ Using a proxy:
--------------
If you have to access the WebDAV server from behind an HTTP(S) proxy,
-set the variable 'all_proxy' to 'http://proxy-host.com:port', or
-'http://login-on-proxy:passwd-on-proxy@proxy-host.com:port'. See 'man
+set the variable 'all_proxy' to `http://proxy-host.com:port`, or
+`http://login-on-proxy:passwd-on-proxy@proxy-host.com:port`. See 'man
curl' for details.
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 92a7d93..79a00d2 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -32,6 +32,13 @@ they run `git merge`. To make it easier to adjust such scripts to the
updated behaviour, the environment variable `GIT_MERGE_AUTOEDIT` can be
set to `no` at the beginning of them.
+--cleanup=<mode>::
+ This option determines how the merge message will be cleaned up before
+ commiting. See linkgit:git-commit[1] for more details. In addition, if
+ the '<mode>' is given a value of `scissors`, scissors will be appended
+ to `MERGE_MSG` before being passed on to the commit machinery in the
+ case of a merge conflict.
+
--ff::
When the merge resolves as a fast-forward, only update the branch
pointer, without creating a merge commit. This is the default
@@ -95,6 +102,8 @@ merge.
+
With --no-squash perform the merge and commit the result. This
option can be used to override --squash.
++
+With --squash, --commit is not allowed, and will fail.
-s <strategy>::
--strategy=<strategy>::
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index ca959a7..286fc16 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -708,6 +708,16 @@ ifdef::git-rev-list[]
Only useful with `--objects`; print the object IDs that are not
in packs.
+--object-names::
+ Only useful with `--objects`; print the names of the object IDs
+ that are found. This is the default behavior.
+
+--no-object-names::
+ Only useful with `--objects`; does not print the names of the object
+ IDs that are found. This inverts `--object-names`. This flag allows
+ the output to be more easily parsed by commands such as
+ linkgit:git-cat-file[1].
+
--filter=<filter-spec>::
Only useful with one of the `--objects*`; omits objects (usually
blobs) from the list of printed objects. The '<filter-spec>'
@@ -725,9 +735,6 @@ specification contained in the blob (or blob-expression) '<blob-ish>'
to omit blobs that would not be not required for a sparse checkout on
the requested refs.
+
-The form '--filter=sparse:path=<path>' similarly uses a sparse-checkout
-specification contained in <path>.
-+
The form '--filter=tree:<depth>' omits all blobs and trees whose depth
from the root tree is >= <depth> (minimum depth if an object is located
at multiple depths in the commits traversed). <depth>=0 will not include
@@ -737,13 +744,17 @@ tree and blobs which are referenced directly by a commit reachable from
<commit> or an explicitly-given object. <depth>=2 is like <depth>=1
while also including trees and blobs one more level removed from an
explicitly-given commit or tree.
++
+Note that the form '--filter=sparse:path=<path>' that wants to read
+from an arbitrary path on the filesystem has been dropped for security
+reasons.
--no-filter::
Turn off any previous `--filter=` argument.
--filter-print-omitted::
Only useful with `--filter=`; prints a list of the objects omitted
- by the filter. Object IDs are prefixed with a ``~'' character.
+ by the filter. Object IDs are prefixed with a ``~'' character.
--missing=<missing-action>::
A debug option to help with future "partial clone" development.
@@ -805,12 +816,13 @@ include::pretty-options.txt[]
author's). If `-local` is appended to the format (e.g.,
`iso-local`), the user's local time zone is used instead.
+
+--
`--date=relative` shows dates relative to the current time,
e.g. ``2 hours ago''. The `-local` option has no effect for
`--date=relative`.
-+
+
`--date=local` is an alias for `--date=default-local`.
-+
+
`--date=iso` (or `--date=iso8601`) shows timestamps in a ISO 8601-like format.
The differences to the strict ISO 8601 format are:
@@ -818,15 +830,14 @@ The differences to the strict ISO 8601 format are:
- 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.
-+
+
`--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.
-+
+
`--date=raw` shows the date as seconds since the epoch (1970-01-01
00:00:00 UTC), followed by a space, and then the timezone as an offset
from UTC (a `+` or `-` with four digits; the first two are hours, and
@@ -835,28 +846,28 @@ with `strftime("%s %z")`).
Note that the `-local` option does not affect the seconds-since-epoch
value (which is always measured in UTC), but does switch the accompanying
timezone value.
-+
+
`--date=human` shows the timezone if the timezone does not match the
current time-zone, and doesn't print the whole date if that matches
(ie skip printing year for dates that are "this year", but also skip
the whole date itself if it's in the last few days and we can just say
what weekday it was). For older dates the hour and minute is also
omitted.
-+
+
`--date=unix` shows the date as a Unix epoch timestamp (seconds since
1970). As with `--raw`, this is always in UTC and therefore `-local`
has no effect.
-+
+
`--date=format:...` feeds the format `...` to your system `strftime`,
except for %z and %Z, which are handled internally.
Use `--date=format:%c` to show the date in your system locale's
preferred format. See the `strftime` manual for a complete list of
format placeholders. When using `-local`, the correct syntax is
`--date=format-local:...`.
-+
+
`--date=default` is the default format, and is similar to
`--date=rfc2822`, with a few exceptions:
-
+--
- there is no comma after the day-of-week
- the time zone is omitted when the local time zone is used
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index a1c7a65..97f995e 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -58,14 +58,14 @@ when you run `git merge`.
when you run `git cherry-pick`.
+
Note that any of the 'refs/*' cases above may come either from
-the '$GIT_DIR/refs' directory or from the '$GIT_DIR/packed-refs' file.
+the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
While the ref name encoding is unspecified, UTF-8 is preferred as
some output processing may assume ref names in UTF-8.
'@'::
'@' alone is a shortcut for `HEAD`.
-'<refname>@{<date>}', e.g. 'master@\{yesterday\}', 'HEAD@{5 minutes ago}'::
+'[<refname>]@{<date>}', e.g. 'master@\{yesterday\}', 'HEAD@{5 minutes ago}'::
A ref followed by the suffix '@' with a date specification
enclosed in a brace
pair (e.g. '\{yesterday\}', '{1 month 2 weeks 3 days 1 hour 1
@@ -95,7 +95,7 @@ some output processing may assume ref names in UTF-8.
The construct '@{-<n>}' means the <n>th branch/commit checked out
before the current one.
-'<branchname>@\{upstream\}', e.g. 'master@\{upstream\}', '@\{u\}'::
+'[<branchname>]@\{upstream\}', e.g. 'master@\{upstream\}', '@\{u\}'::
The suffix '@\{upstream\}' to a branchname (short form '<branchname>@\{u\}')
refers to the branch that the branch specified by branchname is set to build on
top of (configured with `branch.<name>.remote` and
@@ -103,12 +103,12 @@ some output processing may assume ref names in UTF-8.
current one. These suffixes are also accepted when spelled in uppercase, and
they mean the same thing no matter the case.
-'<branchname>@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
+'[<branchname>]@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
The suffix '@\{push}' reports the branch "where we would push to" if
`git push` were run while `branchname` was checked out (or the current
`HEAD` if no branchname is specified). Since our push destination is
in a remote repository, of course, we report the local tracking branch
- that corresponds to that branch (i.e., something in 'refs/remotes/').
+ that corresponds to that branch (i.e., something in `refs/remotes/`).
+
Here's an example to make it more clear:
+
@@ -131,7 +131,7 @@ from one location and push to another. In a non-triangular workflow,
This suffix is also accepted when spelled in uppercase, and means the same
thing no matter the case.
-'<rev>{caret}', e.g. 'HEAD{caret}, v1.5.1{caret}0'::
+'<rev>{caret}[<n>]', e.g. 'HEAD{caret}, v1.5.1{caret}0'::
A suffix '{caret}' to a revision parameter means the first parent of
that commit object. '{caret}<n>' means the <n>th parent (i.e.
'<rev>{caret}'
@@ -139,7 +139,9 @@ thing no matter the case.
'<rev>{caret}0' means the commit itself and is used when '<rev>' is the
object name of a tag object that refers to a commit object.
-'<rev>{tilde}<n>', e.g. 'master{tilde}3'::
+'<rev>{tilde}[<n>]', e.g. 'HEAD{tilde}, master{tilde}3'::
+ A suffix '{tilde}' to a revision parameter means the first parent of
+ that commit object.
A suffix '{tilde}<n>' to a revision parameter means the commit
object that is the <n>th generation ancestor of the named
commit object, following only the first parents. I.e. '<rev>{tilde}3' is
@@ -159,12 +161,12 @@ thing no matter the case.
'<rev>{caret}0'
is a short-hand for '<rev>{caret}\{commit\}'.
+
-'rev{caret}\{object\}' can be used to make sure 'rev' names an
-object that exists, without requiring 'rev' to be a tag, and
-without dereferencing 'rev'; because a tag is already an object,
+'<rev>{caret}\{object\}' can be used to make sure '<rev>' names an
+object that exists, without requiring '<rev>' to be a tag, and
+without dereferencing '<rev>'; because a tag is already an object,
it does not have to be dereferenced even once to get to an object.
+
-'rev{caret}\{tag\}' can be used to ensure that 'rev' identifies an
+'<rev>{caret}\{tag\}' can be used to ensure that '<rev>' identifies an
existing tag object.
'<rev>{caret}{}', e.g. 'v0.99.8{caret}{}'::
@@ -194,19 +196,16 @@ existing tag object.
Depending on the given text, the shell's word splitting rules might
require additional quoting.
-'<rev>:<path>', e.g. 'HEAD:README', ':README', 'master:./README'::
+'<rev>:<path>', e.g. 'HEAD:README', 'master:./README'::
A suffix ':' followed by a path names the blob or tree
at the given path in the tree-ish object named by the part
before the colon.
- ':path' (with an empty part before the colon)
- is a special case of the syntax described next: content
- recorded in the index at the given path.
A path starting with './' or '../' is relative to the current working directory.
The given path will be converted to be relative to the working tree's root directory.
This is most useful to address a blob or tree from a commit or tree that has
the same tree structure as the working tree.
-':<n>:<path>', e.g. ':0:README', ':README'::
+':[<n>:]<path>', e.g. ':0:README', ':README'::
A colon, optionally followed by a stage number (0 to 3) and a
colon, followed by a path, names a blob object in the
index at the given path. A missing stage number (and the colon
@@ -302,7 +301,7 @@ The 'r1{caret}@' notation means all parents of 'r1'.
The 'r1{caret}!' notation includes commit 'r1' but excludes all of its parents.
By itself, this notation denotes the single commit 'r1'.
-The '<rev>{caret}-<n>' notation includes '<rev>' but excludes the <n>th
+The '<rev>{caret}-[<n>]' notation includes '<rev>' but excludes the <n>th
parent (i.e. a shorthand for '<rev>{caret}<n>..<rev>'), with '<n>' = 1 if
not given. This is typically useful for merge commits where you
can just pass '<commit>{caret}-' to get all the commits in the branch
diff --git a/Documentation/sequencer.txt b/Documentation/sequencer.txt
index 5747f44..5a57c4a 100644
--- a/Documentation/sequencer.txt
+++ b/Documentation/sequencer.txt
@@ -1,6 +1,6 @@
--continue::
Continue the operation in progress using the information in
- '.git/sequencer'. Can be used to continue after resolving
+ `.git/sequencer`. Can be used to continue after resolving
conflicts in a failed cherry-pick or revert.
--quit::
diff --git a/Documentation/technical/api-config.txt b/Documentation/technical/api-config.txt
index fa39ac9..7d20716 100644
--- a/Documentation/technical/api-config.txt
+++ b/Documentation/technical/api-config.txt
@@ -229,7 +229,7 @@ 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;
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index 2b036d7..2e2e7c1 100644
--- a/Documentation/technical/api-parse-options.txt
+++ b/Documentation/technical/api-parse-options.txt
@@ -198,8 +198,10 @@ There are some macros to easily define options:
The filename will be prefixed by passing the filename along with
the prefix argument of `parse_options()` to `prefix_filename()`.
-`OPT_ARGUMENT(long, description)`::
+`OPT_ARGUMENT(long, &int_var, description)`::
Introduce a long-option argument that will be kept in `argv[]`.
+ If this option was seen, `int_var` will be set to one (except
+ if a `NULL` pointer was passed).
`OPT_NUMBER_CALLBACK(&var, description, func_ptr)`::
Recognize numerical options like -123 and feed the integer as
diff --git a/Documentation/technical/api-trace2.txt b/Documentation/technical/api-trace2.txt
index 2de565f..f7ffe7d 100644
--- a/Documentation/technical/api-trace2.txt
+++ b/Documentation/technical/api-trace2.txt
@@ -22,21 +22,41 @@ Targets are defined using a VTable allowing easy extension to other
formats in the future. This might be used to define a binary format,
for example.
+Trace2 is controlled using `trace2.*` config values in the system and
+global config files and `GIT_TRACE2*` environment variables. Trace2 does
+not read from repo local or worktree config files or respect `-c`
+command line config settings.
+
== Trace2 Targets
Trace2 defines the following set of Trace2 Targets.
Format details are given in a later section.
-`GIT_TR2` (NORMAL)::
+=== The Normal Format Target
+
+The normal format target is a tradition printf format and similar
+to GIT_TRACE format. This format is enabled with the `GIT_TRACE2`
+environment variable or the `trace2.normalTarget` system or global
+config setting.
+
+For example
- a simple printf format like GIT_TRACE.
-+
------------
-$ export GIT_TR2=~/log.normal
+$ export GIT_TRACE2=~/log.normal
$ git version
git version 2.20.1.155.g426c96fcdb
------------
-+
+
+or
+
+------------
+$ git config --global trace2.normalTarget ~/log.normal
+$ git version
+git version 2.20.1.155.g426c96fcdb
+------------
+
+yields
+
------------
$ cat ~/log.normal
12:28:42.620009 common-main.c:38 version 2.20.1.155.g426c96fcdb
@@ -46,76 +66,86 @@ $ cat ~/log.normal
12:28:42.621250 trace2/tr2_tgt_normal.c:124 atexit elapsed:0.001265 code:0
------------
-`GIT_TR2_PERF` (PERF)::
+=== The Performance Format Target
+
+The performance format target (PERF) is a column-based format to
+replace GIT_TRACE_PERFORMANCE and is suitable for development and
+testing, possibly to complement tools like gprof. This format is
+enabled with the `GIT_TRACE2_PERF` environment variable or the
+`trace2.perfTarget` system or global config setting.
+
+For example
- a column-based format to replace GIT_TRACE_PERFORMANCE suitable for
- development and testing, possibly to complement tools like gprof.
-+
------------
-$ export GIT_TR2_PERF=~/log.perf
+$ export GIT_TRACE2_PERF=~/log.perf
$ git version
git version 2.20.1.155.g426c96fcdb
------------
-+
+
+or
+
+------------
+$ git config --global trace2.perfTarget ~/log.perf
+$ git version
+git version 2.20.1.155.g426c96fcdb
+------------
+
+yields
+
------------
$ cat ~/log.perf
12:28:42.620675 common-main.c:38 | d0 | main | version | | | | | 2.20.1.155.g426c96fcdb
-12:28:42.621001 common-main.c:39 | d0 | main | start | | | | | git version
+12:28:42.621001 common-main.c:39 | d0 | main | start | | 0.001173 | | | git version
12:28:42.621111 git.c:432 | d0 | main | cmd_name | | | | | version (version)
12:28:42.621225 git.c:662 | d0 | main | exit | | 0.001227 | | | code:0
12:28:42.621259 trace2/tr2_tgt_perf.c:211 | d0 | main | atexit | | 0.001265 | | | code:0
------------
-`GIT_TR2_EVENT` (EVENT)::
+=== The Event Format Target
+
+The event format target is a JSON-based format of event data suitable
+for telemetry analysis. This format is enabled with the `GIT_TRACE2_EVENT`
+environment variable or the `trace2.eventTarget` system or global config
+setting.
+
+For example
- a JSON-based format of event data suitable for telemetry analysis.
-+
------------
-$ export GIT_TR2_EVENT=~/log.event
+$ export GIT_TRACE2_EVENT=~/log.event
$ git version
git version 2.20.1.155.g426c96fcdb
------------
-+
-------------
-$ cat ~/log.event
-{"event":"version","sid":"1547659722619736-11614","thread":"main","time":"2019-01-16 17:28:42.620713","file":"common-main.c","line":38,"evt":"1","exe":"2.20.1.155.g426c96fcdb"}
-{"event":"start","sid":"1547659722619736-11614","thread":"main","time":"2019-01-16 17:28:42.621027","file":"common-main.c","line":39,"argv":["git","version"]}
-{"event":"cmd_name","sid":"1547659722619736-11614","thread":"main","time":"2019-01-16 17:28:42.621122","file":"git.c","line":432,"name":"version","hierarchy":"version"}
-{"event":"exit","sid":"1547659722619736-11614","thread":"main","time":"2019-01-16 17:28:42.621236","file":"git.c","line":662,"t_abs":0.001227,"code":0}
-{"event":"atexit","sid":"1547659722619736-11614","thread":"main","time":"2019-01-16 17:28:42.621268","file":"trace2/tr2_tgt_event.c","line":163,"t_abs":0.001265,"code":0}
-------------
-== Enabling a Target
+or
-A Trace2 Target is enabled when the corresponding environment variable
-(`GIT_TR2`, `GIT_TR2_PERF`, or `GIT_TR2_EVENT`) is set. The following
-values are recognized.
-
-`0`::
-`false`::
-
- Disables the target.
-
-`1`::
-`true`::
-
- Enables the target and writes stream to `STDERR`.
+------------
+$ git config --global trace2.eventTarget ~/log.event
+$ git version
+git version 2.20.1.155.g426c96fcdb
+------------
-`[2-9]`::
+yields
- Enables the target and writes to the already opened file descriptor.
+------------
+$ cat ~/log.event
+{"event":"version","sid":"sid":"20190408T191610.507018Z-H9b68c35f-P000059a8","thread":"main","time":"2019-01-16T17:28:42.620713Z","file":"common-main.c","line":38,"evt":"1","exe":"2.20.1.155.g426c96fcdb"}
+{"event":"start","sid":"20190408T191610.507018Z-H9b68c35f-P000059a8","thread":"main","time":"2019-01-16T17:28:42.621027Z","file":"common-main.c","line":39,"t_abs":0.001173,"argv":["git","version"]}
+{"event":"cmd_name","sid":"20190408T191610.507018Z-H9b68c35f-P000059a8","thread":"main","time":"2019-01-16T17:28:42.621122Z","file":"git.c","line":432,"name":"version","hierarchy":"version"}
+{"event":"exit","sid":"20190408T191610.507018Z-H9b68c35f-P000059a8","thread":"main","time":"2019-01-16T17:28:42.621236Z","file":"git.c","line":662,"t_abs":0.001227,"code":0}
+{"event":"atexit","sid":"20190408T191610.507018Z-H9b68c35f-P000059a8","thread":"main","time":"2019-01-16T17:28:42.621268Z","file":"trace2/tr2_tgt_event.c","line":163,"t_abs":0.001265,"code":0}
+------------
-`<absolute-pathname>`::
+=== Enabling a Target
- Enables the target, opens and writes to the file in append mode.
+To enable a target, set the corresponding environment variable or
+system or global config value to one of the following:
-`af_unix:[<socket_type>:]<absolute-pathname>`::
+include::../trace2-target-values.txt[]
- Enables the target, opens and writes to a Unix Domain Socket
- (on platforms that support them).
-+
-Socket type can be either `stream` or `dgram`. If the socket type is
-omitted, Git will try both.
+If the target already exists and is a directory, the traces will be
+written to files (one per process) underneath the given directory. They
+will be named according to the last component of the SID (optionally
+followed by a counter to avoid filename collisions).
== Trace2 API
@@ -160,17 +190,23 @@ purposes.
These are concerned with the lifetime of the overall git process.
+`void trace2_initialize_clock()`::
+
+ Initialize the Trace2 start clock and nothing else. This should
+ be called at the very top of main() to capture the process start
+ time and reduce startup order dependencies.
+
`void trace2_initialize()`::
Determines if any Trace2 Targets should be enabled and
- initializes the Trace2 facility. This includes starting the
- elapsed time clocks and thread local storage (TLS).
+ initializes the Trace2 facility. This includes setting up the
+ Trace2 thread local storage (TLS).
+
This function emits a "version" message containing the version of git
and the Trace2 protocol.
+
This function should be called from `main()` as early as possible in
-the life of the process.
+the life of the process after essential process initialization.
`int trace2_is_enabled()`::
@@ -237,15 +273,16 @@ significantly affects program performance or behavior, such as
Emits a "def_param" messages for "important" configuration
settings.
+
-The environment variable `GIT_TR2_CONFIG_PARAMS` can be set to a
+The environment variable `GIT_TRACE2_CONFIG_PARAMS` or the `trace2.configParams`
+config value can be set to a
list of patterns of important configuration settings, for example:
`core.*,remote.*.url`. This function will iterate over all config
settings and emit a "def_param" message for each match.
`void trace2_cmd_set_config(const char *key, const char *value)`::
- Emits a "def_param" message for a specific configuration
- setting IFF it matches the `GIT_TR2_CONFIG_PARAMS` pattern.
+ Emits a "def_param" message for a new or updated key/value
+ pair IF `key` is considered important.
+
This is used to hook into `git_config_set()` and catch any
configuration changes and update a value previously reported by
@@ -412,9 +449,6 @@ recursive tree walk.
=== NORMAL Format
-NORMAL format is enabled when the `GIT_TR2` environment variable is
-set.
-
Events are written as lines of the form:
------------
@@ -431,8 +465,8 @@ Events are written as lines of the form:
Note that this may contain embedded LF or CRLF characters that are
not escaped, so the event may spill across multiple lines.
-If `GIT_TR2_BRIEF` is true, the `time`, `filename`, and `line` fields
-are omitted.
+If `GIT_TRACE2_BRIEF` or `trace2.normalBrief` is true, the `time`, `filename`,
+and `line` fields are omitted.
This target is intended to be more of a summary (like GIT_TRACE) and
less detailed than the other targets. It ignores thread, region, and
@@ -440,9 +474,6 @@ data messages, for example.
=== PERF Format
-PERF format is enabled when the `GIT_TR2_PERF` environment variable
-is set.
-
Events are written as lines of the form:
------------
@@ -502,8 +533,8 @@ This field is in anticipation of in-proc submodules in the future.
15:33:33.532712 wt-status.c:2331 | d0 | main | region_leave | r1 | 0.127568 | 0.001504 | status | label:print
------------
-If `GIT_TR2_PERF_BRIEF` is true, the `time`, `file`, and `line`
-fields are omitted.
+If `GIT_TRACE2_PERF_BRIEF` or `trace2.perfBrief` is true, the `time`, `file`,
+and `line` fields are omitted.
------------
d0 | main | region_leave | r1 | 0.011717 | 0.009122 | index | label:preload
@@ -514,9 +545,6 @@ during development and is quite noisy.
=== EVENT Format
-EVENT format is enabled when the `GIT_TR2_EVENT` environment
-variable is set.
-
Each event is a JSON-object containing multiple key/value pairs
written as a single line and followed by a LF.
@@ -534,11 +562,11 @@ The following key/value pairs are common to all events:
------------
{
"event":"version",
- "sid":"1547659722619736-11614",
+ "sid":"20190408T191827.272759Z-H9b68c35f-P00003510",
"thread":"main",
- "time":"2019-01-16 17:28:42.620713",
+ "time":"2019-04-08T19:18:27.282761Z",
"file":"common-main.c",
- "line":38,
+ "line":42,
...
}
------------
@@ -570,9 +598,9 @@ The following key/value pairs are common to all events:
`"repo":<repo-id>`::
when present, is the integer repo-id as described previously.
-If `GIT_TR2_EVENT_BRIEF` is true, the `file` and `line` fields are omitted
-from all events and the `time` field is only present on the "start" and
-"atexit" events.
+If `GIT_TRACE2_EVENT_BRIEF` or `trace2.eventBrief` is true, the `file`
+and `line` fields are omitted from all events and the `time` field is
+only present on the "start" and "atexit" events.
==== Event-Specific Key/Value Pairs
@@ -595,6 +623,7 @@ from all events and the `time` field is only present on the "start" and
{
"event":"start",
...
+ "t_abs":0.001227, # elapsed time in seconds
"argv":["git","version"]
}
------------
@@ -882,7 +911,7 @@ visited.
The `category` field may be used in a future enhancement to
do category-based filtering.
+
-The `GIT_TR2_EVENT_NESTING` environment variable can be used to
+`GIT_TRACE2_EVENT_NESTING` or `trace2.eventNesting` can be used to
filter deeply nested regions and data events. It defaults to "2".
`"region_leave"`::
@@ -1010,8 +1039,8 @@ rev-list, and gc. This example also shows that fetch took
5.199 seconds and of that 4.932 was in ssh.
+
----------------
-$ export GIT_TR2_BRIEF=1
-$ export GIT_TR2=~/log.normal
+$ export GIT_TRACE2_BRIEF=1
+$ export GIT_TRACE2=~/log.normal
$ git fetch origin
...
----------------
@@ -1046,8 +1075,8 @@ its name as "gc", it also reports the hierarchy as "fetch/gc".
indented for clarity.)
+
----------------
-$ export GIT_TR2_BRIEF=1
-$ export GIT_TR2=~/log.normal
+$ export GIT_TRACE2_BRIEF=1
+$ export GIT_TRACE2=~/log.normal
$ git fetch origin
...
----------------
@@ -1105,14 +1134,14 @@ In this example, scanning for untracked files ran from +0.012568 to
+0.027149 (since the process started) and took 0.014581 seconds.
+
----------------
-$ export GIT_TR2_PERF_BRIEF=1
-$ export GIT_TR2_PERF=~/log.perf
+$ export GIT_TRACE2_PERF_BRIEF=1
+$ export GIT_TRACE2_PERF=~/log.perf
$ git status
...
$ cat ~/log.perf
d0 | main | version | | | | | 2.20.1.160.g5676107ecd.dirty
-d0 | main | start | | | | | git status
+d0 | main | start | | 0.001173 | | | git status
d0 | main | def_repo | r1 | | | | worktree:/Users/jeffhost/work/gfw
d0 | main | cmd_name | | | | | status (status)
...
@@ -1151,13 +1180,13 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
We can further investigate the time spent scanning for untracked files.
+
----------------
-$ export GIT_TR2_PERF_BRIEF=1
-$ export GIT_TR2_PERF=~/log.perf
+$ export GIT_TRACE2_PERF_BRIEF=1
+$ export GIT_TRACE2_PERF=~/log.perf
$ git status
...
$ cat ~/log.perf
d0 | main | version | | | | | 2.20.1.162.gb4ccea44db.dirty
-d0 | main | start | | | | | git status
+d0 | main | start | | 0.001173 | | | git status
d0 | main | def_repo | r1 | | | | worktree:/Users/jeffhost/work/gfw
d0 | main | cmd_name | | | | | status (status)
...
@@ -1207,13 +1236,13 @@ int read_index_from(struct index_state *istate, const char *path,
This example shows that the index contained 3552 entries.
+
----------------
-$ export GIT_TR2_PERF_BRIEF=1
-$ export GIT_TR2_PERF=~/log.perf
+$ export GIT_TRACE2_PERF_BRIEF=1
+$ export GIT_TRACE2_PERF=~/log.perf
$ git status
...
$ cat ~/log.perf
d0 | main | version | | | | | 2.20.1.156.gf9916ae094.dirty
-d0 | main | start | | | | | git status
+d0 | main | start | | 0.001173 | | | git status
d0 | main | def_repo | r1 | | | | worktree:/Users/jeffhost/work/gfw
d0 | main | cmd_name | | | | | status (status)
d0 | main | region_enter | r1 | 0.001791 | | index | label:do_read_index .git/index
@@ -1281,8 +1310,8 @@ Data events are tagged with the active thread name. They are used
to report the per-thread parameters.
+
----------------
-$ export GIT_TR2_PERF_BRIEF=1
-$ export GIT_TR2_PERF=~/log.perf
+$ export GIT_TRACE2_PERF_BRIEF=1
+$ export GIT_TRACE2_PERF=~/log.perf
$ git status
...
$ cat ~/log.perf
diff --git a/Documentation/technical/commit-graph.txt b/Documentation/technical/commit-graph.txt
index 7805b09..fb53341 100644
--- a/Documentation/technical/commit-graph.txt
+++ b/Documentation/technical/commit-graph.txt
@@ -127,23 +127,6 @@ Design Details
helpful for these clones, anyway. The commit-graph will not be read or
written when shallow commits are present.
-Future Work
------------
-
-- After computing and storing generation numbers, we must make graph
- walks aware of generation numbers to gain the performance benefits they
- enable. This will mostly be accomplished by swapping a commit-date-ordered
- priority queue with one ordered by generation number. The following
- operations are important candidates:
-
- - 'log --topo-order'
- - 'tag --merged'
-
-- A server could provide a commit-graph file as part of the network protocol
- to avoid extra calculations by clients. This feature is only of benefit if
- the user is willing to trust the file, because verifying the file is correct
- is as hard as computing it from scratch.
-
Related Links
-------------
[0] https://bugs.chromium.org/p/git/issues/detail?id=8
diff --git a/Documentation/technical/directory-rename-detection.txt b/Documentation/technical/directory-rename-detection.txt
index 1c0086e..844629c 100644
--- a/Documentation/technical/directory-rename-detection.txt
+++ b/Documentation/technical/directory-rename-detection.txt
@@ -20,8 +20,8 @@ More interesting possibilities exist, though, such as:
* one side of history renames x -> z, and the other renames some file to
x/e, causing the need for the merge to do a transitive rename.
- * one side of history renames x -> z, but also renames all files within
- x. For example, x/a -> z/alpha, x/b -> z/bravo, etc.
+ * one side of history renames x -> z, but also renames all files within x.
+ For example, x/a -> z/alpha, x/b -> z/bravo, etc.
* both 'x' and 'y' being merged into a single directory 'z', with a
directory rename being detected for both x->z and y->z.
diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt
index 7a2375a..c73e72d 100644
--- a/Documentation/technical/pack-protocol.txt
+++ b/Documentation/technical/pack-protocol.txt
@@ -657,14 +657,14 @@ can be rejected.
An example client/server communication might look like this:
----
- S: 007c74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/local\0report-status delete-refs ofs-delta\n
+ S: 006274730d410fcb6603ace96f1dc55ea6196122532d refs/heads/local\0report-status delete-refs ofs-delta\n
S: 003e7d1665144a3a975c05f1f43902ddaf084e784dbe refs/heads/debug\n
S: 003f74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/master\n
- S: 003f74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/team\n
+ S: 003d74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/team\n
S: 0000
- C: 003e7d1665144a3a975c05f1f43902ddaf084e784dbe 74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/debug\n
- C: 003e74730d410fcb6603ace96f1dc55ea6196122532d 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a refs/heads/master\n
+ C: 00677d1665144a3a975c05f1f43902ddaf084e784dbe 74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/debug\n
+ C: 006874730d410fcb6603ace96f1dc55ea6196122532d 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a refs/heads/master\n
C: 0000
C: [PACKDATA]
diff --git a/Documentation/technical/protocol-v2.txt b/Documentation/technical/protocol-v2.txt
index ead85ce..03264c7 100644
--- a/Documentation/technical/protocol-v2.txt
+++ b/Documentation/technical/protocol-v2.txt
@@ -1,5 +1,5 @@
- Git Wire Protocol, Version 2
-==============================
+Git Wire Protocol, Version 2
+============================
This document presents a specification for a version 2 of Git's wire
protocol. Protocol v2 will improve upon v1 in the following ways:
@@ -22,8 +22,8 @@ will be commands which a client can request be executed. Once a command
has completed, a client can reuse the connection and request that other
commands be executed.
- Packet-Line Framing
----------------------
+Packet-Line Framing
+-------------------
All communication is done using packet-line framing, just as in v1. See
`Documentation/technical/pack-protocol.txt` and
@@ -34,8 +34,8 @@ In protocol v2 these special packets will have the following semantics:
* '0000' Flush Packet (flush-pkt) - indicates the end of a message
* '0001' Delimiter Packet (delim-pkt) - separates sections of a message
- Initial Client Request
-------------------------
+Initial Client Request
+----------------------
In general a client can request to speak protocol v2 by sending
`version=2` through the respective side-channel for the transport being
@@ -43,22 +43,22 @@ used which inevitably sets `GIT_PROTOCOL`. More information can be
found in `pack-protocol.txt` and `http-protocol.txt`. In all cases the
response from the server is the capability advertisement.
- Git Transport
-~~~~~~~~~~~~~~~
+Git Transport
+~~~~~~~~~~~~~
When using the git:// transport, you can request to use protocol v2 by
sending "version=2" as an extra parameter:
003egit-upload-pack /project.git\0host=myserver.com\0\0version=2\0
- SSH and File Transport
-~~~~~~~~~~~~~~~~~~~~~~~~
+SSH and File Transport
+~~~~~~~~~~~~~~~~~~~~~~
When using either the ssh:// or file:// transport, the GIT_PROTOCOL
environment variable must be set explicitly to include "version=2".
- HTTP Transport
-~~~~~~~~~~~~~~~~
+HTTP Transport
+~~~~~~~~~~~~~~
When using the http:// or https:// transport a client makes a "smart"
info/refs request as described in `http-protocol.txt` and requests that
@@ -79,8 +79,8 @@ A v2 server would reply:
Subsequent requests are then made directly to the service
`$GIT_URL/git-upload-pack`. (This works the same for git-receive-pack).
- Capability Advertisement
---------------------------
+Capability Advertisement
+------------------------
A server which decides to communicate (based on a request from a client)
using protocol version 2, notifies the client by sending a version string
@@ -101,8 +101,8 @@ to be executed by the client.
key = 1*(ALPHA | DIGIT | "-_")
value = 1*(ALPHA | DIGIT | " -_.,?\/{}[]()<>!@#$%^&*+=:;")
- Command Request
------------------
+Command Request
+---------------
After receiving the capability advertisement, a client can then issue a
request to select the command it wants with any particular capabilities
@@ -137,8 +137,8 @@ command be executed or can terminate the connection. A client may
optionally send an empty request consisting of just a flush-pkt to
indicate that no more requests will be made.
- Capabilities
---------------
+Capabilities
+------------
There are two different types of capabilities: normal capabilities,
which can be used to to convey information or alter the behavior of a
@@ -153,8 +153,8 @@ management on the server side in order to function correctly. This
permits simple round-robin load-balancing on the server side, without
needing to worry about state management.
- agent
-~~~~~~~
+agent
+~~~~~
The server can advertise the `agent` capability with a value `X` (in the
form `agent=X`) to notify the client that the server is running version
@@ -168,8 +168,8 @@ printable ASCII characters except space (i.e., the byte range 32 < x <
and debugging purposes, and MUST NOT be used to programmatically assume
the presence or absence of particular features.
- ls-refs
-~~~~~~~~~
+ls-refs
+~~~~~~~
`ls-refs` is the command used to request a reference advertisement in v2.
Unlike the current reference advertisement, ls-refs takes in arguments
@@ -199,8 +199,8 @@ The output of ls-refs is as follows:
symref = "symref-target:" symref-target
peeled = "peeled:" obj-id
- fetch
-~~~~~~~
+fetch
+~~~~~
`fetch` is the command used to fetch a packfile in v2. It can be looked
at as a modified version of the v1 fetch where the ref-advertisement is
@@ -444,8 +444,8 @@ header.
2 - progress messages
3 - fatal error message just before stream aborts
- server-option
-~~~~~~~~~~~~~~~
+server-option
+~~~~~~~~~~~~~
If advertised, indicates that any number of server specific options can be
included in a request. This is done by sending each option as a
diff --git a/Documentation/trace2-target-values.txt b/Documentation/trace2-target-values.txt
new file mode 100644
index 0000000..27d3c64
--- /dev/null
+++ b/Documentation/trace2-target-values.txt
@@ -0,0 +1,10 @@
+--
+* `0` or `false` - Disables the target.
+* `1` or `true` - Writes to `STDERR`.
+* `[2-9]` - Writes to the already opened file descriptor.
+* `<absolute-pathname>` - Writes to the file in append mode.
+* `af_unix:[<socket_type>:]<absolute-pathname>` - Write to a
+Unix DomainSocket (on platforms that support them). Socket
+type can be either `stream` or `dgram`; if omitted Git will
+try both.
+--
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index b05da95..bc354fe 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -62,7 +62,7 @@ may be used:
where <address> may be a path, a server and path, or an arbitrary
URL-like string recognized by the specific remote helper being
-invoked. See linkgit:gitremote-helpers[1] for details.
+invoked. See linkgit:gitremote-helpers[7] for details.
If there are a large number of similarly-named remote repositories and
you want to use a different format for them (such that the URLs you