summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-05diffcore-pickaxe: unify code for log -S/-GLibravatar Jeff King1-69/+49
The logic flow of has_changes() used for "log -S" and diff_grep() used for "log -G" are essentially the same. See if we have both sides that could be different in any interesting way, slurp the contents in core, possibly after applying textconv, inspect the contents, clean-up and report the result. The only difference between the two is how "inspect" step works. Unify this codeflow in a helper, pickaxe_match(), which takes a callback function that implements the specific "inspect" step. After removing the common scaffolding code from the existing has_changes() and diff_grep(), they each becomes such a callback function suitable for passing to pickaxe_match(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-05diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>"Libravatar Junio C Hamano1-5/+7
The diff_grep() and has_changes() functions had early return codepaths for unmerged filepairs, which simply returned 0. When we taught textconv filter to them, one was ignored and continued to return early without freeing the result filtered by textconv, and the other had a failed attempt to fix, which allowed the planned return value 0 to be overwritten by a bogus call to contains(). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-05diffcore-pickaxe: port optimization from has_changes() to diff_grep()Libravatar Junio C Hamano1-1/+6
These two functions are called in the same codeflow to implement "log -S<block>" and "log -G<pattern>", respectively, but the latter lacked two obvious optimizations the former implemented, namely: - When a pickaxe limit is not given at all, they should return without wasting any cycle; - When both sides of the filepair are the same, and the same textconv conversion apply to them, return early, as there will be no interesting differences between the two anyway. Also release the filespec data once the processing is done (this is not about leaking memory--it is about releasing data we finished looking at as early as possible). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-05diffcore-pickaxe: respect --no-textconvLibravatar Simon Ruderich2-4/+36
git log -S doesn't respect --no-textconv: $ echo '*.txt diff=wrong' > .gitattributes $ git -c diff.wrong.textconv='xxx' log --no-textconv -Sfoo error: cannot run xxx: No such file or directory fatal: unable to read files to diff Reported-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Simon Ruderich <simon@ruderich.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04diffcore-pickaxe: remove fill_one()Libravatar Jeff King1-20/+10
fill_one is _almost_ identical to just calling fill_textconv; the exception is that for the !DIFF_FILE_VALID case, fill_textconv gives us an empty buffer rather than a NULL one. Since we currently use the NULL pointer as a signal that the file is not present on one side of the diff, we must now switch to using DIFF_FILE_VALID to make the same check. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Simon Ruderich <simon@ruderich.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04diffcore-pickaxe: remove unnecessary call to get_textconv()Libravatar Simon Ruderich1-9/+14
The fill_one() function is responsible for finding and filling the textconv filter as necessary, and is called by diff_grep() function that implements "git log -G<pattern>". The has_changes() function that implements "git log -S<block>" calls get_textconv() for two sides being compared, before it checks to see if it was asked to perform the pickaxe limiting. Move the code around to avoid this wastage. After has_changes() calls get_textconv() to obtain textconv for both sides, fill_one() is called to use them. By adding get_textconv() to diff_grep() and relieving fill_one() of responsibility to find the textconv filter, we can avoid calling get_textconv() twice in has_changes(). With this change it's also no longer necessary for fill_one() to modify the textconv argument, therefore pass a pointer instead of a pointer to a pointer. Signed-off-by: Simon Ruderich <simon@ruderich.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-28pickaxe: use textconv for -S countingLibravatar Jeff King2-17/+51
We currently just look at raw blob data when using "-S" to pickaxe. This is mostly historical, as pickaxe predates the textconv feature. If the user has bothered to define a textconv filter, it is more likely that their search string will be on the textconv output, as that is what they will see in the diff (and we do not even provide a mechanism for them to search for binary needles that contain NUL characters). This patch teaches "-S" to use textconv, just as we already do for "-G". Signed-off-by: Jeff King <peff@peff.net>
2012-10-28pickaxe: hoist empty needle checkLibravatar Jeff King1-2/+3
If we are given an empty pickaxe needle like "git log -S ''", it is impossible for us to find anything (because no matter what the content, the count will always be 0). We currently check this at the lowest level of contains(). Let's hoist the logic much earlier to has_changes(), so that it is simpler to return our answer before loading any blob data. Signed-off-by: Jeff King <peff@peff.net>
2012-10-28diff_grep: use textconv buffers for add/deleted filesLibravatar Jeff King2-2/+14
If you use "-G" to grep a diff, we will apply a configured textconv filter to the data before generating the diff. However, if the diff is an addition or deletion, we do not bother running the diff at all, and just look for the token in the added (or removed) content. This works because we know that the diff must contain every line of content. However, while we used the textconv-derived buffers in the regular diff, we accidentally passed the original unmodified buffers to regexec when checking the added or removed content. This could lead to an incorrect answer. Worse, in some cases we might have a textconv buffer but no original buffer (e.g., if we pulled the textconv data from cache, or if we reused a working tree file when generating it). In that case, we could actually feed NULL to regexec and segfault. Reported-by: Peter Oberndorfer <kumbayo84@arcor.de> Signed-off-by: Jeff King <peff@peff.net>
2012-10-17Git 1.7.12.4Libravatar Junio C Hamano4-3/+27
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-17Merge branch 'jk/maint-http-half-auth-push' into maintLibravatar Junio C Hamano3-6/+6
* jk/maint-http-half-auth-push: http: fix segfault in handle_curl_result
2012-10-17Merge branch 'rr/git-uri-doc' into maintLibravatar Junio C Hamano1-2/+6
* rr/git-uri-doc: Git url doc: mark ftp/ftps as read-only and deprecate them
2012-10-17Merge branch 'bw/cp-a-is-gnuism' into maintLibravatar Junio C Hamano3-3/+3
* bw/cp-a-is-gnuism: tests: "cp -a" is a GNUism
2012-10-17Merge branch 'nd/doc-ignore' into maintLibravatar Junio C Hamano1-1/+5
* nd/doc-ignore: gitignore.txt: suggestions how to get literal # or ! at the beginning
2012-10-17Merge branch 'jc/doc-long-options' into maintLibravatar Junio C Hamano1-1/+11
* jc/doc-long-options: gitcli: parse-options lets you omit tail of long options
2012-10-17Merge branch 'jc/maint-t1450-fsck-order-fix' into maintLibravatar Junio C Hamano1-3/+1
* jc/maint-t1450-fsck-order-fix: t1450: the order the objects are checked is undefined
2012-10-17Merge branch 'rr/test-use-shell-path-not-shell' into maintLibravatar Junio C Hamano1-16/+16
* rr/test-use-shell-path-not-shell: test-lib: use $SHELL_PATH, not $SHELL
2012-10-17Merge branch 'rr/test-make-sure-we-have-git' into maintLibravatar Junio C Hamano2-10/+9
* rr/test-make-sure-we-have-git: t/test-lib: make sure Git has already been built
2012-10-17Merge branch 'po/maint-docs' into maintLibravatar Junio C Hamano5-15/+28
* po/maint-docs: Doc branch: show -vv option and alternative Doc clean: add See Also link Doc add: link gitignore Doc: separate gitignore pattern sources Doc: shallow clone deepens _to_ new depth
2012-10-17Merge branch 'jc/ll-merge-binary-ours' into maintLibravatar Junio C Hamano5-12/+41
* jc/ll-merge-binary-ours: ll-merge: warn about inability to merge binary files only when we can't attr: "binary" attribute should choose built-in "binary" merge driver merge: teach -Xours/-Xtheirs to binary ll-merge driver
2012-10-17Merge branch 'db/doc-custom-xmlto' into maintLibravatar Junio C Hamano1-2/+3
* db/doc-custom-xmlto: Documentation/Makefile: Allow custom XMLTO binary
2012-10-13Fix spelling error in post-receive-email hookLibravatar Richard Fearn1-1/+1
Signed-off-by: Richard Fearn <richardfearn@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-12http: fix segfault in handle_curl_resultLibravatar Jeff King3-6/+6
When we create an http active_request_slot, we can set its "results" pointer back to local storage. The http code will fill in the details of how the request went, and we can access those details even after the slot has been cleaned up. Commit 8809703 (http: factor out http error code handling) switched us from accessing our local results struct directly to accessing it via the "results" pointer of the slot. That means we're accessing the slot after it has been marked as finished, defeating the whole purpose of keeping the results storage separate. Most of the time this doesn't matter, as finishing the slot does not actually clean up the pointer. However, when using curl's multi interface with the dumb-http revision walker, we might actually start a new request before handing control back to the original caller. In that case, we may reuse the slot, zeroing its results pointer, and leading the original caller to segfault while looking for its results inside the slot. Instead, we need to pass a pointer to our local results storage to the handle_curl_result function, rather than relying on the pointer in the slot struct. This matches what the original code did before the refactoring (which did not use a separate function, and therefore just accessed the results struct directly). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-12gitweb.cgi: fix "comitter_tz" typo in feedLibravatar Dylan Alex Simon1-1/+1
gitweb's feeds sometimes contained committer timestamps in the wrong timezone due to a misspelling. Signed-off-by: Dylan Simon <dylan@dylex.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-10attr: a note about the order of .gitattributes lookupLibravatar Nguyen Thai Ngoc Duy1-0/+5
This is the documentation part of 1a9d7e9 (attr.c: read .gitattributes from index as well. - 2007-08-14) 06f33c1 (Read attributes from the index that is being checked out - 2009-03-13) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-09Merge branch 'maint' of git://github.com/git-l10n/git-po into maintLibravatar Junio C Hamano1-7/+7
* 'maint' of git://github.com/git-l10n/git-po: l10n: de.po: fix a few minor typos
2012-10-08tests: "cp -a" is a GNUismLibravatar Ben Walton3-3/+3
These tests just want a bit-for-bit identical copy; they do not need even -H (there is no symbolic link involved) nor -p (there is no funny permission or ownership issues involved). Just use "cp -R" instead. Signed-off-by: Ben Walton <bdwalton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-08Git url doc: mark ftp/ftps as read-only and deprecate themLibravatar Ramkumar Ramachandra1-2/+6
It is not even worth mentioning their removal; just discourage people from using them. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-08Git 1.7.12.3Libravatar Junio C Hamano3-2/+19
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-08Merge branch 'os/commit-submodule-ignore' into maintLibravatar Junio C Hamano1-0/+1
"git status" honored the ignore=dirty settings in .gitmodules but "git commit" didn't. * os/commit-submodule-ignore: commit: pay attention to submodule.$name.ignore in .gitmodules
2012-10-08Merge branch 'jk/receive-pack-unpack-error-to-pusher' into maintLibravatar Junio C Hamano2-5/+32
"git receive-pack" (the counterpart to "git push") did not give progress output while processing objects it received to the puser when run over the smart-http protocol. * jk/receive-pack-unpack-error-to-pusher: receive-pack: drop "n/a" on unpacker errors receive-pack: send pack-processing stderr over sideband receive-pack: redirect unpack-objects stdout to /dev/null
2012-10-08Merge branch 'rt/maint-clone-single' into maintLibravatar Junio C Hamano3-18/+218
A repository created with "git clone --single" had its fetch refspecs set up just like a clone without "--single", leading the subsequent "git fetch" to slurp all the other branches, defeating the whole point of specifying "only this branch". * rt/maint-clone-single: clone --single: limit the fetch refspec to fetched branch
2012-10-08Merge branch 'jc/blame-follows-renames' into maintLibravatar Junio C Hamano1-0/+6
It was unclear in the documentation for "git blame" that it is unnecessary for users to use the "--follow" option. * jc/blame-follows-renames: git blame: document that it always follows origin across whole-file renames
2012-10-08Merge branch 'lt/mailinfo-handle-attachment-more-sanely' into maintLibravatar Junio C Hamano1-11/+0
A patch attached as application/octet-stream (e.g. not text/*) were mishandled, not correctly honoring Content-Transfer-Encoding (e.g. base64). * lt/mailinfo-handle-attachment-more-sanely: mailinfo: don't require "text" mime type for attachments
2012-10-07gitignore.txt: suggestions how to get literal # or ! at the beginningLibravatar Nguyễn Thái Ngọc Duy1-1/+5
We support backslash escape, but we hide the details behind the phrase "a shell glob suitable for consumption by fnmatch(3)". So it may not be obvious how one can get literal # or ! at the beginning of pattern. Add a few lines on how to work around the magic characters. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-04gitcli: parse-options lets you omit tail of long optionsLibravatar Junio C Hamano1-1/+11
Describe the behaviour, but do warn people against taking it too literally and expect an abbreviation valid today will stay valid forever. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-04l10n: de.po: fix a few minor typosLibravatar Simon Ruderich1-7/+7
Signed-off-by: Simon Ruderich <simon@ruderich.org> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2012-10-02t1450: the order the objects are checked is undefinedLibravatar Junio C Hamano1-3/+1
When a tag T points at an object X that is of a type that is different from what the tag records as, fsck should report it as an error. However, depending on the order X and T are checked individually, the actual error message can be different. If X is checked first, fsck remembers X's type and then when it checks T, it notices that T records X as a wrong type (i.e. the complaint is about a broken tag T). If T is checked first, on the other hand, fsck remembers that we need to verify X is of the type tag records, and when it later checks X, it notices that X is of a wrong type (i.e. the complaint is about a broken object X). The important thing is that fsck notices such an error and diagnoses the issue on object X, but the test was expecting that we happen to check objects in the order to make us detect issues with tag T, not with object X. Remove this unwarranted assumption. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-02Start preparing for 1.7.12.3Libravatar Junio C Hamano2-1/+19
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-02Merge branch 'rr/maint-submodule-unknown-cmd' into maintLibravatar Junio C Hamano3-4/+11
"git submodule frotz" was not diagnosed as "frotz" being an unknown subcommand to "git submodule"; the user instead got a complaint that "git submodule status" was run with an unknown path "frotz". * rr/maint-submodule-unknown-cmd: submodule: if $command was not matched, don't parse other args
2012-10-02Merge branch 'sp/maint-http-enable-gzip' into maintLibravatar Junio C Hamano3-3/+5
"git fetch" over http advertised that it supports "deflate", which is much less common, and did not advertise more common "gzip" on its Accept-Encoding header. * sp/maint-http-enable-gzip: Enable info/refs gzip decompression in HTTP client
2012-10-02Merge branch 'sp/maint-http-info-refs-no-retry' into maintLibravatar Junio C Hamano1-16/+2
"git fetch" over http had an old workaround for an unlikely server misconfiguration; it turns out that this hurts debuggability of the configuration in general, and has been reverted. * sp/maint-http-info-refs-no-retry: Revert "retry request without query when info/refs?query fails"
2012-10-02l10n: Fix to Swedish translationLibravatar Peter Krefting1-2/+2
Fix bad translation of "Receiving objects". Signed-off-by: Peter Krefting <peter@softwolves.pp.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-30mailinfo: don't require "text" mime type for attachmentsLibravatar Linus Torvalds1-11/+0
Currently "git am" does insane things if the mbox it is given contains attachments with a MIME type that aren't "text/*". In particular, it will still decode them, and pass them "one line at a time" to the mail body filter, but because it has determined that they aren't text (without actually looking at the contents, just at the mime type) the "line" will be the encoding line (eg 'base64') rather than a line of *content*. Which then will cause the text filtering to fail, because we won't correctly notice when the attachment text switches from the commit message to the actual patch. Resulting in a patch failure, even if patch may be a perfectly well-formed attachment, it's just that the message type may be (for example) "application/octet-stream" instead of "text/plain". Just remove all the bogus games with the message_type. The only difference that code creates is how the data is passed to the filter function (chunked per-pred-code line or per post-decode line), and that difference is *wrong*, since chunking things per pre-decode line can never be a sensible operation, and cannot possibly matter for binary data anyway. This code goes all the way back to March of 2007, in commit 87ab79923463 ("builtin-mailinfo.c infrastrcture changes"), and apparently Don used to pass random mbox contents to git. However, the pre-decode vs post-decode logic really shouldn't matter even for that case, and more importantly, "I fed git am crap" is not a valid reason to break *real* patch attachments. If somebody really cares, and determines that some attachment is binary data (by looking at the data, not the MIME-type), the whole attachment should be dismissed, rather than fed in random-sized chunks to "handle_filter()". Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Don Zickus <dzickus@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-29Git 1.7.12.2Libravatar Junio C Hamano3-2/+11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-29Merge branch 'maint' of git://github.com/git-l10n/git-po into maintLibravatar Junio C Hamano2-28/+28
Update German and Simplified Chinese translations. * 'maint' of git://github.com/git-l10n/git-po: l10n: de.po: correct translation of a 'rebase' message l10n: Improve many translation for zh_CN l10n: Unify the translation for '(un)expected'
2012-09-29Merge branch 'jc/maint-log-grep-all-match-1' into maintLibravatar Junio C Hamano6-25/+217
* jc/maint-log-grep-all-match-1: grep.c: make two symbols really file-scope static this time t7810-grep: test --all-match with multiple --grep and --author options t7810-grep: test interaction of multiple --grep and --author options t7810-grep: test multiple --author with --all-match t7810-grep: test multiple --grep with and without --all-match t7810-grep: bring log --grep tests in common form grep.c: mark private file-scope symbols as static log: document use of multiple commit limiting options log --grep/--author: honor --all-match honored for multiple --grep patterns grep: show --debug output only once grep: teach --debug option to dump the parse tree
2012-09-29Merge branch 'jc/maint-mailinfo-mime-attr' into maintLibravatar Junio C Hamano6-4/+32
* jc/maint-mailinfo-mime-attr: mailinfo: do not concatenate charset= attribute values from mime headers
2012-09-28Merge branch 'l10n-thynson' of git://github.com/thynson/git-po-zh_CN into maintLibravatar Jiang Xin1-23/+23
* 'l10n-thynson' of git://github.com/thynson/git-po-zh_CN: l10n: Improve many translation for zh_CN l10n: Unify the translation for '(un)expected'
2012-09-28Merge branch 'maint' of https://github.com/ralfth/git-po-de into maintLibravatar Jiang Xin1-5/+5
* 'maint' of https://github.com/ralfth/git-po-de: l10n: de.po: correct translation of a 'rebase' message