summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-03-28Implement line-history search (git log -L)Libravatar Thomas Rast20-2/+2156
This is a rewrite of much of Bo's work, mainly in an effort to split it into smaller, easier to understand routines. The algorithm is built around the struct range_set, which encodes a series of line ranges as intervals [a,b). This is used in two contexts: * A set of lines we are tracking (which will change as we dig through history). * To encode diffs, as pairs of ranges. The main routine is range_set_map_across_diff(). It processes the diff between a commit C and some parent P. It determines which diff hunks are relevant to the ranges tracked in C, and computes the new ranges for P. The algorithm is then simply to process history in topological order from newest to oldest, computing ranges and (partial) diffs. At branch points, we need to merge the ranges we are watching. We will find that many commits do not affect the chosen ranges, and mark them TREESAME (in addition to those already filtered by pathspec limiting). Another pass of history simplification then gets rid of such commits. This is wired as an extra filtering pass in the log machinery. This currently only reduces code duplication, but should allow for other simplifications and options to be used. Finally, we hook a diff printer into the output chain. Ideally we would wire directly into the diff logic, to optionally use features like word diff. However, that will require some major reworking of the diff chain, so we completely replace the output with our own diff for now. As this was a GSoC project, and has quite some history by now, many people have helped. In no particular order, thanks go to Jakub Narebski <jnareb@gmail.com> Jens Lehmann <Jens.Lehmann@web.de> Jonathan Nieder <jrnieder@gmail.com> Junio C Hamano <gitster@pobox.com> Ramsay Jones <ramsay@ramsay1.demon.co.uk> Will Palmer <wmpalmer@gmail.com> Apologies to everyone I forgot. Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28Export rewrite_parents() for 'log -L'Libravatar Bo Yang2-9/+14
The function rewrite_one is used to rewrite a single parent of the current commit, and is used by rewrite_parents to rewrite all the parents. Decouple the dependence between them by making rewrite_one a callback function that is passed to rewrite_parents. Then export rewrite_parents for reuse by the line history browser. We will use this function in line-log.c. Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28Refactor parse_locLibravatar Bo Yang7-109/+151
We want to use the same style of -L n,m argument for 'git log -L' as for git-blame. Refactor the argument parsing of the range arguments from builtin/blame.c to the (new) file that will hold the 'git log -L' logic. To accommodate different data structures in blame and log -L, the file contents are abstracted away; parse_range_arg takes a callback that it uses to get the contents of a line of the (notional) file. The new test is for a case that made me pause during debugging: the 'blame -L with invalid end' test was the only one that noticed an outright failure to parse the end *at all*. So make a more explicit test for that. Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-27Merge branch 'maint'Libravatar Junio C Hamano2-3/+8
* maint: Update draft release notes to 1.8.1.5 Documentation/submodule: Add --force to update synopsis
2013-02-27Update draft release notes to 1.8.1.5Libravatar Junio C Hamano1-1/+5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-27Merge branch 'ef/non-ascii-parse-options-error-diag' into maintLibravatar Junio C Hamano1-1/+4
* ef/non-ascii-parse-options-error-diag: parse-options: report uncorrupted multi-byte options
2013-02-27Merge branch 'wk/man-deny-current-branch-is-default-these-days' into maintLibravatar Junio C Hamano1-3/+4
* wk/man-deny-current-branch-is-default-these-days: user-manual: typofix (ofthe->of the) user-manual: Update for receive.denyCurrentBranch=refuse
2013-02-27Merge branch 'jn/less-reconfigure' into maintLibravatar Junio C Hamano1-6/+8
* jn/less-reconfigure: Makefile: avoid infinite loop on configure.ac change
2013-02-27Merge branch 'mh/maint-ceil-absolute'Libravatar Junio C Hamano3-16/+52
An earlier workaround designed to help people who list logical directories that will not match what getcwd(3) returns in the GIT_CEILING_DIRECTORIES had an adverse effect when it is slow to stat and readlink a directory component of an element listed on it. * mh/maint-ceil-absolute: Provide a mechanism to turn off symlink resolution in ceiling paths
2013-02-27Documentation/submodule: Add --force to update synopsisLibravatar Brad King1-1/+1
In commit 9db31bdf (submodule: Add --force option for git submodule update, 2011-04-01) we added the option to the implementation's usage synopsis but forgot to add it to the synopsis in the command documentation. Add the option to the synopsis in the same location it is reported in usage and re-wrap the options to avoid long lines. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-26Merge branch 'for-junio' of git://github.com/kusma/gitLibravatar Junio C Hamano1-131/+75
* 'for-junio' of git://github.com/kusma/git: wincred: improve compatibility with windows versions wincred: accept CRLF on stdin to simplify console usage
2013-02-26Revert "compat: add strtok_r()"Libravatar Erik Faye-Lund5-80/+0
This reverts commit 78457bc0ccc1af8b9eb776a0b17986ebd50442bc. commit 28c5d9e ("vcs-svn: drop string_pool") previously removed the only call-site for strtok_r. So let's get rid of the compat implementation as well. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-26wincred: improve compatibility with windows versionsLibravatar Karsten Blees1-129/+70
On WinXP, the windows credential helper doesn't work at all (due to missing Cred[Un]PackAuthenticationBuffer APIs). On Win7, the credential format used by wincred is incompatible with native Windows tools (such as the control panel applet or 'cmdkey.exe /generic'). These Windows tools only set the TargetName, UserName and CredentialBlob members of the CREDENTIAL structure (where CredentialBlob is the UTF-16-encoded password). Remove the unnecessary packing / unpacking of the password, along with the related API definitions, for compatibility with Windows XP. Don't use CREDENTIAL_ATTRIBUTEs to identify credentials for compatibility with Windows credential manager tools. Parse the protocol, username, host and path fields from the credential's target name instead. Credentials created with an old wincred version will have mangled or empty passwords after this change. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2013-02-26wincred: accept CRLF on stdin to simplify console usageLibravatar Karsten Blees1-2/+5
The windows credential helper currently only accepts LF on stdin, but bash and cmd.exe both send CRLF. This prevents interactive use in the console. Change the stdin parser to optionally accept CRLF. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2013-02-25Git 1.8.2-rc1Libravatar Junio C Hamano2-14/+10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-25Merge git://github.com/git-l10n/git-poLibravatar Junio C Hamano4-948/+1200
* git://github.com/git-l10n/git-po: l10n: vi.po: Updated 5 new messages (2009t0f0u) l10n: Update Swedish translation (2009t0f0u) l10n: Update Swedish translation (2004t0f0u) l10n: zh_CN.po: translate 5 new messages l10n: git.pot: v1.8.2 round 3 (5 new)
2013-02-25Sync with 'maint'Libravatar Junio C Hamano3-2/+39
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-25Merge branch 'wk/user-manual'Libravatar Junio C Hamano1-56/+77
Further updates to the user manual. * wk/user-manual: user-manual: Flesh out uncommitted changes and submodule updates user-manual: Use request-pull to generate "please pull" text user-manual: Reorganize the reroll sections, adding 'git rebase -i'
2013-02-25Merge branch 'jn/less-reconfigure'Libravatar Junio C Hamano1-6/+8
A change made on v1.8.1.x maintenance track had a nasty regression to break the build when autoconf is used. * jn/less-reconfigure: Makefile: avoid infinite loop on configure.ac change
2013-02-25Merge branch 'as/check-ignore'Libravatar Junio C Hamano3-3/+18
"git check-ignore ." segfaulted, as a function it calls deep in its callchain took a string in the <ptr, length> form but did not stop when given an empty string. * as/check-ignore: name-hash: allow hashing an empty string t0008: document test_expect_success_multi
2013-02-25Merge branch 'ct/autoconf-htmldir'Libravatar Junio C Hamano1-0/+2
An earlier change to config.mak.autogen broke a build driven by the ./configure script when --htmldir is not specified on the command line of ./configure. * ct/autoconf-htmldir: Bugfix: undefined htmldir in config.mak.autogen
2013-02-25Merge branch 'wk/man-deny-current-branch-is-default-these-days'Libravatar Junio C Hamano1-1/+1
* wk/man-deny-current-branch-is-default-these-days: user-manual: typofix (ofthe->of the)
2013-02-25Prepare for 1.8.1.5Libravatar Junio C Hamano2-1/+38
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-25Merge branch 'jc/mention-tracking-for-pull-default' into maintLibravatar Junio C Hamano1-1/+2
* jc/mention-tracking-for-pull-default: doc: mention tracking for pull.default
2013-02-25Merge branch 'mm/config-intro-in-git-doc' into maintLibravatar Junio C Hamano1-6/+5
* mm/config-intro-in-git-doc: git.txt: update description of the configuration mechanism
2013-02-25Merge branch 'da/p4merge-mktemp-fix' into maintLibravatar Junio C Hamano1-1/+1
* da/p4merge-mktemp-fix: p4merge: fix printf usage
2013-02-25Merge branch 'bw/get-tz-offset-perl' into maintLibravatar Junio C Hamano4-13/+35
* bw/get-tz-offset-perl: cvsimport: format commit timestamp ourselves without using strftime perl/Git.pm: fix get_tz_offset to properly handle DST boundary cases Move Git::SVN::get_tz to Git::get_tz_offset
2013-02-25Merge branch 'al/mergetool-printf-fix' into maintLibravatar Junio C Hamano2-2/+2
* al/mergetool-printf-fix: difftool--helper: fix printf usage git-mergetool: print filename when it contains %
2013-02-25Merge branch 'jx/utf8-printf-width' into maintLibravatar Junio C Hamano3-2/+25
* jx/utf8-printf-width: Add utf8_fprintf helper that returns correct number of columns
2013-02-25Merge branch 'mg/bisect-doc' into maintLibravatar Junio C Hamano1-1/+6
* mg/bisect-doc: git-bisect.txt: clarify that reset quits bisect
2013-02-25Merge branch 'sp/smart-http-content-type-check' into maintLibravatar Junio C Hamano8-17/+59
* sp/smart-http-content-type-check: http_request: reset "type" strbuf before adding t5551: fix expected error output Verify Content-Type from smart HTTP servers
2013-02-25Merge branch 'jc/combine-diff-many-parents' into maintLibravatar Junio C Hamano2-14/+31
* jc/combine-diff-many-parents: t4038: add tests for "diff --cc --raw <trees>" combine-diff: lift 32-way limit of combined diff
2013-02-25Merge branch 'jk/apply-similaritly-parsing' into maintLibravatar Junio C Hamano1-4/+6
* jk/apply-similaritly-parsing: builtin/apply: tighten (dis)similarity index parsing
2013-02-25Merge branch 'jk/remote-helpers-doc' into maintLibravatar Junio C Hamano5-7/+23
* jk/remote-helpers-doc: Rename {git- => git}remote-helpers.txt
2013-02-25Merge branch 'ab/gitweb-use-same-scheme' into maintLibravatar Junio C Hamano1-2/+2
* ab/gitweb-use-same-scheme: gitweb: refer to picon/gravatar images over the same scheme
2013-02-25Merge branch 'zk/clean-report-failure' into maintLibravatar Junio C Hamano1-29/+125
* zk/clean-report-failure: git-clean: Display more accurate delete messages
2013-02-25Merge branch 'nd/clone-no-separate-git-dir-with-bare' into maintLibravatar Junio C Hamano1-0/+2
* nd/clone-no-separate-git-dir-with-bare: clone: forbid --bare --separate-git-dir <dir>
2013-02-25Merge branch 'da/p4merge-mktemp' into maintLibravatar Junio C Hamano1-14/+13
* da/p4merge-mktemp: mergetools/p4merge: Honor $TMPDIR for the /dev/null placeholder
2013-02-25Documentation: "advice" is uncountableLibravatar Greg Price2-2/+2
"Advice" is a mass noun, not a count noun; it's not ordinarily pluralized. Signed-off-by: Greg Price <price@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-22Provide a mechanism to turn off symlink resolution in ceiling pathsLibravatar Michael Haggerty3-16/+52
Commit 1b77d83cab 'setup_git_directory_gently_1(): resolve symlinks in ceiling paths' changed the setup code to resolve symlinks in the entries in GIT_CEILING_DIRECTORIES. Because those entries are compared textually to the symlink-resolved current directory, an entry in GIT_CEILING_DIRECTORIES that contained a symlink would have no effect. It was known that this could cause performance problems if the symlink resolution *itself* touched slow filesystems, but it was thought that such use cases would be unlikely. The intention of the earlier change was to deal with a case when the user has this: GIT_CEILING_DIRECTORIES=/home/gitster but in reality, /home/gitster is a symbolic link to somewhere else, e.g. /net/machine/home4/gitster. A textual comparison between the specified value /home/gitster and the location getcwd(3) returns would not help us, but readlink("/home/gitster") would still be fast. After this change was released, Anders Kaseorg <andersk@mit.edu> reported: > [...] my computer has been acting so slow when I’m not connected to > the network. I put various network filesystem paths in > $GIT_CEILING_DIRECTORIES, such as > /afs/athena.mit.edu/user/a/n/andersk (to avoid hitting its parents > /afs/athena.mit.edu, /afs/athena.mit.edu/user/a, and > /afs/athena.mit.edu/user/a/n which all live in different AFS > volumes). Now when I’m not connected to the network, every > invocation of Git, including the __git_ps1 in my shell prompt, waits > for AFS to timeout. To allow users to work around this problem, give them a mechanism to turn off symlink resolution in GIT_CEILING_DIRECTORIES entries. All the entries that follow an empty entry will not be checked for symbolic links and used literally in comparison. E.g. with these: GIT_CEILING_DIRECTORIES=:/foo/bar:/xyzzy or GIT_CEILING_DIRECTORIES=/foo/bar::/xyzzy we will not readlink("/xyzzy") because it comes after an empty entry. With the former (but not with the latter), "/foo/bar" comes after an empty entry, and we will not readlink it, either. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-20Makefile: avoid infinite loop on configure.ac changeLibravatar Jeff King1-6/+8
If you are using autoconf and change the configure.ac, the Makefile will notice that config.status is older than configure.ac, and will attempt to rebuild and re-run the configure script to pick up your changes. The first step in doing so is to run "make configure". Unfortunately, this tries to include config.mak.autogen, which depends on config.status, which depends on configure.ac; so we must rebuild config.status. Which leads to us running "make configure", and so on. It's easy to demonstrate with: make configure ./configure touch configure.ac make We can break this cycle by not re-invoking make to build "configure", and instead just putting its rules inline into our config.status rebuild procedure. We can avoid a copy by factoring the rules into a make variable. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-19Sync with v1.8.1.4Libravatar Junio C Hamano3-3/+78
2013-02-19Git 1.8.1.4Libravatar Junio C Hamano4-3/+15
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-19Merge branch 'ob/imap-send-ssl-verify' into maintLibravatar Junio C Hamano1-2/+65
* ob/imap-send-ssl-verify: imap-send: support subjectAltName as well imap-send: the subject of SSL certificate must match the host imap-send: move #ifdef around
2013-02-19imap-send: support subjectAltName as wellLibravatar Oswald Buddenhagen1-0/+19
Check not only the common name of the certificate subject, but also check the subject alternative DNS names as well, when verifying that the certificate matches that of the host we are trying to talk to. Signed-off-by: Oswald Buddenhagen <ossi@kde.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-19imap-send: the subject of SSL certificate must match the hostLibravatar Oswald Buddenhagen1-0/+39
We did not check a valid certificate's subject at all, and would have happily talked with a wrong host after connecting to an incorrect address and getting a valid certificate that does not belong to the host we intended to talk to. Signed-off-by: Oswald Buddenhagen <ossi@kde.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-20l10n: vi.po: Updated 5 new messages (2009t0f0u)Libravatar Tran Ngoc Quan1-112/+143
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2013-02-19Bugfix: undefined htmldir in config.mak.autogenLibravatar Jiang Xin1-0/+2
Html documents will be installed to root dir (/) no matter what prefix is set, if run these commands before `make` and `make install-html`: $ make configure $ ./configure --prefix=<PREFIX> After the installation, all the html documents will copy to rootdir (/), and: $ git --html-path <PREFIX> $ git help -w something fatal: '<PREFIX>': not a documentation directory. This is because the variable "htmldir" points to a undefined variable "$(docdir)" in file "config.mak.autogen", which is generated by running `./configure`. By default $(docdir) generated by configure is supposed be set this way: datarootdir='${prefix}/share' htmldir='${docdir}' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' but since fc1c5415d69d (Honor configure's htmldir switch, 2013-02-02), we only set and export htmldir without doing so for PACKAGE_TARNAME (which is set to 'git' by the configure script). Add the required two variables "PACKAGE_TARNAME" and "docdir" to file "config.mak.in" will work this issue around. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-19name-hash: allow hashing an empty stringLibravatar Junio C Hamano3-3/+8
Usually we do not pass an empty string to the function hash_name() because we almost always ask for hash values for a path that is a candidate to be added to the index. However, check-ignore (and most likely check-attr, but I didn't check) apparently has a callchain to ask the hash value for an empty path when it was given a "." from the top-level directory to ask "Is the path . excluded by default?" Make sure that hash_name() does not overrun the end of the given pathname even when it is empty. Remove a sweep-the-issue-under-the-rug conditional in check-ignore that avoided to pass an empty string to the callchain while at it. It is a valid question to ask for check-ignore if the top-level is set to be ignored by default, even though the answer is most likely no, if only because there is currently no way to specify such an entry in the .gitignore file. But it is an unusual thing to ask and it is not worth optimizing for it by special casing at the top level of the call chain. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-19user-manual: Flesh out uncommitted changes and submodule updatesLibravatar W. Trevor King1-1/+3
If you try and update a submodule with a dirty working directory, you get an error message like: $ git submodule update error: Your local changes to the following files would be overwritten by checkout: ... Please, commit your changes or stash them before you can switch branches. Aborting ... Mention this in the submodule notes. The previous phrase was short enough that I originally thought it might have been referring to the reflog note (obviously, uncommitted changes will not show up in the reflog either ;). Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>