From: Junio C Hamano Date: Wed, 13 Dec 2017 21:28:57 +0000 (-0800) Subject: Merge branch 'jk/progress-delay-fix' X-Git-Tag: v2.16.0-rc0~57 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/36ddee941e496685739292e422772fe264ff8a8a?hp=9c5951cacf5cf2a4828480176921ca0307d22746 Merge branch 'jk/progress-delay-fix' A regression in the progress eye-candy was fixed. * jk/progress-delay-fix: progress: drop delay-threshold code progress: set default delay threshold to 100%, not 0% --- diff --git a/.mailmap b/.mailmap index 224db83887..7c71e88ea5 100644 --- a/.mailmap +++ b/.mailmap @@ -113,6 +113,7 @@ Junio C Hamano Junio C Hamano Junio C Hamano Junio C Hamano +Kaartic Sivaraam Karl Wiberg Karl Hasselström Karl Wiberg Karsten Blees diff --git a/.travis.yml b/.travis.yml index fead995edd..281f101f31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,7 +71,7 @@ matrix: packages: - coccinelle before_install: - # "before_script" that builds Git is inherited from base job + before_script: script: ci/run-static-analysis.sh after_failure: - env: Documentation 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.0.txt b/Documentation/RelNotes/2.15.0.txt index 248ba70c3d..cdd761bcc2 100644 --- a/Documentation/RelNotes/2.15.0.txt +++ b/Documentation/RelNotes/2.15.0.txt @@ -65,7 +65,7 @@ UI, Workflows & Features learned to take the 'unfold' and 'only' modifiers to normalize its output, e.g. "git log --format=%(trailers:only,unfold)". - * "gitweb" shows a link to visit the 'raw' contents of blbos in the + * "gitweb" shows a link to visit the 'raw' contents of blobs in the history overview page. * "[gc] rerereResolved = 5.days" used to be invalid, as the variable @@ -109,13 +109,13 @@ Performance, Internal Implementation, Development Support etc. * Conversion from uchar[20] to struct object_id continues. * Start using selected c99 constructs in small, stable and - essentialpart of the system to catch people who care about + essential part of the system to catch people who care about older compilers that do not grok them. * The filter-process interface learned to allow a process with long latency give a "delayed" response. - * Many uses of comparision callback function the hashmap API uses + * Many uses of comparison callback function the hashmap API uses cast the callback function type when registering it to hashmap_init(), which defeats the compile time type checking when the callback interface changes (e.g. gaining more parameters). diff --git a/Documentation/RelNotes/2.15.1.txt b/Documentation/RelNotes/2.15.1.txt new file mode 100644 index 0000000000..ec06704e63 --- /dev/null +++ b/Documentation/RelNotes/2.15.1.txt @@ -0,0 +1,88 @@ +Git v2.15.1 Release Notes +========================= + +Fixes since v2.15 +----------------- + + * TravisCI build updates. + + * "auto" as a value for the columnar output configuration ought to + judge "is the output consumed by humans?" with the same criteria as + "auto" for coloured output configuration, i.e. either the standard + output stream is going to tty, or a pager is in use. We forgot the + latter, which has been fixed. + + * The experimental "color moved lines differently in diff output" + feature was buggy around "ignore whitespace changes" edges, which + has been corrected. + + * Instead of using custom line comparison and hashing functions to + implement "moved lines" coloring in the diff output, use the pair + of these functions from lower-layer xdiff/ code. + + * Some codepaths did not check for errors when asking what branch the + 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 corrected. + + * "git status --ignored -u" did not stop at a working tree of a + separate project that is embedded in an ignored directory and + listed files in that other project, instead of just showing the + directory itself as ignored. + + * A broken access to object databases in recent update to "git grep + --recurse-submodules" has been fixed. + + * A recent regression in "git rebase -i" that broke execution of git + 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 + and make sure we do not even try to expand the at-mark magic in + such a case, but still call the validation logic for branch names. + + * Command line completion (in contrib/) update. + + * Description of blame.{showroot,blankboundary,showemail,date} + configuration variables have been added to "git config --help". + + * After an error from lstat(), diff_populate_filespec() function + sometimes still went ahead and used invalid data in struct stat, + which has been fixed. + + * UNC paths are also relevant in Cygwin builds and they are now + tested just like Mingw builds. + + * Correct start-up sequence so that a repository could be placed + immediately under the root directory again (which was broken at + around Git 2.13). + + * The credential helper for libsecret (in contrib/) has been improved + to allow possibly prompting the end user to unlock secrets that are + currently locked (otherwise the secrets may not be loaded). + + * Updates from GfW project. + + * "git rebase -i" recently started misbehaving when a submodule that + is configured with 'submodule..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/RelNotes/2.15.2.txt b/Documentation/RelNotes/2.15.2.txt new file mode 100644 index 0000000000..9f7e28f8a2 --- /dev/null +++ b/Documentation/RelNotes/2.15.2.txt @@ -0,0 +1,47 @@ +Git v2.15.2 Release Notes +========================= + +Fixes since v2.15.1 +------------------- + + * Recent update to the refs infrastructure implementation started + rewriting packed-refs file more often than before; this has been + optimized again for most trivial cases. + + * The SubmittingPatches document has been converted to produce an + HTML version via AsciiDoc/Asciidoctor. + + * Contrary to the documentation, "git pull -4/-6 other-args" did not + ask the underlying "git fetch" to go over IPv4/IPv6, which has been + corrected. + + * When "git rebase" prepared an mailbox of changes and fed it to "git + am" to replay them, it was confused when a stray "From " happened + to be in the log message of one of the replayed changes. This has + been corrected. + + * Command line completion (in contrib/) has been taught about the + "--copy" option of "git branch". + + * "git apply --inaccurate-eof" when used with "--ignore-space-change" + triggered an internal sanity check, which has been fixed. + + * The sequencer machinery (used by "git cherry-pick A..B", and "git + rebase -i", among other things) would have lost a commit if stopped + due to an unlockable index file, which has been fixed. + + * The three-way merge performed by "git cherry-pick" was confused + when a new submodule was added in the meantime, which has been + fixed (or "papered over"). + + * "git notes" sent its error message to its standard output stream, + which was corrected. + + * A few scripts (both in production and tests) incorrectly redirected + their error output. These have been corrected. + + * Clarify and enhance documentation for "merge-base --fork-point", as + it was clear what it computed but not why/what for. + + +Also contains various documentation updates and code clean-ups. diff --git a/Documentation/RelNotes/2.16.0.txt b/Documentation/RelNotes/2.16.0.txt new file mode 100644 index 0000000000..431bd5e34a --- /dev/null +++ b/Documentation/RelNotes/2.16.0.txt @@ -0,0 +1,309 @@ +Git 2.16 Release Notes +====================== + +Backward compatibility notes and other notable changes. + + * Use of an empty string as a pathspec element that is used for + 'everything matches' is now an error. + + +Updates since v2.15 +------------------- + +UI, Workflows & Features + + * An empty string as a pathspec element that means "everything" + i.e. 'git add ""', is now illegal. We started this by first + deprecating and warning a pathspec that has such an element in + 2.11 (Nov 2016). + + * A hook script that is set unexecutable is simply ignored. Git + notifies when such a file is ignored, unless the message is + squelched via advice.ignoredHook configuration. + + * "git pull" has been taught to accept "--[no-]signoff" option and + pass it down to "git merge". + + * The "--push-option=" option to "git push" now defaults to a + list of strings configured via push.pushOption variable. + + * "gitweb" checks if a directory is searchable with Perl's "-x" + operator, which can be enhanced by using "filetest 'access'" + pragma, which now we do. + + * "git stash save" has been deprecated in favour of "git stash push". + + * The set of paths output from "git status --ignored" was tied + closely with its "--untracked=" option, but now it can be + controlled more flexibly. Most notably, a directory that is + ignored because it is listed to be ignored in the ignore/exclude + mechanism can be handled differently from a directory that ends up + to be ignored only because all files in it are ignored. + + * The remote-helper for talking to MediaWiki has been updated to + truncate an overlong pagename so that ".mw" suffix can still be + added. + + * The remote-helper for talking to MediaWiki has been updated to + work with mediawiki namespaces. + + * The "--format=..." option "git for-each-ref" takes learned to show + the name of the 'remote' repository and the ref at the remote side + that is affected for 'upstream' and 'push' via "%(push:remotename)" + and friends. + + * Doc and message updates to teach users "bisect view" is a synonym + for "bisect visualize". + + * "git bisect run" that did not specify any command to run used to go + ahead and treated all commits to be tested as 'good'. This has + been corrected by making the command error out. + + * The SubmittingPatches document has been converted to produce an + HTML version via AsciiDoc/Asciidoctor. + + * We learned to talk to watchman to speed up "git status" and other + operations that need to see which paths have been modified. + + * The "diff" family of commands learned to ignore differences in + carriage return at the end of line. + + * Places that know about "sendemail.to", like documentation and shell + completion (in contrib/) have been taught about "sendemail.tocmd", + too. + + * "git add --renormalize ." is a new and safer way to record the fact + that you are correcting the end-of-line convention and other + "convert_to_git()" glitches in the in-repository data. + + * "git branch" and "git checkout -b" are now forbidden from creating + a branch whose name is "HEAD". + + * "git branch --list" learned to show its output through the pager by + default when the output is going to a terminal, which is controlled + by the pager.branch configuration variable. This is similar to a + recent change to "git tag --list". + + * "git grep -W", "git diff -W" and their friends learned a heuristic + to extend a pre-context beyond the line that matches the "function + pattern" (aka "diff.*.xfuncname") to include a comment block, if + exists, that immediately precedes it. + + * "git config --expiry-date gc.reflogexpire" can read "2.weeks" from + the configuration and report it as a timestamp, just like "--int" + would read "1k" and report 1024, to help consumption by scripts. + + * The shell completion (in contrib/) learned that "git pull" can take + the "--autostash" option. + + +Performance, Internal Implementation, Development Support etc. + + * An earlier update made it possible to use an on-stack in-core + lockfile structure (as opposed to having to deliberately leak an + on-heap one). Many codepaths have been updated to take advantage + of this new facility. + + * Calling cmd_foo() as if it is a general purpose helper function is + a no-no. Correct two instances of such to set an example. + + * We try to see if somebody runs our test suite with a shell that + does not support "local" like bash/dash does. + + * An early part of piece-by-piece rewrite of "git bisect" in C. + + * GSoC to piece-by-piece rewrite "git submodule" in C. + + * Optimize the code to find shortest unique prefix of object names. + + * Pathspec-limited revision traversal was taught not to keep finding + unneeded differences once it knows two trees are different inside + given pathspec. + + * Conversion from uchar[20] to struct object_id continues. + + * Code cleanup. + + * A single-word "unsigned flags" in the diff options is being split + into a structure with many bitfields. + + * TravisCI build updates. + + * Parts of a test to drive the long-running content filter interface + has been split into its own module, hopefully to eventually become + reusable. + + * Drop (perhaps overly cautious) sanity check before using the index + read from the filesystem at runtime. + + * The build procedure has been taught to avoid some unnecessary + instability in the build products. + + * A new mechanism to upgrade the wire protocol in place is proposed + and demonstrated that it works with the older versions of Git + without harming them. + +Also contains various documentation updates and code clean-ups. + + +Fixes since v2.15 +----------------- + + * "auto" as a value for the columnar output configuration ought to + judge "is the output consumed by humans?" with the same criteria as + "auto" for coloured output configuration, i.e. either the standard + output stream is going to tty, or a pager is in use. We forgot the + latter, which has been fixed. + + * The experimental "color moved lines differently in diff output" + feature was buggy around "ignore whitespace changes" edges, which + has been corrected. + + * Instead of using custom line comparison and hashing functions to + implement "moved lines" coloring in the diff output, use the pair + of these functions from lower-layer xdiff/ code. + + * Some codepaths did not check for errors when asking what branch the + 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 corrected. + + * "git status --ignored -u" did not stop at a working tree of a + separate project that is embedded in an ignored directory and + listed files in that other project, instead of just showing the + directory itself as ignored. + + * A broken access to object databases in recent update to "git grep + --recurse-submodules" has been fixed. + + * A recent regression in "git rebase -i" that broke execution of git + commands from subdirectories via "exec" instruction has been fixed. + + * A (possibly flakey) test fix. + + * "git check-ref-format --branch @{-1}" bit a "BUG()" when run + outside a repository for obvious reasons; clarify the documentation + and make sure we do not even try to expand the at-mark magic in + such a case, but still call the validation logic for branch names. + + * "git fetch --recurse-submodules" now knows that submodules can be + moved around in the superproject in addition to getting updated, + and finds the ones that need to be fetched accordingly. + + * Command line completion (in contrib/) update. + + * Description of blame.{showroot,blankboundary,showemail,date} + configuration variables have been added to "git config --help". + + * After an error from lstat(), diff_populate_filespec() function + sometimes still went ahead and used invalid data in struct stat, + which has been fixed. + + * UNC paths are also relevant in Cygwin builds and they are now + tested just like Mingw builds. + + * Correct start-up sequence so that a repository could be placed + immediately under the root directory again (which was broken at + around Git 2.13). + + * The credential helper for libsecret (in contrib/) has been improved + to allow possibly prompting the end user to unlock secrets that are + currently locked (otherwise the secrets may not be loaded). + + * MinGW updates. + + * Error checking in "git imap-send" for empty response has been + improved. + + * Recent update to the refs infrastructure implementation started + rewriting packed-refs file more often than before; this has been + optimized again for most trivial cases. + + * Some error messages did not quote filenames shown in it, which have + been fixed. + + * "git rebase -i" recently started misbehaving when a submodule that + is configured with 'submodule..ignore' is dirty; this has + been corrected. + + * 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. + + * Doc update around use of "format-patch --subject-prefix" etc. + + * A fix for an ancient bug in "git apply --ignore-space-change" codepath. + + * Clarify and enhance documentation for "merge-base --fork-point", as + it was clear what it computed but not why/what for. + + * A few scripts (both in production and tests) incorrectly redirected + their error output. These have been corrected. + + * "git notes" sent its error message to its standard output stream, + which was corrected. + + * The three-way merge performed by "git cherry-pick" was confused + when a new submodule was added in the meantime, which has been + fixed (or "papered over"). + + * The sequencer machinery (used by "git cherry-pick A..B", and "git + rebase -i", among other things) would have lost a commit if stopped + due to an unlockable index file, which has been fixed. + + * "git apply --inaccurate-eof" when used with "--ignore-space-change" + triggered an internal sanity check, which has been fixed. + + * Command line completion (in contrib/) has been taught about the + "--copy" option of "git branch". + + * When "git rebase" prepared an mailbox of changes and fed it to "git + am" to replay them, it was confused when a stray "From " happened + to be in the log message of one of the replayed changes. This has + been corrected. + + * There was a recent semantic mismerge in the codepath to write out a + section of a configuration section, which has been corrected. + + * Mentions of "git-rebase" and "git-am" (dashed form) still remained + in end-user visible strings emitted by the "git rebase" command; + they have been corrected. + + * Contrary to the documentation, "git pull -4/-6 other-args" did not + ask the underlying "git fetch" to go over IPv4/IPv6, which has been + corrected. + + * "git checkout --recursive" may overwrite and rewind the history of + the branch that happens to be checked out in submodule + repositories, which might not be desirable. Detach the HEAD but + still allow the recursive checkout to succeed in such a case. + (merge 57f22bf997 sb/submodule-recursive-checkout-detach-head later to maint). + + * "git branch --set-upstream" has been deprecated and (sort of) + removed, as "--set-upstream-to" is the preferred one these days. + The documentation still had "--set-upstream" listed on its + synopsys section, which has been corrected. + (merge a060f3d3d8 tz/branch-doc-remove-set-upstream later to maint). + + * Internaly we use 0{40} as a placeholder object name to signal the + codepath that there is no such object (e.g. the fast-forward check + while "git fetch" stores a new remote-tracking ref says "we know + there is no 'old' thing pointed at by the ref, as we are creating + it anew" by passing 0{40} for the 'old' side), and expect that a + codepath to locate an in-core object to return NULL as a sign that + the object does not exist. A look-up for an object that does not + exist however is quite costly with a repository with large number + of packfiles. This access pattern has been optimized. + (merge 87b5e236a1 jk/fewer-pack-rescan later to maint). + + * In addition to "git stash -m message", the command learned to + accept "git stash -mmessage" form. + (merge 5675473fcb ph/stash-save-m-option-fix later to maint). + + * Other minor doc, test and build updates and code cleanups. + (merge 1a1fc2d5b5 rd/man-prune-progress later to maint). + (merge 0ba014035a rd/man-reflog-add-n later to maint). + (merge e54b63359f rd/doc-notes-prune-fix later to maint). + (merge ff4c9b413a sp/doc-info-attributes later to maint). 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)' +.... + git show -s --date=short --pretty='format:%h ("%s", %ad)' +.... -(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 "[]", use +`git format-patch --subject-prefix=`. As a shortcut, you +can use `--rfc` instead of `--subject-prefix="RFC PATCH"`, or +`-v ` instead of `--subject-prefix="PATCH v"`. 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] - *1* The current maintainer: gitster@pobox.com - *2* The mailing list: git@vger.kernel.org - - -(5) Certify your work by adding your "Signed-off-by: " line +[[sign-off]] +=== Certify your work by adding your "Signed-off-by: " line To improve tracking of who did what, we've borrowed the "sign-off" procedure from the Linux kernel project on patches @@ -263,35 +288,39 @@ the patch, which certifies that you wrote it or otherwise have the right to pass it on as a open-source patch. The rules are pretty simple: if you can certify the below D-C-O: - Developer's Certificate of Origin 1.1 - - By making a contribution to this project, I certify that: - - (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - - (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - - (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - - (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. +[[dco]] +.Developer's Certificate of Origin 1.1 +____ +By making a contribution to this project, I certify that: + +a. The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +b. The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +c. The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +d. I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. +____ then you just add a line saying - Signed-off-by: Random J Developer +.... + Signed-off-by: Random J Developer +.... This line can be automatically added by Git if you run the git-commit command with the -s option. @@ -302,85 +331,86 @@ D-C-O. Indeed you are encouraged to do so. Do not forget to place an in-body "From: " line at the beginning to properly attribute the change to its true author (see (2) above). +[[real-name]] Also notice that a real name is used in the Signed-off-by: line. Please don't hide your real name. +[[commit-trailers]] If you like, you can put extra tags at the end: -1. "Reported-by:" is used to credit someone who found the bug that - the patch attempts to fix. -2. "Acked-by:" says that the person who is more familiar with the area - the patch attempts to modify liked the patch. -3. "Reviewed-by:", unlike the other tags, can only be offered by the - reviewer and means that she is completely satisfied that the patch - is ready for application. It is usually offered only after a - detailed review. -4. "Tested-by:" is used to indicate that the person applied the patch - and found it to have the desired effect. +. `Reported-by:` is used to credit someone who found the bug that + the patch attempts to fix. +. `Acked-by:` says that the person who is more familiar with the area + the patch attempts to modify liked the patch. +. `Reviewed-by:`, unlike the other tags, can only be offered by the + reviewer and means that she is completely satisfied that the patch + is ready for application. It is usually offered only after a + detailed review. +. `Tested-by:` is used to indicate that the person applied the patch + and found it to have the desired effect. You can also create your own tag or use one that's in common usage such as "Thanks-to:", "Based-on-patch-by:", or "Mentored-by:". ------------------------------------------------- -Subsystems with dedicated maintainers +== Subsystems with dedicated maintainers 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 + 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 + 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/ Patches to these parts should be based on their trees. ------------------------------------------------- -An ideal patch flow +[[patch-flow]] +== An ideal patch flow Here is an ideal patch flow for this project the current maintainer suggests to the contributors: - (0) You come up with an itch. You code it up. +. You come up with an itch. You code it up. - (1) Send it to the list and cc people who may need to know about - the change. +. Send it to the list and cc people who may need to know about + the change. ++ +The people who may need to know are the ones whose code you +are butchering. These people happen to be the ones who are +most likely to be knowledgeable enough to help you, but +they have no obligation to help you (i.e. you ask for help, +don't demand). +git log -p {litdd} _$area_you_are_modifying_+ would +help you find out who they are. - The people who may need to know are the ones whose code you - are butchering. These people happen to be the ones who are - most likely to be knowledgeable enough to help you, but - they have no obligation to help you (i.e. you ask for help, - don't demand). "git log -p -- $area_you_are_modifying" would - help you find out who they are. +. You get comments and suggestions for improvements. You may + even get them in a "on top of your change" patch form. - (2) You get comments and suggestions for improvements. You may - even get them in a "on top of your change" patch form. +. Polish, refine, and re-send to the list and the people who + spend their time to improve your patch. Go back to step (2). - (3) Polish, refine, and re-send to the list and the people who - spend their time to improve your patch. Go back to step (2). +. The list forms consensus that the last round of your patch is + good. Send it to the maintainer and cc the list. - (4) The list forms consensus that the last round of your patch is - good. Send it to the maintainer and cc the list. - - (5) A topic branch is created with the patch and is merged to 'next', - and cooked further and eventually graduates to 'master'. +. A topic branch is created with the patch and is merged to `next`, + and cooked further and eventually graduates to `master`. In any time between the (2)-(3) cycle, the maintainer may pick it up -from the list and queue it to 'pu', in order to make it easier for +from the list and queue it to `pu`, in order to make it easier for people play with it without having to pick up and apply the patch to their trees themselves. ------------------------------------------------- -Know the status of your patch after submission +[[patch-status]] +== Know the status of your patch after submission * You can use Git itself to find out when your patch is merged in - master. 'git pull --rebase' will automatically skip already-applied + master. `git pull --rebase` will automatically skip already-applied patches, and will let you know. This works only if you rebase on top of the branch in which your patch has been merged (i.e. it will not tell you if your patch is merged in pu if you rebase on top of @@ -390,8 +420,8 @@ Know the status of your patch after submission entitled "What's cooking in git.git" and "What's in git.git" giving the status of various proposed changes. --------------------------------------------------- -GitHub-Travis CI hints +[[travis]] +== GitHub-Travis CI hints With an account at GitHub (you can get one for free to work on open source projects), you can use Travis CI to test your changes on Linux, @@ -400,25 +430,25 @@ test build here: https://travis-ci.org/git/git/builds/120473209 Follow these steps for the initial setup: - (1) Fork https://github.com/git/git to your GitHub account. - You can find detailed instructions how to fork here: - https://help.github.com/articles/fork-a-repo/ +. Fork https://github.com/git/git to your GitHub account. + You can find detailed instructions how to fork here: + https://help.github.com/articles/fork-a-repo/ - (2) Open the Travis CI website: https://travis-ci.org +. Open the Travis CI website: https://travis-ci.org - (3) Press the "Sign in with GitHub" button. +. Press the "Sign in with GitHub" button. - (4) Grant Travis CI permissions to access your GitHub account. - You can find more information about the required permissions here: - https://docs.travis-ci.com/user/github-oauth-scopes +. Grant Travis CI permissions to access your GitHub account. + You can find more information about the required permissions here: + https://docs.travis-ci.com/user/github-oauth-scopes - (5) Open your Travis CI profile page: https://travis-ci.org/profile +. Open your Travis CI profile page: https://travis-ci.org/profile - (6) Enable Travis CI builds for your Git fork. +. Enable Travis CI builds for your Git fork. After the initial setup, Travis CI will run whenever you push new changes to your fork of Git on GitHub. You can monitor the test state of all your -branches here: https://travis-ci.org//git/branches +branches here: https://travis-ci.org/____/git/branches If a branch did not pass all test cases then it is marked with a red cross. In that case you can click on the failing Travis CI job and @@ -430,17 +460,16 @@ example: https://travis-ci.org/git/git/jobs/122676187 Fix the problem and push your fix to your Git fork. This will trigger a new Travis CI build to ensure all tests pass. - ------------------------------------------------- -MUA specific hints +[[mua]] +== MUA specific hints Some of patches I receive or pick up from the list share common patterns of breakage. Please make sure your MUA is set up properly not to corrupt whitespaces. -See the DISCUSSION section of git-format-patch(1) for hints on +See the DISCUSSION section of linkgit:git-format-patch[1] for hints on checking your patch by mailing it to yourself and applying with -git-am(1). +linkgit:git-am[1]. While you are at it, check the resulting commit log message from a trial run of applying the patch. If what is in the resulting @@ -452,23 +481,24 @@ should come after the three-dash line that signals the end of the commit message. -Pine ----- +=== Pine (Johannes Schindelin) +.... I don't know how many people still use pine, but for those poor souls it may be good to mention that the quell-flowed-text is needed for recent versions. ... the "no-strip-whitespace-before-send" option, too. AFAIK it was introduced in 4.60. +.... (Linus Torvalds) +.... And 4.58 needs at least this. ---- diff-tree 8326dd8350be64ac7fc805f6563a1d61ad10d32c (from e886a61f76edf5410573e92e38ce22974f9c40f1) Author: Linus Torvalds Date: Mon Aug 15 17:23:51 2005 -0700 @@ -490,10 +520,11 @@ diff --git a/pico/pico.c b/pico/pico.c +#endif c |= COMP_EXIT; break; - +.... (Daniel Barkalow) +.... > A patch to SubmittingPatches, MUA specific help section for > users of Pine 4.63 would be very much appreciated. @@ -503,23 +534,21 @@ that or Gentoo did it.) So you need to set the "no-strip-whitespace-before-send" option, unless the option you have is "strip-whitespace-before-send", in which case you should avoid checking it. +.... +=== Thunderbird, KMail, GMail -Thunderbird, KMail, GMail -------------------------- - -See the MUA-SPECIFIC HINTS section of git-format-patch(1). +See the MUA-SPECIFIC HINTS section of linkgit:git-format-patch[1]. -Gnus ----- +=== Gnus -'|' in the *Summary* buffer can be used to pipe the current +"|" in the `*Summary*` buffer can be used to pipe the current message to an external program, and this is a handy way to drive -"git am". However, if the message is MIME encoded, what is +`git am`. However, if the message is MIME encoded, what is piped into the program is the representation you see in your -*Article* buffer after unwrapping MIME. This is often not what +`*Article*` buffer after unwrapping MIME. This is often not what you would want for two reasons. It tends to screw up non ASCII characters (most notably in people's names), and also -whitespaces (fatal in patches). Running 'C-u g' to display the -message in raw form before using '|' to run the pipe can work +whitespaces (fatal in patches). Running "C-u g" to display the +message in raw form before using "|" to run the pipe can work this problem around. diff --git a/Documentation/config.txt b/Documentation/config.txt index 1ac0ae6adb..c1598ee703 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -351,6 +351,9 @@ advice.*:: addEmbeddedRepo:: Advice on what to do when you've accidentally added one git repo inside of another. + ignoredHook:: + Advice shown if an hook is ignored because the hook is not + set as executable. -- core.fileMode:: @@ -413,6 +416,13 @@ core.protectNTFS:: 8.3 "short" names. Defaults to `true` on Windows, and `false` elsewhere. +core.fsmonitor:: + If set, the value of this variable is used as a command which + will identify all files that may have changed since the + requested date/time. This information is used to speed up git by + avoiding unnecessary processing of files that have not changed. + See the "fsmonitor-watchman" section of linkgit:githooks[5]. + core.trustctime:: If false, the ctime differences between the index and the working tree are ignored; useful when the inode change time @@ -949,6 +959,23 @@ apply.whitespace:: Tells 'git apply' how to handle whitespaces, in the same way as the `--whitespace` option. See linkgit:git-apply[1]. +blame.showRoot:: + Do not treat root commits as boundaries in linkgit:git-blame[1]. + This option defaults to false. + +blame.blankBoundary:: + Show blank commit object name for boundary commits in + linkgit:git-blame[1]. This option defaults to false. + +blame.showEmail:: + Show the author email instead of author name in linkgit:git-blame[1]. + This option defaults to false. + +blame.date:: + Specifies the format used to output dates in linkgit:git-blame[1]. + If unset the iso format is used. For supported values, + see the discussion of the `--date` option at linkgit:git-log[1]. + branch.autoSetupMerge:: Tells 'git branch' and 'git checkout' to set up new branches so that linkgit:git-pull[1] will appropriately merge from the @@ -2081,15 +2108,40 @@ matched against are those given directly to Git commands. This means any URLs visited as a result of a redirection do not participate in matching. ssh.variant:: - Depending on the value of the environment variables `GIT_SSH` or - `GIT_SSH_COMMAND`, or the config setting `core.sshCommand`, Git - auto-detects whether to adjust its command-line parameters for use - with plink or tortoiseplink, as opposed to the default (OpenSSH). + By default, Git determines the command line arguments to use + based on the basename of the configured SSH command (configured + using the environment variable `GIT_SSH` or `GIT_SSH_COMMAND` or + the config setting `core.sshCommand`). If the basename is + unrecognized, Git will attempt to detect support of OpenSSH + options by first invoking the configured SSH command with the + `-G` (print configuration) option and will subsequently use + OpenSSH options (if that is successful) or no options besides + the host and remote command (if it fails). ++ +The config variable `ssh.variant` can be set to override this detection. +Valid values are `ssh` (to use OpenSSH options), `plink`, `putty`, +`tortoiseplink`, `simple` (no options except the host and remote command). +The default auto-detection can be explicitly requested using the value +`auto`. Any other value is treated as `ssh`. This setting can also be +overridden via the environment variable `GIT_SSH_VARIANT`. ++ +The current command-line parameters used for each variant are as +follows: ++ +-- + +* `ssh` - [-p port] [-4] [-6] [-o option] [username@]host command + +* `simple` - [username@]host command + +* `plink` or `putty` - [-P port] [-4] [-6] [username@]host command + +* `tortoiseplink` - [-P port] [-4] [-6] -batch [username@]host command + +-- + -The config variable `ssh.variant` can be set to override this auto-detection; -valid values are `ssh`, `plink`, `putty` or `tortoiseplink`. Any other value -will be treated as normal ssh. This setting can be overridden via the -environment variable `GIT_SSH_VARIANT`. +Except for the `simple` variant, command-line parameters are likely to +change as git gains new features. i18n.commitEncoding:: Character encoding the commit messages are stored in; Git itself @@ -2517,6 +2569,23 @@ The protocol names currently used by git are: `hg` to allow the `git-remote-hg` helper) -- +protocol.version:: + Experimental. If set, clients will attempt to communicate with a + server using the specified protocol version. If unset, no + attempt will be made by the client to communicate using a + particular protocol version, this results in protocol version 0 + being used. + Supported versions: ++ +-- + +* `0` - the original wire protocol. + +* `1` - the original wire protocol with the addition of a version string + in the initial response from the server. + +-- + pull.ff:: By default, Git does not create an extra merge commit when merging a commit that is a descendant of the current commit. Instead, the @@ -2621,6 +2690,35 @@ push.gpgSign:: override a value from a lower-priority config file. An explicit command-line flag always overrides this config option. +push.pushOption:: + When no `--push-option=