summaryrefslogtreecommitdiff
path: root/Documentation
AgeCommit message (Collapse)AuthorFilesLines
2017-01-10Fifth batch 2.12Libravatar Junio C Hamano1-0/+45
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-01-10Merge branch 'sb/submodule-embed-gitdir'Libravatar Junio C Hamano1-0/+15
A new submodule helper "git submodule embedgitdirs" to make it easier to move embedded .git/ directory for submodules in a superproject to .git/modules/ (and point the latter with the former that is turned into a "gitdir:" file) has been added. * sb/submodule-embed-gitdir: worktree: initialize return value for submodule_uses_worktrees submodule: add absorb-git-dir function move connect_work_tree_and_git_dir to dir.h worktree: check if a submodule uses worktrees test-lib-functions.sh: teach test_commit -C <dir> submodule helper: support super prefix submodule: use absolute path for computing relative path connecting
2017-01-10Merge branch 'jc/retire-compaction-heuristics'Libravatar Junio C Hamano2-6/+2
"git diff" and its family had two experimental heuristics to shift the contents of a hunk to make the patch easier to read. One of them turns out to be better than the other, so leave only the "--indent-heuristic" option and remove the other one. * jc/retire-compaction-heuristics: diff: retire "compaction" heuristics
2017-01-10Merge branch 'jc/abbrev-autoscale-config'Libravatar Junio C Hamano1-4/+5
Recent update to the default abbreviation length that auto-scales lacked documentation update, which has been corrected. * jc/abbrev-autoscale-config: config.abbrev: document the new default that auto-scales
2017-01-10Merge branch 'dt/smart-http-detect-server-going-away'Libravatar Junio C Hamano2-3/+8
When the http server gives an incomplete response to a smart-http rpc call, it could lead to client waiting for a full response that will never come. Teach the client side to notice this condition and abort the transfer. An improvement counterproposal has failed. cf. <20161114194049.mktpsvgdhex2f4zv@sigill.intra.peff.net> * dt/smart-http-detect-server-going-away: upload-pack: optionally allow fetching any sha1 remote-curl: don't hang when a server dies before any output
2017-01-10Merge branch 'mm/gc-safety-doc'Libravatar Junio C Hamano2-9/+29
Doc update. * mm/gc-safety-doc: git-gc.txt: expand discussion of races with other processes
2017-01-10Merge branch 'mm/push-social-engineering-attack-doc'Libravatar Junio C Hamano6-22/+51
Doc update on fetching and pushing. * mm/push-social-engineering-attack-doc: doc: mention transfer data leaks in more places
2016-12-27Fourth batch for 2.12Libravatar Junio C Hamano1-0/+42
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-27Merge branch 'lt/shortlog-by-committer'Libravatar Junio C Hamano1-0/+4
"git shortlog" learned "--committer" option to group commits by committer, instead of author. * lt/shortlog-by-committer: t4201: make tests work with and without the MINGW prerequiste shortlog: test and document --committer option shortlog: group by committer information
2016-12-27Merge branch 'ls/filter-process'Libravatar Junio C Hamano1-1/+3
Doc update. * ls/filter-process: t0021: fix flaky test docs: warn about possible '=' in clean/smudge filter process values
2016-12-27Merge branch 'bw/transport-protocol-policy'Libravatar Junio C Hamano2-24/+60
Finer-grained control of what protocols are allowed for transports during clone/fetch/push have been enabled via a new configuration mechanism. * bw/transport-protocol-policy: http: respect protocol.*.allow=user for http-alternates transport: add from_user parameter to is_transport_allowed http: create function to get curl allowed protocols transport: add protocol policy config option http: always warn if libcurl version is too old lib-proto-disable: variable name fix
2016-12-27Merge branch 'cp/merge-continue'Libravatar Junio C Hamano1-0/+8
"git merge --continue" has been added as a synonym to "git commit" to conclude a merge that has stopped due to conflicts. * cp/merge-continue: merge: mark usage error strings for translation merge: ensure '--abort' option takes no arguments completion: add --continue option for merge merge: add '--continue' option as a synonym for 'git commit'
2016-12-27Merge branch 'sb/submodule-config-cleanup'Libravatar Junio C Hamano1-5/+9
Minor code clean-up. * sb/submodule-config-cleanup: submodule-config: clarify parsing of null_sha1 element submodule-config: rename commit_sha1 to treeish_name submodule config: inline config_from_{name, path}
2016-12-23diff: retire "compaction" heuristicsLibravatar Junio C Hamano2-6/+2
When a patch inserts a block of lines, whose last lines are the same as the existing lines that appear before the inserted block, "git diff" can choose any place between these existing lines as the boundary between the pre-context and the added lines (adjusting the end of the inserted block as appropriate) to come up with variants of the same patch, and some variants are easier to read than others. We have been trying to improve the choice of this boundary, and Git 2.11 shipped with an experimental "compaction-heuristic". Since then another attempt to improve the logic further resulted in a new "indent-heuristic" logic. It is agreed that the latter gives better result overall, and the former outlived its usefulness. Retire "compaction", and keep "indent" as an experimental feature. The latter hopefully will be turned on by default in a future release, but that should be done as a separate step. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-22config.abbrev: document the new default that auto-scalesLibravatar Junio C Hamano1-4/+5
We somehow forgot to update the "default is 7" in the documentation. Also give a way to explicitly ask the auto-scaling by setting config.abbrev to "auto". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-21Third batch for 2.12Libravatar Junio C Hamano1-0/+40
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-21Merge branch 'jk/quote-env-path-list-component'Libravatar Junio C Hamano1-0/+6
A recent update to receive-pack to make it easier to drop garbage objects made it clear that GIT_ALTERNATE_OBJECT_DIRECTORIES cannot have a pathname with a colon in it (no surprise!), and this in turn made it impossible to push into a repository at such a path. This has been fixed by introducing a quoting mechanism used when appending such a path to the colon-separated list. * jk/quote-env-path-list-component: t5615-alternate-env: double-quotes in file names do not work on Windows t5547-push-quarantine: run the path separator test on Windows, too tmp-objdir: quote paths we add to alternates alternates: accept double-quoted paths
2016-12-19Second batch for 2.12Libravatar Junio C Hamano1-3/+90
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-19Merge branch 'kh/tutorial-grammofix'Libravatar Junio C Hamano1-6/+6
* kh/tutorial-grammofix: doc: omit needless "for" doc: make the intent of sentence clearer doc: add verb in front of command to run doc: add articles (grammar)
2016-12-19Merge branch 'lr/doc-fix-cet'Libravatar Junio C Hamano1-1/+1
* lr/doc-fix-cet: date-formats.txt: Typo fix
2016-12-19Merge branch 'nd/rebase-forget'Libravatar Junio C Hamano1-1/+6
"git rebase" learned "--quit" option, which allows a user to remove the metadata left by an earlier "git rebase" that was manually aborted without using "git rebase --abort". * nd/rebase-forget: rebase: add --quit to cleanup rebase, leave everything else untouched
2016-12-19Merge branch 'jk/trailers-placeholder-in-pretty'Libravatar Junio C Hamano2-0/+4
In addition to %(subject), %(body), "log --pretty=format:..." learned a new placeholder %(trailers). * jk/trailers-placeholder-in-pretty: ref-filter: add support to display trailers as part of contents pretty: add %(trailers) format for displaying trailers of a commit message
2016-12-19Merge branch 'ak/commit-only-allow-empty'Libravatar Junio C Hamano1-1/+2
"git commit --allow-empty --only" (no pathspec) with dirty index ought to be an acceptable way to create a new commit that does not change any paths, but it was forbidden, perhaps because nobody needed it so far. * ak/commit-only-allow-empty: commit: remove 'Clever' message for --only --amend commit: make --only --allow-empty work without paths
2016-12-19Merge branch 'jk/http-walker-limit-redirect-2.9'Libravatar Junio C Hamano1-0/+10
Transport with dumb http can be fooled into following foreign URLs that the end user does not intend to, especially with the server side redirects and http-alternates mechanism, which can lead to security issues. Tighten the redirection and make it more obvious to the end user when it happens. * jk/http-walker-limit-redirect-2.9: http: treat http-alternates like redirects http: make redirects more obvious remote-curl: rename shadowed options variable http: always update the base URL for redirects http: simplify update_url_from_redirect
2016-12-19Merge branch 'nd/for-each-ref-ignore-case'Libravatar Junio C Hamano3-0/+11
"git branch --list" and friends learned "--ignore-case" option to optionally sort branches and tags case insensitively. * nd/for-each-ref-ignore-case: tag, branch, for-each-ref: add --ignore-case for sorting and filtering
2016-12-16First batch for 2.12Libravatar Junio C Hamano1-1/+34
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-16Merge branch 'ls/p4-retry-thrice'Libravatar Junio C Hamano1-0/+4
* ls/p4-retry-thrice: git-p4: add config to retry p4 commands; retry 3 times by default
2016-12-16Merge branch 'ld/p4-update-shelve'Libravatar Junio C Hamano1-0/+4
* ld/p4-update-shelve: git-p4: support updating an existing shelved changelist
2016-12-16Merge branch 'vk/p4-submit-shelve'Libravatar Junio C Hamano1-0/+5
* vk/p4-submit-shelve: git-p4: allow submit to create shelved changelists.
2016-12-16shortlog: test and document --committer optionLibravatar Jeff King1-0/+4
This puts the final touches on the feature added by fbfda15fb8 (shortlog: group by committer information, 2016-10-11). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-15transport: add protocol policy config optionLibravatar Brandon Williams2-24/+60
Previously the `GIT_ALLOW_PROTOCOL` environment variable was used to specify a whitelist of protocols to be used in clone/fetch/push commands. This patch introduces new configuration options for more fine-grained control for allowing/disallowing protocols. This also has the added benefit of allowing easier construction of a protocol whitelist on systems where setting an environment variable is non-trivial. Now users can specify a policy to be used for each type of protocol via the 'protocol.<name>.allow' config option. A default policy for all unconfigured protocols can be set with the 'protocol.allow' config option. If no user configured default is made git will allow known-safe protocols (http, https, git, ssh, file), disallow known-dangerous protocols (ext), and have a default policy of `user` for all other protocols. The supported policies are `always`, `never`, and `user`. The `user` policy can be used to configure a protocol to be usable when explicitly used by a user, while disallowing it for commands which run clone/fetch/push commands without direct user intervention (e.g. recursive initialization of submodules). Commands which can potentially clone/fetch/push from untrusted repositories without user intervention can export `GIT_PROTOCOL_FROM_USER` with a value of '0' to prevent protocols configured to the `user` policy from being used. Fix remote-ext tests to use the new config to allow the ext protocol to be tested. Based on a patch by Jeff King <peff@peff.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-14merge: add '--continue' option as a synonym for 'git commit'Libravatar Chris Packham1-0/+8
Teach 'git merge' the --continue option which allows 'continuing' a merge by completing it. The traditional way of completing a merge after resolving conflicts is to use 'git commit'. Now with commands like 'git rebase' and 'git cherry-pick' having a '--continue' option adding such an option to 'git merge' presents a consistent UI. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-13Early fixes for 2.11.x seriesLibravatar Junio C Hamano1-0/+10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-13Merge branch 'ew/svn-fixes'Libravatar Junio C Hamano1-1/+7
* ew/svn-fixes: git-svn: document useLogAuthor and addAuthorFrom config keys git-svn: allow "0" in SVN path components
2016-12-12submodule: add absorb-git-dir functionLibravatar Stefan Beller1-0/+15
When a submodule has its git dir inside the working dir, the submodule support for checkout that we plan to add in a later patch will fail. Add functionality to migrate the git directory to be absorbed into the superprojects git directory. The newly added code in this patch is structured such that other areas of Git can also make use of it. The code in the submodule--helper is a mere wrapper and option parser for the function `absorb_git_dir_into_superproject`, that takes care of embedding the submodules git directory into the superprojects git dir. That function makes use of the more abstract function for this use case `relocate_gitdir`, which can be used by e.g. the worktree code eventually to move around a git directory. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-12alternates: accept double-quoted pathsLibravatar Jeff King1-0/+6
We read lists of alternates from objects/info/alternates files (delimited by newline), as well as from the GIT_ALTERNATE_OBJECT_DIRECTORIES environment variable (delimited by colon or semi-colon, depending on the platform). There's no mechanism for quoting the delimiters, so it's impossible to specify an alternate path that contains a colon in the environment, or one that contains a newline in a file. We've lived with that restriction for ages because both alternates and filenames with colons are relatively rare, and it's only a problem when the two meet. But since 722ff7f87 (receive-pack: quarantine objects until pre-receive accepts, 2016-10-03), which builds on the alternates system, every push causes the receiver to set GIT_ALTERNATE_OBJECT_DIRECTORIES internally. It would be convenient to have some way to quote the delimiter so that we can represent arbitrary paths. The simplest thing would be an escape character before a quoted delimiter (e.g., "\:" as a literal colon). But that creates a backwards compatibility problem: any path which uses that escape character is now broken, and we've just shifted the problem. We could choose an unlikely escape character (e.g., something from the non-printable ASCII range), but that's awkward to use. Instead, let's treat names as unquoted unless they begin with a double-quote, in which case they are interpreted via our usual C-stylke quoting rules. This also breaks backwards-compatibility, but in a smaller way: it only matters if your file has a double-quote as the very _first_ character in the path (whereas an escape character is a problem anywhere in the path). It's also consistent with many other parts of git, which accept either a bare pathname or a double-quoted one, and the sender can choose to quote or not as required. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-12date-formats.txt: Typo fixLibravatar Luis Ressel1-1/+1
Last time I checked, I was living in the UTC+01:00 time zone. UTC+02:00 would be Central European _Summer_ Time. Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-12git-svn: document useLogAuthor and addAuthorFrom config keysLibravatar Eric Wong1-1/+7
We've always supported these config keys in git-svn, so document them so users won't have to respecify them on every invocation. Reported-by: Juergen Kosel <juergen.kosel@gmx.de> Signed-off-by: Eric Wong <e@80x24.org>
2016-12-11ref-filter: add support to display trailers as part of contentsLibravatar Jacob Keller1-0/+2
Add %(trailers) and %(contents:trailers) to display the trailers as interpreted by trailer_info_get. Update documentation and add a test for the new feature. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-11pretty: add %(trailers) format for displaying trailers of a commit messageLibravatar Jacob Keller1-0/+2
Recent patches have expanded on the trailers.c code and we have the builtin commant git-interpret-trailers which can be used to add or modify trailer lines. However, there is no easy way to simply display the trailers of a commit message. Add support for %(trailers) format modifier which will use the trailer_info_get() calls to read trailers in an identical way as git interpret-trailers does. Use a long format option instead of a short name so that future work can more easily unify ref-filter and pretty formats. Add documentation and tests for the same. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-11rebase: add --quit to cleanup rebase, leave everything else untouchedLibravatar Nguyễn Thái Ngọc Duy1-1/+6
There are occasions when you decide to abort an in-progress rebase and move on to do something else but you forget to do "git rebase --abort" first. Or the rebase has been in progress for so long you forgot about it. By the time you realize that (e.g. by starting another rebase) it's already too late to retrace your steps. The solution is normally rm -r .git/<some rebase dir> and continue with your life. But there could be two different directories for <some rebase dir> (and it obviously requires some knowledge of how rebase works), and the ".git" part could be much longer if you are not at top-dir, or in a linked worktree. And "rm -r" is very dangerous to do in .git, a mistake in there could destroy object database or other important data. Provide "git rebase --quit" for this use case, mimicking a precedent that is "git cherry-pick --quit". Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-09doc: omit needless "for"Libravatar Kristoffer Haugsbakk1-1/+1
What was intended was perhaps "... plumbing does for you" ("you" added), but simply omitting the word "for" is more terse and gets the intended point across just as well, if not more so. I originally went with the approach of writing "for you", but Junio C Hamano suggested this approach instead. Signed-off-by: Kristoffer Haugsbakk <kristoffer.haugsbakk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-09doc: make the intent of sentence clearerLibravatar Kristoffer Haugsbakk1-1/+1
By adding the word "just", which might have been accidentally omitted. Adding the word "just" makes it clear that the point is to *not* do an octopus merge simply because you *can* do it. In other words, you should have a reason for doing it beyond simply having two (seemingly) independent commits that you need to merge into another branch, since it's not always the best approach. The previous sentence made it look more like it was trying to say that you shouldn't do an octopus merge *because* you can do an octopus merge. Although this interpretation doesn't make sense and the rest of the paragraph makes the intended meaning clear, this adjustment should make the intent of the sentence more immediately clear to the reader. Signed-off-by: Kristoffer Haugsbakk <kristoffer.haugsbakk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-09doc: add verb in front of command to runLibravatar Kristoffer Haugsbakk1-1/+1
Instead of using the command 'git clone' as a verb, use "run" as the verb indicating the action of executing the command 'git clone'. Signed-off-by: Kristoffer Haugsbakk <kristoffer.haugsbakk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-09doc: add articles (grammar)Libravatar Kristoffer Haugsbakk1-3/+3
Add definite and indefinite articles in three places where they were missing. - Use "the" in front of a directory name - Use "the" in front of "style of cooperation" - Use an indefinite article in front of "CVS background" Signed-off-by: Kristoffer Haugsbakk <kristoffer.haugsbakk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-06http: make redirects more obviousLibravatar Jeff King1-0/+10
We instruct curl to always follow HTTP redirects. This is convenient, but it creates opportunities for malicious servers to create confusing situations. For instance, imagine Alice is a git user with access to a private repository on Bob's server. Mallory runs her own server and wants to access objects from Bob's repository. Mallory may try a few tricks that involve asking Alice to clone from her, build on top, and then push the result: 1. Mallory may simply redirect all fetch requests to Bob's server. Git will transparently follow those redirects and fetch Bob's history, which Alice may believe she got from Mallory. The subsequent push seems like it is just feeding Mallory back her own objects, but is actually leaking Bob's objects. There is nothing in git's output to indicate that Bob's repository was involved at all. The downside (for Mallory) of this attack is that Alice will have received Bob's entire repository, and is likely to notice that when building on top of it. 2. If Mallory happens to know the sha1 of some object X in Bob's repository, she can instead build her own history that references that object. She then runs a dumb http server, and Alice's client will fetch each object individually. When it asks for X, Mallory redirects her to Bob's server. The end result is that Alice obtains objects from Bob, but they may be buried deep in history. Alice is less likely to notice. Both of these attacks are fairly hard to pull off. There's a social component in getting Mallory to convince Alice to work with her. Alice may be prompted for credentials in accessing Bob's repository (but not always, if she is using a credential helper that caches). Attack (1) requires a certain amount of obliviousness on Alice's part while making a new commit. Attack (2) requires that Mallory knows a sha1 in Bob's repository, that Bob's server supports dumb http, and that the object in question is loose on Bob's server. But we can probably make things a bit more obvious without any loss of functionality. This patch does two things to that end. First, when we encounter a whole-repo redirect during the initial ref discovery, we now inform the user on stderr, making attack (1) much more obvious. Second, the decision to follow redirects is now configurable. The truly paranoid can set the new http.followRedirects to false to avoid any redirection entirely. But for a more practical default, we will disallow redirects only after the initial ref discovery. This is enough to thwart attacks similar to (2), while still allowing the common use of redirects at the repository level. Since c93c92f30 (http: update base URLs when we see redirects, 2013-09-28) we re-root all further requests from the redirect destination, which should generally mean that no further redirection is necessary. As an escape hatch, in case there really is a server that needs to redirect individual requests, the user can set http.followRedirects to "true" (and this can be done on a per-server basis via http.*.followRedirects config). Reported-by: Jann Horn <jannh@google.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-06docs: warn about possible '=' in clean/smudge filter process valuesLibravatar Lars Schneider1-1/+3
A pathname value in a clean/smudge filter process "key=value" pair can contain the '=' character (introduced in edcc858). Make the user aware of this issue in the docs, add a corresponding test case, and fix the issue in filter process value parser of the example implementation in contrib. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-05tag, branch, for-each-ref: add --ignore-case for sorting and filteringLibravatar Nguyễn Thái Ngọc Duy3-0/+11
This options makes sorting ignore case, which is great when you have branches named bug-12-do-something, Bug-12-do-some-more and BUG-12-do-what and want to group them together. Sorting externally may not be an option because we lose coloring and column layout from git-branch and git-tag. The same could be said for filtering, but it's probably less important because you can always go with the ugly pattern [bB][uU][gG]-* if you're desperate. You can't have case-sensitive filtering and case-insensitive sorting (or the other way around) with this though. For branch and tag, that should be no problem. for-each-ref, as a plumbing, might want finer control. But we can always add --{filter,sort}-ignore-case when there is a need for it. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-05git-p4: add config to retry p4 commands; retry 3 times by defaultLibravatar Lars Schneider1-0/+4
P4 commands can fail due to random network issues. P4 users can counter these issues by using a retry flag supported by all p4 commands [1]. Add an integer Git config value `git-p4.retries` to define the number of retries for all p4 invocations. If the config is not defined then set the default retry count to 3. [1] https://www.perforce.com/perforce/doc.current/manuals/cmdref/global.options.html Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Reviewed-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-05git-p4: support updating an existing shelved changelistLibravatar Luke Diamand1-0/+4
Adds new option "--update-shelve CHANGELIST" which updates an existing shelved changelist. The original changelist must have been created by the current user. This allows workflow something like: hack hack hack git commit git p4 submit --shelve $mail interested parties about shelved changelist make corrections git commit --amend git p4 submit --update-shelve $CHANGELIST $mail interested parties about shelved changelist etc Signed-off-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>