summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* index-pack: --clone-bundle optionjc/bundleJunio C Hamano2016-03-032-5/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach a new option "--clone-bundle" to "git index-pack" to create a split bundle file that uses an existing packfile as its data part. The expected "typical" preparation for helping initial clone would start by preparing a packfile that contains most of the history and add another packfile that contains the remainder (e.g. the objects that are only reachable from reflog entries). The first pack can then be used as the data part of a split bundle and these two files can be served as static files to bootstrap the clients without incurring any more CPU cycles to the server side. Among the objects in the packfile, the ones that are not referenced by no other objects are identified and recorded as the "references" in the resulting bundle. As the packfile does not record any ref information, however, the names of the "references" recorded in the bundle need to be synthesized; we arbitrarily choose to record the object whose name is $SHA1 as refs/objects/$SHA1. Note that this name choice does not matter very much in the larger picture. As an initial clone that bootstraps from a clone-bundle is expected to do a rough equivalent of: # create a new repository git init new-repository && git remote add origin $URL && # prime the object store and anchor the history to temporary # references git fetch $bundle 'refs/*:refs/temporary/*' && # fetch the more recent history from the true origin git fetch origin && git checkout -f && # remove the temporary refs git for-each-ref -z --format=%(refname) refs/temporary/ | xargs -0 git update-ref -d the names recorded in the bundle will not really matter to the end result. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jc/index-pack' into jc/bundleJunio C Hamano2016-03-032-18/+23
|\ | | | | | | | | | | * jc/index-pack: index-pack: add a helper function to derive .idx/.keep filename index-pack: correct --keep[=<msg>]
| * index-pack: add a helper function to derive .idx/.keep filenamejc/index-packJunio C Hamano2016-03-031-18/+17
| | | | | | | | | | | | | | | | These are automatically named by replacing .pack suffix in the name of the packfile. Add a small helper to do so, as I'll be adding another one soonish. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Merge branch 'jc/maint-index-pack-keep' into jc/index-packJunio C Hamano2016-03-032-1/+7
| |\ | | | | | | | | | | | | * jc/maint-index-pack-keep: index-pack: correct --keep[=<msg>]
| | * index-pack: correct --keep[=<msg>]jc/maint-index-pack-keepJunio C Hamano2016-03-032-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When 592ce208 (index-pack: use strip_suffix to avoid magic numbers, 2014-06-30) refactored the code to derive names of .idx and .keep files from the name of .pack file, a copy-and-paste typo crept in, mistakingly attempting to create and store the keep message file in the .idx file we just created, instead of .keep file. As we create the .keep file with O_CREAT|O_EXCL, and we do so after we write the .idx file, we luckily do not clobber the .idx file, but because we deliberately ignored EEXIST when creating .keep file (which is justifiable because only the existence of .keep file matters), nobody noticed this mistake so far. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | bundle v3: the beginningJunio C Hamano2016-03-023-9/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bundle v3 format introduces an ability to have the bundle header (which describes what references in the bundled history can be fetched, and what objects the receiving repository must have in order to unbundle it successfully) in one file, and the bundled pack stream data in a separate file. A v3 bundle file begins with a line with "# v3 git bundle", followed by zero or more "extended header" lines, and an empty line, finally followed by the list of prerequisites and references in the same format as v2 bundle. If it uses the "split bundle" feature, there is a "data: $URL" extended header line, and nothing follows the list of prerequisites and references. Also, "sha1: " and "size: " extended header lines may exist to help validating that the pack stream data matches the bundle header. A typical expected use of a split bundle is to help initial clone that involves a huge data transfer, and would go like this: - Any repository people would clone and fetch from would regularly be repacked, and it is expected that there would be a packfile without prerequisites that holds all (or at least most) of the history of it (call it pack-$name.pack). - After arranging that packfile to be downloadable over popular transfer methods used for serving static files (such as HTTP or HTTPS) that are easily resumable as $URL/pack-$name.pack, a v3 bundle file (call it $name.bndl) can be prepared with an extended header "data: $URL/pack-$name.pack" to point at the download location for the packfile, and be served at "$URL/$name.bndl". - An updated Git client, when trying to "git clone" from such a repository, may be redirected to $URL/$name.bndl", which would be a tiny text file (when split bundle feature is used). - The client would then inspect the downloaded $name.bndl, learn that the corresponding packfile exists at $URL/pack-$name.pack, and downloads it as pack-$name.pack, until the download succeeds. This can easily be done with "wget --continue" equivalent over an unreliable link. The checksum recorded on the "sha1: " header line and the length of the file on the "size: " header line are expected to be used by this downloader. - After fully downloading $name.bndl and pack-$name.pack and storing them next to each other, the client would clone from the $name.bndl; this would populate the newly created repository with reasonably recent history. - Then the client can issue "git fetch" against the original repository to obtain the most recent part of the history created since the bundle was made. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | bundle: keep a copy of bundle file name in the in-core bundle headerJunio C Hamano2016-03-024-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be necessary when we start reading from a split bundle where the header and the thin-pack data live in different files. The in-core bundle header will read from a file that has the header, and will record the path to that file. We would find the name of the file that hosts the thin-pack data from the header, and we would take that name as relative to the file we read the header from. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | bundle: plug resource leakJunio C Hamano2016-03-023-0/+14
| | | | | | | | | | | | | | | | | | | | | The bundle header structure holds two lists of refs and object names, which should be released when the user is done with it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | bundle doc: 'verify' is not about verifying the bundleJunio C Hamano2016-03-021-5/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though the command does read the bundle header and checks to see if it looks reasonable, the thin-pack data stream that follows the header in the bundle file is not checked. The documentation gives an incorrect impression that the data contained in the bundle is validated, but the command is to validate that the receiving repository is ready to accept the bundle, not to check the validity of a bundle file itself. Rephrase the paragraph to clarify this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Git 2.8-rc0v2.8.0-rc0Junio C Hamano2016-02-262-1/+96
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'mm/readme-markdown'Junio C Hamano2016-02-262-26/+32
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | README has been renamed to README.md and its contents got tweaked slightly to make it easier on the eyes. * mm/readme-markdown: README.md: move down historical explanation about the name README.md: don't call git stupid in the title README.md: move the link to git-scm.com up README.md: add hyperlinks on filenames README: use markdown syntax
| * | README.md: move down historical explanation about the nameMatthieu Moy2016-02-251-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The explanations about why the name was chosen are secondary compared to the description and link to the documentation. Some consider these explanations as good computer scientists joke, but other see it as needlessly offensive vocabulary. This patch preserves the historical joke, but gives it less importance by moving it to the end of the README, and makes it clear that it is a historical explanation, that does not necessarily reflect the state of mind of current developers. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | README.md: don't call git stupid in the titleMatthieu Moy2016-02-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "the stupid content tracker" was true in the early days of Git, but hardly applicable these days. "fast, scalable, distributed" describes Git more accuralety. Also, "stupid" can be seen as offensive by some people. Let's not use it in the very first words of the README. The new formulation is taken from the description of the Debian package. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | README.md: move the link to git-scm.com upMatthieu Moy2016-02-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation available on git-scm.com is nicely formatted. It's better to point users to it than to the source code of the documentation. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | README.md: add hyperlinks on filenamesMatthieu Moy2016-02-251-6/+13
| | | | | | | | | | | | | | | Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | README: use markdown syntaxMatthieu Moy2016-02-252-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | This allows repository browsers like GitHub to display the content of the file nicely formatted. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'ma/update-hooks-sample-typofix'Junio C Hamano2016-02-261-1/+1
|\ \ \ | | | | | | | | | | | | | | | | * ma/update-hooks-sample-typofix: templates/hooks: fix minor typo in the sample update-hook
| * | | templates/hooks: fix minor typo in the sample update-hookma/update-hooks-sample-typofixMartin Amdisen2016-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Mosegaard Amdisen <martin.amdisen@praqma.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'ls/makefile-cflags-developer-tweak'Junio C Hamano2016-02-263-1/+18
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a new DEVELOPER knob that enables many compiler warning options in the Makefile. * ls/makefile-cflags-developer-tweak: add DEVELOPER makefile knob to check for acknowledged warnings
| * | | | add DEVELOPER makefile knob to check for acknowledged warningsls/makefile-cflags-developer-tweakLars Schneider2016-02-253-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We assume Git developers have a reasonably modern compiler and recommend them to enable the DEVELOPER makefile knob to ensure their patches are clear of all compiler warnings the Git core project cares about. Enable the DEVELOPER makefile knob in the Travis-CI build. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'dt/initial-ref-xn-commit-doc'Junio C Hamano2016-02-261-0/+12
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * dt/initial-ref-xn-commit-doc: refs: document transaction semantics
| * | | | | refs: document transaction semanticsdt/initial-ref-xn-commit-docDavid Turner2016-02-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some comments on ref transaction semantics to refs.h Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'js/config-set-in-non-repository'Junio C Hamano2016-02-262-0/+14
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git config section.var value" to set a value in per-repository configuration file failed when it was run outside any repository, but didn't say the reason correctly. * js/config-set-in-non-repository: git config: report when trying to modify a non-existing repo config
| * | | | | | git config: report when trying to modify a non-existing repo configjs/config-set-in-non-repositoryJohannes Schindelin2016-02-252-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a pilot error to call `git config section.key value` outside of any Git worktree. The message error: could not lock config file .git/config: No such file or directory is not very helpful in that situation, though. Let's print a helpful message instead. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'jk/epipe-in-async'Junio C Hamano2016-02-266-3/+25
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling of errors while writing into our internal asynchronous process has been made more robust, which reduces flakiness in our tests. * jk/epipe-in-async: t5504: handle expected output from SIGPIPE death test_must_fail: report number of unexpected signal fetch-pack: ignore SIGPIPE in sideband demuxer write_or_die: handle EPIPE in async threads
| * | | | | | | t5504: handle expected output from SIGPIPE deathjk/epipe-in-asyncJeff King2016-02-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8bf4bec (add "ok=sigpipe" to test_must_fail and use it to fix flaky tests, 2015-11-27) taught t5504 to handle "git push" racily exiting with SIGPIPE rather than failing. However, one of the tests checks the output of the command, as well. In the SIGPIPE case, we will not have produced any output. If we want the test to be truly non-flaky, we have to accept either output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | test_must_fail: report number of unexpected signalJeff King2016-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a command is marked as test_must_fail but dies with a signal, we consider that a problem and report the error to stderr. However, we don't say _which_ signal; knowing that can make debugging easier. Let's share as much as we know. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | fetch-pack: ignore SIGPIPE in sideband demuxerJeff King2016-02-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the other side feeds us a bogus pack, index-pack (or unpack-objects) may die early, before consuming all of its input. As a result, the sideband demuxer may get SIGPIPE (racily, depending on whether our data made it into the pipe buffer or not). If this happens and we are compiled with pthread support, it will take down the main thread, too. This isn't the end of the world, as the main process will just die() anyway when it sees index-pack failed. But it does mean we don't get a chance to say "fatal: index-pack failed" or similar. And it also means that we racily fail t5504, as we sometimes die() and sometimes are killed by SIGPIPE. So let's ignore SIGPIPE while demuxing the sideband. We are already careful to check the return value of write(), so we won't waste time writing to a broken pipe. The caller will notice the error return from the async thread, though in practice we don't even get that far, as we die() as soon as we see that index-pack failed. The non-sideband case is already fine; we let index-pack read straight from the socket, so there is no SIGPIPE at all. Technically the non-threaded async case is also OK without this (the forked async process gets SIGPIPE), but it's not worth distinguishing from the threaded case here. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | write_or_die: handle EPIPE in async threadsJeff King2016-02-253-0/+15
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When write_or_die() sees EPIPE, it treats it specially by converting it into a SIGPIPE death. We obviously cannot ignore it, as the write has failed and the caller expects us to die. But likewise, we cannot just call die(), because printing any message at all would be a nuisance during normal operations. However, this is a problem if write_or_die() is called from a thread. Our raised signal ends up killing the whole process, when logically we just need to kill the thread (after all, if we are ignoring SIGPIPE, there is good reason to think that the main thread is expecting to handle it). Inside an async thread, the die() code already does the right thing, because we use our custom die_async() routine, which calls pthread_join(). So ideally we would piggy-back on that, and simply call: die_quietly_with_code(141); or similar. But refactoring the die code to do this is surprisingly non-trivial. The die_routines themselves handle both printing and the decision of the exit code. Every one of them would have to be modified to take new parameters for the code, and to tell us to be quiet. Instead, we can just teach write_or_die() to check for the async case and handle it specially. We do have to build an interface to abstract the async exit, but it's simple and self-contained. If we had many call-sites that wanted to do this die_quietly_with_code(), this approach wouldn't scale as well, but we don't. This is the only place where do this weird exit trick. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'mm/push-default-warning'Junio C Hamano2016-02-261-34/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Across the transition at around Git version 2.0, the user used to get a pretty loud warning when running "git push" without setting push.default configuration variable. We no longer warn, given that the transition is over long time ago. * mm/push-default-warning: push: remove "push.default is unset" warning message
| * | | | | | | push: remove "push.default is unset" warning messagemm/push-default-warningMatthieu Moy2016-02-251-34/+0
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning was important before the 2.0 transition, and remained important for a while after, so that new users get push.default explicitly in their configuration and do not experience inconsistent behavior if they ever used an older version of Git. The warning has been there since version 1.8.0 (Oct 2012), hence we can expect the vast majority of current Git users to have been exposed to it, and most of them have already set push.default explicitly. The switch from 'matching' to 'simple' was planned for 2.0 (May 2014), but actually happened only for 2.3 (Feb 2015). Today, the warning is mostly seen by beginners, who have not set their push.default configuration (yet). For many of them, the warning is confusing because it talks about concepts that they have not learned and asks them a choice that they are not able to make yet. See for example http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0 (1260 votes for the question, 1824 for the answer as of writing) Remove the warning completely to avoid disturbing beginners. People who still occasionally use an older version of Git will be exposed to the warning through this old version. Eventually, versions of Git without the warning will be deployed enough and tutorials will not need to advise setting push.default anymore. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'fa/merge-recursive-no-rename'Junio C Hamano2016-02-265-4/+337
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git merge-recursive" learned "--no-renames" option to disable its rename detection logic. * fa/merge-recursive-no-rename: t3034: test deprecated interface t3034: test option to disable renames t3034: add rename threshold tests merge-recursive: find-renames resets threshold merge-strategies.txt: fix typo merge-recursive: more consistent interface merge-recursive: option to disable renames
| * | | | | | | t3034: test deprecated interfacefa/merge-recursive-no-renameFelipe Gonçalves Assis2016-02-241-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --find-renames= and --rename-threshold= should be aliases. Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | t3034: test option to disable renamesFelipe Gonçalves Assis2016-02-241-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | t3034: add rename threshold testsFelipe Gonçalves Assis2016-02-242-1/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 10ae752 (merge-recursive: option to specify rename threshold, 2010-09-27) introduced this feature but did not include any tests. The tests use the new option --find-renames, which replaces the then introduced and now deprecated option --rename-threshold. Also update name and description of t3032 for consistency: "merge-recursive options" -> "merge-recursive space options" Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | merge-recursive: find-renames resets thresholdFelipe Gonçalves Assis2016-02-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the find-renames option follow the behaviour in git-diff, where it resets the threshold when none is given. So, for instance, "--find-renames=25 --find-renames" should result in the default threshold (50%) instead of 25%. Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | merge-strategies.txt: fix typoFelipe Gonçalves Assis2016-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | merge-recursive: more consistent interfaceFelipe Gonçalves Assis2016-02-172-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add strategy option find-renames, following git-diff interface. This makes the option rename-threshold redundant. Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | merge-recursive: option to disable renamesFelipe Gonçalves Assis2016-02-173-0/+14
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recursive strategy turns on rename detection by default. Add a strategy option to disable rename detection even for exact renames. Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'sb/submodule-fetch-nontip'Junio C Hamano2016-02-261-3/+26
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When "git submodule update" did not result in fetching the commit object in the submodule that is referenced by the superproject, the command learned to retry another fetch, specifically asking for that commit that may not be connected to the refs it usually fetches. * sb/submodule-fetch-nontip: submodule: try harder to fetch needed sha1 by direct fetching sha1
| * | | | | | | submodule: try harder to fetch needed sha1 by direct fetching sha1sb/submodule-fetch-nontipStefan Beller2016-02-241-3/+26
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reviewing a change that also updates a submodule in Gerrit, a common review practice is to download and cherry-pick the patch locally to test it. However when testing it locally, the 'git submodule update' may fail fetching the correct submodule sha1 as the corresponding commit in the submodule is not yet part of the project history, but also just a proposed change. If $sha1 was not part of the default fetch, we try to fetch the $sha1 directly. Some servers however do not support direct fetch by sha1, which leads git-fetch to fail quickly. We can fail ourselves here as the still missing sha1 would lead to a failure later in the checkout stage anyway, so failing here is as good as we can get. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'sb/submodule-module-list-fix'Junio C Hamano2016-02-262-8/+27
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A helper function "git submodule" uses since v2.7.0 to list the modules that match the pathspec argument given to its subcommands (e.g. "submodule add <repo> <path>") has been fixed. * sb/submodule-module-list-fix: submodule helper list: respect correct path prefix
| * | | | | | | submodule helper list: respect correct path prefixsb/submodule-module-list-fixStefan Beller2016-02-242-8/+27
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression introduced by 74703a1e4d (submodule: rewrite `module_list` shell function in C, 2015-09-02). Add a test to ensure we list the right submodule when giving a specific pathspec. Reported-By: Caleb Jorden <cjorden@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'tb/conversion'Junio C Hamano2016-02-262-232/+272
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code simplification. * tb/conversion: convert.c: correct attr_action() convert.c: simplify text_stat convert.c: refactor crlf_action convert.c: use text_eol_is_crlf() convert.c: remove input_crlf_action() convert.c: remove unused parameter 'path' t0027: add tests for get_stream_filter()
| * | | | | | | convert.c: correct attr_action()tb/conversionTorsten Bögershausen2016-02-232-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | df747b81 (convert.c: refactor crlf_action, 2016-02-10) introduced a bug to "git ls-files --eol". The "text" attribute was shown as "text eol=lf" or "text eol=crlf", depending on core.autocrlf or core.eol. Correct this and add test cases in t0027. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | convert.c: simplify text_statTorsten Bögershausen2016-02-101-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the statistics: lonecr counts the CR which is not followed by a LF, lonelf counts the LF which is not preceded by a CR, crlf counts CRLF combinations. This simplifies the evaluation of the statistics. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | convert.c: refactor crlf_actionTorsten Bögershausen2016-02-101-31/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the determination and usage of crlf_action. Today, when no "crlf" attribute are set on a file, crlf_action is set to CRLF_GUESS. Use CRLF_UNDEFINED instead, and search for "text" or "eol" as before. After searching for line ending attributes, save the value in struct conv_attrs.crlf_action attr_action, so that get_convert_attr_ascii() is able report the attributes. Replace the old CRLF_GUESS usage: CRLF_GUESS && core.autocrlf=true -> CRLF_AUTO_CRLF CRLF_GUESS && core.autocrlf=false -> CRLF_BINARY CRLF_GUESS && core.autocrlf=input -> CRLF_AUTO_INPUT Save the action in conv_attrs.crlf_action (as before) and change all callers. Make more clear, what is what, by defining: - CRLF_UNDEFINED : No attributes set. Temparally used, until core.autocrlf and core.eol is evaluated and one of CRLF_BINARY, CRLF_AUTO_INPUT or CRLF_AUTO_CRLF is selected - CRLF_BINARY : No processing of line endings. - CRLF_TEXT : attribute "text" is set, line endings are processed. - CRLF_TEXT_INPUT: attribute "input" or "eol=lf" is set. This implies text. - CRLF_TEXT_CRLF : attribute "eol=crlf" is set. This implies text. - CRLF_AUTO : attribute "auto" is set. - CRLF_AUTO_INPUT: core.autocrlf=input (no attributes) - CRLF_AUTO_CRLF : core.autocrlf=true (no attributes) Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | convert.c: use text_eol_is_crlf()Torsten Bögershausen2016-02-081-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a helper function to find out, which line endings text files should get at checkout, depending on core.autocrlf and core.eol configuration variables. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | convert.c: remove input_crlf_action()Torsten Bögershausen2016-02-081-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Integrate the code of input_crlf_action() into convert_attrs(), so that ca.crlf_action is always valid after calling convert_attrs(). Keep a copy of crlf_action in attr_action, this is needed for get_convert_attr_ascii(). Remove eol_attr from struct conv_attrs, as it is now used temporally. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | convert.c: remove unused parameter 'path'Torsten Bögershausen2016-02-081-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some functions get a parameter path, but don't use it. Remove the unused parameter. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>