libgit2/src
Carlos Martín Nieto 704b55cce3 revwalk: don't try to find merge bases when there can be none
As a way to speed up the cases where we need to hide some commits, we
find out what the merge bases are so we know to stop marking commits as
uninteresting and avoid walking down a potentially very large amount of
commits which we will never see. There are however two oversights in
current code.

The merge-base finding algorithm fails to recognize that if it is only
given one commit, there can be no merge base. It instead walks down the
whole ancestor chain needlessly. Make it return an empty list
immediately in this situation.

The revwalk does not know whether the user has asked to hide any commits
at all. In situation where the user pushes multiple commits but doesn't
hide any, the above fix wouldn't do the trick. Keep track of whether the
user wants to hide any commits and only run the merge-base finding
algorithm when it's needed.
2014-03-20 20:24:11 +01:00
..
hash Add simple global shutdown hooks 2013-09-17 09:31:45 -07:00
transports Seamless support for NTLM/Kerberos auth on Windows 2014-03-18 10:24:23 -04:00
unix Test cancel from indexer progress callback 2013-12-11 15:02:20 -08:00
win32 Remove unused utf8 -> utf16 conversion code 2014-02-05 15:03:00 -08:00
xdiff Merge branch 'new-error-handling' into development 2012-05-02 15:59:02 -07:00
array.h Address PR comments 2014-02-20 14:27:10 -08:00
attr_file.c Fix warning 2013-09-19 23:14:06 +08:00
attr_file.h Revert PR #1462 and provide alternative fix 2013-08-09 10:52:35 -07:00
attr.c Move system directory cache out of utils 2014-02-24 17:52:38 -08:00
attr.h Implement global/system file search paths 2013-03-15 16:39:00 -07:00
attrcache.h Add ~ expansion to global attributes and excludes 2013-05-24 11:09:04 -07:00
bitvec.h Address PR comments 2014-02-20 14:27:10 -08:00
blame_git.c Reset num_parents to 1 only for merge commits 2014-02-26 19:25:07 +01:00
blame_git.h Blame: minor cleanup 2013-09-25 14:40:19 -07:00
blame.c blame: Fix compare function's data types 2014-03-07 15:52:34 +01:00
blame.h Improve GIT_EUSER handling 2013-12-11 10:57:49 -08:00
blob.c Some missing oid to id renames 2014-01-30 09:59:59 -08:00
blob.h Fix rename detection to use actual blob size 2013-07-25 12:27:39 -07:00
branch.c branch: constness fixes 2014-03-17 17:47:46 +01:00
branch.h branch: rename 'tracking' to 'upstream' 2013-03-30 15:45:57 +01:00
bswap.h update copyrights 2013-01-08 17:31:27 -06:00
buf_text.c Fix longstanding valgrind warning 2013-09-17 09:31:44 -07:00
buf_text.h Start of filter API + git_blob_filtered_content 2013-09-17 09:30:06 -07:00
buffer.c Remove now-duplicated stdarg.h include 2014-02-24 23:32:25 -08:00
buffer.h Remove now-duplicated stdarg.h include 2014-02-24 23:32:25 -08:00
cache.c util: It's called memzero 2013-06-12 21:10:33 +02:00
cache.h git_atomic_ssize for 64-bit atomics only on 64-bit platforms 2013-04-25 12:40:33 -05:00
cc-compat.h Include stdarg.h for the va_copy test 2014-02-24 21:56:08 -08:00
checkout.c git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
checkout.h git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
clone.c git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
commit_list.c Replace pqueue with code from hashsig heap 2014-02-03 21:02:08 -08:00
commit_list.h Replace pqueue with code from hashsig heap 2014-02-03 21:02:08 -08:00
commit.c commit: simplify and correct refcounting in nth_gen_ancestor 2014-03-07 16:03:10 +01:00
commit.h Introduce git_revert to revert a single commit 2013-12-02 16:57:41 -06:00
common.h Address PR comments 2014-02-20 14:27:10 -08:00
config_cache.c Add config read fns with controlled error behavior 2013-12-11 10:57:49 -08:00
config_file.c Move system directory cache out of utils 2014-02-24 17:52:38 -08:00
config_file.h replaced foreach() with non callback based iterations in git_config_backend 2013-08-08 11:14:53 +02:00
config.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
config.h config: use git_buf for returning paths 2014-01-27 04:44:05 +01:00
crlf.c Never convert CRLF->LF 2014-02-11 16:52:08 -08:00
date.c Use time(2) to get the time 2013-08-19 16:44:17 -05:00
delta-apply.c update copyrights 2013-01-08 17:31:27 -06:00
delta-apply.h update copyrights 2013-01-08 17:31:27 -06:00
delta.c Fixed left shift size of int. 2013-12-08 01:50:10 -08:00
delta.h Fix warnings on Win64 build 2012-11-27 13:18:29 -08:00
diff_driver.c Update Javascript userdiff driver and tests 2014-01-27 11:45:06 -08:00
diff_driver.h Initial take on builtin drivers with multiline 2014-01-24 10:43:05 -08:00
diff_file.c Add buffer to buffer diff and patch APIs 2014-02-27 14:13:22 -08:00
diff_file.h Add buffer to buffer diff and patch APIs 2014-02-27 14:13:22 -08:00
diff_patch.c Add buffer to buffer diff and patch APIs 2014-02-27 14:13:22 -08:00
diff_patch.h Rename diff objects and split patch.h 2013-10-11 14:51:54 -07:00
diff_print.c diff: change id abbrev option's name to id_abbrev 2014-01-25 08:15:44 +01:00
diff_tform.c Use a portable cast 2014-02-24 13:39:04 -08:00
diff_xdiff.c Remove converting user error to GIT_EUSER 2013-12-11 10:57:49 -08:00
diff_xdiff.h Reorganize diff and add basic diff driver 2013-06-10 10:10:39 -07:00
diff.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
diff.h diff: rename the file's 'oid' to 'id' 2014-01-25 08:15:44 +01:00
errors.c Remove now-duplicated stdarg.h include 2014-02-24 23:32:25 -08:00
fetch.c - need_pack was not set to 0 when local fetch was already present causing negotiate_fetch access violation 2014-02-25 14:57:47 +01:00
fetch.h remote: put the _download() callback with the others 2013-10-02 06:41:42 +02:00
fetchhead.c One more rename/cleanup for callback err functions 2013-12-11 10:57:50 -08:00
fetchhead.h update copyrights 2013-01-08 17:31:27 -06:00
filebuf.c Remove now-duplicated stdarg.h include 2014-02-24 23:32:25 -08:00
filebuf.h move mode_t to filebuf_open instead of _commit 2013-11-04 22:33:05 -05:00
fileops.c Move system directory cache out of utils 2014-02-24 17:52:38 -08:00
fileops.h Move system directory cache out of utils 2014-02-24 17:52:38 -08:00
filter.c Cleanups, renames, and leak fixes 2013-12-12 12:11:38 -08:00
filter.h Add ident filter 2013-09-17 09:31:45 -07:00
fnmatch.c update copyrights 2013-01-08 17:31:27 -06:00
fnmatch.h update copyrights 2013-01-08 17:31:27 -06:00
global.c Move system directory cache out of utils 2014-02-24 17:52:38 -08:00
global.h Add simple global shutdown hooks 2013-09-17 09:31:45 -07:00
graph.c Replace pqueue with code from hashsig heap 2014-02-03 21:02:08 -08:00
hash.c update copyrights 2013-01-08 17:31:27 -06:00
hash.h Add simple global shutdown hooks 2013-09-17 09:31:45 -07:00
hashsig.c Major rename detection changes 2013-07-31 16:40:42 -07:00
hashsig.h Refine pluggable similarity API 2013-02-20 15:09:41 -08:00
ident.c Bug fixes and cleanups 2013-09-17 09:31:46 -07:00
ignore.c Remove converting user error to GIT_EUSER 2013-12-11 10:57:49 -08:00
ignore.h Improve building ignore file lists 2013-08-09 11:41:41 -07:00
index.c corrected typo in error message 2014-03-10 14:40:07 +11:00
index.h Fix some Windows warnings 2014-02-07 15:43:37 -08:00
indexer.c Some fixes for Windows x64 warnings 2014-01-30 09:59:59 -08:00
iterator.c index: rename an entry's id to 'id' 2014-01-25 08:15:44 +01:00
iterator.h Put hooks in place for precompose in dirload fn 2013-10-03 10:44:13 -07:00
khash.h Isolate khash inlines from global namespace 2012-07-12 11:49:15 -07:00
map.h update copyrights 2013-01-08 17:31:27 -06:00
merge_file.c diff: rename the file's 'oid' to 'id' 2014-01-25 08:15:44 +01:00
merge_file.h Introduce diff3 mode for checking out conflicts 2014-01-20 17:15:13 -05:00
merge.c revwalk: don't try to find merge bases when there can be none 2014-03-20 20:24:11 +01:00
merge.h Don't try to merge binary files 2014-01-20 17:15:12 -05:00
message.c messsage: use git_buf in prettify() 2014-01-27 04:44:06 +01:00
message.h update copyrights 2013-01-08 17:31:27 -06:00
mwindow.c Further threading fixes 2013-04-22 16:52:07 +02:00
mwindow.h update copyrights 2013-01-08 17:31:27 -06:00
netops.c netops: fix leak 2013-11-18 21:40:19 +01:00
netops.h Use http_parser_parse_url to parse urls 2013-11-04 11:42:14 -08:00
notes.c index: rename an entry's id to 'id' 2014-01-25 08:15:44 +01:00
notes.h note: rename the id getter to git_note_id() 2014-01-24 11:18:51 +01:00
object_api.c object: haha 2013-04-30 13:19:02 +02:00
object.c Add git_object_short_id API to get short id string 2014-03-04 16:23:28 -08:00
object.h object: Explicitly define helper API methods for all obj types 2013-04-30 13:13:38 +02:00
odb_loose.c Check short OID len in odb, not in backends 2014-03-05 13:06:22 -08:00
odb_pack.c Add exists_prefix to ODB backend and ODB API 2014-03-04 15:34:23 -08:00
odb.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
odb.h Create public filter object and use it 2013-09-17 09:30:06 -07:00
offmap.h pack: introduce a delta base cache 2013-01-11 16:55:37 +01:00
oid.c git_oid_fromstrn: Simplify the implementation and fix memory access issues 2014-03-07 15:52:27 +01:00
oid.h oid: Helper for old-school hashcmp 2013-08-14 10:34:07 +02:00
oidmap.h Add callback to git_objects_table 2013-04-22 16:51:40 +02:00
pack-objects.c pack-objects: free memory safely 2014-03-04 20:11:50 +01:00
pack-objects.h Packbuilder contains its own zstream 2014-01-14 09:45:14 -08:00
pack.c Drop parsing pack filename SHA1 part, no one cares the filename 2014-01-23 23:28:28 +08:00
pack.h Drop parsing pack filename SHA1 part, no one cares the filename 2014-01-23 23:28:28 +08:00
path.c refdb: catch a directory disappearing 2014-03-05 21:00:15 +01:00
path.h Remove converting user error to GIT_EUSER 2013-12-11 10:57:49 -08:00
pathspec.c Fix some Windows warnings 2014-02-07 15:43:37 -08:00
pathspec.h Add git_pathspec_match_diff API 2013-07-10 20:50:33 +02:00
pool.c pool: Correct overflow checks 2013-12-13 12:41:22 +01:00
pool.h Improved tree iterator internals 2013-03-14 13:40:15 -07:00
posix.c Check for EWOULDBLOCK as well as EAGAIN on write. 2014-02-16 16:56:37 +00:00
posix.h Check for EWOULDBLOCK as well as EAGAIN on write. 2014-02-16 16:56:37 +00:00
pqueue.c Fix pqueue sort boundary condition bug 2014-03-12 11:21:55 -07:00
pqueue.h Convert pqueue to just be a git_vector 2014-02-04 10:01:37 -08:00
push.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
push.h Initial Implementation of progress reports during push 2013-09-30 13:22:28 -04:00
refdb_fs.c reflog: handle symref chains 2014-03-19 18:14:35 +01:00
refdb_fs.h immutable references and a pluggable ref database 2013-03-07 11:01:52 -06:00
refdb.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
refdb.h refs: placeholder conditional delete 2014-02-05 12:07:57 +01:00
reflog.c Align git_signature_dup. 2014-01-14 21:33:35 +01:00
reflog.h reflog: move the reflog implementation into refdb_fs 2013-10-02 06:53:24 +02:00
refs.c branch: constness fixes 2014-03-17 17:47:46 +01:00
refs.h refs: remove the _with_log differentiation 2014-01-15 13:32:43 +01:00
refspec.c refspec: move to git_buf for outputting strings 2014-01-27 04:44:06 +01:00
refspec.h refspec: move to git_buf for outputting strings 2014-01-27 04:44:06 +01:00
remote.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
remote.h Fix warnings 2013-11-18 12:14:50 -08:00
repo_template.h Make mode handling during init more like git 2013-02-27 13:44:15 -08:00
repository.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
repository.h clean up state metadata more consistently 2013-12-02 16:57:41 -06:00
reset.c Merge pull request #2028 from libgit2/options-names 2014-03-07 19:02:58 +01:00
revert.c git_revert_opts -> git_revert_options 2014-03-06 09:44:52 -08:00
revparse.c revparse: do look at all refs when matching text 2014-02-05 12:16:44 +01:00
revwalk.c revwalk: don't try to find merge bases when there can be none 2014-03-20 20:24:11 +01:00
revwalk.h revwalk: don't try to find merge bases when there can be none 2014-03-20 20:24:11 +01:00
settings.c features: Rename _HAS_ to _FEATURE_ 2014-03-03 12:40:25 +01:00
sha1_lookup.c Backport @peff's fix for duplicates in sha1_lookup 2013-09-04 13:16:57 +02:00
sha1_lookup.h sha1_lookup: do not use the "experimental" lookup mode 2013-08-14 10:28:01 +02:00
signature.c Add git_commit_amend API 2014-02-07 16:17:59 -08:00
signature.h update copyrights 2013-01-08 17:31:27 -06:00
sortedcache.c Convert pqueue to just be a git_vector 2014-02-04 10:01:37 -08:00
sortedcache.h Add stddef include for sortedcache 2013-08-28 11:20:47 -07:00
stash.c git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
status.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
status.h Rename diff objects and split patch.h 2013-10-11 14:51:54 -07:00
strmap.c config: get rid of a useless asignment 2013-08-12 11:40:57 +02:00
strmap.h config: get rid of a useless asignment 2013-08-12 11:40:57 +02:00
strnlen.h Split p_strlen into its own header 2014-02-05 14:34:15 +01:00
submodule.c MSVC is silly 2014-03-10 18:20:47 +01:00
submodule.h Make submodule fetchRecurse match other options 2014-01-30 09:59:59 -08:00
sysdir.c Move system directory cache out of utils 2014-02-24 17:52:38 -08:00
sysdir.h Move system directory cache out of utils 2014-02-24 17:52:38 -08:00
tag.c refs: remove the _with_log differentiation 2014-01-15 13:32:43 +01:00
tag.h Simplify object table parse functions 2013-04-22 16:52:06 +02:00
thread-utils.c update copyrights 2013-01-08 17:31:27 -06:00
thread-utils.h Load SRWLock APIs at runtime 2013-08-26 14:56:31 -07:00
trace.c Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
trace.h Remove now-duplicated stdarg.h include 2014-02-24 23:32:25 -08:00
transport.c Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
tree-cache.c tree-cache: Fix error message typo 2013-11-19 13:25:38 +01:00
tree-cache.h update copyrights 2013-01-08 17:31:27 -06:00
tree.c Convert pqueue to just be a git_vector 2014-02-04 10:01:37 -08:00
tree.h Add cat-file example and increase const use in API 2013-05-16 10:38:27 -07:00
tsort.c Sorting function cleanup and MinGW fix 2013-03-11 16:43:58 -07:00
userdiff.h Some fixes for Windows x64 warnings 2014-01-30 09:59:59 -08:00
util.c Move libgit2 settings out of util 2014-01-14 18:36:00 -08:00
util.h Split p_strlen into its own header 2014-02-05 14:34:15 +01:00
vector.c Convert pqueue to just be a git_vector 2014-02-04 10:01:37 -08:00
vector.h Address PR comments 2014-02-20 14:27:10 -08:00
zstream.c Defer zstream NUL termination to end 2014-01-30 10:23:35 -08:00
zstream.h Reorganize zstream API and fix wrap problems 2014-01-30 09:59:59 -08:00