summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-02-02vcs-svn: allow import of > 4GiB filesJonathan Nieder
There is no reason in principle that an svn-format dump would not be able to represent a file whose length does not fit in a 32-bit integer. Use off_t consistently to represent file lengths (in place of using uint32_t in some contexts) so we can handle that. Most svn-fe code is already ready to do that without this patch and passes values of type off_t around. The type mismatch from stragglers was noticed with gcc -Wtype-limits. While at it, tighten the parsing of the Text-content-length field to make sure it is a number and does not overflow, and tighten other overflow checks as that value is passed around and manipulated. Inspired-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-02vcs-svn: rename check_overflow arguments for clarityRamsay Jones
Code using the argument names a and b just doesn't look right (not sure why!). Use more explicit names "offset" and "len" to make their type and meaning clearer. Also rename check_overflow() to check_offset_overflow() to clarify that we are making sure that "len" bytes beyond "offset" still fits the type to represent an offset. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-27vcs-svn/svndiff.c: squelch false "unused" warning from gccJunio C Hamano
Curiously, pre_len given to read_length() does not trigger the same warning even though the code structure is the same. Most likely this is because read_offset() is used only once and inlining it will make gcc realize that it has a chance to do more flow analysis. Alas, the analysis is flawed, so it does not help X-<. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-27Merge branch 'svn-fe' of git://repo.or.cz/git/jrn into jn/svn-feJunio C Hamano
This simplifies svn-fe a great deal and fulfills a longstanding wish: support for dumps with deltas in them, and incremental imports. The cost is that commandline usage of the svn-fe tool becomes a little more complicated since it no longer keeps state itself but instead reads blobs back from fast-import in order to copy them between revisions and apply deltas to them. Also removes a couple of custom data structures and replaces them with strbufs like other parts of Git. * 'svn-fe' of git://repo.or.cz/git/jrn: (32 commits) vcs-svn: reset first_commit_done in fast_export_init vcs-svn: do not initialize report_buffer twice vcs-svn: avoid hangs from corrupt deltas vcs-svn: guard against overflow when computing preimage length vcs-svn: cap number of bytes read from sliding view test-svn-fe: split off "test-svn-fe -d" into a separate function vcs-svn: implement text-delta handling vcs-svn: let deltas use data from preimage vcs-svn: let deltas use data from postimage vcs-svn: verify that deltas consume all inline data vcs-svn: implement copyfrom_data delta instruction vcs-svn: read instructions from deltas vcs-svn: read inline data from deltas vcs-svn: read the preimage when applying deltas vcs-svn: parse svndiff0 window header vcs-svn: skeleton of an svn delta parser vcs-svn: make buffer_read_binary API more convenient vcs-svn: learn to maintain a sliding view of a file Makefile: list one vcs-svn/xdiff object or header per line vcs-svn: avoid using ls command twice ... Conflicts: Makefile contrib/svn-fe/svn-fe.txt
2012-01-23Fix typo in 1.7.9 release notesMichael Haggerty
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-18Git 1.7.9-rc2v1.7.9-rc2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-18Merge branch 'maint'Junio C Hamano
* maint: Git 1.7.8.4 Git 1.7.7.6 diff-index: enable recursive pathspec matching in unpack_trees Conflicts: GIT-VERSION-GEN
2012-01-18Git 1.7.8.4v1.7.8.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-18Merge branch 'maint-1.7.7' into maintJunio C Hamano
* maint-1.7.7: Git 1.7.7.6 diff-index: enable recursive pathspec matching in unpack_trees Conflicts: GIT-VERSION-GEN
2012-01-18Git 1.7.7.6v1.7.7.6Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-18diff-index: enable recursive pathspec matching in unpack_treesNguyen Thai Ngoc Duy
The pathspec structure has a few bits of data to drive various operation modes after we unified the pathspec matching logic in various codepaths. For example, max_depth field is there so that "git grep" can limit the output for files found in limited depth of tree traversal. Also in order to show just the surface level differences in "git diff-tree", recursive field stops us from descending into deeper level of the tree structure when it is set to false, and this also affects pathspec matching when we have wildcards in the pathspec. The diff-index has always wanted the recursive behaviour, and wanted to match pathspecs without any depth limit. But we forgot to do so when we updated tree_entry_interesting() logic to unify the pathspec matching logic. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-18Merge branch 'jc/pull-signed-tag-doc'Junio C Hamano
* jc/pull-signed-tag-doc: pulling signed tag: add howto document
2012-01-18pulling signed tag: add howto documentJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-18Merge branch 'jk/credentials'Junio C Hamano
* jk/credentials: credential-cache: ignore "connection refused" errors unix-socket: do not let close() or chdir() clobber errno during cleanup credential-cache: report more daemon connection errors unix-socket: handle long socket pathnames
2012-01-18Merge branch 'nd/pathspec-recursion-cleanup'Junio C Hamano
* nd/pathspec-recursion-cleanup: diff-index: enable recursive pathspec matching in unpack_trees Document limited recursion pathspec matching with wildcards
2012-01-18Merge branch 'mh/maint-show-ref-doc'Junio C Hamano
* mh/maint-show-ref-doc: git-show-ref doc: typeset regexp in fixed width font git-show-ref: fix escaping in asciidoc source
2012-01-18Merge branch 'tr/maint-word-diff-incomplete-line'Junio C Hamano
* tr/maint-word-diff-incomplete-line: word-diff: ignore '\ No newline at eof' marker
2012-01-17credential-cache: ignore "connection refused" errorsJeff King
The credential-cache helper will try to connect to its daemon over a unix socket. Originally, a failure to do so was silently ignored, and we would either give up (if performing a "get" or "erase" operation), or spawn a new daemon (for a "store" operation). But since 8ec6c8d, we try to report more errors. We detect a missing daemon by checking for ENOENT on our connection attempt. If the daemon is missing, we continue as before (giving up or spawning a new daemon). For any other error, we die and report the problem. However, checking for ENOENT is not sufficient for a missing daemon. We might also get ECONNREFUSED if a dead daemon process left a stale socket. This generally shouldn't happen, as the daemon cleans up after itself, but the daemon may not always be given a chance to do so (e.g., power loss, "kill -9"). The resulting state is annoying not just because the helper outputs an extra useless message, but because it actually blocks the helper from spawning a new daemon to replace the stale socket. Fix it by checking for ECONNREFUSED. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-17Merge branch 'jn/maint-gitweb-grep-fix'Junio C Hamano
* jn/maint-gitweb-grep-fix: gitweb: Harden "grep" search against filenames with ':' gitweb: Fix file links in "grep" search
2012-01-16diff-index: enable recursive pathspec matching in unpack_treesNguyen Thai Ngoc Duy
The pathspec structure has a few bits of data to drive various operation modes after we unified the pathspec matching logic in various codepaths. For example, max_depth field is there so that "git grep" can limit the output for files found in limited depth of tree traversal. Also in order to show just the surface level differences in "git diff-tree", recursive field stops us from descending into deeper level of the tree structure when it is set to false, and this also affects pathspec matching when we have wildcards in the pathspec. The diff-index has always wanted the recursive behaviour, and wanted to match pathspecs without any depth limit. But we forgot to do so when we updated tree_entry_interesting() logic to unify the pathspec matching logic. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-15Document limited recursion pathspec matching with wildcardsNguyễn Thái Ngọc Duy
It's actually unlimited recursion if wildcards are active regardless --max-depth Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-13git-show-ref doc: typeset regexp in fixed width fontMichael Haggerty
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-13git-show-ref: fix escaping in asciidoc sourceMichael Haggerty
Two "^" characters were incorrectly being interpreted as markup for superscripting. Fix them by writing them as attribute references "{caret}". Although a single "^" character in a paragraph cannot be misinterpreted in this way, also write other "^" characters as "{caret}" in the interest of good hygiene (unless they are in literal paragraphs, of course, in which context attribute references are not recognized). Spell "{}" consistently, namely *not* quoted as "\{\}". Since the braces are empty, they cannot be interpreted as an attribute reference, and either spelling is OK. So arbitrarily choose one variation and use it consistently. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-13Git 1.7.9-rc1v1.7.9-rc1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-13Merge branch 'jc/request-pull-show-head-4'Junio C Hamano
* jc/request-pull-show-head-4: request-pull: use the real fork point when preparing the message
2012-01-13Merge branch 'tr/maint-mailinfo'Junio C Hamano
* tr/maint-mailinfo: mailinfo documentation: accurately describe non -k case
2012-01-13Merge branch 'ss/maint-msys-cvsexportcommit'Junio C Hamano
* ss/maint-msys-cvsexportcommit: git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS t9200: On MSYS, do not pass Windows-style paths to CVS
2012-01-13Merge branch 'jk/maint-upload-archive'Junio C Hamano
* jk/maint-upload-archive: archive: re-allow HEAD:Documentation on a remote invocation
2012-01-13Merge branch 'maint'Junio C Hamano
* maint: Update draft release notes to 1.7.8.4 Update draft release notes to 1.7.7.6 Update draft release notes to 1.7.6.6 thin-pack: try harder to use preferred base objects as base
2012-01-13Update draft release notes to 1.7.8.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-13Merge branch 'maint-1.7.7' into maintJunio C Hamano
* maint-1.7.7: Update draft release notes to 1.7.7.6 Update draft release notes to 1.7.6.6 thin-pack: try harder to use preferred base objects as base
2012-01-13Update draft release notes to 1.7.7.6Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-13Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano
* maint-1.7.6: Update draft release notes to 1.7.6.6 thin-pack: try harder to use preferred base objects as base
2012-01-13Update draft release notes to 1.7.6.6Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-13thin-pack: try harder to use preferred base objects as baseJeff King
When creating a pack using objects that reside in existing packs, we try to avoid recomputing futile delta between an object (trg) and a candidate for its base object (src) if they are stored in the same packfile, and trg is not recorded as a delta already. This heuristics makes sense because it is likely that we tried to express trg as a delta based on src but it did not produce a good delta when we created the existing pack. As the pack heuristics prefer producing delta to remove data, and Linus's law dictates that the size of a file grows over time, we tend to record the newest version of the file as inflated, and older ones as delta against it. When creating a thin-pack to transfer recent history, it is likely that we will try to send an object that is recorded in full, as it is newer. But the heuristics to avoid recomputing futile delta effectively forbids us from attempting to express such an object as a delta based on another object. Sending an object in full is often more expensive than sending a suboptimal delta based on other objects, and it is even more so if we could use an object we know the receiving end already has (i.e. preferred base object) as the delta base. Tweak the recomputation avoidance logic, so that we do not punt on computing delta against a preferred base object. The effect of this change can be seen on two simulated upload-pack workloads. The first is based on 44 reflog entries from my git.git origin/master reflog, and represents the packs that kernel.org sent me git updates for the past month or two. The second workload represents much larger fetches, going from git's v1.0.0 tag to v1.1.0, then v1.1.0 to v1.2.0, and so on. The table below shows the average generated pack size and the average CPU time consumed for each dataset, both before and after the patch: dataset | reflog | tags --------------------------------- before | 53358 | 2750977 size after | 32398 | 2668479 change | -39% | -3% --------------------------------- before | 0.18 | 1.12 CPU after | 0.18 | 1.15 change | +0% | +3% This patch makes a much bigger difference for packs with a shorter slice of history (since its effect is seen at the boundaries of the pack) though it has some benefit even for larger packs. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12word-diff: ignore '\ No newline at eof' markerThomas Rast
The word-diff logic accumulates + and - lines until another line type appears (normally [ @\]), at which point it generates the word diff. This is usually correct, but it breaks when the preimage does not have a newline at EOF: $ printf "%s" "a a a" >a $ printf "%s\n" "a ab a" >b $ git diff --no-index --word-diff a b diff --git 1/a 2/b index 9f68e94..6a7c02f 100644 --- 1/a +++ 2/b @@ -1 +1 @@ [-a a a-] No newline at end of file {+a ab a+} Because of the order of the lines in a unified diff @@ -1 +1 @@ -a a a \ No newline at end of file +a ab a the '\' line flushed the buffers, and the - and + lines were never matched with each other. A proper fix would defer such markers until the end of the hunk. However, word-diff is inherently whitespace-ignoring, so as a cheap fix simply ignore the marker (and hide it from the output). We use a prefix match for '\ ' to parallel the logic in apply.c:parse_fragment(). We currently do not localize this string (just accept other variants of it in git-apply), but this should be future-proof. Noticed-by: Ivan Shirokoff <shirokoff@yandex-team.ru> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12archive: re-allow HEAD:Documentation on a remote invocationCarlos Martín Nieto
The tightening done in (ee27ca4a: archive: don't let remote clients get unreachable commits, 2011-11-17) went too far and disallowed HEAD:Documentation as it would try to find "HEAD:Documentation" as a ref. Only DWIM the "HEAD" part to see if it exists as a ref. Once we're sure that we've been given a valid ref, we follow the normal code path. This still disallows attempts to access commits which are not branch tips. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12Merge branch 'maint'Junio C Hamano
* maint: attr: fix leak in free_attr_elem t2203: fix wrong commit command
2012-01-12Merge branch 'maint-1.7.7' into maintJunio C Hamano
* maint-1.7.7: attr: fix leak in free_attr_elem t2203: fix wrong commit command
2012-01-12Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano
* maint-1.7.6: attr: fix leak in free_attr_elem t2203: fix wrong commit command
2012-01-12attr: fix leak in free_attr_elemJeff King
This function frees the individual "struct match_attr"s we have allocated, but forgot to free the array holding their pointers, leading to a minor memory leak (but it can add up after checking attributes for paths in many directories). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYSSebastian Schuberth
Due to MSYS path mangling GIT_DIR contains a Windows-style path when checked inside a Perl script even if GIT_DIR was previously set to an MSYS-style path in a shell script. So explicitly convert to an MSYS-style path before calling Perl's rel2abs() to make it work. This fix was inspired by a very similar patch in WebKit: http://trac.webkit.org/changeset/76255/trunk/Tools/Scripts/commit-log-editor Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12t9200: On MSYS, do not pass Windows-style paths to CVSSebastian Schuberth
For details, see the commit message of 4114156ae9. Note that while using $PWD as part of GIT_DIR is not required here, it does no harm and it is more consistent. In addition, on MSYS using an environment variable should be slightly faster than spawning an external executable. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12unix-socket: do not let close() or chdir() clobber errno during cleanupJonathan Nieder
unix_stream_connect and unix_stream_listen return -1 on error, with errno set by the failing underlying call to allow the caller to write a useful diagnosis. Unfortunately the error path involves a few system calls itself, such as close(), that can themselves touch errno. This is not as worrisome as it might sound. If close() fails, this just means substituting one meaningful error message for another, which is perfectly fine. However, when the call _succeeds_, it is allowed to (and sometimes might) clobber errno along the way with some undefined value, so it is good higiene to save errno and restore it immediately before returning to the caller. Do so. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12mailinfo documentation: accurately describe non -k caseThomas Rast
Since its very first description of -k, the documentation for git-mailinfo claimed that (in the case without -k) after cleaning up bracketed strings [blah], it would insert [PATCH]. It doesn't; on the contrary, one of the important jobs of mailinfo is to remove those strings. Since we're already there, rewrite the paragraph to give a complete enumeration of all the transformations. Specifically, it was missing the whitespace normalization (run of isspace(c) -> ' ') and the removal of leading ':'. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-11t2203: fix wrong commit commandNguyễn Thái Ngọc Duy
Add commit message to avoid commit's aborting due to the lack of commit message, not because there are INTENT_TO_ADD entries in index. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-11request-pull: use the real fork point when preparing the messageJunio C Hamano
The command takes the "start" argument and computes the merge base between it and the commit to be pulled so that we can show the diffstat, but uses the "start" argument as-is when composing the message The following changes since commit $X are available to tell the integrator which commit the work is based on. Giving "origin" (most of the time it resolves to refs/remotes/origin/master) as the start argument is often convenient, but it is usually not the fork point, and does not help the integrator at all. Use the real fork point, which is the merge base we already compute, when composing that part of the message. Suggested-by: Linus Torvalds Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-10Merge branch 'bw/maint-t8006-sed-incomplete-line'Junio C Hamano
* bw/maint-t8006-sed-incomplete-line: Use perl instead of sed for t8006-blame-textconv test
2012-01-10Sync with maintJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-10Prepare for 1.7.8.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>