Provide macros to generate a type-specific treap implementation and
various functions to operate on it. It uses obj_pool.h to store memory
nodes in a treap. Previously committed nodes are never removed from
the pool; after any *_commit operation, it is assumed (correctly, in
the case of svn-fast-export) that someone else must care about them.
Treaps provide a memory-efficient binary search tree structure.
Insertion/deletion/search are about as about as fast in the average
case as red-black trees and the chances of worst-case behavior are
vanishingly small, thanks to (pseudo-)randomness. The bad worst-case
behavior is a small price to pay, given that treaps are much simpler
to implement.
>From http://www.canonware.com/download/trp/trp_hash/trp.h
[db: Altered to reference nodes by offset from a common base pointer]
[db: Bob Jenkins' hashing implementation dropped for Knuth's]
[db: Methods unnecessary for search and insert dropped]
[rr: Squelched compiler warnings]
[db: Added support for immutable treap nodes]
[jn: Reintroduced treap_nsearch(); with tests]
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Add a memory pool library implemented using C macros. The
obj_pool_gen() macro creates a type-specific memory pool.
The memory pool library is distinguished from the existing specialized
allocators in alloc.c by using a contiguous block for all allocations.
This means that on one hand, long-lived pointers have to be written as
offsets, since the base address changes as the pool grows, but on the
other hand, the entire pool can be easily written to the file system.
This could allow the memory pool to persist between runs of an
application.
For the svn importer, such a facility is useful because each svn
revision can copy trees and files from any previous revision. The
relevant information for all revisions has to persist somehow to
support incremental runs.
[rr: minor cleanups]
[jn: added tests; removed file system backing for now]
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Teach the build system to build a separate library for the
upcoming subversion interop support.
The resulting vcs-svn/lib.a does not contain any code, nor is
it built during a normal build. This is just scaffolding for
later changes.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* 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
* 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
* maint:
push: mention "git pull" in error message for non-fast forwards
Standardize do { ... } while (0) style
t/t7003: replace \t with literal tab in sed expression
index-pack: Don't follow replace refs.
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>
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>
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>
* maint:
post-receive-email: remove spurious commas in email subject
fast-import: export correctly marks larger than 2^20-1
t/lib-git-svn.sh: use $PERL_PATH for perl, not perl from $PATH
diff: strip extra "/" when stripping prefix
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>
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>
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>
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>
* maint:
gitweb: clarify search results page when no matching commit found
Documentation: add a FILES section for show-ref
Makefile: add missing dependency on http.h
Makefile: add missing dependencies on url.h
Documentation/git-log: Clarify --full-diff
git-rebase: fix typo when parsing --force-rebase
imap-send: Fix sprintf usage
prune: allow --dry-run for -n and --verbose for -v
notes: allow --dry-run for -n and --verbose for -v
Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C
Documentation: cite git-am from git-apply
t7003: fix subdirectory-filter test
Allow "check-ref-format --branch" from subdirectory
check-ref-format: handle subcommands in separate functions
pretty-options.txt: match --format's documentation with implementation.
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 'webrick' of git://git.bogomips.org/git-svn:
instaweb: add access+error logging for WEBrick
instaweb: minimize moving parts for WEBrick
instaweb: fix WEBrick server support
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>
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>
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>
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>
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>
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>
This allows WEBrick to support all the logging functionality
in a manner consistent with the other web servers.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Since there are WEBrick configuration settings (including the
upcoming AccessLog support) that cannot be represented in YAML
and require Ruby anyways, the YAML config file is an unnecessary
layer of complexity.
Additionally, the shell script wrapper to start WEBrick is
unecessary since our generated Ruby script can be made
executable in the same manner with /usr/bin/env.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
This has been broken since commit be5347b ("httpd logs in a
"$httpd_only" subdirectory").
Since WEBrick has no other way of preserving environment
variables needed for gitweb, we create a shell script wrapper
that sets the environment variables as our CGI interpreter
to run gitweb.cgi.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
This change allows git-svn to handle an URL with colons in the path
[ew: rewritten to use uri_decode() function]
Signed-off-by: Eric Wong <normalperson@yhbt.net>
* maint:
contrib/svn-fe: Add the svn-fe target to .gitignore
contrib/svn-fe: Fix IncludePath
Fix DIFF_QUEUE_CLEAR refactoring
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
* 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
Include the path "../../vcs-svn" while compiling it in the Makefile
and change svn-fe.c to include svndump.h.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>