1
0
mirror of https://github.com/git/git.git synced 2024-10-03 14:01:22 +02:00
Git Source Code Mirror. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
Go to file
Brian Downing 43fe901b71 compat: Add simplified merge sort implementation from glibc
qsort in Windows 2000 (and various other C libraries) is a Quicksort
with the usual O(n^2) worst case.  Unfortunately, sorting Git trees
seems to get very close to that worst case quite often:

    $ /git/gitbad runstatus
    # On branch master
    qsort, nmemb = 30842
    done, 237838087 comparisons.

This patch adds a simplified version of the merge sort that is glibc's
qsort(3).  As a merge sort, this needs a temporary array equal in size
to the array that is to be sorted, but has a worst-case performance of
O(n log n).

The complexity that was removed is:

* Doing direct stores for word-size and -aligned data.
* Falling back to quicksort if the allocation required to perform the
  merge sort would likely push the machine into swap.

Even with these simplifications, this seems to outperform the Windows
qsort(3) implementation, even in Windows XP (where it is "fixed" and
doesn't trigger O(n^2) complexity on trees).

[jes: moved into compat/qsort.c, as per Johannes Sixt's suggestion]
[bcd: removed gcc-ism, thanks to Edgar Toernig.  renamed make variable
      per Junio's comment.]

Signed-off-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-06 22:35:28 -08:00
arm
compat compat: Add simplified merge sort implementation from glibc 2008-02-06 22:35:28 -08:00
contrib git-p4: Fix an obvious typo 2008-02-03 13:00:15 -08:00
Documentation man pages are littered with .ft C and others 2008-02-05 00:30:22 -08:00
git-gui Merge git://repo.or.cz/git-gui 2008-01-23 21:37:12 -08:00
gitk-git Merge git://git.kernel.org/pub/scm/gitk/gitk 2008-01-20 16:57:56 -08:00
gitweb gitweb: Make use of the $git_dir variable at sub git_get_project_description 2008-01-29 23:55:18 -08:00
mozilla-sha1
perl Don't cache DESTDIR in perl/perl.mak. 2007-12-11 00:38:46 -08:00
ppc
t Test :/string form for checkout 2008-02-04 20:10:07 -08:00
templates Officially deprecate repo-config. 2008-01-17 22:52:40 -08:00
xdiff Remove unreachable statements 2007-11-15 21:23:47 -08:00
.gitignore Remove old generated files from .gitignore. 2007-12-20 17:05:31 -08:00
.mailmap GIT 1.5.4-rc1 2007-12-19 17:24:04 -08:00
alloc.c
archive-tar.c
archive-zip.c
archive.c Move sha1_file_to_archive into libgit 2008-01-18 12:33:50 -08:00
archive.h
attr.c
attr.h
base85.c
blob.c
blob.h
builtin-add.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-annotate.c
builtin-apply.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-archive.c Move sha1_file_to_archive into libgit 2008-01-18 12:33:50 -08:00
builtin-blame.c Fix grammar nits in documentation and in code comments. 2008-01-03 09:15:17 -08:00
builtin-branch.c git config --get-colorbool 2007-12-05 17:57:11 -08:00
builtin-bundle.c bundle create: keep symbolic refs' names instead of resolving them 2007-11-22 15:15:25 -08:00
builtin-cat-file.c
builtin-check-attr.c
builtin-check-ref-format.c
builtin-checkout-index.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-clean.c git-clean: fix off-by-one memory access when given no arguments 2008-01-12 11:10:09 -08:00
builtin-commit-tree.c Re-fix "builtin-commit: fix --signoff" 2007-12-09 00:55:55 -08:00
builtin-commit.c Fix "git-commit -C $tag" 2008-02-03 00:56:35 -08:00
builtin-config.c config --get-colorbool: diff.color is a deprecated synonym to color.diff 2007-12-05 23:05:10 -08:00
builtin-count-objects.c
builtin-describe.c make 'git describe --all --contains' work 2007-12-19 14:59:19 -08:00
builtin-diff-files.c add a "basic" diff config callback 2008-01-04 16:05:23 -08:00
builtin-diff-index.c add a "basic" diff config callback 2008-01-04 16:05:23 -08:00
builtin-diff-tree.c add a "basic" diff config callback 2008-01-04 16:05:23 -08:00
builtin-diff.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-fast-export.c Fix git-fast-export for zero-sized blobs 2007-12-12 10:59:22 -08:00
builtin-fetch--tool.c Error out when user doesn't have access permission to the repository 2007-11-30 13:10:11 -08:00
builtin-fetch-pack.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-fetch.c Rewrite builtin-fetch option parsing to use parse_options(). 2007-12-04 23:48:39 -08:00
builtin-fmt-merge-msg.c Fix parent rewriting in --early-output 2007-11-14 03:59:37 -08:00
builtin-for-each-ref.c for-each-ref: Fix quoting style constants. 2007-12-06 07:53:20 -08:00
builtin-fsck.c git-fsck: report missing author/commit line in a commit as an error 2008-02-03 16:04:56 -08:00
builtin-gc.c slightly better auto gc message 2008-01-07 14:02:25 -08:00
builtin-grep.c Don't access line[-1] for a zero-length "line" from fgets. 2008-01-04 12:28:58 -08:00
builtin-http-fetch.c http-push and http-fetch: handle URLs without trailing / 2008-01-20 15:18:34 -08:00
builtin-init-db.c fix misuse of prefix_path() 2008-02-03 22:49:01 -08:00
builtin-log.c git show <tag>: show the tagger 2007-12-19 14:59:11 -08:00
builtin-ls-files.c Export three helper functions from ls-files 2007-11-22 17:05:05 -08:00
builtin-ls-remote.c ls-remote: add -t and -h options. 2008-01-15 17:04:21 -08:00
builtin-ls-tree.c
builtin-mailinfo.c
builtin-mailsplit.c
builtin-merge-base.c
builtin-merge-file.c
builtin-merge-ours.c git-merge-ours: make it a builtin. 2007-11-22 14:21:59 -08:00
builtin-mv.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-name-rev.c
builtin-pack-objects.c pack-objects: Fix segfault when object count is less than thread count 2008-01-21 17:24:12 -08:00
builtin-pack-refs.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-prune-packed.c
builtin-prune.c Add "--expire <time>" option to 'git prune' 2007-11-30 15:47:01 -08:00
builtin-push.c Merge branch 'sp/refspec-match' 2007-12-04 17:07:10 -08:00
builtin-read-tree.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-reflog.c reflog-expire: Avoid creating new files in a directory inside readdir(3) loop 2008-01-29 21:48:57 -08:00
builtin-rerere.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-reset.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-rev-list.c Don't access line[-1] for a zero-length "line" from fgets. 2008-01-04 12:28:58 -08:00
builtin-rev-parse.c git-rev-parse --symbolic-full-name 2008-01-06 18:41:43 -08:00
builtin-revert.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-rm.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-send-pack.c Update callers of check_ref_format() 2008-01-02 11:20:09 -08:00
builtin-shortlog.c shortlog: mention the "-e" option in the usage 2008-01-09 12:25:27 -08:00
builtin-show-branch.c
builtin-show-ref.c
builtin-stripspace.c
builtin-symbolic-ref.c
builtin-tag.c Fix $EDITOR regression introduced by rewrite in C. 2007-12-22 10:26:08 -08:00
builtin-tar-tree.c
builtin-unpack-objects.c
builtin-update-index.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin-update-ref.c
builtin-upload-archive.c
builtin-verify-pack.c
builtin-verify-tag.c
builtin-write-tree.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
builtin.h Merge branch 'kh/commit' 2007-12-04 17:16:33 -08:00
bundle.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
bundle.h
cache-tree.c
cache-tree.h
cache.h Fix random fast-import errors when compiled with NO_MMAP 2008-01-17 22:39:20 -08:00
check-builtins.sh
check-racy.c
color.c Support GIT_PAGER_IN_USE environment variable 2007-12-11 00:42:05 -08:00
color.h git config --get-colorbool 2007-12-05 17:57:11 -08:00
combine-diff.c Fix rewrite_diff() name quoting. 2007-12-26 17:13:36 -08:00
command-list.txt Officially deprecate repo-config. 2008-01-17 22:52:40 -08:00
commit.c parse_commit_buffer: tighten checks while parsing 2008-01-20 11:00:57 -08:00
commit.h add -i: Fix running from a subdirectory 2007-11-25 10:23:13 -08:00
config.c fix misuse of prefix_path() 2008-02-03 22:49:01 -08:00
config.mak.in autoconf: define NO_SYS_SELECT_H on systems without <sys/select.h>. 2008-01-25 22:26:08 -08:00
configure.ac autoconf: define NO_SYS_SELECT_H on systems without <sys/select.h>. 2008-01-25 22:26:08 -08:00
connect.c
convert.c treat any file with NUL as binary 2008-01-16 09:10:34 -08:00
copy.c
COPYING
csum-file.c
csum-file.h
ctype.c
daemon.c
date.c
decorate.c
decorate.h
delta.h
diff-delta.c fix style of a few comments in diff-delta.c 2007-12-18 15:22:28 -08:00
diff-lib.c Use is_absolute_path() in diff-lib.c, lockfile.c, setup.c, trace.c 2007-11-26 12:32:05 -08:00
diff.c color unchanged lines as "plain" in "diff --color-words" 2008-01-18 01:29:38 -08:00
diff.h add a "basic" diff config callback 2008-01-04 16:05:23 -08:00
diffcore-break.c rename: Break filepairs with different types. 2007-12-02 02:24:46 -08:00
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c Fix a pathological case in git detecting proper renames 2007-11-30 15:49:17 -08:00
diffcore.h
dir.c Fix a memory leak 2007-12-16 12:50:08 -08:00
dir.h per-directory-exclude: lazily read .gitignore files 2007-11-29 02:19:14 -08:00
dump-cache-tree.c
entry.c Merge branch 'jc/maint-add-sync-stat' 2007-11-14 14:15:40 -08:00
environment.c Support GIT_PAGER_IN_USE environment variable 2007-12-11 00:42:05 -08:00
exec_cmd.c Trace and quote with argv: get rid of unneeded count argument. 2007-12-03 22:11:53 -08:00
exec_cmd.h
fast-import.c Document the hairy gfi_unpack_entry part of fast-import 2008-01-21 01:04:12 -08:00
fetch-pack.h
fixup-builtins
generate-cmdlist.sh Consolidate command list to one. 2007-12-01 23:48:28 -08:00
git-add--interactive.perl add--interactive: allow diff colors without interactive colors 2008-01-06 18:41:44 -08:00
git-am.sh git-am: fix type in its usage string 2008-02-03 16:01:27 -08:00
git-archimport.perl
git-bisect.sh git-bisect visualize: work in non-windowed environments better 2007-12-08 02:58:26 -08:00
git-checkout.sh Fix "git checkout -b foo ':/substring'" 2008-02-01 19:08:14 -08:00
git-clone.sh clone: fix options '-o' and '--origin' to be recognised again 2007-12-19 14:59:18 -08:00
git-compat-util.h compat: Add simplified merge sort implementation from glibc 2008-02-06 22:35:28 -08:00
git-cvsexportcommit.perl cvsexportcommit: fix massive commits 2007-12-14 12:06:04 -08:00
git-cvsimport.perl cvsimport: remove last use of repo-config from git standard tools 2008-01-13 21:48:22 -08:00
git-cvsserver.perl cvsserver: Fix for histories with multiple roots 2008-01-26 17:58:18 -08:00
git-filter-branch.sh Revert "filter-branch docs: remove brackets so not to imply revision arg is optional" 2008-01-31 13:51:42 -08:00
git-help--browse.sh rename git-browse--help to git-help--browse 2007-12-16 12:52:40 -08:00
git-instaweb.sh instaweb: use 'browser.<tool>.path' config option if it's set. 2008-01-29 00:49:28 -08:00
git-lost-found.sh Merge branch 'ph/parseopt-sh' 2007-11-17 21:39:37 -08:00
git-merge-octopus.sh
git-merge-one-file.sh Support a merge with conflicting gitlink change 2007-12-11 00:40:56 -08:00
git-merge-resolve.sh
git-merge-stupid.sh
git-merge.sh Merge branch 'ph/parseopt-sh' 2007-11-17 21:39:37 -08:00
git-mergetool.sh Allow git-mergetool to handle paths with a leading space 2008-01-07 21:00:54 -08:00
git-parse-remote.sh
git-pull.sh pull --rebase: be cleverer with rebased upstream branches 2008-01-26 18:24:24 -08:00
git-quiltimport.sh Replace instances of export VAR=VAL with VAR=VAL; export VAR 2007-11-28 17:23:18 -08:00
git-rebase--interactive.sh Squelch bogus progress output from git-rebase--interactive 2008-01-14 20:04:02 -08:00
git-rebase.sh Merge branch 'maint' 2007-11-28 17:06:57 -08:00
git-relink.perl git-relink: avoid hard linking in objects/info directory 2008-01-30 00:01:27 -08:00
git-remote.perl
git-repack.sh
git-request-pull.sh Merge branch 'ph/parseopt-sh' 2007-11-17 21:39:37 -08:00
git-send-email.perl send-email, fix breakage in combination with --compose 2008-01-21 17:24:12 -08:00
git-sh-setup.sh shell-scripts usage(): consistently exit with non-zero 2007-12-20 12:58:06 -08:00
git-stash.sh git-stash clear: refuse to work with extra parameter for now 2008-01-06 18:41:36 -08:00
git-submodule.sh git-submodule: fix subcommand parser 2008-01-20 20:57:42 -08:00
git-svn.perl Let "git svn" run "git gc --auto" occasionally 2008-02-03 13:00:09 -08:00
GIT-VERSION-GEN GIT 1.5.4 2008-02-01 19:10:10 -08:00
git.c Merge branch 'kh/commit' 2007-12-04 17:16:33 -08:00
git.spec.in Add a BuildRequires for gettext in the spec file. 2008-02-04 23:06:19 -08:00
grep.c
grep.h
hash-object.c
hash.c
hash.h
help.c rename git-browse--help to git-help--browse 2007-12-16 12:52:40 -08:00
http-push.c http-push and http-fetch: handle URLs without trailing / 2008-01-20 15:18:34 -08:00
http-walker.c Move fetch_ref from http-push.c and http-walker.c to http.c 2007-12-14 21:31:59 -08:00
http.c Move fetch_ref from http-push.c and http-walker.c to http.c 2007-12-14 21:31:59 -08:00
http.h Clarify that http-push being temporarily disabled with older cURL 2008-01-22 00:48:29 -08:00
ident.c Fix grammar nits in documentation and in code comments. 2008-01-03 09:15:17 -08:00
imap-send.c
index-pack.c Merge branch 'np/progress' 2007-11-14 14:04:19 -08:00
INSTALL
interpolate.c
interpolate.h
list-objects.c
list-objects.h
lockfile.c close_lock_file(): new function in the lockfile API 2008-01-16 15:35:03 -08:00
log-tree.c Make the diff_options bitfields be an unsigned with explicit masks. 2007-11-11 16:54:15 -08:00
log-tree.h
mailmap.c mailmap: fix bogus for() loop that happened to be safe by accident 2007-12-08 03:40:12 -08:00
mailmap.h
Makefile compat: Add simplified merge sort implementation from glibc 2008-02-06 22:35:28 -08:00
match-trees.c
merge-file.c xdl_diff: identify call sites. 2007-12-13 23:04:26 -08:00
merge-index.c
merge-recursive.c Improve use of lockfile API 2008-01-16 15:35:35 -08:00
merge-tree.c xdl_diff: identify call sites. 2007-12-13 23:04:26 -08:00
mktag.c
mktree.c
object-refs.c
object.c parse_object_buffer: don't ignore errors from the object specific parsing functions 2008-02-03 16:04:57 -08:00
object.h
pack-check.c
pack-redundant.c
pack-write.c
pack.h
pager.c Support GIT_PAGER_IN_USE environment variable 2007-12-11 00:42:05 -08:00
parse-options.c parse-options: catch likely typo in presense of aggregated options. 2008-01-26 10:53:31 -08:00
parse-options.h parse-options: Allow to hide options from the default usage. 2007-11-22 22:11:28 -08:00
patch-delta.c
patch-id.c
patch-ids.c Make the diff_options bitfields be an unsigned with explicit masks. 2007-11-11 16:54:15 -08:00
patch-ids.h
path-list.c
path-list.h
path.c
pkt-line.c
pkt-line.h
pretty.c custom pretty format: tolerate empty e-mail address 2008-01-06 18:41:43 -08:00
progress.c Flush progress message buffer in display(). 2007-11-20 13:16:15 -08:00
progress.h
quote.c Fix rewrite_diff() name quoting. 2007-12-26 17:13:36 -08:00
quote.h Fix rewrite_diff() name quoting. 2007-12-26 17:13:36 -08:00
reachable.c
reachable.h
read-cache.c Merge branch 'jc/maint-add-sync-stat' 2007-11-14 14:15:40 -08:00
README
receive-pack.c receive-pack: reject invalid refnames 2008-01-04 15:59:43 -08:00
reflog-walk.c
reflog-walk.h
refs.c refs.c: rework ref_locks by abstracting from underlying struct lock_file 2008-01-16 15:36:10 -08:00
refs.h lock_any_ref_for_update(): reject wildcard return from check_ref_format 2008-01-02 02:28:54 -08:00
RelNotes GIT 1.5.3.8 2008-01-07 22:41:43 -08:00
remote.c remote: Fix bogus make_branch() call in configuration reader. 2007-12-14 20:34:56 -08:00
remote.h Add remote.<name>.proxy 2007-12-03 23:43:07 -08:00
revision.c Fix "git log --diff-filter" bug 2007-12-26 11:57:36 -08:00
revision.h shortlog: default to HEAD when the standard input is a tty 2007-12-11 17:01:31 -08:00
run-command.c run-command: Support sending stderr to /dev/null 2007-11-11 17:09:55 -08:00
run-command.h run-command: Support sending stderr to /dev/null 2007-11-11 17:09:55 -08:00
send-pack.h
server-info.c Don't access line[-1] for a zero-length "line" from fgets. 2008-01-04 12:28:58 -08:00
setup.c Fix grammar nits in documentation and in code comments. 2008-01-03 09:15:17 -08:00
sha1_file.c Fix random fast-import errors when compiled with NO_MMAP 2008-01-17 22:39:20 -08:00
sha1_name.c Merge branch 'sp/refspec-match' 2007-12-04 17:07:10 -08:00
shallow.c
shell.c
show-index.c
sideband.c recv_sideband: Do not use ANSI escape sequence on dumb terminals. 2008-01-09 12:23:59 -08:00
sideband.h
strbuf.c Uninline prefixcmp() 2008-01-03 01:23:12 -08:00
strbuf.h builtin-commit.c: export GIT_INDEX_FILE for launch_editor as well. 2007-11-26 09:13:17 -08:00
symlinks.c
tag.c parse_tag_buffer: don't parse invalid tags 2008-01-06 18:41:44 -08:00
tag.h
tar.h
test-absolute-path.c
test-chmtime.c
test-date.c
test-delta.c
test-genrandom.c
test-match-trees.c
test-parse-options.c parse-options: catch likely typo in presense of aggregated options. 2008-01-26 10:53:31 -08:00
test-sha1.c
test-sha1.sh the use of 'tr' in the test suite isn't really portable 2007-12-17 20:49:18 -08:00
trace.c Trace and quote with argv: get rid of unneeded count argument. 2007-12-03 22:11:53 -08:00
transport.c Don't access line[-1] for a zero-length "line" from fgets. 2008-01-04 12:28:58 -08:00
transport.h Merge branch 'aw/mirror-push' into jk/send-pack 2007-11-14 03:13:30 -08:00
tree-diff.c Fix small memory leaks induced by diff_tree_setup_paths 2007-12-12 10:59:22 -08:00
tree-walk.c tree-walk: don't parse incorrect entries 2008-01-06 18:41:44 -08:00
tree-walk.h rename: Break filepairs with different types. 2007-12-02 02:24:46 -08:00
tree.c
tree.h
unpack-file.c
unpack-trees.c unpack-trees: FLEX_ARRAY fix 2007-12-18 01:10:24 -08:00
unpack-trees.h
update-server-info.c
upload-pack.c
usage.c
utf8.c utf8_width(): allow non NUL-terminated input 2008-01-06 20:53:46 -08:00
utf8.h utf8_width(): allow non NUL-terminated input 2008-01-06 20:53:46 -08:00
var.c Re-fix "builtin-commit: fix --signoff" 2007-12-09 00:55:55 -08:00
walker.c Clarify error response from 'git fetch' for bad responses 2007-12-17 20:49:18 -08:00
walker.h
write_or_die.c
ws.c whitespace: more accurate initial-indent highlighting 2007-12-16 13:07:58 -08:00
wt-status.c git-commit: squelch needless message during an empty merge 2007-12-12 20:50:33 -08:00
wt-status.h git-commit: squelch needless message during an empty merge 2007-12-12 20:50:33 -08:00
xdiff-interface.c Re(-re)*fix trim_common_tail() 2007-12-20 20:54:23 -08:00
xdiff-interface.h xdl_diff: identify call sites. 2007-12-13 23:04:26 -08:00

////////////////////////////////////////////////////////////////

	GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room.
 - "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.
See Documentation/tutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands,
and "man git-commandname" for documentation of each command.
CVS users may also want to read Documentation/cvs-migration.txt.

Many Git online resources are accessible from http://git.or.cz/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.

The messages titled "A note from the maintainer", "What's in
git.git (stable)" and "What's cooking in git.git (topics)" and
the discussion following them on the mailing list give a good
reference for project status, development direction and
remaining tasks.