summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-08-22fix >4GiB source delta assertion failureNicolas Pitre
When people try insane things such as delta-compressing 4GiB files, they get this assertion: diff-delta.c:285: create_delta_index: Assertion `packed_entry - (struct index_entry *)mem == entries' failed. This happens because: 1) the 'entries' variable is an unsigned int 2) it is assigned with entries = (bufsize - 1) / RABIN_WINDOW (that itself is not a problem unless bufsize > 4G * RABIN_WINDOW) 3) the buffer is indexed from top to bottom starting at "data = buffer + entries * RABIN_WINDOW" and the multiplication here does indeed overflows, making the resulting top of the buffer much lower than expected. This makes the number of actually produced index entries smaller than what was computed initially, hence the assertion. Furthermore, the current delta encoding format cannot represent offsets into a reference buffer with more than 32 bits anyway. So let's just limit the number of entries to what the delta format can encode. Reported-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-22t7403: add missing &&'sJens Lehmann
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-22Tell ignore file about generate files in /gitweb/staticMark Rada
Signed-off-by: Mark Rada <marada@uwaterloo.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-20Merge branch 'jc/maint-follow-rename-fix' into maintJunio C Hamano
* jc/maint-follow-rename-fix: log: test for regression introduced in v1.7.2-rc0~103^2~2 diff --follow: do call diffcore_std() as necessary diff --follow: do not waste cycles while recursing
2010-08-20Merge branch 'jn/maint-plug-leak' into maintJunio C Hamano
* jn/maint-plug-leak: write-tree: Avoid leak when index refers to an invalid object read-tree: stop leaking tree objects core: Stop leaking ondisk_cache_entrys
2010-08-20Merge branch 'jn/fix-abbrev' into maintJunio C Hamano
* jn/fix-abbrev: examples/commit: use --abbrev for commit summary checkout, commit: remove confusing assignments to rev.abbrev archive: abbreviate substituted commit ids again
2010-08-20Merge branch 'vs/doc-spell' into maintJunio C Hamano
* vs/doc-spell: Documentation: spelling fixes
2010-08-20Merge branch 'jn/rebase-rename-am' into maintJunio C Hamano
* jn/rebase-rename-am: rebase: protect against diff.renames configuration t3400 (rebase): whitespace cleanup Teach "apply --index-info" to handle rename patches t4150 (am): futureproof against failing tests t4150 (am): style fix
2010-08-20Merge branch 'jn/doc-pull' into maintJunio C Hamano
* jn/doc-pull: Documentation: flesh out “git pull” description
2010-08-20Merge branch 'bc/use-more-hardlinks-in-install' into maintJunio C Hamano
* bc/use-more-hardlinks-in-install: Makefile: make hard/symbolic links for non-builtins too Makefile: link builtins residing in bin directory to main git binary too
2010-08-20Merge branch 'tr/rfc-reset-doc' into maintJunio C Hamano
* tr/rfc-reset-doc: Documentation/reset: move "undo permanently" example behind "make topic" Documentation/reset: reorder examples to match description Documentation/reset: promote 'examples' one section up Documentation/reset: separate options by mode Documentation/git-reset: reorder modes for soft-mixed-hard progression
2010-08-20xmalloc: include size in the failure messageMatthieu Moy
Out-of-memory errors can either be actual lack of memory, or bugs (like code trying to call xmalloc(-1) by mistake). A little more information may help tracking bugs reported by users. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-19Git 1.7.2.2v1.7.2.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-19Merge branch 'tr/xsize-bits' into maintJunio C Hamano
* tr/xsize-bits: xsize_t: check whether we lose bits
2010-08-19Merge branch 'jc/sha1-name-find-fix' into maintJunio C Hamano
* jc/sha1-name-find-fix: sha1_name.c: fix parsing of ":/token" syntax Conflicts: sha1_name.c
2010-08-18Merge branch 'sp/fix-smart-http-deadlock-on-error' into maintJunio C Hamano
* sp/fix-smart-http-deadlock-on-error: smart-http: Don't deadlock on server failure
2010-08-16log: test for regression introduced in v1.7.2-rc0~103^2~2Ævar Arnfjörð Bjarmason
Add a regression test for the git log -M --follow $diff_option bug introduced in v1.7.2-rc0~103^2~2, $diff_option being diff related options like -p, --stat, --name-only etc. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-13diff --follow: do call diffcore_std() as necessaryJunio C Hamano
Usually, diff frontends populate the output queue with filepairs without any rename information and call diffcore_std() to sort the renames out. When --follow is in effect, however, diff-tree family of frontend has a hack that looks like this: diff-tree frontend -> diff_tree_sha1() . populate diff_queued_diff . if --follow is in effect and there is only one change that creates the target path, then -> try_to_follow_renames() -> diff_tree_sha1() with no pathspec but with -C -> diffcore_std() to find renames . if rename is found, tweak diff_queued_diff and put a single filepair that records the found rename there -> diffcore_std() . tweak elements on diff_queued_diff by - rename detection - path ordering - pickaxe filtering We need to skip parts of the second call to diffcore_std() that is related to rename detection, and do so only when try_to_follow_renames() did find a rename. Earlier 1da6175 (Make diffcore_std only can run once before a diff_flush, 2010-05-06) tried to deal with this issue incorrectly; it unconditionally disabled any second call to diffcore_std(). This hopefully fixes the breakage. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-13diff --follow: do not waste cycles while recursingJunio C Hamano
The "--follow" logic is called from diff_tree_sha1() function, but the input trees to diff_tree_sha1() are not necessarily the top-level trees (compare_tree_entry() calls it while it recursively descends into subtrees). When a newly created path lives in somewhere deep in the source hierarchy, e.g. "platform/", but the rename source is in a totally different place in the destination hierarchy, e.g. "lang-api/src/com/...", running "try_to_find_renames()" while base is set to "platform/" is a wasted call. We only need to run the rename following at the very top level. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-13push: mention "git pull" in error message for non-fast forwardsMatthieu Moy
The message remains fuzzy to include "git pull", "git pull --rebase" and others, but directs the user to the simplest solution in the vast majority of cases. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-12Standardize do { ... } while (0) styleJonathan Nieder
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-12t/t7003: replace \t with literal tab in sed expressionBrandon Casey
The sed utilities on IRIX and Solaris do not interpret the sequence '\t' to mean a tab character; they read a literal character 't'. So, use a literal tab instead. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-12index-pack: Don't follow replace refs.Nelson Elhage
Without this, attempting to index a pack containing objects that have been replaced results in a fatal error that looks like: fatal: SHA1 COLLISION FOUND WITH <replaced-object> ! Signed-off-by: Nelson Elhage <nelhage@ksplice.com> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11post-receive-email: remove spurious commas in email subjectMatthieu Moy
The previous form produced subjects like [SCM] project.git branch, foo, updated. ... The new one will produce the lighter [SCM] project.git branch foo updated. ... Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11fast-import: export correctly marks larger than 2^20-1Raja R Harinath
dump_marks_helper() has a bug when dumping marks larger than 2^20-1, i.e., when the sparse array has more than two levels. The bug was that the 'base' counter was being shifted by 20 bits at level 3, and then again by 10 bits at level 2, rather than a total shift of 20 bits in this argument to the recursive call: (base + k) << m->shift There are two ways to fix this correctly, the elegant: (base + k) << 10 and the one I chose due to edit distance: base + (k << m->shift) Signed-off-by: Raja R Harinath <harinath@hurrynot.org> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11t/lib-git-svn.sh: use $PERL_PATH for perl, not perl from $PATHÆvar Arnfjörð Bjarmason
Change the git-svn tests to use $PERL_PATH, not the "perl" in $PATH. Using perl in $PATH was added by Sam Vilain in v1.6.6-rc0~95^2~3, Philippe Bruhat introduced $PERL_PATH to the test suite in v1.6.6-rc0~9^2, but the lib-git-svn.sh tests weren't updated to use the new convention. This resulted in the git-svn tests always being skipped on my system. My /usr/bin/perl has access to SVN::Core and SVN::Repos, but the perl in my $PATH does not. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11write-tree: Avoid leak when index refers to an invalid objectJonathan Nieder
Noticed by valgrind during test t0000.35 “writing this tree without --missing-ok”. Even in the cherry-pick foo..bar code path, such an error is the end of the line. But maybe some day an interactive porcelain will want to link to libgit, making this matter. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11read-tree: stop leaking tree objectsJonathan Nieder
The underlying problem is that the fill_tree_descriptor() API is easy to misuse, and this patch does not fix that. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11core: Stop leaking ondisk_cache_entrysJonathan Nieder
Noticed with valgrind. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11diff: strip extra "/" when stripping prefixJakub Narebski
There are two ways a user might want to use "diff --relative": 1. For a file in a directory, like "subdir/file", the user can use "--relative=subdir/" to strip the directory. 2. To strip part of a filename, like "foo-10", they can use "--relative=foo-". We currently handle both of those situations. However, if the user passes "--relative=subdir" (without the trailing slash), we produce inconsistent results. For the unified diff format, we collapse the double-slash of "a//file" correctly into "a/file". But for other formats (raw, stat, name-status), we end up with "/file". We can do what the user means here and strip the extra "/" (and only a slash). We are not hurting any existing users of (2) above with this behavior change because the existing output for this case was nonsensical. Patch by Jakub, tests and commit message by Jeff King. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09gitweb: clarify search results page when no matching commit foundJonathan Nieder
When searching commits for a string that never occurs, the results page looks something like this: projects / foo.git / search \o/ summary | ... | tree [commit] search: [ kfjdkas ] [ ]re first ⋅ prev ⋅ next Merge branch 'maint' Foo: a demonstration project Without a list of hits to compare it to, the header describing the commit named by the hash parameter (usually HEAD) may itself look like a hit. Add some text (“No match.”) to replace the empty list of hits and avoid this confusion. While at it, remove some nearby dead code, left behind from a simplification a few years ago (v1.5.4-rc0~276^2~4, 2007-11-01). Noticed-by: Erick Mattos <erick.mattos@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09Documentation: add a FILES section for show-refJonathan Nieder
A peek at where the refs are kept might help understanding, even if, as the DESCRIPTION section suggests, direct access is not part of the public API. Balance that out with a pointer to update-ref. Suggested-by: Geoff Russell <geoffrey.russell@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09Makefile: add missing dependency on http.hJonathan Nieder
v1.7.1-rc0~65^2~2 (http: init and cleanup separately from http-walker, 2010-03-02) introduced a direct dependency from http-fetch on the HTTP request library. Declare it. Detected with "make CHECK_HEADER_DEPENDENCIES=1". Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09Makefile: add missing dependencies on url.hJonathan Nieder
v1.7.2-rc0~56^2 and its parent (decode file:// and ssh:// URLs, 2010-05-23) introduced a new url library. Update the Makefile with the relevant dependencies. Detected with "make CHECK_HEADER_DEPENDENCIES=1". Cc: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09Documentation/git-log: Clarify --full-diffMichael J Gruber
The current description gives the impression that "--full-diff" affects "log -p" only. Make it clearer that it affects all diff-based output types. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09git-rebase: fix typo when parsing --force-rebaseWilly Tarreau
Due to two missing hyphens, The "force" keyword on the command line would be taken as an alias for the --force-rebase option. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09imap-send: Fix sprintf usageÆvar Arnfjörð Bjarmason
When composing a command for the imap server, imap-send uses a single nfsnprintf() invocation for brevity instead of dealing separately with the case when there is a message to be sent and the case when there isn’t. The unused argument in the second case, while valid, is confusing for static analyzers and human readers. v1.6.4-rc0~117 (imap-send: add support for IPv6, 2009-05-25) mistakenly used %hu as the format for an int “port”, by analogy with existing usage for the unsigned short “addr.sin_port”.  Use %d instead. Noticed with clang. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09prune: allow --dry-run for -n and --verbose for -vRené Scharfe
For consistency with other git commands, let git prune accept the long options --dry-run and --verbose for the respective short ones -n and -v. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09notes: allow --dry-run for -n and --verbose for -vRené Scharfe
For consistency with other git commands, let the prune subcommand of git notes accept the long options --dry-run and --verbose for the respective short ones -n and -v. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -CMatthieu Moy
These options take an optional argument, but this optional argument was not documented. Original patch by Matthieu Moy, but documentation for -B mostly copied from the explanations of Junio C Hamano. While we're there, fix a typo in a comment in diffcore.h. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09Documentation: cite git-am from git-applyBrad King
Users reading git-apply documentation may also be interested in git-am, especially after receiving an email created with git-format-patch. The documentation for git-am already references git-apply. Add the reverse. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09t7003: fix subdirectory-filter testThomas Rast
The test would not fail if the filtering failed to do anything, since in test -z "$(git diff HEAD directorymoved:newsubdir)"' 'directorymoved:newsubdir' is not valid, so git-diff fails without printing anything on stdout. But then the exit status of git-diff is lost, whereas test -z "" succeeds. Use 'git diff --exit-code' instead, which does the right thing and has the added bonus of showing the differences if there are any. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-06smart-http: Don't deadlock on server failureShawn O. Pearce
If the remote HTTP server fails (e.g. returns 404 or 500) when we posted the RPC to it, we won't have sent anything to the background Git process that is supposed to handle the stream. Because we didn't send anything, its waiting for input from remote-curl, and remote-curl cannot read its response payload because doing so would lead to a deadlock. Send the background task EOF on its input before we try to read its response back, that way it will break out of its read loop and terminate. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-06Allow "check-ref-format --branch" from subdirectoryJonathan Nieder
check-ref-format --branch requires access to the repository to resolve refs like @{-1}. Noticed by Nguyễn Thái Ngọc Duy. Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-06check-ref-format: handle subcommands in separate functionsJonathan Nieder
The code for each subcommand should be easier to read and manipulate this way. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-05pretty-options.txt: match --format's documentation with implementation.Matthieu Moy
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-03Merge branch 'sv/maint-diff-q-clear-fix' into maintJunio C Hamano
* sv/maint-diff-q-clear-fix: Fix DIFF_QUEUE_CLEAR refactoring
2010-08-03Merge branch 'rr/svn-fe' into maintJunio C Hamano
* rr/svn-fe: contrib/svn-fe: Add the svn-fe target to .gitignore contrib/svn-fe: Fix IncludePath
2010-08-03Merge branch 'pt/git-gui' into maintJunio C Hamano
* pt/git-gui: git-gui: fix size and position of window panes on startup git-gui: mc cannot be used before msgcat has been loaded git-gui: use textconv filter for diff and blame git-gui: Avoid using the <<Copy>> binding as a menu accelerator on win32 git-gui: fix shortcut creation on cygwin git-gui: fix PATH environment for mingw development environment git-gui: fix usage of _gitworktree when creating shortcut for windows git-gui: fix "Explore Working Copy" for Windows again git-gui: fix usage of themed widgets variable git-gui: Handle failure of core.worktree to identify the working directory. git-gui: check whether systems nice command works or disable it
2010-08-03contrib/svn-fe: Add the svn-fe target to .gitignoreRamkumar Ramachandra
Add the svn-fe target to .gitignroe. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>