summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/.gitignore1
-rw-r--r--Documentation/Makefile6
-rw-r--r--Documentation/RelNotes/2.15.1.txt26
-rw-r--r--Documentation/SubmittingPatches365
-rw-r--r--apply.c59
-rw-r--r--bisect.c33
-rw-r--r--bisect.h12
-rw-r--r--builtin/commit.c2
-rw-r--r--builtin/fmt-merge-msg.c2
-rw-r--r--builtin/merge-base.c40
-rw-r--r--builtin/merge.c1
-rw-r--r--builtin/pull.c17
-rw-r--r--builtin/rev-list.c3
-rw-r--r--commit.c7
-rw-r--r--commit.h18
-rw-r--r--compat/obstack.c5
-rw-r--r--compat/obstack.h5
-rw-r--r--compat/poll/poll.c3
-rw-r--r--compat/poll/poll.h3
-rw-r--r--compat/regex/regcomp.c5
-rw-r--r--compat/regex/regex.c5
-rw-r--r--compat/regex/regex.h5
-rw-r--r--compat/regex/regex_internal.c5
-rw-r--r--compat/regex/regex_internal.h5
-rw-r--r--compat/regex/regexec.c5
-rw-r--r--config.c6
-rw-r--r--contrib/completion/git-completion.bash3
-rw-r--r--contrib/credential/gnome-keyring/git-credential-gnome-keyring.c3
-rw-r--r--contrib/credential/libsecret/git-credential-libsecret.c3
-rw-r--r--contrib/emacs/git-blame.el5
-rw-r--r--contrib/emacs/git.el5
-rwxr-xr-xcontrib/fast-import/import-directories.perl3
-rwxr-xr-xcontrib/hg-to-git/hg-to-git.py3
-rw-r--r--ewah/bitmap.c3
-rw-r--r--ewah/ewah_bitmap.c3
-rw-r--r--ewah/ewah_io.c3
-rw-r--r--ewah/ewah_rlw.c3
-rw-r--r--ewah/ewok.h3
-rw-r--r--ewah/ewok_rlw.h3
-rwxr-xr-xgit-gui/git-gui.sh3
-rw-r--r--git-rebase--interactive.sh2
-rw-r--r--grep.c2
-rw-r--r--grep.h5
-rw-r--r--imap-send.c18
-rw-r--r--kwset.c4
-rw-r--r--kwset.h4
-rw-r--r--refs/files-backend.c18
-rw-r--r--refs/packed-backend.c94
-rw-r--r--refs/packed-backend.h9
-rw-r--r--sequencer.c45
-rw-r--r--sh-i18n--envsubst.c6
-rw-r--r--sha1_file.c4
-rwxr-xr-xt/t1409-avoid-packing-refs.sh118
-rwxr-xr-xt/t3426-rebase-submodule.sh17
-rwxr-xr-xt/t3600-rm.sh2
-rwxr-xr-xt/t4201-shortlog.sh5
-rwxr-xr-xt/t7001-mv.sh2
-rwxr-xr-xt/t9114-git-svn-dcommit-merge.sh4
-rw-r--r--t/test-lib.sh7
-rw-r--r--trace.c3
-rw-r--r--wrapper.c8
-rw-r--r--wt-status.c4
-rw-r--r--xdiff/xdiff.h4
-rw-r--r--xdiff/xdiffi.c4
-rw-r--r--xdiff/xdiffi.h4
-rw-r--r--xdiff/xemit.c4
-rw-r--r--xdiff/xemit.h4
-rw-r--r--xdiff/xinclude.h4
-rw-r--r--xdiff/xmacros.h4
-rw-r--r--xdiff/xmerge.c4
-rw-r--r--xdiff/xpatience.c4
-rw-r--r--xdiff/xprepare.c4
-rw-r--r--xdiff/xprepare.h4
-rw-r--r--xdiff/xtypes.h4
-rw-r--r--xdiff/xutils.c4
-rw-r--r--xdiff/xutils.h4
76 files changed, 720 insertions, 407 deletions
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 2c8b2d612e..c7096f11f1 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -11,3 +11,4 @@ doc.dep
cmds-*.txt
mergetools-*.txt
manpage-base-url.xsl
+SubmittingPatches.txt
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 471bb29725..2ab65561af 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -67,6 +67,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 += SubmittingPatches
TECH_DOCS += technical/hash-function-transition
TECH_DOCS += technical/http-protocol
TECH_DOCS += technical/index-format
@@ -181,6 +182,7 @@ ASCIIDOC = asciidoctor
ASCIIDOC_CONF =
ASCIIDOC_HTML = xhtml5
ASCIIDOC_DOCBOOK = docbook45
+ASCIIDOC_EXTRA += -acompat-mode
ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
DBLATEX_COMMON =
@@ -323,6 +325,7 @@ clean:
$(RM) *.pdf
$(RM) howto-index.txt howto/*.html doc.dep
$(RM) technical/*.html technical/api-index.txt
+ $(RM) SubmittingPatches.txt
$(RM) $(cmds_txt) $(mergetools_txt) *.made
$(RM) manpage-base-url.xsl
@@ -361,6 +364,9 @@ technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
+SubmittingPatches.txt: SubmittingPatches
+ $(QUIET_GEN) cp $< $@
+
XSLT = docbook.xsl
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
diff --git a/Documentation/RelNotes/2.15.1.txt b/Documentation/RelNotes/2.15.1.txt
index 15b24a0b76..ec06704e63 100644
--- a/Documentation/RelNotes/2.15.1.txt
+++ b/Documentation/RelNotes/2.15.1.txt
@@ -13,7 +13,7 @@ Fixes since v2.15
latter, which has been fixed.
* The experimental "color moved lines differently in diff output"
- feature was buggy around "ignore whitespace changes" edges, whihch
+ feature was buggy around "ignore whitespace changes" edges, which
has been corrected.
* Instead of using custom line comparison and hashing functions to
@@ -24,7 +24,7 @@ Fixes since v2.15
HEAD points at, which have been fixed.
* "git commit", after making a commit, did not check for errors when
- asking on what branch it made the commit, which has been correted.
+ asking on what branch it made the commit, which has been corrected.
* "git status --ignored -u" did not stop at a working tree of a
separate project that is embedded in an ignored directory and
@@ -35,7 +35,7 @@ Fixes since v2.15
--recurse-submodules" has been fixed.
* A recent regression in "git rebase -i" that broke execution of git
- commands from subdirectories via "exec" insn has been fixed.
+ commands from subdirectories via "exec" instruction has been fixed.
* "git check-ref-format --branch @{-1}" bit a "BUG()" when run
outside a repository for obvious reasons; clarify the documentation
@@ -64,5 +64,25 @@ Fixes since v2.15
* Updates from GfW project.
+ * "git rebase -i" recently started misbehaving when a submodule that
+ is configured with 'submodule.<name>.ignore' is dirty; this has
+ been corrected.
+
+ * Some error messages did not quote filenames shown in it, which have
+ been fixed.
+
+ * Building with NO_LIBPCRE1_JIT did not disable it, which has been fixed.
+
+ * We used to add an empty alternate object database to the system
+ that does not help anything; it has been corrected.
+
+ * Error checking in "git imap-send" for empty response has been
+ improved.
+
+ * An ancient bug in "git apply --ignore-space-change" codepath has
+ been fixed.
+
+ * There was a recent semantic mismerge in the codepath to write out a
+ section of a configuration section, which has been corrected.
Also contains various documentation updates and code clean-ups.
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 558d465b65..3ef30922ec 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -1,40 +1,47 @@
+Submitting Patches
+==================
+
+== Guidelines
+
Here are some guidelines for people who want to contribute their code
to this software.
-(0) Decide what to base your work on.
+[[base-branch]]
+=== Decide what to base your work on.
In general, always base your work on the oldest branch that your
change is relevant to.
- - A bugfix should be based on 'maint' in general. If the bug is not
- present in 'maint', base it on 'master'. For a bug that's not yet
- in 'master', find the topic that introduces the regression, and
- base your work on the tip of the topic.
+* A bugfix should be based on `maint` in general. If the bug is not
+ present in `maint`, base it on `master`. For a bug that's not yet
+ in `master`, find the topic that introduces the regression, and
+ base your work on the tip of the topic.
- - A new feature should be based on 'master' in general. If the new
- feature depends on a topic that is in 'pu', but not in 'master',
- base your work on the tip of that topic.
+* A new feature should be based on `master` in general. If the new
+ feature depends on a topic that is in `pu`, but not in `master`,
+ base your work on the tip of that topic.
- - Corrections and enhancements to a topic not yet in 'master' should
- be based on the tip of that topic. If the topic has not been merged
- to 'next', it's alright to add a note to squash minor corrections
- into the series.
+* Corrections and enhancements to a topic not yet in `master` should
+ be based on the tip of that topic. If the topic has not been merged
+ to `next`, it's alright to add a note to squash minor corrections
+ into the series.
- - In the exceptional case that a new feature depends on several topics
- not in 'master', start working on 'next' or 'pu' privately and send
- out patches for discussion. Before the final merge, you may have to
- wait until some of the dependent topics graduate to 'master', and
- rebase your work.
+* In the exceptional case that a new feature depends on several topics
+ not in `master`, start working on `next` or `pu` privately and send
+ out patches for discussion. Before the final merge, you may have to
+ wait until some of the dependent topics graduate to `master`, and
+ rebase your work.
- - Some parts of the system have dedicated maintainers with their own
- repositories (see the section "Subsystems" below). Changes to
- these parts should be based on their trees.
+* Some parts of the system have dedicated maintainers with their own
+ repositories (see the section "Subsystems" below). Changes to
+ these parts should be based on their trees.
-To find the tip of a topic branch, run "git log --first-parent
-master..pu" and look for the merge commit. The second parent of this
+To find the tip of a topic branch, run `git log --first-parent
+master..pu` and look for the merge commit. The second parent of this
commit is the tip of the topic branch.
-(1) Make separate commits for logically separate changes.
+[[separate-commits]]
+=== Make separate commits for logically separate changes.
Unless your patch is really trivial, you should not be sending
out a patch that was generated between your working tree and
@@ -58,8 +65,9 @@ differs substantially from the prior version, are all good things
to have.
Make sure that you have tests for the bug you are fixing. See
-t/README for guidance.
+`t/README` for guidance.
+[[tests]]
When adding a new feature, make sure that you have new tests to show
the feature triggers the new behavior when it should, and to show the
feature does not trigger when it shouldn't. After any code change, make
@@ -84,41 +92,45 @@ turning en_UK spelling to en_US). Obvious typographical fixes are much
more welcomed ("teh -> "the"), preferably submitted as independent
patches separate from other documentation changes.
+[[whitespace-check]]
Oh, another thing. We are picky about whitespaces. Make sure your
changes do not trigger errors with the sample pre-commit hook shipped
-in templates/hooks--pre-commit. To help ensure this does not happen,
-run "git diff --check" on your changes before you commit.
+in `templates/hooks--pre-commit`. To help ensure this does not happen,
+run `git diff --check` on your changes before you commit.
-
-(2) Describe your changes well.
+[[describe-changes]]
+=== Describe your changes well.
The first line of the commit message should be a short description (50
-characters is the soft limit, see DISCUSSION in git-commit(1)), and
-should skip the full stop. It is also conventional in most cases to
+characters is the soft limit, see DISCUSSION in linkgit:git-commit[1]),
+and should skip the full stop. It is also conventional in most cases to
prefix the first line with "area: " where the area is a filename or
identifier for the general area of the code being modified, e.g.
- . doc: clarify distinction between sign-off and pgp-signing
- . githooks.txt: improve the intro section
+* doc: clarify distinction between sign-off and pgp-signing
+* githooks.txt: improve the intro section
-If in doubt which identifier to use, run "git log --no-merges" on the
+If in doubt which identifier to use, run `git log --no-merges` on the
files you are modifying to see the current conventions.
+[[summary-section]]
It's customary to start the remainder of the first line after "area: "
with a lower-case letter. E.g. "doc: clarify...", not "doc:
Clarify...", or "githooks.txt: improve...", not "githooks.txt:
Improve...".
+[[meaningful-message]]
The body should provide a meaningful commit message, which:
- . explains the problem the change tries to solve, i.e. what is wrong
- with the current code without the change.
+. explains the problem the change tries to solve, i.e. what is wrong
+ with the current code without the change.
- . justifies the way the change solves the problem, i.e. why the
- result with the change is better.
+. justifies the way the change solves the problem, i.e. why the
+ result with the change is better.
- . alternate solutions considered but discarded, if any.
+. alternate solutions considered but discarded, if any.
+[[imperative-mood]]
Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
to do frotz", as if you are giving orders to the codebase to change
@@ -126,36 +138,43 @@ its behavior. Try to make sure your explanation can be understood
without external resources. Instead of giving a URL to a mailing list
archive, summarize the relevant points of the discussion.
+[[commit-reference]]
If you want to reference a previous commit in the history of a stable
branch, use the format "abbreviated sha1 (subject, date)",
with the subject enclosed in a pair of double-quotes, like this:
- Commit f86a374 ("pack-bitmap.c: fix a memleak", 2015-03-30)
- noticed that ...
+....
+ Commit f86a374 ("pack-bitmap.c: fix a memleak", 2015-03-30)
+ noticed that ...
+....
The "Copy commit summary" command of gitk can be used to obtain this
-format, or this invocation of "git show":
+format, or this invocation of `git show`:
- git show -s --date=short --pretty='format:%h ("%s", %ad)' <commit>
+....
+ git show -s --date=short --pretty='format:%h ("%s", %ad)' <commit>
+....
-(3) Generate your patch using Git tools out of your commits.
+[[git-tools]]
+=== Generate your patch using Git tools out of your commits.
Git based diff tools generate unidiff which is the preferred format.
-You do not have to be afraid to use -M option to "git diff" or
-"git format-patch", if your patch involves file renames. The
+You do not have to be afraid to use `-M` option to `git diff` or
+`git format-patch`, if your patch involves file renames. The
receiving end can handle them just fine.
+[[review-patch]]
Please make sure your patch does not add commented out debugging code,
or include any extra files which do not relate to what your patch
is trying to achieve. Make sure to review
your patch after generating it, to ensure accuracy. Before
-sending out, please make sure it cleanly applies to the "master"
+sending out, please make sure it cleanly applies to the `master`
branch head. If you are preparing a work based on "next" branch,
that is fine, but please mark it as such.
-
-(4) Sending your patches.
+[[send-patches]]
+=== Sending your patches.
Learn to use format-patch and send-email if possible. These commands
are optimized for the workflow of sending patches, avoiding many ways
@@ -184,14 +203,15 @@ lose tabs that way if you are not careful.
It is a common convention to prefix your subject line with
[PATCH]. This lets people easily distinguish patches from other
-e-mail discussions. Use of additional markers after PATCH and
-the closing bracket to mark the nature of the patch is also
-encouraged. E.g. [PATCH/RFC] is often used when the patch is
-not ready to be applied but it is for discussion, [PATCH v2],
-[PATCH v3] etc. are often seen when you are sending an update to
-what you have previously sent.
-
-"git format-patch" command follows the best current practice to
+e-mail discussions. Use of markers in addition to PATCH within
+the brackets to describe the nature of the patch is also
+encouraged. E.g. [RFC PATCH] (where RFC stands for "request for
+comments") is often used to indicate a patch needs further
+discussion before being accepted, [PATCH v2], [PATCH v3] etc.
+are often seen when you are sending an update to what you have
+previously sent.
+
+The `git format-patch` command follows the best current practice to
format the body of an e-mail message. At the beginning of the
patch should come your commit message, ending with the
Signed-off-by: lines, and a line that consists of three dashes,
@@ -199,6 +219,10 @@ followed by the diffstat information and the patch itself. If
you are forwarding a patch from somebody else, optionally, at
the beginning of the e-mail message just before the commit
message starts, you can put a "From: " line to name that person.
+To change the default "[PATCH]" in the subject to "[<text>]", use
+`git format-patch --subject-prefix=<text>`. As a shortcut, you
+can use `--rfc` instead of `--subject-prefix="RFC PATCH"`, or
+`-v <n>` instead of `--subject-prefix="PATCH v<n>"`.
You often want to add additional explanation about the patch,
other than the commit message itself. Place such "cover letter"
@@ -208,6 +232,7 @@ an explanation of changes between each iteration can be kept in
Git-notes and inserted automatically following the three-dash
line via `git format-patch --notes`.
+[[attachment]]
Do not attach the patch as a MIME attachment, compressed or not.
Do not let your e-mail client send quoted-printable. Do not let
your e-mail client send format=flowed which would destroy
@@ -222,6 +247,7 @@ that it will be postponed.
Exception: If your mailer is mangling patches then someone may ask
you to re-send them using MIME, that is OK.
+[[pgp-signature]]
Do not PGP sign your patch. Most likely, your maintainer or other people on the
list would not have your PGP key and would not bother obtaining it anyway.
Your patch is not judged by who you are; a good patch from an unknown origin
@@ -230,28 +256,27 @@ origin that is done poorly or does incorrect things.
If you really really really really want to do a PGP signed
patch, format it as "multipart/signed", not a text/plain message
-that starts with '-----BEGIN PGP SIGNED MESSAGE-----'. That is
+that starts with `-----BEGIN PGP SIGNED MESSAGE-----`. That is
not a text/plain, it's something else.
Send your patch with "To:" set to the mailing list, with "cc:" listing
people who are involved in the area you are touching (the output from
-"git blame $path" and "git shortlog --no-merges $path" would help to
++git blame _$path_+ and +git shortlog {litdd}no-merges _$path_+ would help to
identify them), to solicit comments and reviews.
+:1: footnote:[The current maintainer: gitster@pobox.com]
+:2: footnote:[The mailing list: git@vger.kernel.org]
+
After the list reached a consensus that it is a good idea to apply the
-patch, re-send it with "To:" set to the maintainer [*1*] and "cc:" the
-list [*2*] for inclusion.
+patch, re-send it with "To:" set to the maintainer{1} and "cc:" the
+list{2} for inclusion.
-Do not forget to add trailers such as "Acked-by:", "Reviewed-by:" and
-"Tested-by:" lines as necessary to credit people who helped your
+Do not forget to add trailers such as `Acked-by:`, `Reviewed-by:` and
+`Tested-by:` lines as necessary to credit people who helped your
patch.
- [Addresses]